summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvfx/nvfx_fragprog.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-02-23 16:48:22 +0100
committerLuca Barbieri <luca@luca-barbieri.com>2010-04-12 12:21:25 +0200
commit330925d9118120863f5e76e01fdfa1a1f44be2b1 (patch)
treefeb63f5237b7d1cc2cd8ff8a0f3f90774c030cb9 /src/gallium/drivers/nvfx/nvfx_fragprog.c
parent26e40448becb07e292d269dc4d8fbc56caebba3c (diff)
nvfx: rework validation logic to use code and avoid stateobjs
This makes the code faster due to the lack of indirect calls and also makes it much easier to understand what is actually going on.
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_fragprog.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_fragprog.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_fragprog.c b/src/gallium/drivers/nvfx/nvfx_fragprog.c
index eb81530248..301ad82c08 100644
--- a/src/gallium/drivers/nvfx/nvfx_fragprog.c
+++ b/src/gallium/drivers/nvfx/nvfx_fragprog.c
@@ -864,7 +864,7 @@ nvfx_fragprog_upload(struct nvfx_context *nvfx,
}
}
-boolean
+void
nvfx_fragprog_validate(struct nvfx_context *nvfx)
{
struct nouveau_channel* chan = nvfx->screen->base.channel;
@@ -878,7 +878,6 @@ nvfx_fragprog_validate(struct nvfx_context *nvfx)
if (fp->translated)
goto update_constants;
- nvfx->fallback_swrast &= ~NVFX_NEW_FRAGPROG;
nvfx_fragprog_translate(nvfx, fp);
if (!fp->translated) {
static unsigned dummy[8] = {1, 0, 0, 0, 1, 0, 0, 0};
@@ -894,7 +893,7 @@ nvfx_fragprog_validate(struct nvfx_context *nvfx)
fp->insn = malloc(sizeof(dummy));
memcpy(fp->insn, dummy, sizeof(dummy));
fp->insn_len = sizeof(dummy) / sizeof(dummy[0]);
- return FALSE;
+ return;
}
fp->buffer = pipe_buffer_create(pscreen,
@@ -948,7 +947,6 @@ update_constants:
OUT_RING(chan, RING_3D(NV34TCL_TX_UNITS_ENABLE, 1));
OUT_RING(chan, fp->samplers);
}
- return TRUE;
}
void
@@ -977,10 +975,3 @@ nvfx_fragprog_destroy(struct nvfx_context *nvfx,
FREE(fp->insn);
}
-struct nvfx_state_entry nvfx_state_fragprog = {
- .validate = nvfx_fragprog_validate,
- .dirty = {
- .pipe = NVFX_NEW_FRAGPROG | NVFX_NEW_FRAGCONST,
- .hw = 0
- }
-};