summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaciej Cencora <[email protected]>2009-07-04 13:17:35 +0200
committerMaciej Cencora <[email protected]>2009-07-13 19:25:58 +0200
commit7360f83364b407e949529eeca9f8c421d2da3ded (patch)
tree8b5becd18a06c2e0cf42e17603ccaafd18e75abb /src
parent37c319f62f59d7750dd172034e43dfd489f572cc (diff)
r300: move fragment program selection before vertex program selection
Prepare for wpos and fogc handling rewrite.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 8c228ab5e7b..344f021acf6 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -2035,7 +2035,6 @@ static void r300ResetHwState(r300ContextPtr r300)
void r300UpdateShaders(r300ContextPtr rmesa)
{
GLcontext *ctx = rmesa->radeon.glCtx;
- struct r300_fragment_program *fp;
/* should only happenen once, just after context is created */
/* TODO: shouldn't we fallback to sw here? */
@@ -2044,21 +2043,34 @@ void r300UpdateShaders(r300ContextPtr rmesa)
return;
}
- if (rmesa->radeon.NewGLState && rmesa->options.hw_tcl_enabled) {
+ {
+ struct r300_fragment_program *fp;
+
+ fp = r300SelectFragmentShader(ctx);
+ if (!fp->translated)
+ r300TranslateFragmentShader(ctx, fp);
+
+ r300SwitchFallback(ctx, R300_FALLBACK_FRAGMENT_PROGRAM, fp->error);
+ }
+
+ if (rmesa->options.hw_tcl_enabled) {
struct r300_vertex_program *vp;
- int i;
- for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
- rmesa->temp_attrib[i] =
- TNL_CONTEXT(ctx)->vb.AttribPtr[i];
- TNL_CONTEXT(ctx)->vb.AttribPtr[i] =
- &rmesa->dummy_attrib[i];
- }
- _tnl_UpdateFixedFunctionProgram(ctx);
+ if (rmesa->radeon.NewGLState) {
+ int i;
+ for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
+ rmesa->temp_attrib[i] =
+ TNL_CONTEXT(ctx)->vb.AttribPtr[i];
+ TNL_CONTEXT(ctx)->vb.AttribPtr[i] =
+ &rmesa->dummy_attrib[i];
+ }
+
+ _tnl_UpdateFixedFunctionProgram(ctx);
- for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
- TNL_CONTEXT(ctx)->vb.AttribPtr[i] =
- rmesa->temp_attrib[i];
+ for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
+ TNL_CONTEXT(ctx)->vb.AttribPtr[i] =
+ rmesa->temp_attrib[i];
+ }
}
vp = r300SelectVertexShader(ctx);
@@ -2068,12 +2080,6 @@ void r300UpdateShaders(r300ContextPtr rmesa)
r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, vp->error);
}
- fp = r300SelectFragmentShader(ctx);
- if (!fp->translated)
- r300TranslateFragmentShader(ctx, fp);
-
- r300SwitchFallback(ctx, R300_FALLBACK_FRAGMENT_PROGRAM, fp->error);
-
r300UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
rmesa->radeon.NewGLState = 0;
}