Mesa (master): nvfx: fix/workaround nv3x hwtnl issues

Luca Barbieri lb at kemper.freedesktop.org
Tue Mar 23 14:42:08 UTC 2010


Module: Mesa
Branch: master
Commit: c652ad907f0715a0c23476ebd48ab722c96a5064
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c652ad907f0715a0c23476ebd48ab722c96a5064

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Wed Mar 17 15:44:45 2010 +0100

nvfx: fix/workaround nv3x hwtnl issues

This patch re-emits the viewport state on framebuffer or rasterizer
change.

This seems to be necessary on nv3x, but the reason is not fully
understood.

It is quite likely that this isn't really the correct fix, but seems
to work, and makes nv3x much better.

---

 src/gallium/drivers/nvfx/nvfx_state_viewport.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/nvfx/nvfx_state_viewport.c b/src/gallium/drivers/nvfx/nvfx_state_viewport.c
index 82e0e92..ec730e3 100644
--- a/src/gallium/drivers/nvfx/nvfx_state_viewport.c
+++ b/src/gallium/drivers/nvfx/nvfx_state_viewport.c
@@ -1,15 +1,16 @@
 #include "nvfx_context.h"
 
+/* Having this depend on FB and RAST looks wrong, but it seems
+   necessary to make this work on nv3x
+   TODO: find the right fix
+*/
+
 static boolean
 nvfx_state_viewport_validate(struct nvfx_context *nvfx)
 {
 	struct pipe_viewport_state *vpt = &nvfx->viewport;
 	struct nouveau_stateobj *so;
 
-	if (nvfx->state.hw[NVFX_STATE_VIEWPORT] &&
-	    !(nvfx->dirty & NVFX_NEW_VIEWPORT))
-		return FALSE;
-
 	so = so_new(2, 9, 0);
 	so_method(so, nvfx->screen->eng3d,
 		  NV34TCL_VIEWPORT_TRANSLATE_X, 8);
@@ -45,7 +46,7 @@ nvfx_state_viewport_validate(struct nvfx_context *nvfx)
 struct nvfx_state_entry nvfx_state_viewport = {
 	.validate = nvfx_state_viewport_validate,
 	.dirty = {
-		.pipe = NVFX_NEW_VIEWPORT,
+		.pipe = NVFX_NEW_VIEWPORT | NVFX_NEW_FB | NVFX_NEW_RAST,
 		.hw = NVFX_STATE_VIEWPORT
 	}
 };




More information about the mesa-commit mailing list