radeonsi: Remove deref chain support in nir scan pass.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 12 May 2018 23:17:23 +0000 (01:17 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 23 Jun 2018 03:54:00 +0000 (20:54 -0700)
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index 21551a76d6b6ee867fdc6309f11ee68a54a63691..c46d0ab5a8238664f3828a7c2ee1a89a3802bc16 100644 (file)
@@ -34,9 +34,6 @@
 
 static nir_variable* tex_get_texture_var(nir_tex_instr *instr)
 {
-       if (instr->texture)
-               return instr->texture->var;
-
        for (unsigned i = 0; i < instr->num_srcs; i++) {
                switch (instr->src[i].src_type) {
                case nir_tex_src_texture_deref:
@@ -51,9 +48,6 @@ static nir_variable* tex_get_texture_var(nir_tex_instr *instr)
 
 static nir_variable* intrinsic_get_var(nir_intrinsic_instr *instr)
 {
-       if (instr->variables[0])
-               return instr->variables[0]->var;
-
        return nir_deref_instr_get_variable(nir_src_as_deref(instr->src[0]));
 }
 
@@ -149,9 +143,6 @@ static void scan_instruction(struct tgsi_shader_info *info,
                case nir_intrinsic_load_tess_level_outer:
                        info->reads_tess_factors = true;
                        break;
-               case nir_intrinsic_image_var_load:
-               case nir_intrinsic_image_var_size:
-               case nir_intrinsic_image_var_samples:
                case nir_intrinsic_image_deref_load:
                case nir_intrinsic_image_deref_size:
                case nir_intrinsic_image_deref_samples: {
@@ -161,15 +152,6 @@ static void scan_instruction(struct tgsi_shader_info *info,
 
                        break;
                }
-               case nir_intrinsic_image_var_store:
-               case nir_intrinsic_image_var_atomic_add:
-               case nir_intrinsic_image_var_atomic_min:
-               case nir_intrinsic_image_var_atomic_max:
-               case nir_intrinsic_image_var_atomic_and:
-               case nir_intrinsic_image_var_atomic_or:
-               case nir_intrinsic_image_var_atomic_xor:
-               case nir_intrinsic_image_var_atomic_exchange:
-               case nir_intrinsic_image_var_atomic_comp_swap:
                case nir_intrinsic_image_deref_store:
                case nir_intrinsic_image_deref_atomic_add:
                case nir_intrinsic_image_deref_atomic_min:
@@ -198,7 +180,6 @@ static void scan_instruction(struct tgsi_shader_info *info,
                case nir_intrinsic_ssbo_atomic_comp_swap:
                        info->writes_memory = true;
                        break;
-               case nir_intrinsic_load_var:
                case nir_intrinsic_load_deref: {
                        nir_variable *var = intrinsic_get_var(intr);
                        nir_variable_mode mode = var->data.mode;
@@ -233,9 +214,6 @@ static void scan_instruction(struct tgsi_shader_info *info,
                        }
                        break;
                }
-               case nir_intrinsic_interp_var_at_centroid:
-               case nir_intrinsic_interp_var_at_sample:
-               case nir_intrinsic_interp_var_at_offset:
                case nir_intrinsic_interp_deref_at_centroid:
                case nir_intrinsic_interp_deref_at_sample:
                case nir_intrinsic_interp_deref_at_offset: {
@@ -243,21 +221,17 @@ static void scan_instruction(struct tgsi_shader_info *info,
                        switch (interp) {
                        case INTERP_MODE_SMOOTH:
                        case INTERP_MODE_NONE:
-                               if (intr->intrinsic == nir_intrinsic_interp_var_at_centroid ||
-                                   intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
+                               if (intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
                                        info->uses_persp_opcode_interp_centroid = true;
-                               else if (intr->intrinsic == nir_intrinsic_interp_var_at_sample ||
-                                        intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
+                               else if (intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
                                        info->uses_persp_opcode_interp_sample = true;
                                else
                                        info->uses_persp_opcode_interp_offset = true;
                                break;
                        case INTERP_MODE_NOPERSPECTIVE:
-                               if (intr->intrinsic == nir_intrinsic_interp_var_at_centroid ||
-                                   intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
+                               if (intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
                                        info->uses_linear_opcode_interp_centroid = true;
-                               else if (intr->intrinsic == nir_intrinsic_interp_var_at_sample ||
-                                        intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
+                               else if (intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
                                        info->uses_linear_opcode_interp_sample = true;
                                else
                                        info->uses_linear_opcode_interp_offset = true;