summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-01-06 13:52:22 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-01-06 13:52:22 +0000
commite32487b8a13a9efabb0359a9dde33e074e905e82 (patch)
treefbfdb33273371a5faec1de4ff97b803766eacf63 /src/mesa/state_tracker
parentaaf7ecfd816f82fef314f4f772cc53bc0ced553e (diff)
parent5b64d94390e4805e1634f0c8b5e3156e12b8b872 (diff)
Merge remote branch 'origin/mesa_7_7_branch'
Conflicts: configs/default src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/mesa/main/version.h
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 5c9be46a77..e788008dfe 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -160,13 +160,14 @@ dst_register( struct st_translate *t,
static struct ureg_src
src_register( struct st_translate *t,
gl_register_file file,
- GLuint index )
+ GLint index )
{
switch( file ) {
case PROGRAM_UNDEFINED:
return ureg_src_undef();
case PROGRAM_TEMPORARY:
+ ASSERT(index >= 0);
if (ureg_dst_is_undef(t->temps[index]))
t->temps[index] = ureg_DECL_temporary( t->ureg );
return ureg_src(t->temps[index]);
@@ -174,9 +175,15 @@ src_register( struct st_translate *t,
case PROGRAM_STATE_VAR:
case PROGRAM_NAMED_PARAM:
case PROGRAM_ENV_PARAM:
+ case PROGRAM_LOCAL_PARAM:
case PROGRAM_UNIFORM:
- case PROGRAM_CONSTANT: /* ie, immediate */
+ ASSERT(index >= 0);
return t->constants[index];
+ case PROGRAM_CONSTANT: /* ie, immediate */
+ if (index < 0)
+ return ureg_DECL_constant( t->ureg, 0 );
+ else
+ return t->constants[index];
case PROGRAM_INPUT:
return t->inputs[t->inputMapping[index]];
@@ -263,9 +270,14 @@ translate_src( struct st_translate *t,
if (SrcReg->Abs)
src = ureg_abs(src);
- if (SrcReg->RelAddr)
+ if (SrcReg->RelAddr) {
src = ureg_src_indirect( src, ureg_src(t->address[0]));
-
+ /* If SrcReg->Index was negative, it was set to zero in
+ * src_register(). Reassign it now.
+ */
+ src.Index = SrcReg->Index;
+ }
+
return src;
}
@@ -859,6 +871,7 @@ st_translate_mesa_program(
for (i = 0; i < program->Parameters->NumParameters; i++) {
switch (program->Parameters->Parameters[i].Type) {
case PROGRAM_ENV_PARAM:
+ case PROGRAM_LOCAL_PARAM:
case PROGRAM_STATE_VAR:
case PROGRAM_NAMED_PARAM:
case PROGRAM_UNIFORM: