Module: Mesa Branch: main Commit: 774e05582331d520d166815f41d6e286cce102c2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=774e05582331d520d166815f41d6e286cce102c2
Author: Samuel Pitoiset <[email protected]> Date: Wed Mar 22 16:19:04 2023 +0100 radv: move uses_user_sample_locations to radv_multisample_state Signed-off-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110> --- src/amd/vulkan/radv_cmd_buffer.c | 3 +-- src/amd/vulkan/radv_pipeline.c | 3 ++- src/amd/vulkan/radv_private.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 56609e7aae9..9f1bd44f89c 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -8601,7 +8601,6 @@ radv_need_late_scissor_emission(struct radv_cmd_buffer *cmd_buffer, ALWAYS_INLINE static uint32_t radv_get_ngg_culling_settings(struct radv_cmd_buffer *cmd_buffer, bool vp_y_inverted) { - const struct radv_graphics_pipeline *pipeline = cmd_buffer->state.graphics_pipeline; const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic; /* Disable shader culling entirely when conservative overestimate is used. @@ -8642,7 +8641,7 @@ radv_get_ngg_culling_settings(struct radv_cmd_buffer *cmd_buffer, bool vp_y_inve /* Small primitive culling assumes a sample position at (0.5, 0.5) * so don't enable it with user sample locations. */ - if (!pipeline->uses_user_sample_locations) { + if (!cmd_buffer->state.ms.uses_user_sample_locations) { nggc_settings |= radv_nggc_small_primitives; /* small_prim_precision = num_samples / 2^subpixel_bits diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 1e1a48459dc..ce5754540d2 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -504,6 +504,8 @@ radv_pipeline_init_multisample_state(const struct radv_device *device, */ pipeline->pa_sc_mode_cntl_1 |= S_028A4C_WALK_ALIGN8_PRIM_FITS_ST(1); } + + ms->uses_user_sample_locations = state->ms && state->ms->sample_locations_enable; } static void @@ -4990,7 +4992,6 @@ radv_graphics_pipeline_init(struct radv_graphics_pipeline *pipeline, struct radv pipeline->base.shaders[pipeline->last_vgt_api_stage]->info.has_ngg_culling; pipeline->force_vrs_per_vertex = pipeline->base.shaders[pipeline->last_vgt_api_stage]->info.force_vrs_per_vertex; - pipeline->uses_user_sample_locations = state.ms && state.ms->sample_locations_enable; pipeline->uses_inner_coverage = pipeline->base.shaders[MESA_SHADER_FRAGMENT]->info.ps.reads_fully_covered; pipeline->rast_prim = vgt_gs_out_prim_type; diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 87b7707ee76..70923da4a6d 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -1573,6 +1573,7 @@ enum rgp_flush_bits { struct radv_multisample_state { bool sample_shading_enable; + bool uses_user_sample_locations; float min_sample_shading; }; @@ -2193,7 +2194,6 @@ struct radv_graphics_pipeline { bool uses_baseinstance; bool use_per_attribute_vb_descs; bool can_use_simple_input; - bool uses_user_sample_locations; /* Whether the pipeline uses inner coverage which means that a fragment has all of its pixel * squares fully covered by the generating primitive.
