summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2013-01-21 19:08:24 +0100
committerMichel Dänzer <[email protected]>2013-01-22 18:50:02 +0100
commita56dfd99e2cf2b7a0916cb59d2866303a627b02f (patch)
tree98f9b25babd8a9845ef008e426a12aba0cd89163 /src/gallium
parent121d19de920212225586c9269f2d34ab7e6e1aec (diff)
radeon/llvm: Handle LP_CHAN_ALL in emit_fetch_immediate().
Fixes piglit spec/ARB_sampler_objects/sampler-incomplete and spec/EXT_texture_swizzle/depth_texture_mode_and_swizzle. Reviewed-by: Tom Stellard <[email protected]> Signed-off-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index 4eb860307df..c645326e610 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -125,7 +125,17 @@ emit_fetch_immediate(
}
struct lp_build_tgsi_soa_context *bld = lp_soa_context(bld_base);
- return LLVMConstBitCast(bld->immediates[reg->Register.Index][swizzle], ctype);
+ if (swizzle == ~0) {
+ LLVMValueRef values[TGSI_NUM_CHANNELS] = {};
+ unsigned chan;
+ for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
+ values[chan] = LLVMConstBitCast(bld->immediates[reg->Register.Index][chan], ctype);
+ }
+ return lp_build_gather_values(bld_base->base.gallivm, values,
+ TGSI_NUM_CHANNELS);
+ } else {
+ return LLVMConstBitCast(bld->immediates[reg->Register.Index][swizzle], ctype);
+ }
}
static LLVMValueRef