}
}
+void
+vec4_visitor::emit_generic_urb_slot(dst_reg reg, int vert_result)
+{
+ assert (vert_result < VERT_RESULT_MAX);
+ current_annotation = output_reg_annotation[vert_result];
+ /* Copy the register, saturating if necessary */
+ vec4_instruction *inst = emit(MOV(reg,
+ src_reg(output_reg[vert_result])));
+ if ((vert_result == VERT_RESULT_COL0 ||
+ vert_result == VERT_RESULT_COL1 ||
+ vert_result == VERT_RESULT_BFC0 ||
+ vert_result == VERT_RESULT_BFC1) &&
+ c->key.clamp_vertex_color) {
+ inst->saturate = true;
+ }
+}
+
void
vec4_visitor::emit_urb_slot(int mrf, int vert_result)
{
current_annotation = "gl_Position";
emit(MOV(reg, src_reg(output_reg[VERT_RESULT_HPOS])));
break;
- case BRW_VERT_RESULT_CLIP0:
- current_annotation = "user clip distances";
- emit_clip_distances(hw_reg, 0);
- break;
- case BRW_VERT_RESULT_CLIP1:
- current_annotation = "user clip distances";
- emit_clip_distances(hw_reg, 4);
+ case VERT_RESULT_CLIP_DIST0:
+ case VERT_RESULT_CLIP_DIST1:
+ if (this->c->key.uses_clip_distance) {
+ emit_generic_urb_slot(reg, vert_result);
+ } else {
+ current_annotation = "user clip distances";
+ emit_clip_distances(hw_reg, (vert_result - VERT_RESULT_CLIP_DIST0) * 4);
+ }
break;
case BRW_VERT_RESULT_PAD:
/* No need to write to this slot */
break;
- default: {
- assert (vert_result < VERT_RESULT_MAX);
- current_annotation = output_reg_annotation[vert_result];
- /* Copy the register, saturating if necessary */
- vec4_instruction *inst = emit(MOV(reg,
- src_reg(output_reg[vert_result])));
- if ((vert_result == VERT_RESULT_COL0 ||
- vert_result == VERT_RESULT_COL1 ||
- vert_result == VERT_RESULT_BFC0 ||
- vert_result == VERT_RESULT_BFC1) &&
- c->key.clamp_vertex_color) {
- inst->saturate = true;
- }
- }
+ default:
+ emit_generic_urb_slot(reg, vert_result);
break;
}
}
assign_vue_slot(vue_map, VERT_RESULT_PSIZ);
assign_vue_slot(vue_map, BRW_VERT_RESULT_NDC);
assign_vue_slot(vue_map, BRW_VERT_RESULT_HPOS_DUPLICATE);
- assign_vue_slot(vue_map, BRW_VERT_RESULT_CLIP0);
- assign_vue_slot(vue_map, BRW_VERT_RESULT_CLIP1);
+ assign_vue_slot(vue_map, VERT_RESULT_CLIP_DIST0);
+ assign_vue_slot(vue_map, VERT_RESULT_CLIP_DIST1);
assign_vue_slot(vue_map, BRW_VERT_RESULT_PAD);
assign_vue_slot(vue_map, VERT_RESULT_HPOS);
break;
assign_vue_slot(vue_map, VERT_RESULT_PSIZ);
assign_vue_slot(vue_map, VERT_RESULT_HPOS);
if (nr_userclip) {
- assign_vue_slot(vue_map, BRW_VERT_RESULT_CLIP0);
- assign_vue_slot(vue_map, BRW_VERT_RESULT_CLIP1);
+ assign_vue_slot(vue_map, VERT_RESULT_CLIP_DIST0);
+ assign_vue_slot(vue_map, VERT_RESULT_CLIP_DIST1);
}
/* front and back colors need to be consecutive so that we can use
* ATTRIBUTE_SWIZZLE_INPUTATTR_FACING to swizzle them when doing