summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi/exec
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-04-11 15:02:21 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-04-11 15:02:21 -0600
commit7c2416f06e518bc1491fe13e145dcc9487d75449 (patch)
tree843ab9262691a74e2ae414b183e35b9febe70fff /src/gallium/auxiliary/tgsi/exec
parente3cf0cd6a9f3f072594e5712763b98ce7e579bcf (diff)
gallium: handle TGSI immediates in SSE code for vertex shaders
Diffstat (limited to 'src/gallium/auxiliary/tgsi/exec')
-rwxr-xr-xsrc/gallium/auxiliary/tgsi/exec/tgsi_sse2.c23
-rwxr-xr-xsrc/gallium/auxiliary/tgsi/exec/tgsi_sse2.h4
2 files changed, 22 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c
index 748c53dbfc..e55fae6047 100755
--- a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c
+++ b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c
@@ -2316,10 +2316,12 @@ emit_declaration(
unsigned
tgsi_emit_sse2(
struct tgsi_token *tokens,
- struct x86_function *func )
+ struct x86_function *func,
+ float (*immediates)[4] )
{
struct tgsi_parse_context parse;
unsigned ok = 1;
+ uint num_immediates = 0;
DUMP_START();
@@ -2341,6 +2343,10 @@ tgsi_emit_sse2(
func,
get_temp_base(),
get_argument( 3 ) );
+ emit_mov(
+ func,
+ get_immediate_base(),
+ get_argument( 4 ) );
tgsi_parse_init( &parse, tokens );
@@ -2363,9 +2369,18 @@ tgsi_emit_sse2(
break;
case TGSI_TOKEN_TYPE_IMMEDIATE:
- /* XXX implement this */
- ok = 0;
- debug_printf("failed to emit immediate value to SSE\n");
+ /* simply copy the immediate values into the next immediates[] slot */
+ {
+ const uint size = parse.FullToken.FullImmediate.Immediate.Size - 1;
+ uint i;
+ assert(size <= 4);
+ assert(num_immediates < TGSI_EXEC_NUM_IMMEDIATES);
+ for( i = 0; i < size; i++ ) {
+ immediates[num_immediates][i] =
+ parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float;
+ }
+ num_immediates++;
+ }
break;
default:
diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h
index fde06047fe..d1190727d0 100755
--- a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h
+++ b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h
@@ -11,7 +11,9 @@ struct x86_function;
unsigned
tgsi_emit_sse2(
struct tgsi_token *tokens,
- struct x86_function *function );
+ struct x86_function *function,
+ float (*immediates)[4]
+ );
unsigned
tgsi_emit_sse2_fs(