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 <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
This commit is contained in:
Alyssa Rosenzweig 2021-06-01 19:47:03 -04:00 committed by Marge Bot
parent 14da452598
commit 16e6657132
2 changed files with 12 additions and 8 deletions

View file

@ -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

View file

@ -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);