aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.h6
3 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 17bde91bb2c..f99dc51682b 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -561,7 +561,7 @@ vec4_visitor::setup_uniform_clipplane_values()
int compacted_clipplane_index = 0;
for (int i = 0; i < MAX_CLIP_PLANES; ++i) {
- if (ctx->Transform.ClipPlanesEnabled & (1 << i)) {
+ if (c->key.userclip_planes_enabled & (1 << i)) {
this->uniform_vector_size[this->uniforms] = 4;
this->userplane[compacted_clipplane_index] = dst_reg(UNIFORM, this->uniforms);
this->userplane[compacted_clipplane_index].type = BRW_REGISTER_TYPE_F;
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 02e60dc20bf..eb673e29c96 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -289,6 +289,8 @@ static void brw_upload_vs_prog(struct brw_context *brw)
key.program_string_id = vp->id;
key.nr_userclip = _mesa_bitcount_64(ctx->Transform.ClipPlanesEnabled);
key.uses_clip_distance = vp->program.UsesClipDistance;
+ if (!key.uses_clip_distance)
+ key.userclip_planes_enabled = ctx->Transform.ClipPlanesEnabled;
key.copy_edgeflag = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h
index 7ec4ad8e793..a12b1390aad 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.h
+++ b/src/mesa/drivers/dri/i965/brw_vs.h
@@ -57,6 +57,12 @@ struct brw_vs_prog_key {
*/
GLuint uses_clip_distance:1;
+ /**
+ * Which user clip planes are active. Zero if the shader uses
+ * gl_ClipDistance.
+ */
+ GLuint userclip_planes_enabled:MAX_CLIP_PLANES;
+
GLuint copy_edgeflag:1;
GLuint point_coord_replace:8;
GLuint clamp_vertex_color:1;