radeon/llvm: add support for non-scalar system values

The sample position is one of them.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Marek Olšák 2014-05-06 13:57:31 +02:00
parent 250aa93e23
commit bd2df40a84
1 changed files with 6 additions and 0 deletions

View File

@ -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);
}