radeonsi: merge uses_persp_opcode_interp_sample/uses_linear_opcode_interp_sample
authorMarek Olšák <marek.olsak@amd.com>
Sun, 6 Sep 2020 06:38:09 +0000 (02:38 -0400)
committerVivek Pandya <vivekvpandya@gmail.com>
Mon, 7 Sep 2020 15:55:17 +0000 (21:25 +0530)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6624>

src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_shader_nir.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index 59c1d76..6535476 100644 (file)
@@ -355,8 +355,7 @@ struct si_shader_info {
    bool uses_linear_center;
    bool uses_linear_centroid;
    bool uses_linear_sample;
-   bool uses_persp_opcode_interp_sample;
-   bool uses_linear_opcode_interp_sample;
+   bool uses_interp_at_sample;
    bool uses_instanceid;
    bool uses_drawid;
    bool uses_primid;
index 8873aa2..ce05143 100644 (file)
@@ -397,9 +397,6 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
                info->uses_linear_centroid = true;
             else
                info->uses_linear_center = true;
-
-            if (intr->intrinsic == nir_intrinsic_load_barycentric_at_sample)
-               info->uses_linear_opcode_interp_sample = true;
          } else {
             if (intr->intrinsic == nir_intrinsic_load_barycentric_sample)
                info->uses_persp_sample = true;
@@ -407,10 +404,9 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
                info->uses_persp_centroid = true;
             else
                info->uses_persp_center = true;
-
-            if (intr->intrinsic == nir_intrinsic_load_barycentric_at_sample)
-               info->uses_persp_opcode_interp_sample = true;
          }
+         if (intr->intrinsic == nir_intrinsic_load_barycentric_at_sample)
+            info->uses_interp_at_sample = true;
          break;
       }
       case nir_intrinsic_load_input:
index 4fbbcf4..400b0de 100644 (file)
@@ -1980,8 +1980,7 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh
                                                              sel->info.uses_linear_sample >
                                                           1;
 
-         if (sel->info.uses_persp_opcode_interp_sample ||
-             sel->info.uses_linear_opcode_interp_sample)
+         if (sel->info.uses_interp_at_sample)
             key->mono.u.ps.interpolate_at_sample_force_center = 1;
       }