Mesa (master): nv50: fix clip state validation
Christoph Bumiller
chrisbmr at kemper.freedesktop.org
Tue Jan 10 20:51:10 UTC 2012
Module: Mesa
Branch: master
Commit: bd38459fe922b9f672673bf8edd835937ed311ec
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bd38459fe922b9f672673bf8edd835937ed311ec
Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date: Tue Jan 10 21:33:48 2012 +0100
nv50: fix clip state validation
Don't create clip outputs if no clip planes are enabled.
Move clip validation after program validation: we were calling
linkage validation in case the VP needed rebuilding before the
FP was validated.
The vertex program needs to be built first because when
ClipDistance is used we'll want to only enable those outputs that
are also written.
---
src/gallium/drivers/nv50/nv50_state_validate.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c
index edf648e..c8a1c4e 100644
--- a/src/gallium/drivers/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
@@ -254,7 +254,8 @@ nv50_validate_clip(struct nv50_context *nv50)
BEGIN_RING(chan, RING_3D(VP_CLIP_DISTANCE_ENABLE), 1);
OUT_RING (chan, clip_enable);
- nv50_check_program_ucps(nv50, vp, clip_enable);
+ if (clip_enable)
+ nv50_check_program_ucps(nv50, vp, clip_enable);
}
static void
@@ -356,8 +357,6 @@ static struct state_validate {
{ nv50_validate_scissor, NV50_NEW_SCISSOR },
#endif
{ nv50_validate_viewport, NV50_NEW_VIEWPORT },
- { nv50_validate_clip, NV50_NEW_CLIP | NV50_NEW_RASTERIZER |
- NV50_NEW_VERTPROG | NV50_NEW_GMTYPROG },
{ nv50_vertprog_validate, NV50_NEW_VERTPROG },
{ nv50_gmtyprog_validate, NV50_NEW_GMTYPROG },
{ nv50_fragprog_validate, NV50_NEW_FRAGPROG },
@@ -366,6 +365,8 @@ static struct state_validate {
{ nv50_gp_linkage_validate, NV50_NEW_GMTYPROG | NV50_NEW_VERTPROG },
{ nv50_validate_derived_rs, NV50_NEW_FRAGPROG | NV50_NEW_RASTERIZER |
NV50_NEW_VERTPROG | NV50_NEW_GMTYPROG },
+ { nv50_validate_clip, NV50_NEW_CLIP | NV50_NEW_RASTERIZER |
+ NV50_NEW_VERTPROG | NV50_NEW_GMTYPROG },
{ nv50_constbufs_validate, NV50_NEW_CONSTBUF },
{ nv50_validate_textures, NV50_NEW_TEXTURES },
{ nv50_validate_samplers, NV50_NEW_SAMPLERS },
More information about the mesa-commit
mailing list