mesa: Require names from Gen in core context
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 18 Aug 2012 00:14:02 +0000 (17:14 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 29 Aug 2012 22:09:37 +0000 (15:09 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/bufferobj.c
src/mesa/main/texobj.c

index f8938a51054bcec20d842ecac3926489cb1cb189..728cc51da4ff6da4eef106055150401d4eba540c 100644 (file)
@@ -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);
    }
    
index 638e418dab4de4a4df4ae2c95c8045478cc26a0c..513f3bb0567d396176b40d5c0610aa1dd094f66e 100644 (file)
@@ -1216,6 +1216,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) {