nir: Rename nir_address_format_vk_index_offset to not be vk
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 9 Mar 2019 16:10:37 +0000 (10:10 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 15 Mar 2019 01:02:19 +0000 (01:02 +0000)
It's just a 32-bit index and offset.  We're going to want to use it in
GL as well so stop talking about Vulkan.

Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_io.c
src/intel/vulkan/anv_nir_apply_pipeline_layout.c
src/intel/vulkan/anv_pipeline.c

index 98adf1b53316431fdbfc3dbe0b6ae848d822c752..b25842834ae0434efa0edf511a47f70a587ce0c7 100644 (file)
@@ -3021,9 +3021,9 @@ typedef enum {
 
    /**
     * An address format which is comprised of a vec2 where the first
-    * component is a vulkan descriptor index and the second is an offset.
+    * component is a buffer index and the second is an offset.
     */
-   nir_address_format_vk_index_offset,
+   nir_address_format_32bit_index_offset,
 } nir_address_format;
 bool nir_lower_explicit_io(nir_shader *shader,
                            nir_variable_mode modes,
index d1f95cfe6ac4d603c9b3929ee1296dd0bca07a54..c9db2de0ba04dee14a672bbc692d68841741ff54 100644 (file)
@@ -599,7 +599,7 @@ build_addr_iadd(nir_builder *b, nir_ssa_def *addr,
       assert(addr->num_components == 1);
       return nir_iadd(b, addr, offset);
 
-   case nir_address_format_vk_index_offset:
+   case nir_address_format_32bit_index_offset:
       assert(addr->num_components == 2);
       return nir_vec2(b, nir_channel(b, addr, 0),
                          nir_iadd(b, nir_channel(b, addr, 1), offset));
@@ -619,7 +619,7 @@ static nir_ssa_def *
 addr_to_index(nir_builder *b, nir_ssa_def *addr,
               nir_address_format addr_format)
 {
-   assert(addr_format == nir_address_format_vk_index_offset);
+   assert(addr_format == nir_address_format_32bit_index_offset);
    assert(addr->num_components == 2);
    return nir_channel(b, addr, 0);
 }
@@ -628,7 +628,7 @@ static nir_ssa_def *
 addr_to_offset(nir_builder *b, nir_ssa_def *addr,
                nir_address_format addr_format)
 {
-   assert(addr_format == nir_address_format_vk_index_offset);
+   assert(addr_format == nir_address_format_32bit_index_offset);
    assert(addr->num_components == 2);
    return nir_channel(b, addr, 1);
 }
@@ -651,7 +651,7 @@ addr_to_global(nir_builder *b, nir_ssa_def *addr,
       assert(addr->num_components == 1);
       return addr;
 
-   case nir_address_format_vk_index_offset:
+   case nir_address_format_32bit_index_offset:
       unreachable("Cannot get a 64-bit address with this address format");
    }
 
index d8369c8e18b37c216d171cd82f5d745476b8200e..96e2e617d7d99918745b585ce5d4ed2a6dc0cecd 100644 (file)
@@ -168,7 +168,7 @@ lower_res_index_intrinsic(nir_intrinsic_instr *intrin,
       index = nir_imm_ivec2(b, state->set[set].desc_offset,
                                bind_layout->descriptor_offset);
    } else {
-      /* We're using nir_address_format_vk_index_offset */
+      /* We're using nir_address_format_32bit_index_offset */
       index = nir_vec2(b, nir_iadd_imm(b, array_index, surface_index),
                           nir_imm_int(b, 0));
    }
@@ -211,7 +211,7 @@ lower_load_vulkan_descriptor(nir_intrinsic_instr *intrin,
 
    b->cursor = nir_before_instr(&intrin->instr);
 
-   /* We follow the nir_address_format_vk_index_offset model */
+   /* We follow the nir_address_format_32bit_index_offset model */
    assert(intrin->src[0].is_ssa);
    nir_ssa_def *index = intrin->src[0].ssa;
 
@@ -231,7 +231,7 @@ lower_get_buffer_size(nir_intrinsic_instr *intrin,
    assert(intrin->src[0].is_ssa);
    nir_ssa_def *index = intrin->src[0].ssa;
 
-   /* We're following the nir_address_format_vk_index_offset model so the
+   /* We're following the nir_address_format_32bit_index_offset model so the
     * binding table index is the first component of the address.  The
     * back-end wants a scalar binding table index source.
     */
index bb9c70a07180e4f65b4996e3fe83759c44f84340..53500fd65d8b1281b5db201ba9783c50ecc2ca9e 100644 (file)
@@ -600,7 +600,7 @@ anv_pipeline_lower_nir(struct anv_pipeline *pipeline,
 
       NIR_PASS_V(nir, nir_lower_explicit_io,
                  nir_var_mem_ubo | nir_var_mem_ssbo,
-                 nir_address_format_vk_index_offset);
+                 nir_address_format_32bit_index_offset);
 
       NIR_PASS_V(nir, nir_opt_constant_folding);
    }