spirv: Drop the constant_as_global as option
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 19 Aug 2020 16:26:53 +0000 (11:26 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 20:50:04 +0000 (20:50 +0000)
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

src/compiler/spirv/nir_spirv.h
src/compiler/spirv/spirv2nir.c
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_variables.c

index dd7b5b36996eea3099861d638d1a34edd891e7f3..8d5c1008aa21b0c518752a334d9365d2e2e5494d 100644 (file)
@@ -80,12 +80,6 @@ struct spirv_to_nir_options {
    nir_address_format temp_addr_format;
    nir_address_format constant_addr_format;
 
-   /* Whether UniformConstant memory should be treated as normal global memory.
-    * This is usefull for CL 2.0 implementations with fine grain system SVM
-    * support.
-    */
-   bool constant_as_global;
-
    struct {
       void (*func)(void *private_data,
                    enum nir_spirv_debug_level level,
index 6bc946e9b5dbb3a2e88981aa098d7fe2b14ce25a..bbec4d2af6a699e78128c07036d4baf78e6cfb80 100644 (file)
@@ -137,7 +137,6 @@ int main(int argc, char **argv)
       spirv_opts.caps.int16 = true;
       spirv_opts.caps.int64 = true;
       spirv_opts.caps.kernel = true;
-      spirv_opts.constant_as_global = true;
    }
 
    nir_shader *nir = spirv_to_nir(map, word_count, NULL, 0,
index b9f1fae0115327262b1515b09148b0f99d59d526..399e5ea3edea8f9b9494b227c40ed9d8daaa22a7 100644 (file)
@@ -4481,10 +4481,8 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
          assert(nir_address_format_num_components(b->options->global_addr_format) == 1);
          assert(nir_address_format_bit_size(b->options->shared_addr_format) == 32);
          assert(nir_address_format_num_components(b->options->shared_addr_format) == 1);
-         if (!b->options->constant_as_global) {
-            assert(nir_address_format_bit_size(b->options->constant_addr_format) == 32);
-            assert(nir_address_format_num_components(b->options->constant_addr_format) == 1);
-         }
+         assert(nir_address_format_bit_size(b->options->constant_addr_format) == 32);
+         assert(nir_address_format_num_components(b->options->constant_addr_format) == 1);
          break;
       case SpvAddressingModelPhysical64:
          vtn_fail_if(b->shader->info.stage != MESA_SHADER_KERNEL,
@@ -4495,10 +4493,8 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
          assert(nir_address_format_num_components(b->options->global_addr_format) == 1);
          assert(nir_address_format_bit_size(b->options->shared_addr_format) == 64);
          assert(nir_address_format_num_components(b->options->shared_addr_format) == 1);
-         if (!b->options->constant_as_global) {
-            assert(nir_address_format_bit_size(b->options->constant_addr_format) == 64);
-            assert(nir_address_format_num_components(b->options->constant_addr_format) == 1);
-         }
+         assert(nir_address_format_bit_size(b->options->constant_addr_format) == 64);
+         assert(nir_address_format_num_components(b->options->constant_addr_format) == 1);
          break;
       case SpvAddressingModelLogical:
          vtn_fail_if(b->shader->info.stage == MESA_SHADER_KERNEL,
index 52c2837e9ebc0fa9d0ad95550edcd743756dca96..f5ba73f4fca761f8e0d98efd89d0ab0af2d8b077 100644 (file)
@@ -1803,13 +1803,8 @@ vtn_storage_class_to_mode(struct vtn_builder *b,
       break;
    case SpvStorageClassUniformConstant:
       if (b->shader->info.stage == MESA_SHADER_KERNEL) {
-         if (b->options->constant_as_global) {
-            mode = vtn_variable_mode_cross_workgroup;
-            nir_mode = nir_var_mem_global;
-         } else {
-            mode = vtn_variable_mode_constant;
-            nir_mode = nir_var_mem_constant;
-         }
+         mode = vtn_variable_mode_constant;
+         nir_mode = nir_var_mem_constant;
       } else {
          mode = vtn_variable_mode_uniform;
          nir_mode = nir_var_uniform;