glsl/distance: make sure we use clip dist varying slot for lowered var.
authorDave Airlie <airlied@redhat.com>
Tue, 24 May 2016 20:03:24 +0000 (06:03 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 1 Jun 2016 21:09:21 +0000 (07:09 +1000)
When lowering, we always want to use the clip dist varying.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/compiler/glsl/lower_distance.cpp

index 49a71c2cedda5d3009bd712b51bcc952d6b438ba..c2158f24f3940d111106564a18ab2c59cc9f8e8e 100644 (file)
@@ -168,6 +168,7 @@ lower_distance_visitor::visit(ir_variable *ir)
       *new_var = ir->clone(ralloc_parent(ir), NULL);
       (*new_var)->name = ralloc_strdup(*new_var, GLSL_CLIP_VAR_NAME);
       (*new_var)->data.max_array_access = new_size - 1;
+      (*new_var)->data.location = VARYING_SLOT_CLIP_DIST0;
 
       if (!ir->type->fields.array->is_array()) {
          /* gl_ClipDistance (used for vertex, tessellation evaluation and