radv: do not use an user SGPR for the sample position offset
We know the number of samples at compile time. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -2710,35 +2710,6 @@ radv_pipeline_generate_multisample_state(struct radeon_cmdbuf *cs,
|
||||
|
||||
radeon_set_context_reg(cs, R_028804_DB_EQAA, ms->db_eqaa);
|
||||
radeon_set_context_reg(cs, R_028A4C_PA_SC_MODE_CNTL_1, ms->pa_sc_mode_cntl_1);
|
||||
|
||||
if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.info.ps.needs_sample_positions) {
|
||||
uint32_t offset;
|
||||
struct radv_userdata_info *loc = radv_lookup_user_sgpr(pipeline, MESA_SHADER_FRAGMENT, AC_UD_PS_SAMPLE_POS_OFFSET);
|
||||
uint32_t base_reg = pipeline->user_data_0[MESA_SHADER_FRAGMENT];
|
||||
if (loc->sgpr_idx == -1)
|
||||
return;
|
||||
assert(loc->num_sgprs == 1);
|
||||
assert(!loc->indirect);
|
||||
switch (pipeline->graphics.ms.num_samples) {
|
||||
default:
|
||||
offset = 0;
|
||||
break;
|
||||
case 2:
|
||||
offset = 1;
|
||||
break;
|
||||
case 4:
|
||||
offset = 3;
|
||||
break;
|
||||
case 8:
|
||||
offset = 7;
|
||||
break;
|
||||
case 16:
|
||||
offset = 15;
|
||||
break;
|
||||
}
|
||||
|
||||
radeon_set_sh_reg(cs, base_reg + loc->sgpr_idx * 4, offset);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user