diff options
author | Dave Airlie <[email protected]> | 2018-08-27 02:03:41 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-08-30 00:15:40 +0100 |
commit | bb17ae49ee2591a4a35479ed6e48cb3c18422e2a (patch) | |
tree | 967e58d081a09538156b4f6a67d46fa2bd97c36c /src/gallium/auxiliary/gallivm/lp_bld_tgsi.c | |
parent | 3bcec6cf1c4a535ce00efa6a1754a7dc668f8f51 (diff) |
gallivm: allow to pass two swizzles into fetches.
This hijacks the top 16-bits of swizzle, to pass in the swizzle
for the second channel.
This fixes handling .yx swizzles of 64-bit values.
This should fixup radeonsi and llvmpipe.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107524
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_tgsi.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c index 64d2cd703be..2c3be8fb127 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.c @@ -353,6 +353,15 @@ lp_build_emit_fetch_src( assert(0 && "invalid swizzle in emit_fetch()"); return bld_base->base.undef; } + if (tgsi_type_is_64bit(stype)) { + unsigned swizzle2; + swizzle2 = tgsi_util_get_full_src_register_swizzle(reg, chan_index + 1); + if (swizzle2 > 3) { + assert(0 && "invalid swizzle in emit_fetch()"); + return bld_base->base.undef; + } + swizzle |= (swizzle2 << 16); + } } assert(reg->Register.Index <= bld_base->info->file_max[reg->Register.File]); |