assert(node->op == ppir_op_load_varying ||
node->op == ppir_op_load_coords ||
node->op == ppir_op_load_fragcoord ||
- node->op == ppir_op_load_pointcoord);
+ node->op == ppir_op_load_pointcoord ||
+ node->op == ppir_op_load_frontface);
f->imm.dest = index >> 2;
f->imm.mask = dest->write_mask << (index & 0x3);
case ppir_op_load_pointcoord:
f->imm.source_type = 3;
break;
+ case ppir_op_load_frontface:
+ f->imm.source_type = 3;
+ f->imm.perspective = 1;
+ break;
default:
break;
}
return &lnode->node;
case nir_intrinsic_load_frag_coord:
- if (!instr->dest.is_ssa)
- mask = u_bit_consecutive(0, instr->num_components);
-
- lnode = ppir_node_create_dest(block, ppir_op_load_fragcoord, &instr->dest, mask);
- if (!lnode)
- return NULL;
-
- lnode->num_components = instr->num_components;
- return &lnode->node;
-
case nir_intrinsic_load_point_coord:
+ case nir_intrinsic_load_front_face:
if (!instr->dest.is_ssa)
mask = u_bit_consecutive(0, instr->num_components);
- lnode = ppir_node_create_dest(block, ppir_op_load_pointcoord, &instr->dest, mask);
+ ppir_op op;
+ switch (instr->intrinsic) {
+ case nir_intrinsic_load_frag_coord:
+ op = ppir_op_load_fragcoord;
+ break;
+ case nir_intrinsic_load_point_coord:
+ op = ppir_op_load_pointcoord;
+ break;
+ case nir_intrinsic_load_front_face:
+ op = ppir_op_load_frontface;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ lnode = ppir_node_create_dest(block, op, &instr->dest, mask);
if (!lnode)
return NULL;
PPIR_INSTR_SLOT_VARYING, PPIR_INSTR_SLOT_END
},
},
+ [ppir_op_load_frontface] = {
+ .name = "ld_frontface",
+ .type = ppir_node_type_load,
+ .slots = (int []) {
+ PPIR_INSTR_SLOT_VARYING, PPIR_INSTR_SLOT_END
+ },
+ },
[ppir_op_load_uniform] = {
.name = "ld_uni",
.type = ppir_node_type_load,
}
else if (node->op == ppir_op_load_varying ||
node->op == ppir_op_load_fragcoord ||
- node->op == ppir_op_load_pointcoord) {
+ node->op == ppir_op_load_pointcoord ||
+ node->op == ppir_op_load_frontface) {
/* delay the load varying dup to scheduler */
if (!create_new_instr(block, node))
return false;
ppir_op_load_coords,
ppir_op_load_fragcoord,
ppir_op_load_pointcoord,
+ ppir_op_load_frontface,
ppir_op_load_texture,
ppir_op_load_temp,
case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
+ case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
return 1;
case PIPE_CAP_MAX_TEXTURE_2D_SIZE: