Framebuffer::Framebuffer(rx::SurfaceImpl *surface) : mState(), mImpl(surface->createDefaultFramebuffer(mState)), mId(0), mCachedStatus(GL_FRAMEBUFFER_COMPLETE), mDirtyDepthAttachmentBinding(this, DIRTY_BIT_DEPTH_ATTACHMENT), mDirtyStencilAttachmentBinding(this, DIRTY_BIT_STENCIL_ATTACHMENT) { ASSERT(mImpl != nullptr); mDirtyColorAttachmentBindings.push_back( ChannelBinding(this, static_cast<SignalToken>(DIRTY_BIT_COLOR_ATTACHMENT_0))); }
Framebuffer11::Framebuffer11(const gl::FramebufferState &data, Renderer11 *renderer) : FramebufferD3D(data, renderer), mRenderer(renderer), mCachedDepthStencilRenderTarget(nullptr), mDepthStencilRenderTargetDirty(this, gl::IMPLEMENTATION_MAX_FRAMEBUFFER_ATTACHMENTS) { ASSERT(mRenderer != nullptr); mCachedColorRenderTargets.fill(nullptr); for (size_t colorIndex = 0; colorIndex < data.getColorAttachments().size(); ++colorIndex) { mColorRenderTargetsDirty.push_back( ChannelBinding(this, static_cast<SignalToken>(colorIndex))); } }
Framebuffer::Framebuffer(const Caps &caps, rx::GLImplFactory *factory, GLuint id) : mState(caps), mImpl(factory->createFramebuffer(mState)), mId(id), mCachedStatus(), mDirtyDepthAttachmentBinding(this, DIRTY_BIT_DEPTH_ATTACHMENT), mDirtyStencilAttachmentBinding(this, DIRTY_BIT_STENCIL_ATTACHMENT) { ASSERT(mId != 0); ASSERT(mImpl != nullptr); ASSERT(mState.mColorAttachments.size() == static_cast<size_t>(caps.maxColorAttachments)); for (size_t colorIndex = 0; colorIndex < mState.mColorAttachments.size(); ++colorIndex) { mDirtyColorAttachmentBindings.push_back(ChannelBinding( this, static_cast<SignalToken>(DIRTY_BIT_COLOR_ATTACHMENT_0 + colorIndex))); } }