- /*
- * 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
- * one.
- *
- * This is not a mere optimization. Wrong results will be produced if the
- * dst alpha is used, the dst format does not have alpha, and the previous
- * rendering was not flushed from the swizzled to linear buffer. For
- * example, NonPowTwo DCT.
- *
- * TODO: This should be generalized to all channels for better
- * performance, but only alpha causes correctness issues.
- *
- * Also, force rgb/alpha func/factors match, to make AoS blending easier.
- */
- if (format_desc->swizzle[3] > UTIL_FORMAT_SWIZZLE_W ||
- format_desc->swizzle[3] == format_desc->swizzle[0]) {
- /* Doesn't cover mixed snorm/unorm but can't render to them anyway */
- boolean clamped_zero = !util_format_is_float(format) &&
- !util_format_is_snorm(format);
- blend_rt->rgb_src_factor = force_dst_alpha_one(blend_rt->rgb_src_factor,
- clamped_zero);
- blend_rt->rgb_dst_factor = force_dst_alpha_one(blend_rt->rgb_dst_factor,
- clamped_zero);
- blend_rt->alpha_func = blend_rt->rgb_func;
- blend_rt->alpha_src_factor = blend_rt->rgb_src_factor;
- blend_rt->alpha_dst_factor = blend_rt->rgb_dst_factor;
+ /*
+ * 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 one.
+ *
+ * This is not a mere optimization. Wrong results will be produced if
+ * the dst alpha is used, the dst format does not have alpha, and the
+ * previous rendering was not flushed from the swizzled to linear
+ * buffer. For example, NonPowTwo DCT.
+ *
+ * TODO: This should be generalized to all channels for better
+ * performance, but only alpha causes correctness issues.
+ *
+ * Also, force rgb/alpha func/factors match, to make AoS blending
+ * easier.
+ */
+ if (format_desc->swizzle[3] > UTIL_FORMAT_SWIZZLE_W ||
+ format_desc->swizzle[3] == format_desc->swizzle[0]) {
+ /* Doesn't cover mixed snorm/unorm but can't render to them anyway */
+ boolean clamped_zero = !util_format_is_float(format) &&
+ !util_format_is_snorm(format);
+ blend_rt->rgb_src_factor =
+ force_dst_alpha_one(blend_rt->rgb_src_factor, clamped_zero);
+ blend_rt->rgb_dst_factor =
+ force_dst_alpha_one(blend_rt->rgb_dst_factor, clamped_zero);
+ blend_rt->alpha_func = blend_rt->rgb_func;
+ blend_rt->alpha_src_factor = blend_rt->rgb_src_factor;
+ blend_rt->alpha_dst_factor = blend_rt->rgb_dst_factor;
+ }
+ }
+ else {
+ /* no color buffer for this fragment output */
+ key->cbuf_format[i] = PIPE_FORMAT_NONE;
+ blend_rt->colormask = 0x0;
+ blend_rt->blend_enable = 0;