f->reg.dest = index >> 2;
f->reg.mask = dest->write_mask << (index & 0x3);
- f->reg.source_type = 1;
-
- ppir_src *src = &load->src;
- index = ppir_target_get_src_reg_index(src);
- f->reg.source = index >> 2;
- f->reg.negate = src->negate;
- f->reg.absolute = src->absolute;
- f->reg.swizzle = encode_swizzle(src->swizzle, index & 0x3, 0);
+ if (load->num_src) {
+ f->reg.source_type = 1;
+ ppir_src *src = &load->src;
+ index = ppir_target_get_src_reg_index(src);
+ f->reg.source = index >> 2;
+ f->reg.negate = src->negate;
+ f->reg.absolute = src->absolute;
+ f->reg.swizzle = encode_swizzle(src->swizzle, index & 0x3, 0);
+ }
}
}
load->dest.pipeline = ppir_pipeline_reg_discard;
load->src = load_tex->src_coords;
+ load->num_src = 1;
ppir_node_foreach_pred_safe(node, dep) {
ppir_node *pred = dep->pred;
int num_components;
ppir_dest dest;
ppir_src src;
+ int num_src;
} ppir_load_node;
typedef struct {
return ppir_node_to_alu(node)->num_src;
case ppir_node_type_branch:
return ppir_node_to_branch(node)->num_src;
- case ppir_node_type_load_texture:
case ppir_node_type_load:
+ return ppir_node_to_load(node)->num_src;
+ case ppir_node_type_load_texture:
case ppir_node_type_store:
return 1;
default: