Mesa (main): asahi: Skip over holes in the vbufs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 6 13:55:47 UTC 2021


Module: Mesa
Branch: main
Commit: 8d79fdea814ff8bbbabc23781c35372b3c4e803f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d79fdea814ff8bbbabc23781c35372b3c4e803f

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Mon Jul  5 17:32:34 2021 -0400

asahi: Skip over holes in the vbufs

Fixes dEQP-GLES2.functional.vertex_arrays.multiple_attributes.stride.3_float2_17_float2_17_float2_0

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>

---

 src/gallium/drivers/asahi/agx_state.c    | 4 ++--
 src/gallium/drivers/asahi/agx_uniforms.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c
index 9236a35ef3d..bdbf3fea28f 100644
--- a/src/gallium/drivers/asahi/agx_state.c
+++ b/src/gallium/drivers/asahi/agx_state.c
@@ -938,9 +938,9 @@ agx_update_vs(struct agx_context *ctx)
    memcpy(key.attributes, ctx->attributes,
           sizeof(key.attributes[0]) * AGX_MAX_ATTRIBS);
 
-   for (unsigned i = 0; i < key.num_vbufs; ++i) {
+   u_foreach_bit(i, ctx->vb_mask) {
       assert((ctx->vertex_buffers[i].stride & 0x3) == 0);
-      key.vbuf_strides[i] = ctx->vertex_buffers[i].stride / 4; // TODO: alignment
+      key.vbuf_strides[i] = ctx->vertex_buffers[i].stride / 4;
    }
 
    struct asahi_shader_key akey = {
diff --git a/src/gallium/drivers/asahi/agx_uniforms.c b/src/gallium/drivers/asahi/agx_uniforms.c
index 7ef9ddfd413..13650373732 100644
--- a/src/gallium/drivers/asahi/agx_uniforms.c
+++ b/src/gallium/drivers/asahi/agx_uniforms.c
@@ -71,7 +71,7 @@ agx_push_location_direct(struct agx_context *ctx, struct agx_push push,
       struct agx_ptr ptr = agx_pool_alloc_aligned(&batch->pool, count * sizeof(uint64_t), 8);
       uint64_t *addresses = ptr.cpu;
 
-      for (unsigned i = 0; i < count; ++i) {
+      u_foreach_bit(i, ctx->vb_mask) {
          struct pipe_vertex_buffer vb = ctx->vertex_buffers[i];
          assert(!vb.is_user_buffer);
 



More information about the mesa-commit mailing list