[Mesa-dev] [PATCH 15/18] mesa: Require names from Gen in core context

Ian Romanick idr at freedesktop.org
Fri Aug 24 08:49:14 PDT 2012


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/bufferobj.c |    4 ++++
 src/mesa/main/texobj.c    |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index f8938a5..728cc51 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -720,6 +720,10 @@ bind_buffer_object(struct gl_context *ctx, GLenum target, GLuint buffer)
    else {
       /* non-default buffer object */
       newBufObj = _mesa_lookup_bufferobj(ctx, buffer);
+      if (newBufObj == NULL && ctx->API == API_OPENGL_CORE) {
+         _mesa_error(ctx, GL_INVALID_OPERATION, "glBindBuffer(non-gen name)");
+         return;
+      }
       handle_bind_buffer_gen(ctx, target, buffer, &newBufObj);
    }
    
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 2b2dccf..2e6a5be 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1215,6 +1215,11 @@ _mesa_BindTexture( GLenum target, GLuint texName )
          }
       }
       else {
+         if (ctx->API == API_OPENGL_CORE) {
+            _mesa_error(ctx, GL_INVALID_OPERATION, "glBindTexture");
+            return;
+         }
+
          /* if this is a new texture id, allocate a texture object now */
          newTexObj = ctx->Driver.NewTextureObject(ctx, texName, target);
          if (!newTexObj) {
-- 
1.7.6.5



More information about the mesa-dev mailing list