i965/vec4: Remove uses_clip_distance from program key.

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>
This commit is contained in:
Paul Berry 2013-10-23 11:10:14 -07:00
parent 11634e491b
commit 068df64ba6
4 changed files with 3 additions and 12 deletions

View 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();

View 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;

View 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);

View 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;
}