diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2024-05-10 15:21:02 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-05-14 15:32:08 +0000 |
commit | 6c8224c693c59f7a5da821e3bcb8c6ea9580a2f0 (patch) | |
tree | eb3b72e35fdca3a5d0648b2a41a51e94272f5034 | |
parent | c63ac0521a2cf61edc1949a858e4d0ff29067347 (diff) |
Also remove useless check about ps_offset being zero because memcmp
return false in this case.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28983>
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 32efe792c78..bff5fcfcddd 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2499,14 +2499,16 @@ radv_emit_ps_inputs(struct radv_cmd_buffer *cmd_buffer) uint32_t ps_input_cntl[32]; unsigned ps_offset = 0; - if (ps->info.ps.prim_id_input && !mesh) - slot_to_ps_input(outinfo, VARYING_SLOT_PRIMITIVE_ID, ps_input_cntl, &ps_offset, false, radv_ps_in_flat); + if (!mesh) { + if (ps->info.ps.prim_id_input) + slot_to_ps_input(outinfo, VARYING_SLOT_PRIMITIVE_ID, ps_input_cntl, &ps_offset, false, radv_ps_in_flat); - if (ps->info.ps.layer_input && !mesh) - slot_to_ps_input(outinfo, VARYING_SLOT_LAYER, ps_input_cntl, &ps_offset, true, radv_ps_in_flat); + if (ps->info.ps.layer_input) + slot_to_ps_input(outinfo, VARYING_SLOT_LAYER, ps_input_cntl, &ps_offset, true, radv_ps_in_flat); - if (ps->info.ps.viewport_index_input && !mesh) - slot_to_ps_input(outinfo, VARYING_SLOT_VIEWPORT, ps_input_cntl, &ps_offset, true, radv_ps_in_flat); + if (ps->info.ps.viewport_index_input) + slot_to_ps_input(outinfo, VARYING_SLOT_VIEWPORT, ps_input_cntl, &ps_offset, true, radv_ps_in_flat); + } if (ps->info.ps.has_pcoord) ps_input_cntl[ps_offset++] = S_028644_PT_SPRITE_TEX(1) | S_028644_OFFSET(0x20); @@ -2520,22 +2522,21 @@ radv_emit_ps_inputs(struct radv_cmd_buffer *cmd_buffer) input_mask_to_ps_inputs(outinfo, ps, ps->info.ps.input_mask, ps_input_cntl, &ps_offset, radv_ps_in_interpolated); /* Per-primitive PS inputs: the HW needs these to be last. */ + if (mesh) { + if (ps->info.ps.prim_id_input) + slot_to_ps_input(outinfo, VARYING_SLOT_PRIMITIVE_ID, ps_input_cntl, &ps_offset, false, per_prim); - if (ps->info.ps.prim_id_input && mesh) - slot_to_ps_input(outinfo, VARYING_SLOT_PRIMITIVE_ID, ps_input_cntl, &ps_offset, false, per_prim); - - if (ps->info.ps.layer_input && mesh) - slot_to_ps_input(outinfo, VARYING_SLOT_LAYER, ps_input_cntl, &ps_offset, true, per_prim); + if (ps->info.ps.layer_input) + slot_to_ps_input(outinfo, VARYING_SLOT_LAYER, ps_input_cntl, &ps_offset, true, per_prim); - if (ps->info.ps.viewport_index_input && mesh) - slot_to_ps_input(outinfo, VARYING_SLOT_VIEWPORT, ps_input_cntl, &ps_offset, true, per_prim); + if (ps->info.ps.viewport_index_input) + slot_to_ps_input(outinfo, VARYING_SLOT_VIEWPORT, ps_input_cntl, &ps_offset, true, per_prim); + } input_mask_to_ps_inputs(outinfo, ps, ps->info.ps.input_per_primitive_mask, ps_input_cntl, &ps_offset, per_prim); - if (ps_offset) { - radeon_opt_set_context_regn(cmd_buffer, R_028644_SPI_PS_INPUT_CNTL_0, ps_input_cntl, - cmd_buffer->tracked_regs.spi_ps_input_cntl, ps_offset); - } + radeon_opt_set_context_regn(cmd_buffer, R_028644_SPI_PS_INPUT_CNTL_0, ps_input_cntl, + cmd_buffer->tracked_regs.spi_ps_input_cntl, ps_offset); } static void |