diff options
author | Marek Olšák <[email protected]> | 2014-05-06 13:57:31 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-05-10 13:58:46 +0200 |
commit | bd2df40a848c2641c70fed5e1a452938dd8eb7cb (patch) | |
tree | 3128170cb2a54dbc410c5de7c857ab9e6c480825 /src/gallium | |
parent | 250aa93e230d56aa555eaa45f3a50a8d164afb63 (diff) |
radeon/llvm: add support for non-scalar system values
The sample position is one of them.
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c index 60ade78b5f2..f8be0df94cf 100644 --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c @@ -218,7 +218,13 @@ static LLVMValueRef fetch_system_value( unsigned swizzle) { struct radeon_llvm_context * ctx = radeon_llvm_context(bld_base); + struct gallivm_state *gallivm = bld_base->base.gallivm; + LLVMValueRef cval = ctx->system_values[reg->Register.Index]; + if (LLVMGetTypeKind(LLVMTypeOf(cval)) == LLVMVectorTypeKind) { + cval = LLVMBuildExtractElement(gallivm->builder, cval, + lp_build_const_int32(gallivm, swizzle), ""); + } return bitcast(bld_base, type, cval); } |