diff options
author | Paul Berry <stereotype441@gmail.com> | 2011-09-23 21:33:50 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2011-09-28 11:38:03 -0700 |
commit | e7da40afe84349a640fe15e3af408a0dfe880e85 (patch) | |
tree | 9cf7f8a407bb4c4cb77f5c42fe58ad421d6dba06 /src/mesa/drivers/dri/i965/brw_curbe.c | |
parent | 7e2b23ba85a89282565d9375b0a885cc48e66c82 (diff) | |
download | external_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_curbe.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_curbe.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 2ee2b46..e1676de 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -208,8 +208,13 @@ static void prepare_constant_buffer(struct brw_context *brw) } - /* The clipplanes are actually delivered to both CLIP and VS units. - * VS uses them to calculate the outcode bitmasks. + /* When using the old VS backend, the clipplanes are actually delivered to + * both CLIP and VS units. VS uses them to calculate the outcode bitmasks. + * + * When using the new VS backend, it is responsible for setting up its own + * clipplane constants if it needs them. This results in a slight waste of + * of curbe space, but the advantage is that the new VS backend can use its + * general-purpose uniform layout code to store the clipplanes. */ if (brw->curbe.clip_size) { GLuint offset = brw->curbe.clip_start * 16; |