anv/brw: store min_sample_shading on wm_prog_data

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36665>
This commit is contained in:
Lionel Landwerlin 2025-04-14 15:20:23 +03:00 committed by Marge Bot
parent 3fa212c4f5
commit f2696b441d
6 changed files with 11 additions and 9 deletions

View file

@ -960,6 +960,7 @@ brw_nir_populate_wm_prog_data(nir_shader *shader,
prog_data->sample_shading =
shader->info.fs.uses_sample_shading ||
shader->info.outputs_read;
prog_data->min_sample_shading = key->min_sample_shading;
assert(key->multisample_fbo != INTEL_NEVER ||
key->persample_interp == INTEL_NEVER);

View file

@ -360,6 +360,9 @@ struct brw_wm_prog_key {
struct brw_base_prog_key base;
uint64_t input_slots_valid;
float min_sample_shading;
uint8_t color_outputs_valid;
/* Some collection of BRW_WM_IZ_* */
@ -395,7 +398,7 @@ struct brw_wm_prog_key {
bool coarse_pixel:1;
bool null_push_constant_tbimr_workaround:1;
uint64_t padding:33;
uint64_t padding:1;
};
static inline bool

View file

@ -767,7 +767,6 @@ void anv_CmdBindPipeline(
cmd_buffer->state.gfx.vs_source_hash = new_pipeline->vs_source_hash;
cmd_buffer->state.gfx.fs_source_hash = new_pipeline->fs_source_hash;
cmd_buffer->state.gfx.min_sample_shading = new_pipeline->min_sample_shading;
cmd_buffer->state.gfx.sample_shading_enable = new_pipeline->sample_shading_enable;
cmd_buffer->state.gfx.instance_multiplier = new_pipeline->instance_multiplier;
cmd_buffer->state.gfx.primitive_id_index = new_pipeline->primitive_id_index;

View file

@ -564,6 +564,8 @@ populate_wm_prog_key(struct anv_pipeline_stage *stage,
key->mesh_input = is_mesh;
key->min_sample_shading = ms ? ms->min_sample_shading : 1.0f;
/* Vulkan doesn't support fixed-function alpha test */
key->alpha_test_replicate_alpha = false;
@ -1569,6 +1571,7 @@ anv_pipeline_compile_fs(const struct brw_compiler *compiler,
struct anv_graphics_base_pipeline *pipeline,
uint32_t view_mask,
bool use_primitive_replication,
const struct vk_multisample_state *ms,
char **error_str)
{
/* When using Primitive Replication for multiview, each view gets its own
@ -2519,7 +2522,7 @@ anv_graphics_pipeline_compile(struct anv_graphics_base_pipeline *pipeline,
anv_pipeline_compile_fs(compiler, stage_ctx, device,
stage, prev_stage, pipeline,
view_mask, use_primitive_replication,
&error_str);
state->ms, &error_str);
break;
default:
UNREACHABLE("Invalid graphics shader stage");
@ -2917,10 +2920,8 @@ anv_graphics_pipeline_emit(struct anv_graphics_pipeline *pipeline,
/* TODO(mesh): Mesh vs. Multiview with Instancing. */
}
if (pipeline->base.shaders[MESA_SHADER_FRAGMENT] && state->ms) {
if (pipeline->base.shaders[MESA_SHADER_FRAGMENT] && state->ms)
pipeline->sample_shading_enable = state->ms->sample_shading_enable;
pipeline->min_sample_shading = state->ms->min_sample_shading;
}
/* Mark all color output as unused by default */
memset(pipeline->color_output_mapping,

View file

@ -4123,7 +4123,6 @@ struct anv_cmd_graphics_state {
bool kill_pixel;
bool uses_xfb;
bool sample_shading_enable;
float min_sample_shading;
uint32_t primitive_id_index;
uint32_t first_vue_slot;
@ -5096,7 +5095,6 @@ struct anv_graphics_pipeline {
bool kill_pixel;
bool uses_xfb;
bool sample_shading_enable;
float min_sample_shading;
/* Number of VERTEX_ELEMENT_STATE input elements used by the shader */
uint32_t vs_input_elements;

View file

@ -841,7 +841,7 @@ update_fs_msaa_flags(struct anv_gfx_dynamic_state *hw_state,
enum intel_msaa_flags fs_msaa_flags =
intel_fs_msaa_flags((struct intel_fs_params) {
.shader_sample_shading = wm_prog_data->sample_shading,
.shader_min_sample_shading = gfx->min_sample_shading,
.shader_min_sample_shading = wm_prog_data->min_sample_shading,
.state_sample_shading = gfx->sample_shading_enable,
.rasterization_samples = dyn->ms.rasterization_samples,
.coarse_pixel = !vk_fragment_shading_rate_is_disabled(&dyn->fsr),