From 16e665713261748ac8ab6ffde3e22c2627326cd1 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 1 Jun 2021 19:47:03 -0400 Subject: [PATCH] pan/indirect_draw: Fix 1 instance, nonzero divisor Instead of doing a complicated hack with the POT divisor, just zero the stride of the linear attribute buffer like we do on the CPU. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- .../panfrost/ci/deqp-panfrost-g52-fails.txt | 2 -- src/panfrost/lib/pan_indirect_draw.c | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt b/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt index 294345d43db..cc23dee451c 100644 --- a/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt +++ b/src/gallium/drivers/panfrost/ci/deqp-panfrost-g52-fails.txt @@ -1,5 +1,3 @@ -dEQP-GLES31.functional.draw_indirect.draw_elements_indirect.line_strip.instanced_attributes,Fail -dEQP-GLES31.functional.draw_indirect.random.31,Fail dEQP-GLES31.functional.layout_binding.image.image2d.vertex_binding_max_array,Fail dEQP-GLES31.functional.layout_binding.image.image3d.vertex_binding_max_array,Fail dEQP-GLES31.functional.separate_shader.random.23,Fail diff --git a/src/panfrost/lib/pan_indirect_draw.c b/src/panfrost/lib/pan_indirect_draw.c index 3498dea46aa..80087645072 100644 --- a/src/panfrost/lib/pan_indirect_draw.c +++ b/src/panfrost/lib/pan_indirect_draw.c @@ -513,6 +513,16 @@ update_vertex_attrib_buf(struct indirect_draw_shader_builder *builder, } } +static void +zero_attrib_buf_stride(struct indirect_draw_shader_builder *builder, + nir_ssa_def *attrib_buf_ptr) +{ + /* Stride is an unadorned 32-bit uint at word 2 */ + nir_builder *b = &builder->b; + store_global(b, get_address_imm(b, attrib_buf_ptr, WORD(2)), + nir_imm_int(b, 0), 1); +} + static void adjust_attrib_offset(struct indirect_draw_shader_builder *builder, nir_ssa_def *attrib_ptr, nir_ssa_def *attrib_buf_ptr, @@ -659,12 +669,8 @@ update_vertex_attribs(struct indirect_draw_shader_builder *builder) } ENDIF } ELSE { /* Single instance with a non-0 divisor: all - * accesses should point to attribute 0, pick - * the biggest pot divisor. - */ - update_vertex_attrib_buf(builder, attrib_buf_ptr, - MALI_ATTRIBUTE_TYPE_1D_POT_DIVISOR, - nir_imm_int(b, 31), NULL); + * accesses should point to attribute 0 */ + zero_attrib_buf_stride(builder, attrib_buf_ptr); } ENDIF adjust_attrib_offset(builder, attrib_ptr, attrib_buf_ptr, instance_div);