mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1
authorMarta Lofstedt <marta.lofstedt@intel.com>
Fri, 8 Jan 2016 13:55:55 +0000 (14:55 +0100)
committerMarta Lofstedt <marta.lofstedt@linux.intel.com>
Tue, 19 Jan 2016 12:08:42 +0000 (13:08 +0100)
Sanity check of BindVertexBuffer for OpenGL ES in
_mesa_handle_bind_buffer_gen breaks OpenGL ES 2 conformance.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93426
Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/bufferobj.c
src/mesa/main/varray.c

index 26f873bc9a97c55c7f4742fd02ddd35f8a75b2d5..8ede1f06e4ecfa88156ceb3fe1f9d4779168e776 100644 (file)
@@ -953,7 +953,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context *ctx,
 {
    struct gl_buffer_object *buf = *buf_handle;
 
-   if (!buf && (ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx))) {
+   if (!buf && (ctx->API == API_OPENGL_CORE)) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", caller);
       return false;
    }
index c71e16a1e5685fc4dda0b6ea7220c3ec62834eaf..c2bf2951687ebd11735e9651f5a080afff720ea7 100644 (file)
@@ -1744,6 +1744,10 @@ vertex_array_vertex_buffer(struct gl_context *ctx,
    } else if (buffer != 0) {
       vbo = _mesa_lookup_bufferobj(ctx, buffer);
 
+      if (!vbo && _mesa_is_gles31(ctx)) {
+         _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", func);
+         return;
+      }
       /* From the GL_ARB_vertex_attrib_array spec:
        *
        *   "[Core profile only:]