From: Samuel Pitoiset Date: Mon, 10 Apr 2023 07:38:09 +0000 (+0200) Subject: radv: fix re-emitting vertex user SGPRs when binding a graphics pipeline X-Git-Tag: upstream/23.3.3~10181 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ccaf5583f6b9d7182c0e3ab74bd86ca6c739754;p=platform%2Fupstream%2Fmesa.git radv: fix re-emitting vertex user SGPRs when binding a graphics pipeline The base SGPR and the number of SGPRs can be equal but it was incorrect because one VS can have draw_id and one can have base_instance. Fix this by invalidating the vertex user SGPRs unconditionally. Though they should also be invalidated after executing secondaries, otherwise nothing is invalidated if the same pipeline is bind to the primary again. This fixes dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed*. Signed-off-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/ci/external/radv-bonaire-aco-fails.txt b/src/amd/ci/external/radv-bonaire-aco-fails.txt index b937368..9f8a01f 100644 --- a/src/amd/ci/external/radv-bonaire-aco-fails.txt +++ b/src/amd/ci/external/radv-bonaire-aco-fails.txt @@ -19,16 +19,6 @@ dEQP-VK.texture.mipmap.cubemap.image_view_min_lod.base_level.nearest_linear,Fail dEQP-VK.texture.mipmap.cubemap.image_view_min_lod.base_level.nearest_nearest,Fail # New CTS failures in 1.3.5.0. -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed3_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed46_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed49_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed50_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed52_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed59_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed65_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed6_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed81_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed8_tessellation,Fail dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_fragment_stage,Crash dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_fragment_stage_delayed_destroy,Crash dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_fragment_stage_no_cache,Crash diff --git a/src/amd/ci/external/radv-gfx1100-aco-fails.txt b/src/amd/ci/external/radv-gfx1100-aco-fails.txt index f178e1f..6d22796 100644 --- a/src/amd/ci/external/radv-gfx1100-aco-fails.txt +++ b/src/amd/ci/external/radv-gfx1100-aco-fails.txt @@ -10,11 +10,4 @@ dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_ dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_tessellation_control_stage_tessellation_evaluation_stage_fragment_stage_delayed_destroy,Crash dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_tessellation_control_stage_tessellation_evaluation_stage_fragment_stage_no_cache,Crash -# New CTS failures in 1.3.5.0 -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed3_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed49_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed65_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed81_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed8_tessellation,Fail - dEQP-VK.subgroups.builtin_var.ray_tracing.subgroupsize,Fail diff --git a/src/amd/ci/external/radv-pitcairn-aco-fails.txt b/src/amd/ci/external/radv-pitcairn-aco-fails.txt index aeccbd3..935a5c6 100644 --- a/src/amd/ci/external/radv-pitcairn-aco-fails.txt +++ b/src/amd/ci/external/radv-pitcairn-aco-fails.txt @@ -31,16 +31,6 @@ dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_ # New CTS failures in 1.3.5.0. dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_2_secondary_cmdbuffers,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed3_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed46_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed49_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed50_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed52_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed59_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed65_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed6_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed81_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed8_tessellation,Fail dEQP-VK.image.texel_view_compatible.compute.basic.1d_image.image_store.bc1_rgb_srgb_block.r16g16b16a16_sint,Fail dEQP-VK.image.texel_view_compatible.compute.basic.1d_image.image_store.bc1_rgb_srgb_block.r16g16b16a16_snorm,Fail dEQP-VK.image.texel_view_compatible.compute.basic.1d_image.image_store.bc1_rgb_srgb_block.r16g16b16a16_uint,Fail diff --git a/src/amd/ci/external/radv-polaris10-aco-fails.txt b/src/amd/ci/external/radv-polaris10-aco-fails.txt index 7ab54d0..9f865e1 100644 --- a/src/amd/ci/external/radv-polaris10-aco-fails.txt +++ b/src/amd/ci/external/radv-polaris10-aco-fails.txt @@ -30,14 +30,4 @@ dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_ dEQP-VK.pipeline.pipeline_library.creation_feedback.graphics_tests.vertex_stage_tessellation_control_stage_tessellation_evaluation_stage_fragment_stage_no_cache,Crash # New CTS failures in 1.3.5.0. -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed3_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed46_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed49_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed50_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed52_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed59_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed65_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed6_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed81_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed8_tessellation,Fail dEQP-VK.pipeline.fast_linked_library.multisample_interpolation.sample_interpolation_consistency.component_1.128_128_1.samples_8,Fail diff --git a/src/amd/ci/radv-navi10-aco-fails.txt b/src/amd/ci/radv-navi10-aco-fails.txt index 3e3b9d2..fb373a8 100644 --- a/src/amd/ci/radv-navi10-aco-fails.txt +++ b/src/amd/ci/radv-navi10-aco-fails.txt @@ -109,10 +109,5 @@ dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers2_sets4_im dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers32_sets1,Crash dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers3_sets1,Crash dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers8_sets1,Crash -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed3_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed49_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed65_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed81_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed8_tessellation,Fail dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.two_draws_static.topology_line,Fail dEQP-VK.pipeline.fast_linked_library.multisample_interpolation.sample_interpolation_consistency.component_1.128_128_1.samples_8,Fail diff --git a/src/amd/ci/radv-raven-fails.txt b/src/amd/ci/radv-raven-fails.txt index 17cd46a..557c980 100644 --- a/src/amd/ci/radv-raven-fails.txt +++ b/src/amd/ci/radv-raven-fails.txt @@ -32,7 +32,6 @@ dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers16_sets1,C dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers1_sets3_imm_samplers,Crash dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers2_sets4_imm_samplers,Crash dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed49_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed50_geometry,Fail dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed59_geometry,Fail dEQP-VK.memory.mapping.dedicated_alloc.image.full.variable.implicit_unmap,Timeout dEQP-VK.memory.mapping.suballocation.full.variable.implicit_unmap,Timeout diff --git a/src/amd/ci/radv-renoir-aco-fails.txt b/src/amd/ci/radv-renoir-aco-fails.txt index 447e1e2..a3d726d 100644 --- a/src/amd/ci/radv-renoir-aco-fails.txt +++ b/src/amd/ci/radv-renoir-aco-fails.txt @@ -109,14 +109,4 @@ dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers2_sets4_im dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers32_sets1,Crash dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers3_sets1,Crash dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_vert_buffers8_sets1,Crash -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed3_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed46_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed49_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed50_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed52_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed59_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed65_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed6_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed81_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed8_tessellation,Fail dEQP-VK.pipeline.fast_linked_library.multisample_interpolation.sample_interpolation_consistency.component_1.128_128_1.samples_8,Fail diff --git a/src/amd/ci/radv-stoney-aco-fails.txt b/src/amd/ci/radv-stoney-aco-fails.txt index e08fd2b..4fd33ca 100644 --- a/src/amd/ci/radv-stoney-aco-fails.txt +++ b/src/amd/ci/radv-stoney-aco-fails.txt @@ -23,12 +23,6 @@ dEQP-VK.texture.mipmap.cubemap.image_view_min_lod.base_level.nearest_linear,Fail dEQP-VK.texture.mipmap.cubemap.image_view_min_lod.base_level.nearest_nearest,Fail -# unknown dynamic-rendering geometry/tessellation issues -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed52_geometry,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed8_tessellation,Fail -dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed81_tessellation,Fail - - # descriptor-buffer crashes dEQP-VK.binding_model.descriptor_buffer.multiple.compute_comp_buffers1_sets1,Crash dEQP-VK.binding_model.descriptor_buffer.multiple.compute_comp_buffers2_sets4,Crash diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 3854083..b71757a 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -6411,6 +6411,11 @@ radv_bind_pre_rast_shader(struct radv_cmd_buffer *cmd_buffer, const struct radv_ cmd_buffer->state.vtx_emit_num = loc->num_sgprs; cmd_buffer->state.uses_drawid = shader->info.vs.needs_draw_id; cmd_buffer->state.uses_baseinstance = shader->info.vs.needs_base_instance; + + /* Re-emit some vertex states because the SGPR idx can be different. */ + cmd_buffer->state.last_first_instance = -1; + cmd_buffer->state.last_vertex_offset = -1; + cmd_buffer->state.last_drawid = -1; } if (mesh_shading != cmd_buffer->state.mesh_shading) { @@ -6624,23 +6629,12 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline cmd_buffer->state.last_vgt_shader = graphics_pipeline->base.shaders[graphics_pipeline->last_vgt_api_stage]; - bool vtx_emit_count_changed = - !cmd_buffer->state.graphics_pipeline || - cmd_buffer->state.graphics_pipeline->vtx_emit_num != graphics_pipeline->vtx_emit_num || - cmd_buffer->state.graphics_pipeline->vtx_base_sgpr != graphics_pipeline->vtx_base_sgpr; cmd_buffer->state.graphics_pipeline = graphics_pipeline; cmd_buffer->state.has_nggc = graphics_pipeline->has_ngg_culling; cmd_buffer->state.dirty |= RADV_CMD_DIRTY_PIPELINE | RADV_CMD_DIRTY_DYNAMIC_VERTEX_INPUT; cmd_buffer->push_constant_stages |= graphics_pipeline->active_stages; - /* the new vertex shader might not have the same user regs */ - if (vtx_emit_count_changed) { - cmd_buffer->state.last_first_instance = -1; - cmd_buffer->state.last_vertex_offset = -1; - cmd_buffer->state.last_drawid = -1; - } - /* Prefetch all pipeline shaders at first draw time. */ cmd_buffer->state.prefetch_L2_mask |= RADV_PREFETCH_SHADERS; @@ -7592,11 +7586,8 @@ radv_CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCou primary->state.last_ge_cntl = secondary->state.last_ge_cntl; } - primary->state.last_first_instance = secondary->state.last_first_instance; primary->state.last_num_instances = secondary->state.last_num_instances; - primary->state.last_drawid = secondary->state.last_drawid; primary->state.last_subpass_color_count = secondary->state.last_subpass_color_count; - primary->state.last_vertex_offset = secondary->state.last_vertex_offset; primary->state.last_sx_ps_downconvert = secondary->state.last_sx_ps_downconvert; primary->state.last_sx_blend_opt_epsilon = secondary->state.last_sx_blend_opt_epsilon; primary->state.last_sx_blend_opt_control = secondary->state.last_sx_blend_opt_control; @@ -7621,6 +7612,10 @@ radv_CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCou RADV_CMD_DIRTY_NGG_QUERY; radv_mark_descriptor_sets_dirty(primary, VK_PIPELINE_BIND_POINT_GRAPHICS); radv_mark_descriptor_sets_dirty(primary, VK_PIPELINE_BIND_POINT_COMPUTE); + + primary->state.last_first_instance = -1; + primary->state.last_drawid = -1; + primary->state.last_vertex_offset = -1; } static void