[Mesa-dev] [PATCH 14/14] i965: Propagate UsesClipDistance information to the low-level IR

Ian Romanick idr at freedesktop.org
Fri Jan 6 16:50:05 PST 2012


From: Ian Romanick <ian.d.romanick at intel.com>

Once the i965 driver stops calling _mesa_ir_link_shader, this
information is no longer set.

Ideally gen6_upload_vs_push_constants should use the
gl_shader_program, but I don't see a way to propagate the information
there.  The other alternative, since this is the only usage, is to
move gl_vertex_program::UsesClipDistance to brw_vertex_program.

This should also probably get squashed into the previous commit.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Paul Berry <stereotype441 at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_shader.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index f32f045..dab1ffa 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -85,6 +85,11 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
       _mesa_generate_parameters_list_for_uniforms(shProg, &shader->base,
 						  prog->Parameters);
 
+      if (stage == 0) {
+	 struct gl_vertex_program *vp = (struct gl_vertex_program *) prog;
+	 vp->UsesClipDistance = shProg->Vert.UsesClipDistance;
+      }
+
       void *mem_ctx = ralloc_context(NULL);
       bool progress;
 
-- 
1.7.6.4



More information about the mesa-dev mailing list