This can be reproduced using vkd3d tests. test_coverage() sets pSampleMask when creating a pipeline and writes shader input SampleMask to the render target. The test passes on other Vulkan implementations and on Intel D3D12 implementation. d3d12:23726:sample mask 0x7: Test failed: Got 0x00000003, expected 0x00000007 at (0, 0, 0). d3d12:23726:sample mask 0x9: Test failed: Got 0x00000001, expected 0x00000009 at (0, 0, 0). d3d12:23726:sample mask 0xd: Test failed: Got 0x00000001, expected 0x0000000d at (0, 0, 0). d3d12:23726:sample mask 0xf: Test failed: Got 0x00000003, expected 0x0000000f at (0, 0, 0). d3d12:23726:sample mask 0xff: Test failed: Got 0x00000003, expected 0x0000000f at (0, 0, 0). d3d12:23726:sample mask 0xffffffff: Test failed: Got 0x00000003, expected 0x0000000f at (0, 0, 0).
Created attachment 143510 [details] resulting image on anv Hi, sorry for the delay. I checked an output of the test in RenderDoc and saw this (see attachment). There is a diagonal of pixels having a *wrong* mask. It is happening because this test draws a big triangle which covers the whole render area and this triangle is being clipped which divides it and creates new geometry. So on this diagonal there are two fragments per one pixel and to get the right coverage you should add their coverages together. e.g. you can achieve this by having ssbo and atomic adding sample mask to the corresponding fragment's position (suggested by Lionel on irc).
(In reply to Danylo from comment #1) > Created attachment 143510 [details] > resulting image on anv > > Hi, sorry for the delay. > > I checked an output of the test in RenderDoc and saw this (see attachment). > There is a diagonal of pixels having a *wrong* mask. > > It is happening because this test draws a big triangle which covers the > whole render area and this triangle is being clipped which divides it and > creates new geometry. > > So on this diagonal there are two fragments per one pixel and to get the > right coverage you should add their coverages together. > > e.g. you can achieve this by having ssbo and atomic adding sample mask to > the corresponding fragment's position (suggested by Lionel on irc). Here is how we did it for a post depth coverage test : https://gitlab.freedesktop.org/mesa/piglit/blob/master/tests/spec/arb_post_depth_coverage/multisampling.c#L75
I should have a closer look into the issue before reporting the bug. Thanks.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.