mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
radv: simplify radv_emit_ps_inputs() slightly
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>
This commit is contained in:
parent
c63ac0521a
commit
6c8224c693
1 changed files with 18 additions and 17 deletions
|
|
@ -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)
|
||||
slot_to_ps_input(outinfo, VARYING_SLOT_LAYER, ps_input_cntl, &ps_offset, true, 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.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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue