summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs_state.c
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2011-09-23 21:33:50 -0700
committerPaul Berry <stereotype441@gmail.com>2011-09-28 11:38:03 -0700
commite7da40afe84349a640fe15e3af408a0dfe880e85 (patch)
tree9cf7f8a407bb4c4cb77f5c42fe58ad421d6dba06 /src/mesa/drivers/dri/i965/brw_vs_state.c
parent7e2b23ba85a89282565d9375b0a885cc48e66c82 (diff)
downloadexternal_mesa3d-e7da40afe84349a640fe15e3af408a0dfe880e85.zip
external_mesa3d-e7da40afe84349a640fe15e3af408a0dfe880e85.tar.gz
external_mesa3d-e7da40afe84349a640fe15e3af408a0dfe880e85.tar.bz2
i965 new VS: don't share clip plane constants in pre-GEN6
In pre-GEN6, when using clip planes, both the vertex shader and the clipper need access to the client-supplied clip planes, since the vertex shader needs them to set the clip flags, and the clipper needs them to determine where to insert new vertices. With the old VS backend, we used a clever optimization to avoid placing duplicate copies of these planes in the CURBE: we used the same block of memory for both the clipper and vertex shader constants, with the clip planes at the front of it, and then we instructed the clipper to read just the initial part of this block containing the clip planes. This optimization was tricky, of dubious value, and not completely working in the new VS backend, so I've removed it. Now, when using the new VS backend, separate parts of the CURBE are used for the clipper and the vertex shader. Note that this doesn't affect the number of push constants available to the vertex shader, it simply causes the CURBE to occupy a few more bytes of URB memory. The old VS backend is unaffected. GEN6+, which does clipping entirely in hardware, is also unaffected. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_state.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c
index a01b614..8d86c12 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_state.c
@@ -92,8 +92,8 @@ brw_prepare_vs_unit(struct brw_context *brw)
vs->thread3.dispatch_grf_start_reg = 1;
vs->thread3.urb_entry_read_offset = 0;
- /* BRW_NEW_CURBE_OFFSETS, _NEW_TRANSFORM */
- if (ctx->Transform.ClipPlanesEnabled) {
+ /* BRW_NEW_CURBE_OFFSETS, _NEW_TRANSFORM, BRW_NEW_VERTEX_PROGRAM */
+ if (ctx->Transform.ClipPlanesEnabled && !brw->vs.prog_data->uses_new_param_layout) {
/* Note that we read in the userclip planes as well, hence
* clip_start:
*/
@@ -177,7 +177,8 @@ const struct brw_tracked_state brw_vs_unit = {
BRW_NEW_PROGRAM_CACHE |
BRW_NEW_CURBE_OFFSETS |
BRW_NEW_NR_VS_SURFACES |
- BRW_NEW_URB_FENCE),
+ BRW_NEW_URB_FENCE |
+ BRW_NEW_VERTEX_PROGRAM),
.cache = CACHE_NEW_VS_PROG
},
.prepare = brw_prepare_vs_unit,