From: Michel Dänzer <michel.daen...@amd.com>

Fixes piglit spec/ARB_sampler_objects/sampler-incomplete and
spec/EXT_texture_swizzle/depth_texture_mode_and_swizzle.

Signed-off-by: Michel Dänzer <michel.daen...@amd.com>
---
 src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c 
b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index 4eb8603..c645326 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
-- 
1.7.10.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to