diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-07-22 00:39:00 +0100 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-07-22 12:42:09 +0100 |
commit | fd31f92cea0ce8613a22d8f4b3c75b340bcc5689 (patch) | |
tree | 719c361c346d88cf89ce82754dddf7473f8e2b95 /src/gallium/auxiliary/tgsi/tgsi_dump.c | |
parent | 5e3c62b550407111cf5f7a700abb18f947bd6903 (diff) |
gallium: simplify tgsi_full_immediate struct
Remove the need to have a pointer in this struct by just including
the immediate data inline. Having a pointer in the struct introduces
complications like needing to alloc/free the data pointed to, uncertainty
about who owns the data, etc. There doesn't seem to be a need for it,
and it is unlikely to make much difference plus or minus to performance.
Added some asserts as we now will trip up on immediates with more
than four elements. There were actually already quite a few such asserts,
but the >4 case could be used in the future to specify indexable immediate
ranges, such as lookup tables.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_dump.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_dump.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index a6994ecd48..e1cd8479cb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -295,10 +295,12 @@ iter_immediate( ENM( imm->Immediate.DataType, immediate_type_names ); TXT( " { " ); + + assert( imm->Immediate.NrTokens <= 4 + 1 ); for (i = 0; i < imm->Immediate.NrTokens - 1; i++) { switch (imm->Immediate.DataType) { case TGSI_IMM_FLOAT32: - FLT( imm->u.ImmediateFloat32[i].Float ); + FLT( imm->u[i].Float ); break; default: assert( 0 ); |