diff options
author | Ilia Mirkin <[email protected]> | 2014-07-21 21:18:14 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-05-16 14:51:23 +0200 |
commit | dfc3bced2ceebd1e3abacd07acd83f932b45c639 (patch) | |
tree | a9035bd42ec2b228491cdc161653826bad385356 /src/gallium/auxiliary/tgsi/tgsi_ureg.c | |
parent | ec67d73a73f74011b33f6ab59bed4c88ebaa7497 (diff) |
tgsi/ureg: allow ureg_dst to have dimension indices
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_ureg.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 55d8cf1eeb0..7a8bf5404e3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -914,8 +914,8 @@ void ureg_emit_dst( struct ureg_program *ureg, struct ureg_dst dst ) { - unsigned size = (1 + - (dst.Indirect ? 1 : 0)); + unsigned size = 1 + (dst.Indirect ? 1 : 0) + + (dst.Dimension ? (dst.DimIndirect ? 2 : 1) : 0); union tgsi_any_token *out = get_tokens( ureg, DOMAIN_INSN, size ); unsigned n = 0; @@ -944,6 +944,26 @@ ureg_emit_dst( struct ureg_program *ureg, n++; } + if (dst.Dimension) { + out[0].dst.Dimension = 1; + out[n].dim.Dimension = 0; + out[n].dim.Padding = 0; + if (dst.DimIndirect) { + out[n].dim.Indirect = 1; + out[n].dim.Index = dst.DimensionIndex; + n++; + out[n].value = 0; + out[n].ind.File = dst.DimIndFile; + out[n].ind.Swizzle = dst.DimIndSwizzle; + out[n].ind.Index = dst.DimIndIndex; + out[n].ind.ArrayID = dst.ArrayID; + } else { + out[n].dim.Indirect = 0; + out[n].dim.Index = dst.DimensionIndex; + } + n++; + } + assert(n == size); } |