Commit 69920adf by Nicolas Capens

Validate renderability of texture formats.

Change-Id: I49c0f7b78a131c0d78c2cfb207bb3019b2b93a15 Reviewed-on: https://swiftshader-review.googlesource.com/5129Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 2e904501
......@@ -251,7 +251,7 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
if(mColorbufferType == GL_RENDERBUFFER_OES)
{
if(!es1::IsColorRenderable(colorbuffer->getFormat()))
if(!IsColorRenderable(colorbuffer->getFormat()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES;
}
......@@ -260,15 +260,12 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
{
GLenum format = colorbuffer->getFormat();
if(IsCompressed(format) ||
format == GL_ALPHA ||
format == GL_LUMINANCE ||
format == GL_LUMINANCE_ALPHA)
if(!IsColorRenderable(format))
{
return GL_FRAMEBUFFER_UNSUPPORTED_OES;
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES;
}
if(es1::IsDepthTexture(format) || es1::IsStencilTexture(format))
if(IsDepthTexture(format) || IsStencilTexture(format))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES;
}
......
......@@ -330,7 +330,7 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
if(IsRenderbuffer(mColorbufferType[i]))
{
if(!es2::IsColorRenderable(colorbuffer->getFormat(), egl::getClientVersion()))
if(!IsColorRenderable(colorbuffer->getFormat(), egl::getClientVersion()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
......@@ -339,15 +339,12 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
{
GLenum format = colorbuffer->getFormat();
if(IsCompressed(format, egl::getClientVersion()) ||
format == GL_ALPHA ||
format == GL_LUMINANCE ||
format == GL_LUMINANCE_ALPHA)
if(!IsColorRenderable(format, egl::getClientVersion()))
{
return GL_FRAMEBUFFER_UNSUPPORTED;
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
if(es2::IsDepthTexture(format) || es2::IsStencilTexture(format))
if(IsDepthTexture(format) || IsStencilTexture(format))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
......@@ -369,7 +366,6 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
{
return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE;
}
}
}
......
......@@ -998,6 +998,7 @@ namespace es2
case GL_RG16F:
case GL_RGB16F:
case GL_RGBA16F:
case GL_BGRA8_EXT:
return true;
case GL_R8:
case GL_R8UI:
......
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