diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-07-18 14:44:01 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-07-18 14:46:42 -0600 |
commit | 7218626cf5ecc00fc7ef994253c20c9a2df35cc2 (patch) | |
tree | eaae6494ed8de6a058aa968bc8c2e33ba2b08efb /src/mesa/shader/slang/slang_ir.h | |
parent | a4fd90e3255ea531f2fe0693f00f342f4610cae3 (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 ba0735d64d..61ff649e5c 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); |