Skip to content

anv: Fix coverage masks for VK_EXT_conservative_rasterization

Earlier, I just tried to copy what iris was doing and, as it turns out, copied it wrong. Also, Vulkan doesn't have a concept of getting the conservative coverage in the shader. The spec for SampleMask says:

"Decorating a variable with the SampleMask built-in decoration will
make any variable contain the coverage mask for the current fragment
shader invocation."

And the spec for conservative rasterization says

"When overestimate conservative rasterization is enabled, rather
than evaluating coverage at individual sample locations, a
determination is made of whether any portion of the pixel (including
its edges and corners) is covered by the primitive. If any portion
of the pixel is covered, then all bits of the coverage mask for the
fragment corresponding to that pixel are enabled."

Putting these two together and you get what the Intel HW docs say for ICMS_NORMAL:

"Input Coverage masks based on inner conservatism and factors in
SAMPLE_MASKs. If Pixel is conservatively fully covered all samples
are enabled."

So I'm pretty sure based on this that the right thing to do here is to ignore conservative rasterization and leave it set to ICMS_NORMAL whenever we're not in the post-depth-coverage special case.

Merge request reports