Commit c202d64b authored by Lionel Landwerlin's avatar Lionel Landwerlin
Browse files

anv: don't apply blending on integer color attachments


Signed-off-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: mesa/mesa#2743
Cc: <mesa-stable@lists.freedesktop.org>
parent bc12d096
Pipeline #129397 passed with stages
in 9 minutes and 40 seconds
......@@ -30,6 +30,7 @@
#include "common/gen_sample_positions.h"
#include "nir/nir_xfb_info.h"
#include "vk_util.h"
#include "vk_format.h"
#include "vk_format_info.h"
static uint32_t
......@@ -1065,7 +1066,9 @@ is_dual_src_blend_factor(VkBlendFactor factor)
static void
emit_cb_state(struct anv_graphics_pipeline *pipeline,
const VkPipelineColorBlendStateCreateInfo *info,
const VkPipelineMultisampleStateCreateInfo *ms_info)
const VkPipelineMultisampleStateCreateInfo *ms_info,
const struct anv_render_pass *pass,
const struct anv_subpass *subpass)
{
struct anv_device *device = pipeline->base.device;
const struct brw_wm_prog_data *wm_prog_data = get_wm_prog_data(pipeline);
......@@ -1154,6 +1157,19 @@ emit_cb_state(struct anv_graphics_pipeline *pipeline,
#endif
}
/* Vulkan spec says:
*
* "Blending applies only to fixed-point and floating-point color
* attachments. If the color attachment has an integer format, blending
* is not applied."
*/
const struct anv_subpass_attachment *color_attachment =
&subpass->color_attachments[binding->index];
const struct anv_render_pass_attachment *attachment =
&pass->attachments[color_attachment->attachment];
if (vk_format_is_integer(attachment->format))
entry.ColorBufferBlendEnable = false;
/* The Dual Source Blending documentation says:
*
* "If SRC1 is included in a src/dst blend factor and
......@@ -2172,7 +2188,7 @@ genX(graphics_pipeline_create)(
urb_deref_block_size);
emit_ms_state(pipeline, ms_info);
emit_ds_state(pipeline, ds_info, pass, subpass);
emit_cb_state(pipeline, cb_info, ms_info);
emit_cb_state(pipeline, cb_info, ms_info, pass, subpass);
compute_kill_pixel(pipeline, ms_info, subpass);
emit_3dstate_clip(pipeline,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment