Module: Mesa
Branch: master
Commit: 2bcacc69b9935f073e271527771b4fb42081dcb6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2bcacc69b9935f073e271527771b4fb42081dcb6

Author: Marta Lofstedt <marta.lofst...@intel.com>
Date:   Fri Jan  8 14:55:55 2016 +0100

mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1

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.lofst...@intel.com>
Reviewed-by: Tapani Pälli <tapani.pa...@intel.com>

---

 src/mesa/main/bufferobj.c | 2 +-
 src/mesa/main/varray.c    | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 26f873b..8ede1f0 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..c2bf295 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -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:]

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to