mesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than the ES...
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 27 Jul 2012 14:49:49 +0000 (07:49 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 29 Aug 2012 22:09:34 +0000 (15:09 -0700)
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/APIspec.xml
src/mesa/main/fbobject.c

index 2e374e466b81e0e2a9fa09de84e0516fbed0ad22..1b9481efebbf2bbeb8a7315b3b805d09bb1aa607 100644 (file)
                <param name="pname" type="GLenum"/>
                <vector name="params" type="GLtype *" size="dynamic"/>
        </proto>
-
-       <desc name="pname" category="OES_framebuffer_object">
-               <value name="GL_RENDERBUFFER_WIDTH_OES"/>
-               <value name="GL_RENDERBUFFER_HEIGHT_OES"/>
-               <value name="GL_RENDERBUFFER_INTERNAL_FORMAT_OES"/>
-               <value name="GL_RENDERBUFFER_RED_SIZE_OES"/>
-               <value name="GL_RENDERBUFFER_GREEN_SIZE_OES"/>
-               <value name="GL_RENDERBUFFER_BLUE_SIZE_OES"/>
-               <value name="GL_RENDERBUFFER_ALPHA_SIZE_OES"/>
-               <value name="GL_RENDERBUFFER_DEPTH_SIZE_OES"/>
-               <value name="GL_RENDERBUFFER_STENCIL_SIZE_OES"/>
-
-               <desc name="params" vector_size="1" convert="false"/>
-       </desc>
-
-       <desc name="pname" category="GLES2.0">
-               <value name="GL_RENDERBUFFER_WIDTH"/>
-               <value name="GL_RENDERBUFFER_HEIGHT"/>
-               <value name="GL_RENDERBUFFER_INTERNAL_FORMAT"/>
-               <value name="GL_RENDERBUFFER_RED_SIZE"/>
-               <value name="GL_RENDERBUFFER_GREEN_SIZE"/>
-               <value name="GL_RENDERBUFFER_BLUE_SIZE"/>
-               <value name="GL_RENDERBUFFER_ALPHA_SIZE"/>
-               <value name="GL_RENDERBUFFER_DEPTH_SIZE"/>
-               <value name="GL_RENDERBUFFER_STENCIL_SIZE"/>
-
-               <desc name="params" vector_size="1" convert="false"/>
-       </desc>
 </template>
 
 <template name="IsRenderbuffer" direction="get">
index 43fb6e863ced61d33847fff18f822c813982c386..5c36bd5a60d79f24aadc9a4a9191c175539cf78a 100644 (file)
@@ -1572,7 +1572,8 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params)
       *params = get_component_bits(pname, rb->_BaseFormat, rb->Format);
       break;
    case GL_RENDERBUFFER_SAMPLES:
-      if (ctx->Extensions.ARB_framebuffer_object) {
+      if ((_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_framebuffer_object)
+          || _mesa_is_gles3(ctx)) {
          *params = rb->NumSamples;
          break;
       }