aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-08-27 17:02:27 -0700
committerKenneth Graunke <[email protected]>2015-09-03 22:31:03 -0700
commit082b7f1876095f32578720f30fdc35771b2b3e0a (patch)
tree2d13e631d4ba29d65a5e82ddad83bf98ae30a809 /src/mesa/drivers/dri/i965/brw_vs.c
parent294282aaa6a517b455d3e31d12e2d85516ac04e6 (diff)
i965: Delete the brw_vue_program_key::userclip_active flag.
There are two uses of this flag. The primary use is checking whether we need to emit code to convert legacy gl_ClipVertex/gl_Position clipping to clip distances. In this case, we also have to upload the clip planes as uniforms, which means setting nr_userclip_plane_consts to a positive value. Checking if it's > 0 works for detecting this case. Gen4-5 also wants to know whether we're doing clipping at all, so it can emit user clip flags. Checking if output_reg[VARYING_SLOT_CLIP_DIST0] is set to a real register suffices for this. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 211929a5235..365396825dc 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -172,7 +172,7 @@ brw_codegen_vs_prog(struct brw_context *brw,
* distance varying slots whenever clipping is enabled, even if the vertex
* shader doesn't write to gl_ClipDistance.
*/
- if (key->base.userclip_active) {
+ if (key->base.nr_userclip_plane_consts > 0) {
outputs_written |= BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST0);
outputs_written |= BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST1);
}
@@ -257,10 +257,7 @@ brw_vs_debug_recompile(struct brw_context *brw,
key->gl_attrib_wa_flags[i]);
}
- found |= key_debug(brw, "user clip flags",
- old_key->base.userclip_active, key->base.userclip_active);
-
- found |= key_debug(brw, "user clipping planes as push constants",
+ found |= key_debug(brw, "legacy user clipping",
old_key->base.nr_userclip_plane_consts,
key->base.nr_userclip_plane_consts);
@@ -311,12 +308,10 @@ brw_vs_populate_key(struct brw_context *brw,
*/
key->base.program_string_id = vp->id;
- if (ctx->Transform.ClipPlanesEnabled != 0) {
- key->base.userclip_active = true;
- if (!vp->program.Base.UsesClipDistanceOut) {
- key->base.nr_userclip_plane_consts =
- _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
- }
+ if (ctx->Transform.ClipPlanesEnabled != 0 &&
+ !vp->program.Base.UsesClipDistanceOut) {
+ key->base.nr_userclip_plane_consts =
+ _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
}
/* _NEW_POLYGON */