if (num_components) {
assert(node->op == ppir_op_load_varying ||
node->op == ppir_op_load_coords ||
- node->op == ppir_op_load_fragcoord);
+ node->op == ppir_op_load_fragcoord ||
+ node->op == ppir_op_load_pointcoord);
f->imm.dest = index >> 2;
f->imm.mask = dest->write_mask << (index & 0x3);
else
f->imm.index = load->index >> alignment;
- if (node->op == ppir_op_load_fragcoord) {
- f->imm.source_type = 2;
- f->imm.perspective = 3;
+ switch (node->op) {
+ case ppir_op_load_fragcoord:
+ f->imm.source_type = 2;
+ f->imm.perspective = 3;
+ break;
+ case ppir_op_load_pointcoord:
+ f->imm.source_type = 3;
+ break;
+ default:
+ break;
}
}
else {
lnode->num_components = instr->num_components;
return &lnode->node;
+ case nir_intrinsic_load_point_coord:
+ 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);
+ if (!lnode)
+ return NULL;
+
+ lnode->num_components = instr->num_components;
+ return &lnode->node;
+
case nir_intrinsic_load_uniform:
if (!instr->dest.is_ssa)
mask = u_bit_consecutive(0, instr->num_components);
PPIR_INSTR_SLOT_VARYING, PPIR_INSTR_SLOT_END
},
},
+ [ppir_op_load_pointcoord] = {
+ .name = "ld_pointcoord",
+ .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,
load->dest.pipeline = ppir_pipeline_reg_uniform;
}
else if (node->op == ppir_op_load_varying ||
- node->op == ppir_op_load_fragcoord) {
+ node->op == ppir_op_load_fragcoord ||
+ node->op == ppir_op_load_pointcoord) {
/* delay the load varying dup to scheduler */
if (!create_new_instr(block, node))
return false;
ppir_op_load_varying,
ppir_op_load_coords,
ppir_op_load_fragcoord,
+ ppir_op_load_pointcoord,
ppir_op_load_texture,
ppir_op_load_temp,
return 1;
case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
+ case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
return 1;
case PIPE_CAP_MAX_TEXTURE_2D_SIZE: