r300: update state parameters only once per rendering operation

This commit is contained in:
Maciej Cencora 2009-07-04 12:56:31 +02:00
parent 21db37d432
commit 28066ed012
3 changed files with 3 additions and 15 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);