diff options
author | Zack Rusin <[email protected]> | 2010-06-11 10:35:24 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2010-06-11 10:35:24 -0400 |
commit | 23969670387bc0bb7d0761936905e5eb4df963dc (patch) | |
tree | c18dafe1c955c6d8680a5877c8db690d751b4f4f /src/gallium/auxiliary/tgsi/tgsi_ureg.h | |
parent | 27bc2de5461c1d66c8e005b35de77e7b9e214754 (diff) |
tgsi: support 2d indirect addressing
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_ureg.h')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.h | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index 055545f3d2a..07fb01ab7b3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -49,14 +49,18 @@ struct ureg_src unsigned SwizzleZ : 2; /* TGSI_SWIZZLE_ */ unsigned SwizzleW : 2; /* TGSI_SWIZZLE_ */ unsigned Indirect : 1; /* BOOL */ + unsigned DimIndirect : 1; /* BOOL */ unsigned Dimension : 1; /* BOOL */ unsigned Absolute : 1; /* BOOL */ unsigned Negate : 1; /* BOOL */ int Index : 16; /* SINT */ - unsigned IndirectFile : 4; /* TGSI_FILE_ */ - int IndirectIndex : 16; /* SINT */ - unsigned IndirectSwizzle : 2; /* TGSI_SWIZZLE_ */ - int DimensionIndex : 16; /* SINT */ + unsigned IndirectFile : 4; /* TGSI_FILE_ */ + int IndirectIndex : 16; /* SINT */ + unsigned IndirectSwizzle : 2; /* TGSI_SWIZZLE_ */ + int DimensionIndex : 16; /* SINT */ + unsigned DimIndFile : 4; /* TGSI_FILE_ */ + int DimIndIndex : 16; /* SINT */ + unsigned DimIndSwizzle : 2; /* TGSI_SWIZZLE_ */ }; /* Very similar to a tgsi_dst_register, removing unsupported fields @@ -821,12 +825,28 @@ ureg_src_indirect( struct ureg_src reg, struct ureg_src addr ) return reg; } -static INLINE struct ureg_src +static INLINE struct ureg_src ureg_src_dimension( struct ureg_src reg, int index ) { assert(reg.File != TGSI_FILE_NULL); reg.Dimension = 1; + reg.DimIndirect = 0; + reg.DimensionIndex = index; + return reg; +} + + +static INLINE struct ureg_src +ureg_src_dimension_indirect( struct ureg_src reg, struct ureg_src addr, + int index ) +{ + assert(reg.File != TGSI_FILE_NULL); + reg.Dimension = 1; + reg.DimIndirect = 1; reg.DimensionIndex = index; + reg.DimIndFile = addr.File; + reg.DimIndIndex = addr.Index; + reg.DimIndSwizzle = addr.SwizzleX; return reg; } @@ -874,6 +894,10 @@ ureg_src_register(unsigned file, src.Negate = 0; src.Dimension = 0; src.DimensionIndex = 0; + src.DimIndirect = 0; + src.DimIndFile = TGSI_FILE_NULL; + src.DimIndIndex = 0; + src.DimIndSwizzle = 0; return src; } @@ -897,6 +921,10 @@ ureg_src( struct ureg_dst dst ) src.Negate = 0; src.Dimension = 0; src.DimensionIndex = 0; + src.DimIndirect = 0; + src.DimIndFile = TGSI_FILE_NULL; + src.DimIndIndex = 0; + src.DimIndSwizzle = 0; return src; } @@ -944,7 +972,11 @@ ureg_src_undef( void ) src.Negate = 0; src.Dimension = 0; src.DimensionIndex = 0; - + src.DimIndirect = 0; + src.DimIndFile = TGSI_FILE_NULL; + src.DimIndIndex = 0; + src.DimIndSwizzle = 0; + return src; } |