mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
ac/nir: rename force_center_interp_no_msaa to msaa_disabled
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35345>
This commit is contained in:
parent
3c7a8b4913
commit
1c2007005e
3 changed files with 16 additions and 18 deletions
|
|
@ -286,7 +286,7 @@ ac_nir_lower_legacy_gs(nir_shader *nir, ac_nir_lower_legacy_gs_options *options,
|
|||
*/
|
||||
typedef struct {
|
||||
/* System values. */
|
||||
bool force_center_interp_no_msaa; /* true if MSAA is disabled, false may mean that the state is unknown */
|
||||
bool msaa_disabled; /* true if MSAA is disabled, false may mean that the state is unknown */
|
||||
bool uses_vrs_coarse_shading;
|
||||
bool load_sample_positions_always_loads_current_ones;
|
||||
bool dynamic_rasterization_samples;
|
||||
|
|
@ -295,8 +295,7 @@ typedef struct {
|
|||
bool frag_coord_is_center; /* GL requirement for sample shading */
|
||||
|
||||
/* frag_coord/pixel_coord:
|
||||
* allow_pixel_coord && (frag_coord_is_center || ps_iter_samples == 1 ||
|
||||
* force_center_interp_no_msaa ||
|
||||
* allow_pixel_coord && (frag_coord_is_center || ps_iter_samples == 1 || msaa_disabled ||
|
||||
* the fractional part of frag_coord.xy isn't used):
|
||||
* * frag_coord.xy is replaced by u2f(pixel_coord) + 0.5.
|
||||
* else:
|
||||
|
|
@ -304,7 +303,7 @@ typedef struct {
|
|||
* * ps_iter_samples == 0 means the state is unknown.
|
||||
*
|
||||
* barycentrics:
|
||||
* force_center_interp_no_msaa:
|
||||
* msaa_disabled:
|
||||
* * All barycentrics including at_sample but excluding at_offset are changed to
|
||||
* barycentric_pixel
|
||||
* ps_iter_samples >= 2:
|
||||
|
|
@ -312,7 +311,7 @@ typedef struct {
|
|||
* * barycentric_at_sample(sample_id) is replaced by barycentric_sample.
|
||||
*
|
||||
* sample_mask_in:
|
||||
* force_center_interp_no_msaa && !uses_vrs_coarse_shading:
|
||||
* msaa_disabled && !uses_vrs_coarse_shading:
|
||||
* * sample_mask_in is replaced by b2i32(!helper_invocation)
|
||||
* ps_iter_samples == 2, 4:
|
||||
* * sample_mask_in is changed to (sample_mask_in & (ps_iter_mask << sample_id))
|
||||
|
|
|
|||
|
|
@ -63,19 +63,19 @@ get_baryc_var(nir_builder *b, nir_intrinsic_op baryc_op, enum glsl_interp_mode m
|
|||
case nir_intrinsic_load_barycentric_centroid:
|
||||
if (mode == INTERP_MODE_NOPERSPECTIVE) {
|
||||
return get_baryc_var_common(b, s->options->ps_iter_samples > 1 ||
|
||||
s->options->force_center_interp_no_msaa, &s->linear_centroid,
|
||||
s->options->msaa_disabled, &s->linear_centroid,
|
||||
"linear_centroid");
|
||||
} else {
|
||||
return get_baryc_var_common(b, s->options->ps_iter_samples > 1 ||
|
||||
s->options->force_center_interp_no_msaa, &s->persp_centroid,
|
||||
s->options->msaa_disabled, &s->persp_centroid,
|
||||
"persp_centroid");
|
||||
}
|
||||
case nir_intrinsic_load_barycentric_sample:
|
||||
if (mode == INTERP_MODE_NOPERSPECTIVE) {
|
||||
return get_baryc_var_common(b, s->options->force_center_interp_no_msaa, &s->linear_sample,
|
||||
return get_baryc_var_common(b, s->options->msaa_disabled, &s->linear_sample,
|
||||
"linear_sample");
|
||||
} else {
|
||||
return get_baryc_var_common(b, s->options->force_center_interp_no_msaa, &s->persp_sample,
|
||||
return get_baryc_var_common(b, s->options->msaa_disabled, &s->persp_sample,
|
||||
"persp_sample");
|
||||
}
|
||||
default:
|
||||
|
|
@ -104,7 +104,7 @@ init_interp_param(nir_builder *b, lower_ps_early_state *s)
|
|||
s->linear_center, s->linear_centroid);
|
||||
}
|
||||
|
||||
if (s->options->force_center_interp_no_msaa) {
|
||||
if (s->options->msaa_disabled) {
|
||||
set_interp_vars(b, nir_load_barycentric_pixel(b, 32, .interp_mode = INTERP_MODE_SMOOTH),
|
||||
s->persp_sample, s->persp_centroid);
|
||||
set_interp_vars(b, nir_load_barycentric_pixel(b, 32, .interp_mode = INTERP_MODE_NOPERSPECTIVE),
|
||||
|
|
@ -271,7 +271,7 @@ lower_ps_load_sample_mask_in(nir_builder *b, nir_intrinsic_instr *intrin, lower_
|
|||
/* Set ps_iter_samples=8 if full sample shading is enabled even for 2x and 4x MSAA
|
||||
* to get this fast path that fully replaces sample_mask_in with sample_id.
|
||||
*/
|
||||
if (s->options->force_center_interp_no_msaa && !s->options->uses_vrs_coarse_shading) {
|
||||
if (s->options->msaa_disabled && !s->options->uses_vrs_coarse_shading) {
|
||||
replacement = nir_b2i32(b, nir_inot(b, get_load_helper_invocation(b->impl, s)));
|
||||
} else if (s->options->ps_iter_samples == 8) {
|
||||
replacement = nir_bcsel(b, get_load_helper_invocation(b->impl, s), nir_imm_int(b, 0),
|
||||
|
|
@ -412,7 +412,7 @@ lower_ps_intrinsic(nir_builder *b, nir_intrinsic_instr *intrin, void *state)
|
|||
unsigned mode = nir_intrinsic_interp_mode(intrin);
|
||||
nir_def *sample_id = intrin->src[0].ssa;
|
||||
|
||||
if (s->options->force_center_interp_no_msaa) {
|
||||
if (s->options->msaa_disabled) {
|
||||
nir_def_replace(&intrin->def, nir_load_barycentric_pixel(b, 32, .interp_mode = mode));
|
||||
return true;
|
||||
}
|
||||
|
|
@ -571,8 +571,7 @@ ac_nir_lower_ps_early(nir_shader *nir, const ac_nir_lower_ps_early_options *opti
|
|||
* an even number?
|
||||
*/
|
||||
state.use_fragcoord = !options->frag_coord_is_center && state.options->ps_iter_samples != 1 &&
|
||||
!state.options->force_center_interp_no_msaa &&
|
||||
state.uses_fragcoord_xy_as_float;
|
||||
!state.options->msaa_disabled && state.uses_fragcoord_xy_as_float;
|
||||
|
||||
bool progress = nir_shader_intrinsics_pass(nir, lower_ps_intrinsic,
|
||||
nir_metadata_control_flow, &state);
|
||||
|
|
|
|||
|
|
@ -1403,10 +1403,10 @@ static void run_pre_link_optimization_passes(struct si_nir_shader_ctx *ctx)
|
|||
|
||||
/* This eliminates system values and unused shader output components. */
|
||||
ac_nir_lower_ps_early_options early_options = {
|
||||
.force_center_interp_no_msaa = key->ps.part.prolog.force_persp_center_interp ||
|
||||
key->ps.part.prolog.force_linear_center_interp ||
|
||||
key->ps.part.prolog.force_samplemask_to_helper_invocation ||
|
||||
key->ps.mono.interpolate_at_sample_force_center,
|
||||
.msaa_disabled = key->ps.part.prolog.force_persp_center_interp ||
|
||||
key->ps.part.prolog.force_linear_center_interp ||
|
||||
key->ps.part.prolog.force_samplemask_to_helper_invocation ||
|
||||
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,
|
||||
.optimize_frag_coord = true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue