i965/vec4: Remove uses_clip_distance from program key.
authorPaul Berry <stereotype441@gmail.com>
Wed, 23 Oct 2013 18:10:14 +0000 (11:10 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 25 Oct 2013 05:00:22 +0000 (22:00 -0700)
This should never have been in the program key in the first place,
since it's determined by the shader source, not by GL state.  Change
the code to just refer to gl_program::UsesClipDistanceOut directly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/drivers/dri/i965/brw_vs.c

index d3ee9a1..2bc8cc4 100644 (file)
@@ -1443,7 +1443,7 @@ vec4_visitor::run()
    }
    base_ir = NULL;
 
-   if (key->userclip_active && !key->uses_clip_distance)
+   if (key->userclip_active && !prog->UsesClipDistanceOut)
       setup_uniform_clipplane_values();
 
    emit_thread_end();
index 41d91e5..1039d45 100644 (file)
@@ -64,12 +64,6 @@ struct brw_vec4_prog_key {
     */
    GLuint nr_userclip_plane_consts:4;
 
-   /**
-    * True if the shader uses gl_ClipDistance, regardless of whether any clip
-    * flags are enabled.
-    */
-   GLuint uses_clip_distance:1;
-
    GLuint clamp_vertex_color:1;
 
    struct brw_sampler_prog_key_data tex;
index 231815f..1752ece 100644 (file)
@@ -2789,7 +2789,7 @@ vec4_visitor::emit_vertex()
    }
 
    /* Lower legacy ff and ClipVertex clipping to clip distances */
-   if (key->userclip_active && !key->uses_clip_distance) {
+   if (key->userclip_active && !prog->UsesClipDistanceOut) {
       current_annotation = "user clip distances";
 
       output_reg[VARYING_SLOT_CLIP_DIST0] = dst_reg(this, glsl_type::vec4_type);
index 04cf857..407d397 100644 (file)
@@ -370,8 +370,6 @@ brw_vs_debug_recompile(struct brw_context *brw,
                       old_key->base.nr_userclip_plane_consts,
                       key->base.nr_userclip_plane_consts);
 
-   found |= key_debug(brw, "clip distance enable",
-                      old_key->base.uses_clip_distance, key->base.uses_clip_distance);
    found |= key_debug(brw, "copy edgeflag",
                       old_key->copy_edgeflag, key->copy_edgeflag);
    found |= key_debug(brw, "PointCoord replace",
@@ -396,8 +394,7 @@ brw_setup_vec4_key_clip_info(struct brw_context *brw,
    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) {
+   if (key->userclip_active && !program_uses_clip_distance) {
       key->nr_userclip_plane_consts
          = _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
    }