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

Submitted by Marta Löfstedt on Jan. 8, 2016, 1:55 p.m.

Details

Message ID 1452261355-25450-1-git-send-email-marta.lofstedt@linux.intel.com
State New
Series "mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1"
Headers show

Commit Message

Marta Löfstedt Jan. 8, 2016, 1:55 p.m.
From: Marta Lofstedt <marta.lofstedt@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@intel.com>
---
 src/mesa/main/bufferobj.c | 2 +-
 src/mesa/main/varray.c    | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

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:
        *

Comments

Lofstedt, Marta Jan. 18, 2016, 3:10 p.m.
Note to myself the new tests need to go before the old one.

> -----Original Message-----
> From: Marta Lofstedt [mailto:marta.lofstedt@linux.intel.com]
> Sent: Friday, January 8, 2016 2:56 PM
> To: mesa-dev@lists.freedesktop.org
> Cc: Lofstedt, Marta
> Subject: [PATCH] mesa: Move sanity check of BindVertexBuffer for OpenGL
> ES 3.1
> 
> From: Marta Lofstedt <marta.lofstedt@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@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
Tapani Pälli Jan. 19, 2016, 5:30 a.m.
Confirmed that patch fixes all the seen regressions;

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>

On 01/08/2016 03:55 PM, Marta Lofstedt wrote:
> From: Marta Lofstedt <marta.lofstedt@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@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:
>          *
>
Ian Romanick Jan. 19, 2016, 8:15 p.m.
On 01/08/2016 05:55 AM, Marta Lofstedt wrote:
> From: Marta Lofstedt <marta.lofstedt@intel.com>
> 
> Sanity check of BindVertexBuffer for OpenGL ES in
> _mesa_handle_bind_buffer_gen breaks OpenGL ES 2 conformance.

What was previously broken, and why does this fix it?  I think it's also
worth mentioning that this is a revert of
6c3de8996fbe9447e092cc75ccdd6f720fabaf4d.

> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93426
> Signed-off-by: Marta Lofstedt <marta.lofstedt@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:
>         *
>
Lofstedt, Marta Jan. 20, 2016, 8:57 a.m.
> -----Original Message-----

> From: mesa-dev [mailto:mesa-dev-bounces@lists.freedesktop.org] On

> Behalf Of Ian Romanick

> Sent: Tuesday, January 19, 2016 9:16 PM

> To: Marta Lofstedt; mesa-dev@lists.freedesktop.org

> Subject: Re: [Mesa-dev] [PATCH] mesa: Move sanity check of

> BindVertexBuffer for OpenGL ES 3.1

> 

> On 01/08/2016 05:55 AM, Marta Lofstedt wrote:

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

> >

> > Sanity check of BindVertexBuffer for OpenGL ES in

> > _mesa_handle_bind_buffer_gen breaks OpenGL ES 2 conformance.

> 

> What was previously broken, and why does this fix it?  I think it's also worth

> mentioning that this is a revert of

> 6c3de8996fbe9447e092cc75ccdd6f720fabaf4d.

>

I believe this is discussed in the Bug.
> 

> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93426

> > Signed-off-by: Marta Lofstedt <marta.lofstedt@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:

> >         *

> >

> 

> _______________________________________________

> mesa-dev mailing list

> mesa-dev@lists.freedesktop.org

> http://lists.freedesktop.org/mailman/listinfo/mesa-dev