radv: emit the rasterization samples through an user SGPR if needed
When the main FS needs sample positions and the number of samples isn't known at compile time with GPL. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18677>
This commit is contained in:

committed by
Marge Bot

parent
deb2dccc75
commit
f4ec8e1ad5
@@ -5543,6 +5543,13 @@ radv_pipeline_emit_fragment_shader(struct radeon_cmdbuf *ctx_cs, struct radeon_c
|
|||||||
ctx_cs, R_028710_SPI_SHADER_Z_FORMAT,
|
ctx_cs, R_028710_SPI_SHADER_Z_FORMAT,
|
||||||
ac_get_spi_shader_z_format(ps->info.ps.writes_z, ps->info.ps.writes_stencil,
|
ac_get_spi_shader_z_format(ps->info.ps.writes_z, ps->info.ps.writes_stencil,
|
||||||
ps->info.ps.writes_sample_mask, false));
|
ps->info.ps.writes_sample_mask, false));
|
||||||
|
|
||||||
|
struct radv_userdata_info *loc =
|
||||||
|
radv_lookup_user_sgpr(&pipeline->base, MESA_SHADER_FRAGMENT, AC_UD_PS_NUM_SAMPLES);
|
||||||
|
if (loc->sgpr_idx != -1) {
|
||||||
|
uint32_t base_reg = pipeline->base.user_data_0[MESA_SHADER_FRAGMENT];
|
||||||
|
radeon_set_sh_reg(cs, base_reg + loc->sgpr_idx * 4, pipeline->ms.num_samples);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user