[Mesa-dev] [PATCH] mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1

Marta Lofstedt marta.lofstedt at linux.intel.com
Fri Jan 8 05:55:55 PST 2016


From: Marta Lofstedt <marta.lofstedt at intel.com>

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 at intel.com>
---
 src/mesa/main/bufferobj.c | 2 +-
 src/mesa/main/varray.c    | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index d7c5680..3ca1b3a 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -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;
    }
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index c71e16a..a8d757b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1754,8 +1754,14 @@ vertex_array_vertex_buffer(struct gl_context *ctx,
        * Otherwise, we fall back to the same compat profile behavior as other
        * object references (automatically gen it).
        */
-      if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func))
+      if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func)) {
+          return;
+      }
+
+      if (!vbo && _mesa_is_gles31(ctx)) {
+         _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", func);
          return;
+      }
    } else {
       /* The ARB_vertex_attrib_binding spec says:
        *
-- 
2.5.0



More information about the mesa-dev mailing list