summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-02-22 11:44:31 +0100
committerYounes Manton <[email protected]>2010-03-15 00:03:04 -0400
commitd40a069206ea76feafe35c417d79c8bd5d62b4c1 (patch)
treebb32984dd35916258f857405df26e27319c78362 /src/gallium/drivers/nvfx
parentdbe63ed3b688fc1b2714d1418a031210c9e00d3b (diff)
nvfx: add NOUVEAU_SWTNL to force swtnl at runtime
Replace the FORCE_SWTNL macro with a NOUVEAU_SWTNL environment variable.
Diffstat (limited to 'src/gallium/drivers/nvfx')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_vbo.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c
index 9d501ef1da9..54369f9b64e 100644
--- a/src/gallium/drivers/nvfx/nvfx_vbo.c
+++ b/src/gallium/drivers/nvfx/nvfx_vbo.c
@@ -10,7 +10,14 @@
#include "nouveau/nouveau_pushbuf.h"
#include "nouveau/nouveau_util.h"
-#define FORCE_SWTNL 0
+static boolean
+nvfx_force_swtnl(struct nvfx_context *nvfx)
+{
+ static int force_swtnl = -1;
+ if(force_swtnl < 0)
+ force_swtnl = debug_get_bool_option("NOUVEAU_SWTNL", 0);
+ return force_swtnl;
+}
static INLINE int
nvfx_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, unsigned *ncomp)
@@ -175,7 +182,7 @@ nvfx_draw_arrays(struct pipe_context *pipe,
unsigned restart = 0;
nvfx_vbo_set_idxbuf(nvfx, NULL, 0);
- if (FORCE_SWTNL || !nvfx_state_validate(nvfx)) {
+ if (nvfx_force_swtnl(nvfx) || !nvfx_state_validate(nvfx)) {
nvfx_draw_elements_swtnl(pipe, NULL, 0,
mode, start, count);
return;
@@ -465,7 +472,7 @@ nvfx_draw_elements(struct pipe_context *pipe,
boolean idxbuf;
idxbuf = nvfx_vbo_set_idxbuf(nvfx, indexBuffer, indexSize);
- if (FORCE_SWTNL || !nvfx_state_validate(nvfx)) {
+ if (nvfx_force_swtnl(nvfx) || !nvfx_state_validate(nvfx)) {
nvfx_draw_elements_swtnl(pipe, NULL, 0,
mode, start, count);
return;