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 d3ee9a1f4c9327dd0b8f202ac4dd110c234ac754..2bc8cc4a676f4fa41b96289841e3027ae7f03a58 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 41d91e5c49df2379ea70f1cc51c66ad43c7b8fdc..1039d456524678cf67a98668e1a4a013a8120302 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 231815f12d4d100abcbb055b115f7c6436cf3bb7..1752ece5524a31d4a17c8e8ea799cd8a724f0a77 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 04cf857c98d503561bff3c331571019a070f1737..407d3976adf37b7d3bd15ecad98625c5bc0ce23a 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;
    }