+ /*
+ * Alpha testing needs to be done in the color buffer precision.
+ *
+ * TODO: Ideally, instead of duplicating the color conversion code, we would do
+ * alpha testing after converting the output colors, but that's not very
+ * convenient, because it needs to be done before depth testing. Hopefully
+ * LLVM will detect and remove the duplicate expression.
+ *
+ * FIXME: This should be generalized to formats other than rgba8 variants.
+ */
+ if (type.floating &&
+ util_format_is_rgba8_variant(cbuf_format_desc)) {
+ const unsigned dst_width = 8;