exec_node_remove(&var->node);
exec_list_push_tail(&split_vars, &var->node);
} else {
- assert(split_type == var->type);
+ assert(split_type == glsl_get_bare_type(var->type));
/* If we're not modifying this variable, delete the info so we skip
* it faster in later passes.
*/
const struct glsl_type *type = var->type;
for (unsigned i = 0; i < num_levels; i++) {
usage->levels[i].array_len = glsl_get_length(type);
- assert(glsl_get_explicit_stride(type) == 0);
type = glsl_get_array_element(type);
}
assert(glsl_type_is_vector_or_scalar(type));
static bool
src_is_load_deref(nir_src src, nir_src deref_src)
{
- assert(src.is_ssa);
- assert(deref_src.is_ssa);
-
- if (src.ssa->parent_instr->type != nir_instr_type_intrinsic)
- return false;
-
- nir_intrinsic_instr *load = nir_instr_as_intrinsic(src.ssa->parent_instr);
- if (load->intrinsic != nir_intrinsic_load_deref)
+ nir_intrinsic_instr *load = nir_src_as_intrinsic(src);
+ if (load == NULL || load->intrinsic != nir_intrinsic_load_deref)
return false;
assert(load->src[0].is_ssa);
nir_alu_instr *src_alu = nir_instr_as_alu(src_instr);
- if (src_alu->op == nir_op_imov ||
- src_alu->op == nir_op_fmov) {
+ if (src_alu->op == nir_op_mov) {
/* If it's just a swizzle of a load from the same deref, discount any
* channels that don't move in the swizzle.
*/
b.cursor = nir_before_instr(&intrin->instr);
nir_ssa_def *swizzled =
- nir_swizzle(&b, intrin->src[1].ssa, swizzle, c, false);
+ nir_swizzle(&b, intrin->src[1].ssa, swizzle, c);
/* Rewrite to use the compacted source */
nir_instr_rewrite_src(&intrin->instr, &intrin->src[1],