summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_fragprog.c
diff options
context:
space:
mode:
authorMaciej Cencora <m.cencora@gmail.com>2009-04-16 17:50:13 +0200
committerDave Airlie <airlied@redhat.com>2009-04-17 11:27:31 +1000
commitd7d5c97a215e6845ffa9fc60cee52da6a2d3148a (patch)
tree303b520c8cfe1bbaf41e745671cf2fa35c97b74f /src/mesa/drivers/dri/r300/r300_fragprog.c
parenta92bc56e2428e4219e0eaaa6f142c6cc60fee710 (diff)
r300: cleanup frag prog setup a little
Use proper fields for marking if fp is translated, and if is translated succesfully. Now if fp gets translated (even unsuccesfully) fp->translated is true. If the translation failed (i.e. because we exceeded limit of maximum texture indirections) the fp->error is set. With a little updated fallback function it prevents non native fragment programs from beeing translated with every frame (the translation would fail anyway so there's no point to try again). Also implement IsProgramNative function for GL_FRAGMENT_PROGRAM_ARB (it should give some performance boost in apps that checks if program is native and falls back to simpler shader to meet hw limits if necessary) and cleanup indentation (remove whitespaces on empty lines).
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_fragprog.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index 32182bb667..f2d7cec5d3 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -175,7 +175,7 @@ static GLboolean transform_TEX(
inst.SrcReg[0].File = PROGRAM_TEMPORARY;
inst.SrcReg[0].Index = tmpreg;
}
-
+
tgt = radeonAppendInstructions(t->Program, 1);
_mesa_copy_instructions(tgt, &inst, 1);
@@ -466,8 +466,8 @@ void r300TranslateFragmentShader(r300ContextPtr r300,
_mesa_reference_program(r300->radeon.glCtx, &compiler.program, NULL);
- if (!fp->error)
- fp->translated = GL_TRUE;
+ fp->translated = GL_TRUE;
+
if (fp->error || (RADEON_DEBUG & DEBUG_PIXEL))
r300FragmentProgramDump(fp, &fp->code);
r300UpdateStateParameters(r300->radeon.glCtx, _NEW_PROGRAM);