radv: move uses_user_sample_locations to radv_multisample_state
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Mar 2023 15:19:04 +0000 (16:19 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 27 Mar 2023 09:29:11 +0000 (09:29 +0000)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110>

src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h

index 56609e7..9f1bd44 100644 (file)
@@ -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
index 1e1a484..ce57545 100644 (file)
@@ -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;
index 87b7707..70923da 100644 (file)
@@ -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.