summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_ureg.h
diff options
context:
space:
mode:
authorChristian König <[email protected]>2013-03-10 13:44:25 +0100
committerChristian König <[email protected]>2013-03-19 13:38:32 +0100
commit506d40027566fb5ad0718f3f20e42cb8fbc1e742 (patch)
tree92ffd9a0363a50996fe4c1ddbb5d6266be453371 /src/gallium/auxiliary/tgsi/tgsi_ureg.h
parent52947b93b22cad46f4a010468cd0179662419b6a (diff)
tgsi/ureg: implement support for array temporaries
Don't bother with free temporaries, just allocate them at the end and also emit them in their own declaration. Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_ureg.h')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.h38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index fb663e9c07e..cd140de6ba9 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -71,17 +71,17 @@ struct ureg_src
*/
struct ureg_dst
{
- unsigned File : 4; /* TGSI_FILE_ */
- unsigned WriteMask : 4; /* TGSI_WRITEMASK_ */
- unsigned Indirect : 1; /* BOOL */
- unsigned Saturate : 1; /* BOOL */
- unsigned Predicate : 1;
- unsigned PredNegate : 1; /* BOOL */
- unsigned PredSwizzleX: 2; /* TGSI_SWIZZLE_ */
- unsigned PredSwizzleY: 2; /* TGSI_SWIZZLE_ */
- unsigned PredSwizzleZ: 2; /* TGSI_SWIZZLE_ */
- unsigned PredSwizzleW: 2; /* TGSI_SWIZZLE_ */
- int Index : 16; /* SINT */
+ unsigned File : 4; /* TGSI_FILE_ */
+ unsigned WriteMask : 4; /* TGSI_WRITEMASK_ */
+ unsigned Indirect : 1; /* BOOL */
+ unsigned Saturate : 1; /* BOOL */
+ unsigned Predicate : 1;
+ unsigned PredNegate : 1; /* BOOL */
+ unsigned PredSwizzleX : 2; /* TGSI_SWIZZLE_ */
+ unsigned PredSwizzleY : 2; /* TGSI_SWIZZLE_ */
+ unsigned PredSwizzleZ : 2; /* TGSI_SWIZZLE_ */
+ unsigned PredSwizzleW : 2; /* TGSI_SWIZZLE_ */
+ int Index : 16; /* SINT */
int IndirectIndex : 16; /* SINT */
int IndirectSwizzle : 2; /* TGSI_SWIZZLE_ */
};
@@ -280,6 +280,14 @@ ureg_DECL_temporary( struct ureg_program * );
struct ureg_dst
ureg_DECL_local_temporary( struct ureg_program * );
+/**
+ * Declare "size" continuous temporary registers.
+ */
+struct ureg_dst
+ureg_DECL_array_temporary( struct ureg_program *,
+ unsigned size,
+ boolean local );
+
void
ureg_release_temporary( struct ureg_program *ureg,
struct ureg_dst tmp );
@@ -1094,6 +1102,14 @@ ureg_src_dimension_indirect( struct ureg_src reg, struct ureg_src addr,
}
static INLINE struct ureg_dst
+ureg_dst_array_offset( struct ureg_dst reg, int offset )
+{
+ assert(reg.File == TGSI_FILE_TEMPORARY);
+ reg.Index += offset;
+ return reg;
+}
+
+static INLINE struct ureg_dst
ureg_dst( struct ureg_src src )
{
struct ureg_dst dst;