summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvfx/nvfx_state_emit.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-04 02:57:14 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-04 02:57:14 +0200
commit71a8544f89d736d481b15da421110ac275d7c24f (patch)
tree11550c78dcc2cf61c36bf1b8c859150b3a02e47a /src/gallium/drivers/nvfx/nvfx_state_emit.c
parent5dd296bcb106bccf6b7fb070d4bc877d9612642d (diff)
nvfx: support all coord conventions in hardware
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_state_emit.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_emit.c18
1 files changed, 18 insertions, 0 deletions
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?