switch (nir_alu_type_get_base_type(tex->dest_type)) {
case nir_type_float:
- if (tex->is_shadow && tex->is_new_style_shadow) {
+ switch (nir_tex_instr_dest_size(tex)) {
+ case 1:
+ assert(tex->is_shadow && tex->is_new_style_shadow);
color = nir_unpack_half_2x16_split_x(b, nir_channel(b, color, 0));
- } else {
+ break;
+ case 2: {
+ nir_ssa_def *rg = nir_channel(b, color, 0);
+ color = nir_vec2(b,
+ nir_unpack_half_2x16_split_x(b, rg),
+ nir_unpack_half_2x16_split_y(b, rg));
+ break;
+ }
+ case 4: {
nir_ssa_def *rg = nir_channel(b, color, 0);
nir_ssa_def *ba = nir_channel(b, color, 1);
color = nir_vec4(b,
nir_unpack_half_2x16_split_y(b, rg),
nir_unpack_half_2x16_split_x(b, ba),
nir_unpack_half_2x16_split_y(b, ba));
+ break;
+ }
+ default:
+ unreachable("wrong dest_size");
}
break;