ir3: Don't use msaa key for a6xx+
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 19 Aug 2022 13:41:23 +0000 (15:41 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Sep 2022 11:20:15 +0000 (11:20 +0000)
In the compiler, this was only used to replace some inputs in the
non-MSAA case which apparently no longer need to be replaced anymore,
probably because we clarified some registers related to them and started
setting them better. In the pipeline libraries case we may not have
access to the sample locations state when compiling the FS (although we
do know whether sample shading is enabled), so this removes a
problematic state dependency in turnip.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18554>

src/freedreno/ir3/ir3_compiler_nir.c
src/freedreno/ir3/ir3_shader.c
src/freedreno/vulkan/tu_pipeline.c

index 0272da3..886d588 100644 (file)
@@ -1826,21 +1826,19 @@ emit_intrinsic_barycentric(struct ir3_context *ctx, nir_intrinsic_instr *intr,
 {
    gl_system_value sysval = nir_intrinsic_barycentric_sysval(intr);
 
-   if (!ctx->so->key.msaa) {
+   if (!ctx->so->key.msaa && ctx->compiler->gen < 6) {
       switch (sysval) {
       case SYSTEM_VALUE_BARYCENTRIC_PERSP_SAMPLE:
          sysval = SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL;
          break;
       case SYSTEM_VALUE_BARYCENTRIC_PERSP_CENTROID:
-         if (ctx->compiler->gen < 6)
-            sysval = SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL;
+         sysval = SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL;
          break;
       case SYSTEM_VALUE_BARYCENTRIC_LINEAR_SAMPLE:
          sysval = SYSTEM_VALUE_BARYCENTRIC_LINEAR_PIXEL;
          break;
       case SYSTEM_VALUE_BARYCENTRIC_LINEAR_CENTROID:
-         if (ctx->compiler->gen < 6)
-            sysval = SYSTEM_VALUE_BARYCENTRIC_LINEAR_PIXEL;
+         sysval = SYSTEM_VALUE_BARYCENTRIC_LINEAR_PIXEL;
          break;
       default:
          break;
index cbd9e1c..797aac5 100644 (file)
@@ -544,11 +544,11 @@ ir3_setup_used_key(struct ir3_shader *shader)
       }
 
       /* Only used for deciding on behavior of
-       * nir_intrinsic_load_barycentric_sample, or the centroid demotion
+       * nir_intrinsic_load_barycentric_sample and the centroid demotion
        * on older HW.
        */
-      key->msaa = info->fs.uses_sample_qualifier ||
-                  (shader->compiler->gen < 6 &&
+      key->msaa = shader->compiler->gen < 6 &&
+                  (info->fs.uses_sample_qualifier ||
                    (BITSET_TEST(info->system_values_read,
                                 SYSTEM_VALUE_BARYCENTRIC_PERSP_CENTROID) ||
                     BITSET_TEST(info->system_values_read,
index be91a07..55397d8 100644 (file)
@@ -2473,14 +2473,6 @@ tu_pipeline_shader_key_init(struct ir3_shader_key *key,
       return;
 
    const VkPipelineMultisampleStateCreateInfo *msaa_info = pipeline_info->pMultisampleState;
-   const struct VkPipelineSampleLocationsStateCreateInfoEXT *sample_locations =
-      vk_find_struct_const(msaa_info->pNext, PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT);
-   if (msaa_info->rasterizationSamples > 1 ||
-       /* also set msaa key when sample location is not the default
-        * since this affects varying interpolation */
-       (sample_locations && sample_locations->sampleLocationsEnable)) {
-      key->msaa = true;
-   }
 
    /* The 1.3.215 spec says:
     *