LLVMValueRef scale_val = lp_build_const_vec(gallivm, type, scale);
input = LLVMBuildFMul(builder, input, scale_val, "");
/*
- * The formula above will produce value below -1.0 for most negative
- * value but everything seems happy with that hence disable for now.
+ * The formula above will produce value below -1.0 for most negative values.
+ * compliance requires clamping it.
+ * GTF-GL45.gtf33.GL3Tests.vertex_type_2_10_10_10_rev.vertex_type_2_10_10_10_rev_conversion.
*/
- if (0)
- input = lp_build_max(bld, input,
- lp_build_const_vec(gallivm, type, -1.0f));
+ input = lp_build_max(bld, input,
+ lp_build_const_vec(gallivm, type, -1.0f));
}
}
else if (chan_desc.pure_integer) {
tmp_type = type;
tmp_type.length = 4;
+ if (type.length == 1) {
+ LLVMValueRef fetch = lp_build_fetch_rgba_aos(gallivm, format_desc, tmp_type,
+ aligned, base_ptr, offset,
+ i, j, cache);
+
+ for (k = 0; k < 4; k++)
+ rgba_out[k] = LLVMBuildExtractElement(gallivm->builder, fetch, lp_build_const_int32(gallivm, k), "");
+ return;
+ }
+
/*
* Note that vector transpose can be worse compared to insert/extract
* for aos->soa conversion (for formats with 1 or 2 channels). However,