summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_pack.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-07-29 07:58:27 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:21 +0100
commit833323b8d02a08b4f53847a521e14c707efd8beb (patch)
treeaa1f57b46862a9abaf2b120a8987a9f754022fc7 /src/gallium/drivers/llvmpipe/lp_bld_pack.c
parentc4903ee27f29b39a493701d35b38941249117a54 (diff)
llvmpipe: Separate pixel packing/unpacking from loading/storing.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_pack.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_pack.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_pack.c b/src/gallium/drivers/llvmpipe/lp_bld_pack.c
index 2383a07d72..823d67e12d 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_pack.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_pack.c
@@ -31,10 +31,9 @@
#include "lp_bld.h"
-void
+LLVMValueRef
lp_build_pack_rgba(LLVMBuilderRef builder,
enum pipe_format format,
- LLVMValueRef ptr,
LLVMValueRef rgba)
{
const struct util_format_description *desc;
@@ -121,12 +120,12 @@ lp_build_pack_rgba(LLVMBuilderRef builder,
}
}
- if (packed) {
+ if (!packed)
+ packed = LLVMGetUndef(LLVMInt32Type());
- if (desc->block.bits < 32)
- packed = LLVMBuildTrunc(builder, packed, type, "");
+ if (desc->block.bits < 32)
+ packed = LLVMBuildTrunc(builder, packed, type, "");
- LLVMBuildStore(builder, packed, LLVMBuildBitCast(builder, ptr, LLVMPointerType(type, 0), ""));
- }
+ return packed;
}