static const struct nir_shader_compiler_options scalar_nir_options = {
COMMON_OPTIONS,
+ .lower_pack_half_2x16 = true,
+ .lower_unpack_half_2x16 = true,
};
static const struct nir_shader_compiler_options vector_nir_options = {
return false;
switch (expr->operation) {
+ case ir_unop_pack_half_2x16:
+ return false;
+
/* these opcodes need to act on the whole vector,
* just like texturing.
*/
return visit_continue;
switch (expr->operation) {
+ case ir_unop_pack_half_2x16:
case ir_unop_interpolate_at_centroid:
case ir_binop_interpolate_at_offset:
case ir_binop_interpolate_at_sample:
| LOWER_PACK_SNORM_4x8;
}
- if (brw->gen >= 7) {
- /* Gen7 introduced the f32to16 and f16to32 instructions, which can be
- * used to execute packHalf2x16 and unpackHalf2x16. For AOS code, no
- * lowering is needed. For SOA code, the Half2x16 ops must be
- * scalarized.
- */
- if (compiler->scalar_stage[shader_type]) {
- ops |= LOWER_PACK_HALF_2x16_TO_SPLIT
- | LOWER_UNPACK_HALF_2x16_TO_SPLIT;
- }
- } else {
+ if (brw->gen < 7) {
ops |= LOWER_PACK_HALF_2x16
| LOWER_UNPACK_HALF_2x16;
}