summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r600/r700_vertprog.c
diff options
context:
space:
mode:
authorRichard Li <richardradeon@gmail.com>2009-11-29 12:12:19 -0500
committerRichard Li <richardradeon@gmail.com>2009-11-29 12:33:14 -0500
commit2db72f329f35ee6e12df3ed472de2ee72cf23399 (patch)
tree7bbaef50f61b47ec367e94f9c7124ac0e4382266 /src/mesa/drivers/dri/r600/r700_vertprog.c
parentc332525ad3cf8e946e60c3f9b96af525ca4cb71c (diff)
r600 : add read port allocation for uniform;
mapping ps input based on vs output; fix bugs including constants updating for vs.
Diffstat (limited to 'src/mesa/drivers/dri/r600/r700_vertprog.c')
-rw-r--r--src/mesa/drivers/dri/r600/r700_vertprog.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c
index c8f72d588b..7715214da1 100644
--- a/src/mesa/drivers/dri/r600/r700_vertprog.c
+++ b/src/mesa/drivers/dri/r600/r700_vertprog.c
@@ -631,6 +631,14 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx)
paramList = vp->mesa_program->Base.Parameters;
if(NULL != paramList) {
+ //vp->mesa_program was cloned, not updated by glsl shader api.
+ //_mesa_reference_program has already checked glsl shProg is ok and set ctx->VertexProgem._Current
+ // so, use ctx->VertexProgem._Current
+ struct gl_program_parameter_list *paramListOrginal =
+ paramListOrginal = ctx->VertexProgram._Current->Base.Parameters;
+
+ //---------------------------
+
_mesa_load_state_parameters(ctx, paramList);
if (paramList->NumParameters > R700_MAX_DX9_CONSTS)
@@ -643,10 +651,20 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx)
unNumParamData = paramList->NumParameters;
for(ui=0; ui<unNumParamData; ui++) {
- r700->vs.consts[ui][0].f32All = paramList->ParameterValues[ui][0];
- r700->vs.consts[ui][1].f32All = paramList->ParameterValues[ui][1];
- r700->vs.consts[ui][2].f32All = paramList->ParameterValues[ui][2];
- r700->vs.consts[ui][3].f32All = paramList->ParameterValues[ui][3];
+ if(paramList->Parameters[ui].Type == PROGRAM_UNIFORM)
+ {
+ r700->vs.consts[ui][0].f32All = paramListOrginal->ParameterValues[ui][0];
+ r700->vs.consts[ui][1].f32All = paramListOrginal->ParameterValues[ui][1];
+ r700->vs.consts[ui][2].f32All = paramListOrginal->ParameterValues[ui][2];
+ r700->vs.consts[ui][3].f32All = paramListOrginal->ParameterValues[ui][3];
+ }
+ else
+ {
+ r700->vs.consts[ui][0].f32All = paramList->ParameterValues[ui][0];
+ r700->vs.consts[ui][1].f32All = paramList->ParameterValues[ui][1];
+ r700->vs.consts[ui][2].f32All = paramList->ParameterValues[ui][2];
+ r700->vs.consts[ui][3].f32All = paramList->ParameterValues[ui][3];
+ }
}
} else
r700->vs.num_consts = 0;