do some cleanup in Framebuffer::completeness

Trac #20875 Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1112 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent f20bc216
...@@ -243,6 +243,7 @@ bool Framebuffer::hasStencil() ...@@ -243,6 +243,7 @@ bool Framebuffer::hasStencil()
GLenum Framebuffer::completeness() GLenum Framebuffer::completeness()
{ {
gl::Context *context = gl::getContext();
int width = 0; int width = 0;
int height = 0; int height = 0;
int samples = -1; int samples = -1;
...@@ -270,23 +271,27 @@ GLenum Framebuffer::completeness() ...@@ -270,23 +271,27 @@ GLenum Framebuffer::completeness()
} }
else if (IsInternalTextureTarget(mColorbufferType)) else if (IsInternalTextureTarget(mColorbufferType))
{ {
if (IsCompressed(colorbuffer->getInternalFormat())) GLenum internalformat = colorbuffer->getInternalFormat();
{ D3DFORMAT d3dformat = colorbuffer->getD3DFormat();
return GL_FRAMEBUFFER_UNSUPPORTED;
}
if ((dx2es::IsFloat32Format(colorbuffer->getD3DFormat()) && !getContext()->supportsFloat32RenderableTextures()) || if (IsCompressed(internalformat) ||
(dx2es::IsFloat16Format(colorbuffer->getD3DFormat()) && !getContext()->supportsFloat16RenderableTextures())) internalformat == GL_LUMINANCE ||
internalformat == GL_LUMINANCE_ALPHA)
{ {
return GL_FRAMEBUFFER_UNSUPPORTED; return GL_FRAMEBUFFER_UNSUPPORTED;
} }
if (colorbuffer->getInternalFormat() == GL_LUMINANCE || colorbuffer->getInternalFormat() == GL_LUMINANCE_ALPHA) if ((dx2es::IsFloat32Format(d3dformat) && !context->supportsFloat32RenderableTextures()) ||
(dx2es::IsFloat16Format(d3dformat) && !context->supportsFloat16RenderableTextures()))
{ {
return GL_FRAMEBUFFER_UNSUPPORTED; return GL_FRAMEBUFFER_UNSUPPORTED;
} }
} }
else UNREACHABLE(); else
{
UNREACHABLE();
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
width = colorbuffer->getWidth(); width = colorbuffer->getWidth();
height = colorbuffer->getHeight(); height = colorbuffer->getHeight();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment