diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-10-26 19:31:35 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-10-26 19:31:35 -0600 |
commit | bafbfb4dce7a10fe91c8e0564750e69358ac9461 (patch) | |
tree | db1e3c3ebdaa36456bdff5b5b4d6a5bebde2fe60 /src/mesa/pipe/tgsi/exec/tgsi_exec.c | |
parent | 19710c95da683097372aa54b7538eaa2de778aa5 (diff) |
Fix up handling of immediate values for TGSI shaders.
Still disabled pending LLVM updates.
Diffstat (limited to 'src/mesa/pipe/tgsi/exec/tgsi_exec.c')
-rw-r--r-- | src/mesa/pipe/tgsi/exec/tgsi_exec.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/mesa/pipe/tgsi/exec/tgsi_exec.c index 66a81b4bd8..f577f004d7 100644 --- a/src/mesa/pipe/tgsi/exec/tgsi_exec.c +++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.c @@ -170,24 +170,16 @@ tgsi_exec_prepare( struct tgsi_exec_machine *mach ) break; case TGSI_TOKEN_TYPE_IMMEDIATE: -#if 0 - assert( (parse.FullToken.FullImmediate.Immediate.Size - 1) % 4 == 0 ); - assert( mach->ImmLimit + (parse.FullToken.FullImmediate.Immediate.Size - 1) / 4 <= 256 ); + { + uint size = parse.FullToken.FullImmediate.Immediate.Size - 1; + assert( size % 4 == 0 ); + assert( mach->ImmLimit + size / 4 <= 256 ); - for( i = 0; i < parse.FullToken.FullImmediate.Immediate.Size - 1; i++ ) { - mach->Imms[mach->ImmLimit + i / 4][i % 4] = parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float; - } - mach->ImmLimit += (parse.FullToken.FullImmediate.Immediate.Size - 1) / 4; -#else - /* Add this immediate value (vector of 1,2,3,4 floats) to immediates array */ - assert( parse.FullToken.FullImmediate.Immediate.Size <= 4 ); - assert( mach->ImmLimit < TGSI_EXEC_NUM_IMMEDIATES ); - - for( i = 0; i < parse.FullToken.FullImmediate.Immediate.Size; i++ ) { - mach->Imms[mach->ImmLimit][i] = parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float; + for( i = 0; i < size; i++ ) { + mach->Imms[mach->ImmLimit + i / 4][i % 4] = parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float; + } + mach->ImmLimit += size / 4; } - mach->ImmLimit++; -#endif break; case TGSI_TOKEN_TYPE_INSTRUCTION: |