diff options
author | Kenneth Graunke <[email protected]> | 2015-08-27 17:02:27 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-09-03 22:31:03 -0700 |
commit | 082b7f1876095f32578720f30fdc35771b2b3e0a (patch) | |
tree | 2d13e631d4ba29d65a5e82ddad83bf98ae30a809 /src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | |
parent | 294282aaa6a517b455d3e31d12e2d85516ac04e6 (diff) |
i965: Delete the brw_vue_program_key::userclip_active flag.
There are two uses of this flag.
The primary use is checking whether we need to emit code to convert
legacy gl_ClipVertex/gl_Position clipping to clip distances. In this
case, we also have to upload the clip planes as uniforms, which means
setting nr_userclip_plane_consts to a positive value. Checking if it's
> 0 works for detecting this case.
Gen4-5 also wants to know whether we're doing clipping at all, so it can
emit user clip flags. Checking if output_reg[VARYING_SLOT_CLIP_DIST0]
is set to a real register suffices for this.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index ca86e8b6d56..4d3d28164b5 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -3121,7 +3121,8 @@ vec4_visitor::emit_psiz_and_flags(dst_reg reg) { if (devinfo->gen < 6 && ((prog_data->vue_map.slots_valid & VARYING_BIT_PSIZ) || - key->userclip_active || devinfo->has_negative_rhw_bug)) { + output_reg[VARYING_SLOT_CLIP_DIST0].file != BAD_FILE || + devinfo->has_negative_rhw_bug)) { dst_reg header1 = dst_reg(this, glsl_type::uvec4_type); dst_reg header1_w = header1; header1_w.writemask = WRITEMASK_W; @@ -3136,7 +3137,7 @@ vec4_visitor::emit_psiz_and_flags(dst_reg reg) emit(AND(header1_w, src_reg(header1_w), 0x7ff << 8)); } - if (key->userclip_active) { + if (output_reg[VARYING_SLOT_CLIP_DIST0].file != BAD_FILE) { current_annotation = "Clipping flags"; dst_reg flags0 = dst_reg(this, glsl_type::uint_type); dst_reg flags1 = dst_reg(this, glsl_type::uint_type); @@ -3354,7 +3355,7 @@ vec4_visitor::emit_vertex() } /* Lower legacy ff and ClipVertex clipping to clip distances */ - if (key->userclip_active && !prog->UsesClipDistanceOut) { + if (key->nr_userclip_plane_consts > 0) { current_annotation = "user clip distances"; output_reg[VARYING_SLOT_CLIP_DIST0] = dst_reg(this, glsl_type::vec4_type); |