From 7620a1b13f3e38ef9b5554aef7c1f51b42082bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 19 Aug 2020 16:38:34 +0200 Subject: [PATCH] v3dv/cmd_buffer: set instance id to 0 at start of tile PTB assumes that instance id to be 0 at start of tile, but hw would not do that, we need to set it. This fixes some Vulkan CTS tests that start to fails after some other tests used an instance id. So for example, before this commit for the following tests, executed in that order, we got the following behaviour: dEQP-VK.pipeline.vertex_input.multiple_attributes.binding_one_to_many.attributes.float.mat2.mat3 => Pass dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_strip => Pass dEQP-VK.pipeline.vertex_input.multiple_attributes.binding_one_to_many.attributes.float.mat2.mat3 => Fails Part-of: --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index 4fe54733f5e..593816fc3a6 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -1838,6 +1838,11 @@ cmd_buffer_render_pass_emit_per_tile_rcl(struct v3dv_cmd_buffer *cmd_buffer, fmt.primitive_type = LIST_TRIANGLES; } + /* PTB assumes that value to be 0, but hw will not set it. */ + cl_emit(cl, SET_INSTANCEID, set) { + set.instance_id = 0; + } + cl_emit(cl, BRANCH_TO_IMPLICIT_TILE_LIST, branch); cmd_buffer_render_pass_emit_stores(cmd_buffer, cl, layer);