Commit 2acbd268 by Nicolas Capens Committed by Nicolas Capens

Accept GL_RGB/GL_RGBA for glGetInternalformativ.

The spec mentions them as color-renderable, but our IsColorRenderable() function only handles sized internal format, and adding them there might hide bugs in our renderbuffer implementation since they can only be constructed using sized internal formats. dEQP also has a note about this inconsistency, and consequently these formats are not part of the 'mustpass' set for dEQP-GLES3.functional.state_query.internal_format. So it might be a spec oversight. Change-Id: I08ca3dad4c0b5686536dafd3ade1e855e3968aa0 Reviewed-on: https://swiftshader-review.googlesource.com/16410Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 8507f329
......@@ -3766,6 +3766,12 @@ GL_APICALL void GL_APIENTRY glGetInternalformativ(GLenum target, GLenum internal
return;
}
// OpenGL ES 3.0, section 4.4.4: "An internal format is color-renderable if it is one of the formats
// from table 3.13 noted as color-renderable or if it is unsized format RGBA or RGB."
// Since we only use sized formats internally, replace them here (assuming type = GL_UNSIGNED_BYTE).
if(internalformat == GL_RGB) internalformat = GL_RGB8;
if(internalformat == GL_RGBA) internalformat = GL_RGBA8;
if(!IsColorRenderable(internalformat, egl::getClientVersion()) &&
!IsDepthRenderable(internalformat, egl::getClientVersion()) &&
!IsStencilRenderable(internalformat, egl::getClientVersion()))
......
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