}
current_annotation = "Clipping flags";
- for (i = 0; i < c->key.nr_userclip; i++) {
+ for (i = 0; i < c->key.nr_userclip_planes; i++) {
vec4_instruction *inst;
inst = emit(DP4(dst_null_f(), src_reg(output_reg[VERT_RESULT_HPOS]),
clip_vertex = VERT_RESULT_HPOS;
}
- for (int i = 0; i + offset < c->key.nr_userclip && i < 4; ++i) {
+ for (int i = 0; i + offset < c->key.nr_userclip_planes && i < 4; ++i) {
emit(DP4(dst_reg(brw_writemask(reg, 1 << i)),
src_reg(output_reg[clip_vertex]),
src_reg(this->userplane[i + offset])));
*/
key.program_string_id = vp->id;
key.userclip_active = (ctx->Transform.ClipPlanesEnabled != 0);
- key.nr_userclip = _mesa_bitcount_64(ctx->Transform.ClipPlanesEnabled);
key.uses_clip_distance = vp->program.UsesClipDistance;
- if (!key.uses_clip_distance)
+ if (!key.uses_clip_distance) {
key.userclip_planes_enabled = ctx->Transform.ClipPlanesEnabled;
+ key.nr_userclip_planes
+ = _mesa_bitcount_64(ctx->Transform.ClipPlanesEnabled);
+ }
key.copy_edgeflag = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
*/
if (c->key.userclip_active) {
if (intel->gen >= 6) {
- for (i = 0; i < c->key.nr_userclip; i++) {
+ for (i = 0; i < c->key.nr_userclip_planes; i++) {
c->userplane[i] = stride(brw_vec4_grf(reg + i / 2,
(i % 2) * 4), 0, 4, 1);
}
- reg += ALIGN(c->key.nr_userclip, 2) / 2;
+ reg += ALIGN(c->key.nr_userclip_planes, 2) / 2;
} else {
- for (i = 0; i < c->key.nr_userclip; i++) {
+ for (i = 0; i < c->key.nr_userclip_planes; i++) {
c->userplane[i] = stride(brw_vec4_grf(reg + (6 + i) / 2,
(i % 2) * 4), 0, 4, 1);
}
- reg += (ALIGN(6 + c->key.nr_userclip, 4) / 4) * 2;
+ reg += (ALIGN(6 + c->key.nr_userclip_planes, 4) / 4) * 2;
}
}
*/
if (intel->gen >= 6) {
/* We can only load 32 regs of push constants. */
- max_constant = 32 * 2 - c->key.nr_userclip;
+ max_constant = 32 * 2 - c->key.nr_userclip_planes;
} else {
max_constant = BRW_MAX_GRF - 20 - c->vp->program.Base.NumTemporaries;
}
/* Set the user clip distances in dword 8-15. (m3-4)*/
if (c->key.userclip_active) {
- for (i = 0; i < c->key.nr_userclip; i++) {
+ for (i = 0; i < c->key.nr_userclip_planes; i++) {
struct brw_reg m;
if (i < 4)
m = brw_message_reg(3);
header1, brw_imm_ud(0x7ff<<8));
}
- for (i = 0; i < c->key.nr_userclip; i++) {
+ for (i = 0; i < c->key.nr_userclip_planes; i++) {
brw_set_conditionalmod(p, BRW_CONDITIONAL_L);
brw_DP4(p, brw_null_reg(), pos, c->userplane[i]);
brw_OR(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(1<<i));