From 71a8544f89d736d481b15da421110ac275d7c24f Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Sat, 4 Sep 2010 02:57:14 +0200 Subject: nvfx: support all coord conventions in hardware --- src/gallium/drivers/nvfx/nvfx_state_emit.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/gallium/drivers/nvfx/nvfx_state_emit.c') diff --git a/src/gallium/drivers/nvfx/nvfx_state_emit.c b/src/gallium/drivers/nvfx/nvfx_state_emit.c index 128cf2b6dd..c84bf60c12 100644 --- a/src/gallium/drivers/nvfx/nvfx_state_emit.c +++ b/src/gallium/drivers/nvfx/nvfx_state_emit.c @@ -3,6 +3,21 @@ #include "nvfx_resource.h" #include "draw/draw_context.h" +static void +nvfx_coord_conventions_validate(struct nvfx_context* nvfx) +{ + struct nouveau_channel* chan = nvfx->screen->base.channel; + unsigned value = 0; + if(nvfx->hw_fragprog->coord_conventions & NV34TCL_COORD_CONVENTIONS_ORIGIN_INVERTED) + value |= nvfx->framebuffer.height << NV34TCL_COORD_CONVENTIONS_HEIGHT_SHIFT; + + value |= nvfx->hw_fragprog->coord_conventions; + + WAIT_RING(chan, 2); + OUT_RING(chan, RING_3D(NV34TCL_COORD_CONVENTIONS, 1)); + OUT_RING(chan, value); +} + static boolean nvfx_state_validate_common(struct nvfx_context *nvfx) { @@ -212,6 +227,9 @@ nvfx_state_validate_common(struct nvfx_context *nvfx) OUT_RING(chan, nvfx->framebuffer.zsbuf && nvfx->zsa->pipe.depth.enabled); } + if((all_swizzled >= 0) || (dirty & NVFX_NEW_FRAGPROG)) + nvfx_coord_conventions_validate(nvfx); + if(flush_tex_cache) { // TODO: what about nv30? -- cgit v1.2.3