nir: rename nir_var_ubo to nir_var_mem_ubo
authorKarol Herbst <kherbst@redhat.com>
Tue, 15 Jan 2019 23:09:27 +0000 (00:09 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sat, 19 Jan 2019 19:01:41 +0000 (20:01 +0100)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/glsl/glsl_to_nir.cpp
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_print.c
src/compiler/nir/nir_validate.c
src/compiler/spirv/vtn_variables.c
src/gallium/drivers/radeonsi/si_shader_nir.c
src/intel/vulkan/anv_pipeline.c
src/mesa/state_tracker/st_glsl_to_nir.cpp

index 7a96957f27ea34510c0a2a8f8b82d8378c86477d..6246c99802292df332cdb815ece712397919bf6f 100644 (file)
@@ -367,7 +367,7 @@ nir_visitor::visit(ir_variable *ir)
 
    case ir_var_uniform:
       if (ir->get_interface_type())
-         var->data.mode = nir_var_ubo;
+         var->data.mode = nir_var_mem_ubo;
       else
          var->data.mode = nir_var_uniform;
       break;
index 57ae2afc2e7a5c59c61880c3ba6c0befaef64d42..fa9f3fe7e4936b7fd825fa38c84630cc8611cc42 100644 (file)
@@ -142,7 +142,7 @@ nir_shader_add_variable(nir_shader *shader, nir_variable *var)
       break;
 
    case nir_var_uniform:
-   case nir_var_ubo:
+   case nir_var_mem_ubo:
    case nir_var_ssbo:
       exec_list_push_tail(&shader->uniforms, &var->node);
       break;
index f09d0ddaea37928ffeca077c1bd5620eac659d6e..fb264fb982b2aed76961564adc88cb3e1acca5bb 100644 (file)
@@ -100,7 +100,7 @@ typedef enum {
    nir_var_shader_temp     = (1 << 2),
    nir_var_function_temp   = (1 << 3),
    nir_var_uniform         = (1 << 4),
-   nir_var_ubo             = (1 << 5),
+   nir_var_mem_ubo         = (1 << 5),
    nir_var_system_value    = (1 << 6),
    nir_var_ssbo            = (1 << 7),
    nir_var_shared          = (1 << 8),
index 44af76de599583b93d19b6fcaabfb97a1ea70191..c118842277c06a718ec4586b28d04a0d628aad07 100644 (file)
@@ -54,7 +54,7 @@ nir_assign_var_locations(struct exec_list *var_list, unsigned *size,
        * UBOs have their own address spaces, so don't count them towards the
        * number of global uniforms
        */
-      if (var->data.mode == nir_var_ubo || var->data.mode == nir_var_ssbo)
+      if (var->data.mode == nir_var_mem_ubo || var->data.mode == nir_var_ssbo)
          continue;
 
       var->data.driver_location = location;
@@ -587,7 +587,7 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin,
 
    nir_intrinsic_op op;
    switch (mode) {
-   case nir_var_ubo:
+   case nir_var_mem_ubo:
       op = nir_intrinsic_load_ubo;
       break;
    case nir_var_ssbo:
@@ -602,7 +602,7 @@ build_explicit_io_load(nir_builder *b, nir_intrinsic_instr *intrin,
    load->src[0] = nir_src_for_ssa(addr_to_index(b, addr, addr_format));
    load->src[1] = nir_src_for_ssa(addr_to_offset(b, addr, addr_format));
 
-   if (mode != nir_var_ubo)
+   if (mode != nir_var_mem_ubo)
       nir_intrinsic_set_access(load, nir_intrinsic_access(intrin));
 
    /* TODO: We should try and provide a better alignment.  For OpenCL, we need
index 7e1ad61915b13f87a191192601f267a03e1c79a8..d9bc073b2d5f60bab96fd02ee4c190cb303aa971 100644 (file)
@@ -413,7 +413,7 @@ get_variable_mode_str(nir_variable_mode mode, bool want_local_global_mode)
       return "shader_out";
    case nir_var_uniform:
       return "uniform";
-   case nir_var_ubo:
+   case nir_var_mem_ubo:
       return "ubo";
    case nir_var_system_value:
       return "system";
@@ -506,7 +506,7 @@ print_var_decl(nir_variable *var, print_state *state)
    if (var->data.mode == nir_var_shader_in ||
        var->data.mode == nir_var_shader_out ||
        var->data.mode == nir_var_uniform ||
-       var->data.mode == nir_var_ubo ||
+       var->data.mode == nir_var_mem_ubo ||
        var->data.mode == nir_var_ssbo) {
       const char *loc = NULL;
       char buf[4];
index 43757858207ab3664918780d4719e5ebdfc9da10..22af3b6e75769189cf4744ee7bcb20464121a4fe 100644 (file)
@@ -446,7 +446,7 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state)
 
       case nir_deref_type_array:
       case nir_deref_type_array_wildcard:
-         if (instr->mode == nir_var_ubo ||
+         if (instr->mode == nir_var_mem_ubo ||
              instr->mode == nir_var_ssbo ||
              instr->mode == nir_var_shared) {
             /* Shared variables and UBO/SSBOs have a bit more relaxed rules
index 16cc7aadd718f75a14cf2565b651d0254fb573fe..0ec34ccbe47174646276e7463976c32dbcd6d14b 100644 (file)
@@ -259,7 +259,7 @@ vtn_nir_deref_pointer_dereference(struct vtn_builder *b,
       assert(base->mode == vtn_variable_mode_ssbo ||
              base->mode == vtn_variable_mode_ubo);
       nir_variable_mode nir_mode =
-         base->mode == vtn_variable_mode_ssbo ? nir_var_ssbo : nir_var_ubo;
+         base->mode == vtn_variable_mode_ssbo ? nir_var_ssbo : nir_var_mem_ubo;
 
       tail = nir_build_deref_cast(&b->nb, desc, nir_mode, type->type,
                                   base->ptr_type->stride);
@@ -1662,7 +1662,7 @@ vtn_storage_class_to_mode(struct vtn_builder *b,
    case SpvStorageClassUniform:
       if (interface_type->block) {
          mode = vtn_variable_mode_ubo;
-         nir_mode = nir_var_ubo;
+         nir_mode = nir_var_mem_ubo;
       } else if (interface_type->buffer_block) {
          mode = vtn_variable_mode_ssbo;
          nir_mode = nir_var_ssbo;
index c89a1e6f91b2bb201b1af0a4a683be2988afd7d9..ab8c4486ce7eb0d815582811f9578ad393a4e602 100644 (file)
@@ -677,7 +677,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                 */
                if (variable->interface_type != NULL) {
                        if (variable->data.mode == nir_var_uniform ||
-                           variable->data.mode == nir_var_ubo) {
+                           variable->data.mode == nir_var_mem_ubo) {
 
                                unsigned block_count;
                                if (base_type != GLSL_TYPE_INTERFACE) {
index e89b78ec1fc1d1cb8edf4a94ca81d0e942188ecb..4acbd1040f42030bd5ec53bfc9dcb0bacaea24cb 100644 (file)
@@ -211,7 +211,7 @@ anv_shader_compile_to_nir(struct anv_device *device,
    NIR_PASS_V(nir, nir_remove_dead_variables,
               nir_var_shader_in | nir_var_shader_out | nir_var_system_value);
 
-   NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_ubo | nir_var_ssbo,
+   NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_ubo | nir_var_ssbo,
               nir_address_format_vk_index_offset);
 
    NIR_PASS_V(nir, nir_propagate_invariant);
index bf8d770db73bc1ebfca80fea37b90000a9b89ab9..c2a75c8bd08be9770a727c22f2a13099cf1b9cc1 100644 (file)
@@ -253,7 +253,7 @@ st_nir_assign_uniform_locations(struct gl_context *ctx,
        * UBO's have their own address spaces, so don't count them towards the
        * number of global uniforms
        */
-      if (uniform->data.mode == nir_var_ubo || uniform->data.mode == nir_var_ssbo)
+      if (uniform->data.mode == nir_var_mem_ubo || uniform->data.mode == nir_var_ssbo)
          continue;
 
       const struct glsl_type *type = glsl_without_array(uniform->type);