summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-07-22 00:39:00 +0100
committerKeith Whitwell <keithw@vmware.com>2009-07-22 12:42:09 +0100
commitfd31f92cea0ce8613a22d8f4b3c75b340bcc5689 (patch)
tree719c361c346d88cf89ce82754dddf7473f8e2b95 /src/gallium/drivers/r300
parent5e3c62b550407111cf5f7a700abb18f947bd6903 (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/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_fs.c3
-rw-r--r--src/gallium/drivers/r300/r300_vs.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index 4b304306d0..8672e211bc 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -67,8 +67,7 @@ void r300_translate_fragment_shader(struct r300_context* r300,
for (i = 0; i < 4; i++) {
consts->constants[assembler->imm_offset +
assembler->imm_count][i] =
- parser.FullToken.FullImmediate.u.ImmediateFloat32[i]
- .Float;
+ parser.FullToken.FullImmediate.u[i].Float;
}
assembler->imm_count++;
break;
diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c
index f87435f9f0..a664a316e8 100644
--- a/src/gallium/drivers/r300/r300_vs.c
+++ b/src/gallium/drivers/r300/r300_vs.c
@@ -378,8 +378,7 @@ void r300_translate_vertex_shader(struct r300_context* r300,
for (i = 0; i < 4; i++) {
consts->constants[assembler->imm_offset +
assembler->imm_count][i] =
- parser.FullToken.FullImmediate.u.ImmediateFloat32[i]
- .Float;
+ parser.FullToken.FullImmediate.u[i].Float;
}
assembler->imm_count++;
break;