michael@0: #include "precompiled.h" michael@0: // michael@0: // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: // Framebuffer.cpp: Implements the gl::Framebuffer class. Implements GL framebuffer michael@0: // objects and related functionality. [OpenGL ES 2.0.24] section 4.4 page 105. michael@0: michael@0: #include "libGLESv2/Framebuffer.h" michael@0: michael@0: #include "libGLESv2/main.h" michael@0: #include "libGLESv2/utilities.h" michael@0: #include "libGLESv2/Texture.h" michael@0: #include "libGLESv2/Context.h" michael@0: #include "libGLESv2/renderer/Renderer.h" michael@0: #include "libGLESv2/Renderbuffer.h" michael@0: michael@0: namespace gl michael@0: { michael@0: michael@0: Framebuffer::Framebuffer(rx::Renderer *renderer) michael@0: : mRenderer(renderer) michael@0: { michael@0: for (unsigned int colorAttachment = 0; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: mColorbufferTypes[colorAttachment] = GL_NONE; michael@0: mDrawBufferStates[colorAttachment] = GL_NONE; michael@0: } michael@0: mDrawBufferStates[0] = GL_COLOR_ATTACHMENT0_EXT; michael@0: mReadBufferState = GL_COLOR_ATTACHMENT0_EXT; michael@0: michael@0: mDepthbufferType = GL_NONE; michael@0: mStencilbufferType = GL_NONE; michael@0: } michael@0: michael@0: Framebuffer::~Framebuffer() michael@0: { michael@0: for (unsigned int colorAttachment = 0; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: mColorbufferPointers[colorAttachment].set(NULL); michael@0: } michael@0: mDepthbufferPointer.set(NULL); michael@0: mStencilbufferPointer.set(NULL); michael@0: } michael@0: michael@0: Renderbuffer *Framebuffer::lookupRenderbuffer(GLenum type, GLuint handle) const michael@0: { michael@0: gl::Context *context = gl::getContext(); michael@0: Renderbuffer *buffer = NULL; michael@0: michael@0: if (type == GL_NONE) michael@0: { michael@0: buffer = NULL; michael@0: } michael@0: else if (type == GL_RENDERBUFFER) michael@0: { michael@0: buffer = context->getRenderbuffer(handle); michael@0: } michael@0: else if (IsInternalTextureTarget(type)) michael@0: { michael@0: buffer = context->getTexture(handle)->getRenderbuffer(type); michael@0: } michael@0: else michael@0: { michael@0: UNREACHABLE(); michael@0: } michael@0: michael@0: return buffer; michael@0: } michael@0: michael@0: void Framebuffer::setColorbuffer(unsigned int colorAttachment, GLenum type, GLuint colorbuffer) michael@0: { michael@0: ASSERT(colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS); michael@0: mColorbufferTypes[colorAttachment] = (colorbuffer != 0) ? type : GL_NONE; michael@0: mColorbufferPointers[colorAttachment].set(lookupRenderbuffer(type, colorbuffer)); michael@0: } michael@0: michael@0: void Framebuffer::setDepthbuffer(GLenum type, GLuint depthbuffer) michael@0: { michael@0: mDepthbufferType = (depthbuffer != 0) ? type : GL_NONE; michael@0: mDepthbufferPointer.set(lookupRenderbuffer(type, depthbuffer)); michael@0: } michael@0: michael@0: void Framebuffer::setStencilbuffer(GLenum type, GLuint stencilbuffer) michael@0: { michael@0: mStencilbufferType = (stencilbuffer != 0) ? type : GL_NONE; michael@0: mStencilbufferPointer.set(lookupRenderbuffer(type, stencilbuffer)); michael@0: } michael@0: michael@0: void Framebuffer::detachTexture(GLuint texture) michael@0: { michael@0: for (unsigned int colorAttachment = 0; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: if (mColorbufferPointers[colorAttachment].id() == texture && IsInternalTextureTarget(mColorbufferTypes[colorAttachment])) michael@0: { michael@0: mColorbufferTypes[colorAttachment] = GL_NONE; michael@0: mColorbufferPointers[colorAttachment].set(NULL); michael@0: } michael@0: } michael@0: michael@0: if (mDepthbufferPointer.id() == texture && IsInternalTextureTarget(mDepthbufferType)) michael@0: { michael@0: mDepthbufferType = GL_NONE; michael@0: mDepthbufferPointer.set(NULL); michael@0: } michael@0: michael@0: if (mStencilbufferPointer.id() == texture && IsInternalTextureTarget(mStencilbufferType)) michael@0: { michael@0: mStencilbufferType = GL_NONE; michael@0: mStencilbufferPointer.set(NULL); michael@0: } michael@0: } michael@0: michael@0: void Framebuffer::detachRenderbuffer(GLuint renderbuffer) michael@0: { michael@0: for (unsigned int colorAttachment = 0; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: if (mColorbufferPointers[colorAttachment].id() == renderbuffer && mColorbufferTypes[colorAttachment] == GL_RENDERBUFFER) michael@0: { michael@0: mColorbufferTypes[colorAttachment] = GL_NONE; michael@0: mColorbufferPointers[colorAttachment].set(NULL); michael@0: } michael@0: } michael@0: michael@0: if (mDepthbufferPointer.id() == renderbuffer && mDepthbufferType == GL_RENDERBUFFER) michael@0: { michael@0: mDepthbufferType = GL_NONE; michael@0: mDepthbufferPointer.set(NULL); michael@0: } michael@0: michael@0: if (mStencilbufferPointer.id() == renderbuffer && mStencilbufferType == GL_RENDERBUFFER) michael@0: { michael@0: mStencilbufferType = GL_NONE; michael@0: mStencilbufferPointer.set(NULL); michael@0: } michael@0: } michael@0: michael@0: unsigned int Framebuffer::getRenderTargetSerial(unsigned int colorAttachment) const michael@0: { michael@0: ASSERT(colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS); michael@0: michael@0: Renderbuffer *colorbuffer = mColorbufferPointers[colorAttachment].get(); michael@0: michael@0: if (colorbuffer) michael@0: { michael@0: return colorbuffer->getSerial(); michael@0: } michael@0: michael@0: return 0; michael@0: } michael@0: michael@0: unsigned int Framebuffer::getDepthbufferSerial() const michael@0: { michael@0: Renderbuffer *depthbuffer = mDepthbufferPointer.get(); michael@0: michael@0: if (depthbuffer) michael@0: { michael@0: return depthbuffer->getSerial(); michael@0: } michael@0: michael@0: return 0; michael@0: } michael@0: michael@0: unsigned int Framebuffer::getStencilbufferSerial() const michael@0: { michael@0: Renderbuffer *stencilbuffer = mStencilbufferPointer.get(); michael@0: michael@0: if (stencilbuffer) michael@0: { michael@0: return stencilbuffer->getSerial(); michael@0: } michael@0: michael@0: return 0; michael@0: } michael@0: michael@0: Renderbuffer *Framebuffer::getColorbuffer(unsigned int colorAttachment) const michael@0: { michael@0: ASSERT(colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS); michael@0: return mColorbufferPointers[colorAttachment].get(); michael@0: } michael@0: michael@0: Renderbuffer *Framebuffer::getDepthbuffer() const michael@0: { michael@0: return mDepthbufferPointer.get(); michael@0: } michael@0: michael@0: Renderbuffer *Framebuffer::getStencilbuffer() const michael@0: { michael@0: return mStencilbufferPointer.get(); michael@0: } michael@0: michael@0: Renderbuffer *Framebuffer::getDepthOrStencilbuffer() const michael@0: { michael@0: Renderbuffer *depthstencilbuffer = mDepthbufferPointer.get(); michael@0: michael@0: if (!depthstencilbuffer) michael@0: { michael@0: depthstencilbuffer = mStencilbufferPointer.get(); michael@0: } michael@0: michael@0: return depthstencilbuffer; michael@0: } michael@0: michael@0: Renderbuffer *Framebuffer::getReadColorbuffer() const michael@0: { michael@0: // Will require more logic if glReadBuffers is supported michael@0: return mColorbufferPointers[0].get(); michael@0: } michael@0: michael@0: GLenum Framebuffer::getReadColorbufferType() const michael@0: { michael@0: // Will require more logic if glReadBuffers is supported michael@0: return mColorbufferTypes[0]; michael@0: } michael@0: michael@0: Renderbuffer *Framebuffer::getFirstColorbuffer() const michael@0: { michael@0: for (unsigned int colorAttachment = 0; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: if (mColorbufferTypes[colorAttachment] != GL_NONE) michael@0: { michael@0: return mColorbufferPointers[colorAttachment].get(); michael@0: } michael@0: } michael@0: michael@0: return NULL; michael@0: } michael@0: michael@0: GLenum Framebuffer::getColorbufferType(unsigned int colorAttachment) const michael@0: { michael@0: ASSERT(colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS); michael@0: return mColorbufferTypes[colorAttachment]; michael@0: } michael@0: michael@0: GLenum Framebuffer::getDepthbufferType() const michael@0: { michael@0: return mDepthbufferType; michael@0: } michael@0: michael@0: GLenum Framebuffer::getStencilbufferType() const michael@0: { michael@0: return mStencilbufferType; michael@0: } michael@0: michael@0: GLuint Framebuffer::getColorbufferHandle(unsigned int colorAttachment) const michael@0: { michael@0: ASSERT(colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS); michael@0: return mColorbufferPointers[colorAttachment].id(); michael@0: } michael@0: michael@0: GLuint Framebuffer::getDepthbufferHandle() const michael@0: { michael@0: return mDepthbufferPointer.id(); michael@0: } michael@0: michael@0: GLuint Framebuffer::getStencilbufferHandle() const michael@0: { michael@0: return mStencilbufferPointer.id(); michael@0: } michael@0: michael@0: GLenum Framebuffer::getDrawBufferState(unsigned int colorAttachment) const michael@0: { michael@0: return mDrawBufferStates[colorAttachment]; michael@0: } michael@0: michael@0: void Framebuffer::setDrawBufferState(unsigned int colorAttachment, GLenum drawBuffer) michael@0: { michael@0: mDrawBufferStates[colorAttachment] = drawBuffer; michael@0: } michael@0: michael@0: bool Framebuffer::isEnabledColorAttachment(unsigned int colorAttachment) const michael@0: { michael@0: return (mColorbufferTypes[colorAttachment] != GL_NONE && mDrawBufferStates[colorAttachment] != GL_NONE); michael@0: } michael@0: michael@0: bool Framebuffer::hasEnabledColorAttachment() const michael@0: { michael@0: for (unsigned int colorAttachment = 0; colorAttachment < gl::IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: if (isEnabledColorAttachment(colorAttachment)) michael@0: { michael@0: return true; michael@0: } michael@0: } michael@0: michael@0: return false; michael@0: } michael@0: michael@0: bool Framebuffer::hasStencil() const michael@0: { michael@0: if (mStencilbufferType != GL_NONE) michael@0: { michael@0: const Renderbuffer *stencilbufferObject = getStencilbuffer(); michael@0: michael@0: if (stencilbufferObject) michael@0: { michael@0: return stencilbufferObject->getStencilSize() > 0; michael@0: } michael@0: } michael@0: michael@0: return false; michael@0: } michael@0: michael@0: bool Framebuffer::usingExtendedDrawBuffers() const michael@0: { michael@0: for (unsigned int colorAttachment = 1; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: if (isEnabledColorAttachment(colorAttachment)) michael@0: { michael@0: return true; michael@0: } michael@0: } michael@0: michael@0: return false; michael@0: } michael@0: michael@0: GLenum Framebuffer::completeness() const michael@0: { michael@0: int width = 0; michael@0: int height = 0; michael@0: int colorbufferSize = 0; michael@0: int samples = -1; michael@0: bool missingAttachment = true; michael@0: michael@0: for (unsigned int colorAttachment = 0; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: if (mColorbufferTypes[colorAttachment] != GL_NONE) michael@0: { michael@0: const Renderbuffer *colorbuffer = getColorbuffer(colorAttachment); michael@0: michael@0: if (!colorbuffer) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (colorbuffer->getWidth() == 0 || colorbuffer->getHeight() == 0) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (mColorbufferTypes[colorAttachment] == GL_RENDERBUFFER) michael@0: { michael@0: if (!gl::IsColorRenderable(colorbuffer->getInternalFormat())) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: } michael@0: else if (IsInternalTextureTarget(mColorbufferTypes[colorAttachment])) michael@0: { michael@0: GLint internalformat = colorbuffer->getInternalFormat(); michael@0: GLenum format = gl::ExtractFormat(internalformat); michael@0: michael@0: if (IsCompressed(format) || michael@0: format == GL_ALPHA || michael@0: format == GL_LUMINANCE || michael@0: format == GL_LUMINANCE_ALPHA) michael@0: { michael@0: return GL_FRAMEBUFFER_UNSUPPORTED; michael@0: } michael@0: michael@0: bool filtering, renderable; michael@0: michael@0: if ((gl::IsFloat32Format(internalformat) && !mRenderer->getFloat32TextureSupport(&filtering, &renderable)) || michael@0: (gl::IsFloat16Format(internalformat) && !mRenderer->getFloat16TextureSupport(&filtering, &renderable))) michael@0: { michael@0: return GL_FRAMEBUFFER_UNSUPPORTED; michael@0: } michael@0: michael@0: if (gl::IsDepthTexture(internalformat) || gl::IsStencilTexture(internalformat)) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: } michael@0: else michael@0: { michael@0: UNREACHABLE(); michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (!missingAttachment) michael@0: { michael@0: // all color attachments must have the same width and height michael@0: if (colorbuffer->getWidth() != width || colorbuffer->getHeight() != height) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; michael@0: } michael@0: michael@0: // APPLE_framebuffer_multisample, which EXT_draw_buffers refers to, requires that michael@0: // all color attachments have the same number of samples for the FBO to be complete. michael@0: if (colorbuffer->getSamples() != samples) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT; michael@0: } michael@0: michael@0: // all color attachments attachments must have the same number of bitplanes michael@0: if (gl::ComputePixelSize(colorbuffer->getInternalFormat()) != colorbufferSize) michael@0: { michael@0: return GL_FRAMEBUFFER_UNSUPPORTED; michael@0: } michael@0: michael@0: // D3D11 does not allow for overlapping RenderTargetViews, so ensure uniqueness michael@0: for (unsigned int previousColorAttachment = 0; previousColorAttachment < colorAttachment; previousColorAttachment++) michael@0: { michael@0: if (mColorbufferPointers[colorAttachment].get() == mColorbufferPointers[previousColorAttachment].get()) michael@0: { michael@0: return GL_FRAMEBUFFER_UNSUPPORTED; michael@0: } michael@0: } michael@0: } michael@0: else michael@0: { michael@0: width = colorbuffer->getWidth(); michael@0: height = colorbuffer->getHeight(); michael@0: samples = colorbuffer->getSamples(); michael@0: colorbufferSize = gl::ComputePixelSize(colorbuffer->getInternalFormat()); michael@0: missingAttachment = false; michael@0: } michael@0: } michael@0: } michael@0: michael@0: const Renderbuffer *depthbuffer = NULL; michael@0: const Renderbuffer *stencilbuffer = NULL; michael@0: michael@0: if (mDepthbufferType != GL_NONE) michael@0: { michael@0: depthbuffer = getDepthbuffer(); michael@0: michael@0: if (!depthbuffer) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (depthbuffer->getWidth() == 0 || depthbuffer->getHeight() == 0) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (mDepthbufferType == GL_RENDERBUFFER) michael@0: { michael@0: if (!gl::IsDepthRenderable(depthbuffer->getInternalFormat())) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: } michael@0: else if (IsInternalTextureTarget(mDepthbufferType)) michael@0: { michael@0: GLint internalformat = depthbuffer->getInternalFormat(); michael@0: michael@0: // depth texture attachments require OES/ANGLE_depth_texture michael@0: if (!mRenderer->getDepthTextureSupport()) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (!gl::IsDepthTexture(internalformat)) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: } michael@0: else michael@0: { michael@0: UNREACHABLE(); michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (missingAttachment) michael@0: { michael@0: width = depthbuffer->getWidth(); michael@0: height = depthbuffer->getHeight(); michael@0: samples = depthbuffer->getSamples(); michael@0: missingAttachment = false; michael@0: } michael@0: else if (width != depthbuffer->getWidth() || height != depthbuffer->getHeight()) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; michael@0: } michael@0: else if (samples != depthbuffer->getSamples()) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE; michael@0: } michael@0: } michael@0: michael@0: if (mStencilbufferType != GL_NONE) michael@0: { michael@0: stencilbuffer = getStencilbuffer(); michael@0: michael@0: if (!stencilbuffer) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (stencilbuffer->getWidth() == 0 || stencilbuffer->getHeight() == 0) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (mStencilbufferType == GL_RENDERBUFFER) michael@0: { michael@0: if (!gl::IsStencilRenderable(stencilbuffer->getInternalFormat())) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: } michael@0: else if (IsInternalTextureTarget(mStencilbufferType)) michael@0: { michael@0: GLint internalformat = stencilbuffer->getInternalFormat(); michael@0: michael@0: // texture stencil attachments come along as part michael@0: // of OES_packed_depth_stencil + OES/ANGLE_depth_texture michael@0: if (!mRenderer->getDepthTextureSupport()) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (!gl::IsStencilTexture(internalformat)) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: } michael@0: else michael@0: { michael@0: UNREACHABLE(); michael@0: return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; michael@0: } michael@0: michael@0: if (missingAttachment) michael@0: { michael@0: width = stencilbuffer->getWidth(); michael@0: height = stencilbuffer->getHeight(); michael@0: samples = stencilbuffer->getSamples(); michael@0: missingAttachment = false; michael@0: } michael@0: else if (width != stencilbuffer->getWidth() || height != stencilbuffer->getHeight()) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; michael@0: } michael@0: else if (samples != stencilbuffer->getSamples()) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE; michael@0: } michael@0: } michael@0: michael@0: // if we have both a depth and stencil buffer, they must refer to the same object michael@0: // since we only support packed_depth_stencil and not separate depth and stencil michael@0: if (depthbuffer && stencilbuffer && (depthbuffer != stencilbuffer)) michael@0: { michael@0: return GL_FRAMEBUFFER_UNSUPPORTED; michael@0: } michael@0: michael@0: // we need to have at least one attachment to be complete michael@0: if (missingAttachment) michael@0: { michael@0: return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; michael@0: } michael@0: michael@0: return GL_FRAMEBUFFER_COMPLETE; michael@0: } michael@0: michael@0: DefaultFramebuffer::DefaultFramebuffer(rx::Renderer *renderer, Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil) michael@0: : Framebuffer(renderer) michael@0: { michael@0: mColorbufferPointers[0].set(new Renderbuffer(mRenderer, 0, colorbuffer)); michael@0: michael@0: Renderbuffer *depthStencilRenderbuffer = new Renderbuffer(mRenderer, 0, depthStencil); michael@0: mDepthbufferPointer.set(depthStencilRenderbuffer); michael@0: mStencilbufferPointer.set(depthStencilRenderbuffer); michael@0: michael@0: mColorbufferTypes[0] = GL_RENDERBUFFER; michael@0: mDepthbufferType = (depthStencilRenderbuffer->getDepthSize() != 0) ? GL_RENDERBUFFER : GL_NONE; michael@0: mStencilbufferType = (depthStencilRenderbuffer->getStencilSize() != 0) ? GL_RENDERBUFFER : GL_NONE; michael@0: michael@0: mDrawBufferStates[0] = GL_BACK; michael@0: mReadBufferState = GL_BACK; michael@0: } michael@0: michael@0: int Framebuffer::getSamples() const michael@0: { michael@0: if (completeness() == GL_FRAMEBUFFER_COMPLETE) michael@0: { michael@0: // for a complete framebuffer, all attachments must have the same sample count michael@0: // in this case return the first nonzero sample size michael@0: for (unsigned int colorAttachment = 0; colorAttachment < IMPLEMENTATION_MAX_DRAW_BUFFERS; colorAttachment++) michael@0: { michael@0: if (mColorbufferTypes[colorAttachment] != GL_NONE) michael@0: { michael@0: return getColorbuffer(colorAttachment)->getSamples(); michael@0: } michael@0: } michael@0: } michael@0: michael@0: return 0; michael@0: } michael@0: michael@0: GLenum DefaultFramebuffer::completeness() const michael@0: { michael@0: // The default framebuffer *must* always be complete, though it may not be michael@0: // subject to the same rules as application FBOs. ie, it could have 0x0 size. michael@0: return GL_FRAMEBUFFER_COMPLETE; michael@0: } michael@0: michael@0: }