anv/brw: move sample_shading_enable to wm_prog_data

The vulkan runtime doesn´t store this parameter in the dynamic state
(since it's not a dynamic state). Just capture it at compile time and
leave on the 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:42:59 +03:00
committed by Marge Bot
parent f2696b441d
commit 6d863fda2d
6 changed files with 11 additions and 9 deletions
+1
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->api_sample_shading = key->api_sample_shading;
prog_data->min_sample_shading = key->min_sample_shading;
assert(key->multisample_fbo != INTEL_NEVER ||
+8 -2
View File
@@ -397,8 +397,7 @@ struct brw_wm_prog_key {
bool ignore_sample_mask_out:1;
bool coarse_pixel:1;
bool null_push_constant_tbimr_workaround:1;
uint64_t padding:1;
bool api_sample_shading:1;
};
static inline bool
@@ -758,6 +757,13 @@ struct brw_wm_prog_data {
*/
bool sample_shading;
/** True if the API wants sample shading
*
* Not used by the compiler, but useful for restore from the cache. The
* driver is expected to write the value it wants.
*/
bool api_sample_shading;
/** Min sample shading value
*
* Not used by the compiler, but useful for restore from the cache. The
-1
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.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;
cmd_buffer->state.gfx.first_vue_slot = new_pipeline->first_vue_slot;
+1 -3
View File
@@ -564,6 +564,7 @@ populate_wm_prog_key(struct anv_pipeline_stage *stage,
key->mesh_input = is_mesh;
key->api_sample_shading = ms ? ms->sample_shading_enable : false;
key->min_sample_shading = ms ? ms->min_sample_shading : 1.0f;
/* Vulkan doesn't support fixed-function alpha test */
@@ -2920,9 +2921,6 @@ 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)
pipeline->sample_shading_enable = state->ms->sample_shading_enable;
/* Mark all color output as unused by default */
memset(pipeline->color_output_mapping,
ANV_COLOR_OUTPUT_UNUSED,
-2
View File
@@ -4122,7 +4122,6 @@ struct anv_cmd_graphics_state {
bool kill_pixel;
bool uses_xfb;
bool sample_shading_enable;
uint32_t primitive_id_index;
uint32_t first_vue_slot;
@@ -5094,7 +5093,6 @@ struct anv_graphics_pipeline {
bool kill_pixel;
bool uses_xfb;
bool sample_shading_enable;
/* Number of VERTEX_ELEMENT_STATE input elements used by the shader */
uint32_t vs_input_elements;
+1 -1
View File
@@ -842,7 +842,7 @@ update_fs_msaa_flags(struct anv_gfx_dynamic_state *hw_state,
intel_fs_msaa_flags((struct intel_fs_params) {
.shader_sample_shading = wm_prog_data->sample_shading,
.shader_min_sample_shading = wm_prog_data->min_sample_shading,
.state_sample_shading = gfx->sample_shading_enable,
.state_sample_shading = wm_prog_data->api_sample_shading,
.rasterization_samples = dyn->ms.rasterization_samples,
.coarse_pixel = !vk_fragment_shading_rate_is_disabled(&dyn->fsr),
.alpha_to_coverage = dyn->ms.alpha_to_coverage_enable,