nir: Rename get_buffer_size to get_ssbo_size

This makes it explicit that this intrinsic is only for SSBOs.  For the
v3dv driver, we'll be adding a get_ubo_size intrinsic and we want to be
able to distinguish between the two.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6812>
This commit is contained in:
Jason Ekstrand
2020-09-22 03:24:45 -05:00
committed by Marge Bot
parent f100cf0d30
commit 9750164c09
25 changed files with 48 additions and 47 deletions

View File

@@ -2090,7 +2090,7 @@ nir_visitor::visit(ir_expression *ir)
case ir_unop_get_buffer_size: {
nir_intrinsic_instr *load = nir_intrinsic_instr_create(
this->shader,
nir_intrinsic_get_buffer_size);
nir_intrinsic_get_ssbo_size);
load->num_components = ir->type->vector_elements;
load->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[0]));
unsigned bit_size = glsl_get_bit_size(ir->type);

View File

@@ -267,7 +267,7 @@ visit_intrinsic(nir_intrinsic_instr *instr, struct divergence_state *state)
case nir_intrinsic_image_samples:
case nir_intrinsic_image_deref_samples:
case nir_intrinsic_bindless_image_samples:
case nir_intrinsic_get_buffer_size:
case nir_intrinsic_get_ssbo_size:
case nir_intrinsic_image_size:
case nir_intrinsic_image_deref_size:
case nir_intrinsic_bindless_image_size:

View File

@@ -194,9 +194,9 @@ intrinsic("interp_deref_at_vertex", src_comp=[1, 1], dest_comp=0,
intrinsic("deref_buffer_array_length", src_comp=[-1], dest_comp=1,
flags=[CAN_ELIMINATE, CAN_REORDER])
# Ask the driver for the size of a given buffer. It takes the buffer index
# Ask the driver for the size of a given SSBO. It takes the buffer index
# as source.
intrinsic("get_buffer_size", src_comp=[-1], dest_comp=1,
intrinsic("get_ssbo_size", src_comp=[-1], dest_comp=1,
flags=[CAN_ELIMINATE, CAN_REORDER])
# a barrier is an intrinsic with no inputs/outputs but which can't be moved

View File

@@ -1653,6 +1653,7 @@ lower_explicit_io_array_length(nir_builder *b, nir_intrinsic_instr *intrin,
assert(glsl_type_is_array(deref->type));
assert(glsl_get_length(deref->type) == 0);
assert(deref->mode == nir_var_mem_ssbo);
unsigned stride = glsl_get_explicit_stride(deref->type);
assert(stride > 0);
@@ -1661,7 +1662,7 @@ lower_explicit_io_array_length(nir_builder *b, nir_intrinsic_instr *intrin,
nir_ssa_def *offset = addr_to_offset(b, addr, addr_format);
nir_intrinsic_instr *bsize =
nir_intrinsic_instr_create(b->shader, nir_intrinsic_get_buffer_size);
nir_intrinsic_instr_create(b->shader, nir_intrinsic_get_ssbo_size);
bsize->src[0] = nir_src_for_ssa(index);
nir_ssa_dest_init(&bsize->instr, &bsize->dest, 1, 32, NULL);
nir_builder_instr_insert(b, &bsize->instr);

View File

@@ -2818,7 +2818,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
nir_intrinsic_instr *instr =
nir_intrinsic_instr_create(b->nb.shader,
nir_intrinsic_get_buffer_size);
nir_intrinsic_get_ssbo_size);
instr->src[0] = nir_src_for_ssa(ptr->block_index);
nir_ssa_dest_init(&instr->instr, &instr->dest, 1, 32, NULL);
nir_builder_instr_insert(&b->nb, &instr->instr);