int index = ppir_target_get_dest_reg_index(dest);
int num_components = load->num_components;
- if (num_components) {
+ if (node->op != ppir_op_load_coords_reg) {
assert(node->op == ppir_op_load_varying ||
node->op == ppir_op_load_coords ||
node->op == ppir_op_load_fragcoord ||
break;
}
}
- else {
- assert(node->op == ppir_op_load_coords);
-
+ else { /* node->op == ppir_op_load_coords_reg */
f->reg.dest = index >> 2;
f->reg.mask = dest->write_mask << (index & 0x3);
load = ppir_node_to_load(src_coords);
else {
/* Create load_coords node */
- load = ppir_node_create(block, ppir_op_load_coords, -1, 0);
+ load = ppir_node_create(block, ppir_op_load_coords_reg, -1, 0);
if (!load)
return false;
list_addtail(&load->node.list, &node->list);
load->src = load_tex->src_coords;
load->num_src = 1;
+ if (load_tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE)
+ load->num_components = 3;
+ else
+ load->num_components = 2;
ppir_debug("%s create load_coords node %d for %d\n",
__FUNCTION__, load->node.index, node->index);
/* Fallthrough */
case ppir_op_load_uniform:
case ppir_op_load_coords:
+ case ppir_op_load_coords_reg:
/* Clone uniform and texture coord loads for each block.
* Also ensure that each load has a single successor.
* Let's do a fetch each time and hope for a cache hit instead
PPIR_INSTR_SLOT_VARYING, PPIR_INSTR_SLOT_END
},
},
+ [ppir_op_load_coords_reg] = {
+ .name = "ld_coords_reg",
+ .type = ppir_node_type_load,
+ .slots = (int []) {
+ PPIR_INSTR_SLOT_VARYING, PPIR_INSTR_SLOT_END
+ },
+ },
[ppir_op_load_fragcoord] = {
.name = "ld_fragcoord",
.type = ppir_node_type_load,
case ppir_op_load_varying:
case ppir_op_load_temp:
case ppir_op_load_coords:
+ case ppir_op_load_coords_reg:
return ppir_node_clone_load(block, node);
default:
return NULL;
switch (node->op) {
case ppir_op_load_varying:
case ppir_op_load_coords:
+ case ppir_op_load_coords_reg:
case ppir_op_load_fragcoord:
case ppir_op_load_pointcoord:
case ppir_op_load_frontface:
ppir_op_load_uniform,
ppir_op_load_varying,
ppir_op_load_coords,
+ ppir_op_load_coords_reg,
ppir_op_load_fragcoord,
ppir_op_load_pointcoord,
ppir_op_load_frontface,