radv: enable SAMPLE_COVERAGE_ENA if the fully covered built-in is used
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Feb 2023 15:34:18 +0000 (16:34 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Mar 2023 08:44:09 +0000 (08:44 +0000)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>

src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h
src/amd/vulkan/radv_shader_info.c

index a1c356a..2ff3ca0 100644 (file)
@@ -3219,7 +3219,7 @@ radv_compute_spi_ps_input(const struct radv_pipeline_key *pipeline_key,
       spi_ps_input |= S_0286CC_ANCILLARY_ENA(1);
    }
 
-   if (info->ps.reads_sample_mask_in) {
+   if (info->ps.reads_sample_mask_in || info->ps.reads_fully_covered) {
       spi_ps_input |= S_0286CC_SAMPLE_COVERAGE_ENA(1);
    }
 
index 8c4e22f..afd4099 100644 (file)
@@ -341,6 +341,7 @@ struct radv_shader_info {
       bool reads_linear_sample;
       bool reads_linear_center;
       bool reads_linear_centroid;
+      bool reads_fully_covered;
       uint8_t reads_frag_coord_mask;
       uint8_t reads_sample_pos_mask;
       uint8_t depth_layout;
index 83d0e41..5fd2f46 100644 (file)
@@ -574,6 +574,8 @@ gather_shader_info_fs(const nir_shader *nir, const struct radv_pipeline_key *pip
    info->ps.reads_frag_shading_rate = BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FRAG_SHADING_RATE);
    info->ps.reads_front_face = BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FRONT_FACE);
    info->ps.reads_barycentric_model = BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_BARYCENTRIC_PULL_MODEL);
+   info->ps.reads_fully_covered =
+      BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FULLY_COVERED);
 
    bool uses_persp_or_linear_interp = info->ps.reads_persp_center ||
                                       info->ps.reads_persp_centroid ||