summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_pack.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_pack.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_pack.c b/src/gallium/drivers/llvmpipe/lp_bld_pack.c
index 823d67e12d..f436f09737 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_pack.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_pack.c
@@ -39,7 +39,12 @@ lp_build_pack_rgba(LLVMBuilderRef builder,
const struct util_format_description *desc;
LLVMTypeRef type;
LLVMValueRef packed = NULL;
- unsigned shift = 0;
+ LLVMValueRef swizzles[4];
+ LLVMValueRef shifted, casted, scaled, unswizzled;
+ LLVMValueRef shifts[4];
+ LLVMValueRef scales[4];
+ bool normalized;
+ unsigned shift;
unsigned i, j;
desc = util_format_description(format);
@@ -50,10 +55,6 @@ lp_build_pack_rgba(LLVMBuilderRef builder,
type = LLVMIntType(desc->block.bits);
- LLVMValueRef swizzles[4];
- LLVMValueRef shifted, casted, scaled, unswizzled;
-
-
/* Unswizzle the color components into the source vector. */
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j) {
@@ -70,10 +71,8 @@ lp_build_pack_rgba(LLVMBuilderRef builder,
LLVMGetUndef(LLVMVectorType(LLVMFloatType(), 4)),
LLVMConstVector(swizzles, 4), "");
- LLVMValueRef shifts[4];
- LLVMValueRef scales[4];
- bool normalized = FALSE;
-
+ normalized = FALSE;
+ shift = 0;
for (i = 0; i < 4; ++i) {
unsigned bits = desc->channel[i].size;