aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index f1ff14166ef..0a3924fddf4 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -381,6 +381,23 @@ brw_vs_debug_recompile(struct brw_context *brw,
}
}
+
+void
+brw_setup_vec4_key_clip_info(struct brw_context *brw,
+ struct brw_vec4_prog_key *key,
+ bool program_uses_clip_distance)
+{
+ struct gl_context *ctx = &brw->ctx;
+
+ key->userclip_active = (ctx->Transform.ClipPlanesEnabled != 0);
+ key->uses_clip_distance = program_uses_clip_distance;
+ if (key->userclip_active && !key->uses_clip_distance) {
+ key->nr_userclip_plane_consts
+ = _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
+ }
+}
+
+
static void brw_upload_vs_prog(struct brw_context *brw)
{
struct gl_context *ctx = &brw->ctx;
@@ -397,12 +414,7 @@ static void brw_upload_vs_prog(struct brw_context *brw)
* the inputs it asks for, whether they are varying or not.
*/
key.base.program_string_id = vp->id;
- key.base.userclip_active = (ctx->Transform.ClipPlanesEnabled != 0);
- key.base.uses_clip_distance = vp->program.UsesClipDistance;
- if (key.base.userclip_active && !key.base.uses_clip_distance) {
- key.base.nr_userclip_plane_consts
- = _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
- }
+ brw_setup_vec4_key_clip_info(brw, &key.base, vp->program.UsesClipDistance);
/* _NEW_POLYGON */
if (brw->gen < 6) {