Mesa (master): iris: Fix assert when using vertex attrib without buffer binding

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 4 22:59:06 UTC 2019


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

Author: Danylo Piliaiev <danylo.piliaiev at globallogic.com>
Date:   Thu Apr  4 15:04:50 2019 +0300

iris: Fix assert when using vertex attrib without buffer binding

The GL 4.5 spec says:
 "If any enabled array’s buffer binding is zero when DrawArrays or
  one of the other drawing commands defined in section 10.4 is called,
  the result is undefined."

The result is undefined but it should not crash.

Fixes: gl-3.1-vao-broken-attrib
Signed-off-by: Danylo Piliaiev <danylo.piliaiev at globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/gallium/drivers/iris/iris_state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 591c6359315..0035b07caeb 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -2642,7 +2642,8 @@ iris_set_vertex_buffers(struct pipe_context *ctx,
          continue;
       }
 
-      assert(!buffer->is_user_buffer);
+      /* We may see user buffers that are NULL bindings. */
+      assert(!(buffer->is_user_buffer && buffer->buffer.user != NULL));
 
       pipe_resource_reference(&state->resource, buffer->buffer.resource);
       struct iris_resource *res = (void *) state->resource;




More information about the mesa-commit mailing list