If we want to be able to use copy_deref instructions on explicitly laid
out types, we have to be a little more flexible about what types we
allow. Instead, of requiring the types to exactly match, only require
the bare types to match.
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src_deref_arr + 1);
}
} else {
- assert(dst_deref->type == src_deref->type);
+ assert(glsl_get_bare_type(dst_deref->type) ==
+ glsl_get_bare_type(src_deref->type));
assert(glsl_type_is_vector_or_scalar(dst_deref->type));
nir_store_deref(b, dst_deref, nir_load_deref(b, src_deref), ~0);
split_deref_copy_instr(nir_builder *b,
nir_deref_instr *dst, nir_deref_instr *src)
{
- assert(dst->type == src->type);
+ assert(glsl_get_bare_type(dst->type) ==
+ glsl_get_bare_type(src->type));
if (glsl_type_is_vector_or_scalar(src->type)) {
nir_copy_deref(b, dst, src);
} else if (glsl_type_is_struct_or_ifc(src->type)) {
case nir_intrinsic_copy_deref: {
nir_deref_instr *dst = nir_src_as_deref(instr->src[0]);
nir_deref_instr *src = nir_src_as_deref(instr->src[1]);
- validate_assert(state, dst->type == src->type);
+ validate_assert(state, glsl_get_bare_type(dst->type) ==
+ glsl_get_bare_type(src->type));
validate_assert(state, (dst->mode & (nir_var_shader_in |
nir_var_uniform)) == 0);
break;