"");
/* Scale bits */
- chans[j] = scale_bits(gallivm, src_fmt->channel[j].size, blend_type.width, chans[j], src_type);
+ if (src_type.norm) {
+ chans[j] = scale_bits(gallivm, src_fmt->channel[j].size,
+ blend_type.width, chans[j], src_type);
+ }
/* Insert bits into correct position */
chans[j] = LLVMBuildShl(builder,
"");
/* Scale down bits */
- chans[j] = scale_bits(gallivm, blend_type.width, src_fmt->channel[j].size, chans[j], src_type);
+ if (src_type.norm) {
+ chans[j] = scale_bits(gallivm, blend_type.width,
+ src_fmt->channel[j].size, chans[j], src_type);
+ }
/* Insert bits */
chans[j] = LLVMBuildShl(builder,
}
}
+ if (util_format_is_pure_integer(out_format)) {
+ /*
+ * In this case fs_type was really ints or uints disguised as floats,
+ * fix that up now.
+ */
+ fs_type.floating = 0;
+ fs_type.sign = dst_type.sign;
+ for (i = 0; i < num_fs; ++i) {
+ for (j = 0; j < dst_channels; ++j) {
+ fs_src[i][j] = LLVMBuildBitCast(builder, fs_src[i][j],
+ lp_build_vec_type(gallivm, fs_type), "");
+ }
+ if (dst_channels == 3 && !has_alpha) {
+ fs_src[i][3] = LLVMBuildBitCast(builder, fs_src[i][3],
+ lp_build_vec_type(gallivm, fs_type), "");
+ }
+ }
+ }
+
/*
* Pixel twiddle from fragment shader order to memory order
}
}
- key->alpha.enabled = lp->depth_stencil->alpha.enabled;
+ /* alpha test only applies if render buffer 0 is non-integer (or does not exist) */
+ if (!lp->framebuffer.nr_cbufs ||
+ !util_format_is_pure_integer(lp->framebuffer.cbufs[0]->format)) {
+ key->alpha.enabled = lp->depth_stencil->alpha.enabled;
+ }
if(key->alpha.enabled)
key->alpha.func = lp->depth_stencil->alpha.func;
/* alpha.ref_value is passed in jit_context */
*/
blend_rt->colormask &= util_format_colormask(format_desc);
+ /*
+ * Disable blend for integer formats.
+ */
+ if (util_format_is_pure_integer(format)) {
+ blend_rt->blend_enable = 0;
+ }
+
/*
* Our swizzled render tiles always have an alpha channel, but the linear
* render target format often does not, so force here the dst alpha to be