summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_builtin.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-07-29 17:15:08 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-07-29 17:15:08 -0600
commit38a62ede6c68f292615ff8eaac749e12652dbdb9 (patch)
tree58fdb14a2544525d5ba415329af3e56e0b7662e3 /src/mesa/shader/slang/slang_builtin.c
parent378017417a7a0b7b8e25b6e859e9dcb92ef24ea9 (diff)
mesa: rework array/struct addressing code.
The slang_ir_storage type now has a pointer to parent storage to represent storage of an array element within an array, or a field within a struct. This fixes some problems related to addressing of fields/elements in non- trivial cases. More work to follow.
Diffstat (limited to 'src/mesa/shader/slang/slang_builtin.c')
-rw-r--r--src/mesa/shader/slang/slang_builtin.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c
index f0f59aa87a..f99a59e3e1 100644
--- a/src/mesa/shader/slang/slang_builtin.c
+++ b/src/mesa/shader/slang/slang_builtin.c
@@ -35,6 +35,7 @@
#include "shader/prog_parameter.h"
#include "shader/prog_statevars.h"
#include "shader/slang/slang_ir.h"
+#include "shader/slang/slang_emit.h"
#include "shader/slang/slang_builtin.h"
@@ -438,8 +439,13 @@ _slang_alloc_statevar(slang_ir_node *n,
pos = lookup_statevar(var, index1, index2, field, &swizzle, paramList);
assert(pos >= 0);
if (pos >= 0) {
- n0->Store->Index = pos;
- n0->Store->Swizzle = swizzle;
+ /* XXX should overwrite Store's fields instead of changing pointers
+ * since there may be a child storage_info pointing to this one.
+ */
+ n0->Store = _slang_new_ir_storage_swz(PROGRAM_STATE_VAR,
+ pos,
+ n0->Store->Size,
+ swizzle);
}
return pos;
}