diff options
author | Brian Paul <[email protected]> | 2008-07-29 17:15:08 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-07-29 17:15:08 -0600 |
commit | 38a62ede6c68f292615ff8eaac749e12652dbdb9 (patch) | |
tree | 58fdb14a2544525d5ba415329af3e56e0b7662e3 /src/mesa/shader/slang/slang_ir.h | |
parent | 378017417a7a0b7b8e25b6e859e9dcb92ef24ea9 (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_ir.h')
-rw-r--r-- | src/mesa/shader/slang/slang_ir.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index ba0735d64dd..61ff649e5cc 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -147,6 +147,11 @@ struct _slang_ir_storage GLuint Swizzle; GLint RefCount; /**< Used during IR tree delete */ GLboolean RelAddr; + + /** If Parent is non-null, Index is relative to parent. + * The other fields are ignored. + */ + struct _slang_ir_storage *Parent; }; typedef struct _slang_ir_storage slang_ir_storage; @@ -165,7 +170,6 @@ typedef struct slang_ir_node_ /** special fields depending on Opcode: */ const char *Field; /**< If Opcode == IR_FIELD */ - int FieldOffset; /**< If Opcode == IR_FIELD */ GLuint Writemask; /**< If Opcode == IR_MOVE */ GLfloat Value[4]; /**< If Opcode == IR_FLOAT */ slang_variable *Var; /**< If Opcode == IR_VAR or IR_VAR_DECL */ @@ -193,6 +197,20 @@ extern const slang_ir_info * _slang_ir_info(slang_ir_opcode opcode); +extern slang_ir_storage * +_slang_new_ir_storage(enum register_file file, GLint index, GLint size); + + +extern slang_ir_storage * +_slang_new_ir_storage_swz(enum register_file file, GLint index, GLint size, + GLuint swizzle); + +extern slang_ir_storage * +_slang_new_ir_storage_relative(GLint index, GLint size, + slang_ir_storage *parent); + + + extern void _slang_free_ir_tree(slang_ir_node *n); |