mesa/es: Validate FBO target enum in Mesa code rather than the ES wrapper
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 20 Sep 2011 22:10:50 +0000 (15:10 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 4 Oct 2011 19:25:56 +0000 (12:25 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/APIspec.xml
src/mesa/main/fbobject.c

index 2b277a081b9177a747e86002246ddfa00040960f..cb94a5c91d77436c13ce34b277f1289e424e4fed 100644 (file)
                <param name="target" type="GLenum"/>
                <param name="framebuffer" type="GLuint"/>
        </proto>
-
-       <desc name="target">
-               <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
-               <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
-       </desc>
 </template>
 
 <template name="DeleteFramebuffers">
                <param name="renderbuffer" type="GLuint"/>
        </proto>
 
-       <desc name="target">
-               <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
-               <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
-       </desc>
-
        <desc name="renderbuffertarget">
                <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
                <value name="GL_RENDERBUFFER" category="GLES2.0"/>
                <param name="level" type="GLint"/>
        </proto>
 
-       <desc name="target">
-               <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
-               <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
-       </desc>
-
        <desc name="textarget" error="GL_INVALID_OPERATION">
                <value name="GL_TEXTURE_2D"/>
                <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
                <param name="zoffset" type="GLint"/>
        </proto>
 
-       <desc name="target">
-               <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
-               <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
-       </desc>
-
        <desc name="textarget" error="GL_INVALID_OPERATION">
                <value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/>
        </desc>
                <return type="GLenum"/>
                <param name="target" type="GLenum"/>
        </proto>
-
-       <desc name="target">
-               <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
-               <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
-       </desc>
 </template>
 
 <template name="GetFramebufferAttachmentParameter" direction="get">
                <vector name="params" type="GLtype *" size="dynamic"/>
        </proto>
 
-       <desc name="target">
-               <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
-               <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
-       </desc>
-
        <desc name="pname">
                <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" category="OES_framebuffer_object"/>
                <value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" category="OES_framebuffer_object"/>
index 2e0af97f4d373172d166a979d6e249ae78dd73f2..6e54c09d7c74ed592f5552173d22e50971c33024 100644 (file)
@@ -194,9 +194,11 @@ get_framebuffer_target(struct gl_context *ctx, GLenum target)
 {
    switch (target) {
    case GL_DRAW_FRAMEBUFFER:
-      return ctx->Extensions.EXT_framebuffer_blit ? ctx->DrawBuffer : NULL;
+      return ctx->Extensions.EXT_framebuffer_blit && ctx->API == API_OPENGL
+        ? ctx->DrawBuffer : NULL;
    case GL_READ_FRAMEBUFFER:
-      return ctx->Extensions.EXT_framebuffer_blit ? ctx->ReadBuffer : NULL;
+      return ctx->Extensions.EXT_framebuffer_blit && ctx->API == API_OPENGL
+        ? ctx->ReadBuffer : NULL;
    case GL_FRAMEBUFFER_EXT:
       return ctx->DrawBuffer;
    default: