anv: Take write mask into account in has_color_buffer_write_enabled
authorAlex Smith <asmith@feralinteractive.com>
Thu, 4 Jan 2018 18:01:45 +0000 (18:01 +0000)
committerAlex Smith <asmith@feralinteractive.com>
Fri, 5 Jan 2018 15:36:22 +0000 (15:36 +0000)
commit12f4e00b69e724a23504b7bd3958fb75dc462950
tree073ed60a3e320a7fb939027091a303c6242278dc
parent0bd1c4676d93b1baf009e6d9beeedaf49b8e423d
anv: Take write mask into account in has_color_buffer_write_enabled

If we have a color attachment, but its writes are masked, this would
have still returned true. This is inconsistent with how HasWriteableRT
in 3DSTATE_PS_BLEND is set, which does take the mask into account.

This could lead to PixelShaderHasUAV not being set in 3DSTATE_PS_EXTRA
if the fragment shader does use UAVs, meaning the fragment shader may
not be invoked because HasWriteableRT is false. Specifically, this was
seen to occur when the shader also enables early fragment tests: the
fragment shader was not invoked despite passing depth/stencil.

Fix by taking the color write mask into account in this function. This
is consistent with how things are done on i965.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/genX_pipeline.c