From: Ian Romanick Date: Sat, 18 Aug 2012 00:14:02 +0000 (-0700) Subject: mesa: Require names from Gen in core context X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91107b4ccf7a47633fce98b9ccfba7f559098cb7;p=mesa.git mesa: Require names from Gen in core context Signed-off-by: Ian Romanick --- diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index f8938a51054..728cc51da4f 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 638e418dab4..513f3bb0567 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -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) {