mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 23:08:18 +02:00
ac/nir/lower_ps_early: assume frag_coord_is_center is always true
RADV will never use this option because it lowers sample_pos in its own pass. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41768>
This commit is contained in:
parent
c42e4a2fba
commit
146d3d7e1f
3 changed files with 1 additions and 7 deletions
|
|
@ -308,7 +308,6 @@ typedef struct {
|
|||
bool load_sample_positions_always_loads_current_ones;
|
||||
bool dynamic_rasterization_samples;
|
||||
int force_front_face; /* 0 -> keep, 1 -> set to true, -1 -> set to false */
|
||||
bool frag_coord_is_center; /* GL requirement for sample shading */
|
||||
|
||||
/* barycentrics:
|
||||
* msaa_disabled:
|
||||
|
|
|
|||
|
|
@ -422,15 +422,12 @@ lower_ps_intrinsic(nir_builder *b, nir_intrinsic_instr *intrin, void *state)
|
|||
case nir_intrinsic_load_sample_pos:
|
||||
if (s->options->msaa_disabled) {
|
||||
nir_def_replace(&intrin->def, nir_imm_vec2(b, 0.5, 0.5));
|
||||
} else if (s->options->frag_coord_is_center) {
|
||||
} else {
|
||||
/* We have to use the alternative way to get sample_pos. */
|
||||
nir_def *num_samples = s->options->load_sample_positions_always_loads_current_ones ?
|
||||
nir_undef(b, 1, 32) : nir_load_rasterization_samples_amd(b);
|
||||
nir_def_replace(&intrin->def, nir_load_sample_positions_amd(b, 32, nir_load_sample_id(b),
|
||||
num_samples));
|
||||
} else {
|
||||
/* sample_pos = ffract(frag_coord.xy); */
|
||||
nir_def_replace(&intrin->def, nir_ffract(b, nir_build_frag_coord(b, 2)));
|
||||
}
|
||||
return true;
|
||||
case nir_intrinsic_load_sample_id:
|
||||
|
|
|
|||
|
|
@ -849,7 +849,6 @@ static void si_preprocess_nir(struct si_nir_shader_ctx *ctx)
|
|||
key->ps.mono.interpolate_at_sample_force_center,
|
||||
.load_sample_positions_always_loads_current_ones = true,
|
||||
.force_front_face = key->ps.opt.force_front_face_input,
|
||||
.frag_coord_is_center = true,
|
||||
/* This does a lot of things. See the description in ac_nir_lower_ps_early_options. */
|
||||
.ps_iter_samples = nir->info.fs.uses_sample_shading ? 8 :
|
||||
key->ps.part.prolog.samplemask_log_ps_iter ?
|
||||
|
|
@ -888,7 +887,6 @@ static void si_preprocess_nir(struct si_nir_shader_ctx *ctx)
|
|||
NIR_PASS(progress, nir, si_nir_lower_polygon_stipple);
|
||||
} else {
|
||||
ac_nir_lower_ps_early_options early_options = {
|
||||
.frag_coord_is_center = true,
|
||||
.ps_iter_samples = nir->info.fs.uses_sample_shading ? 8 : 0,
|
||||
.lower_color_inputs_to_load_color01 = true,
|
||||
.alpha_func = COMPARE_FUNC_ALWAYS,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue