spirv: Remove a dead case in function parameter handling

Ever since 31a7476335, we've set something for vtn_type::type for
all pointer types.  For logical pointer types, it's uint32_t.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5278>
This commit is contained in:
Jason Ekstrand
2020-05-29 21:02:31 -05:00
parent 9e3213ad30
commit 32ba23f897

View File

@@ -36,14 +36,12 @@ vtn_load_param_pointer(struct vtn_builder *b,
uint32_t param_idx) uint32_t param_idx)
{ {
struct vtn_type *ptr_type = param_type; struct vtn_type *ptr_type = param_type;
if (param_type->base_type != vtn_base_type_pointer) { assert(param_type->base_type == vtn_base_type_image ||
assert(param_type->base_type == vtn_base_type_image || param_type->base_type == vtn_base_type_sampler);
param_type->base_type == vtn_base_type_sampler); ptr_type = rzalloc(b, struct vtn_type);
ptr_type = rzalloc(b, struct vtn_type); ptr_type->base_type = vtn_base_type_pointer;
ptr_type->base_type = vtn_base_type_pointer; ptr_type->deref = param_type;
ptr_type->deref = param_type; ptr_type->storage_class = SpvStorageClassUniformConstant;
ptr_type->storage_class = SpvStorageClassUniformConstant;
}
return vtn_pointer_from_ssa(b, nir_load_param(&b->nb, param_idx), ptr_type); return vtn_pointer_from_ssa(b, nir_load_param(&b->nb, param_idx), ptr_type);
} }
@@ -104,14 +102,10 @@ vtn_type_add_to_function_params(struct vtn_type *type,
break; break;
case vtn_base_type_pointer: case vtn_base_type_pointer:
if (type->type) { func->params[(*param_idx)++] = (nir_parameter) {
func->params[(*param_idx)++] = (nir_parameter) { .num_components = glsl_get_vector_elements(type->type),
.num_components = glsl_get_vector_elements(type->type), .bit_size = glsl_get_bit_size(type->type),
.bit_size = glsl_get_bit_size(type->type), };
};
} else {
func->params[(*param_idx)++] = nir_deref_param;
}
break; break;
default: default:
@@ -337,13 +331,11 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
vtn_load_param_pointer(b, image_type, b->func_param_idx++); vtn_load_param_pointer(b, image_type, b->func_param_idx++);
val->sampled_image->sampler = val->sampled_image->sampler =
vtn_load_param_pointer(b, sampler_type, b->func_param_idx++); vtn_load_param_pointer(b, sampler_type, b->func_param_idx++);
} else if (type->base_type == vtn_base_type_pointer && } else if (type->base_type == vtn_base_type_pointer) {
type->type != NULL) {
/* This is a pointer with an actual storage type */ /* This is a pointer with an actual storage type */
nir_ssa_def *ssa_ptr = nir_load_param(&b->nb, b->func_param_idx++); nir_ssa_def *ssa_ptr = nir_load_param(&b->nb, b->func_param_idx++);
vtn_push_pointer(b, w[2], vtn_pointer_from_ssa(b, ssa_ptr, type)); vtn_push_pointer(b, w[2], vtn_pointer_from_ssa(b, ssa_ptr, type));
} else if (type->base_type == vtn_base_type_pointer || } else if (type->base_type == vtn_base_type_image ||
type->base_type == vtn_base_type_image ||
type->base_type == vtn_base_type_sampler) { type->base_type == vtn_base_type_sampler) {
vtn_push_pointer(b, w[2], vtn_load_param_pointer(b, type, b->func_param_idx++)); vtn_push_pointer(b, w[2], vtn_load_param_pointer(b, type, b->func_param_idx++));
} else { } else {