summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Cencora <[email protected]>2009-07-04 12:56:31 +0200
committerMaciej Cencora <[email protected]>2009-07-13 19:25:56 +0200
commit28066ed012b51f2171866669a2972bc7ee293565 (patch)
treed31b35711225b05002bce573eac3ed72ec5b98de
parent21db37d43245f97032fa21030279c3b47c901639 (diff)
r300: update state parameters only once per rendering operation
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog_common.c11
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c6
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.h1
3 files changed, 3 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
index abc8757ba1f..1644e6f42af 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
@@ -50,13 +50,6 @@
#include "radeon_program.h"
#include "radeon_program_alu.h"
-static void update_params(GLcontext *ctx, struct gl_fragment_program *fp)
-{
- /* Ask Mesa nicely to fill in ParameterValues for us */
- if (fp->Base.Parameters)
- _mesa_load_state_parameters(ctx, fp->Base.Parameters);
-}
-
static void nqssadce_init(struct nqssadce_state* s)
{
s->Outputs[FRAG_RESULT_COLOR].Sourced = WRITEMASK_XYZW;
@@ -281,11 +274,7 @@ void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
r300_fp->translated = GL_TRUE;
- r300UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
-
if (r300_fp->error || (RADEON_DEBUG & DEBUG_PIXEL))
r300->vtbl.FragmentProgramDump(&r300_fp->code);
}
-
- update_params(ctx, fp);
}
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index c0eda977db8..67bd6ec33be 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -1093,7 +1093,7 @@ r300FetchStateParameter(GLcontext * ctx,
* Update R300's own internal state parameters.
* For now just STATE_R300_WINDOW_DIMENSION
*/
-void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state)
+static void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state)
{
struct r300_fragment_program *fp;
struct gl_program_parameter_list *paramList;
@@ -1111,6 +1111,8 @@ void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state)
if (!paramList)
return;
+ _mesa_load_state_parameters(ctx, paramList);
+
for (i = 0; i < paramList->NumParameters; i++) {
if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) {
r300FetchStateParameter(ctx,
@@ -2323,8 +2325,6 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
R300_STATECHANGE(r300, cb);
}
- r300UpdateStateParameters(ctx, new_state);
-
r300->radeon.NewGLState |= new_state;
}
diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h
index 23282894202..d46bf9f1796 100644
--- a/src/mesa/drivers/dri/r300/r300_state.h
+++ b/src/mesa/drivers/dri/r300/r300_state.h
@@ -52,7 +52,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
void r300UpdateViewportOffset (GLcontext * ctx);
void r300UpdateDrawBuffer (GLcontext * ctx);
-void r300UpdateStateParameters (GLcontext * ctx, GLuint new_state);
void r300UpdateShaders (r300ContextPtr rmesa);
void r300UpdateShaderStates (r300ContextPtr rmesa);
void r300InitState (r300ContextPtr r300);