nir: Rename nir_address_format_vk_index_offset to not be vk

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>
This commit is contained in:
Jason Ekstrand 2019-03-09 10:10:37 -06:00 committed by Jason Ekstrand
parent 60af3a93e9
commit c8d42c8cf6
4 changed files with 10 additions and 10 deletions

View 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,

View 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");
}

View 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.
*/

View 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);
}