summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_pack.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-07-01 18:27:39 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-07-02 11:50:00 +0100
commit37f4c2f906c8e2a6df609a190e4ca9ff028b265b (patch)
tree136b83bda6536b6d6cc83e5fef4de84996998c24 /src/gallium/auxiliary/gallivm/lp_bld_pack.c
parent8556b77c56f3f1f0e75ce46d6b5c0d84c7b4eabd (diff)
gallivm: Fix 4 x unorm8 -> 4 x float conversion.
Also fix the test.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_pack.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_pack.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_pack.c b/src/gallium/auxiliary/gallivm/lp_bld_pack.c
index dfe83b36c4..7748f8f099 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_pack.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_pack.c
@@ -430,7 +430,10 @@ lp_build_pack(LLVMBuilderRef builder,
/**
- * Truncate or expand the bitwidth
+ * Truncate or expand the bitwidth.
+ *
+ * NOTE: Getting the right sign flags is crucial here, as we employ some
+ * intrinsics that do saturation.
*/
void
lp_build_resize(LLVMBuilderRef builder,
@@ -442,7 +445,18 @@ lp_build_resize(LLVMBuilderRef builder,
LLVMValueRef tmp[LP_MAX_VECTOR_LENGTH];
unsigned i;
- assert(!src_type.floating || src_type.width == dst_type.width);
+ /*
+ * We don't support float <-> int conversion here. That must be done
+ * before/after calling this function.
+ */
+ assert(src_type.floating == dst_type.floating);
+
+ /*
+ * We don't support double <-> float conversion yet, although it could be
+ * added with little effort.
+ */
+ assert((!src_type.floating && !dst_type.floating) ||
+ src_type.width == dst_type.width);
/* We must not loose or gain channels. Only precision */
assert(src_type.length * num_srcs == dst_type.length * num_dsts);