Sampling with mipmapped HiZ behaves unexpectedly on Gen9
iris currently prevents sampling with mipmapped HiZ buffers if any level isn't 8x4-aligned. When the alignment restriction is dropped (see !4674 (merged)), the gen9 sampler demonstrates unexpected behavior. iris is able to workaround this behavior, but this may need debugging before similar enabling happens in anv.
Consider the test group dEQP-GLES3.functional.texture.specification.tex*depth*
. A number of tests here simply upload data into different depth buffer miplevels then samples from them. Note that the sample operation occurs with HiZ, so iris prepares for this with an ambiguate operation.
Here's the result of some analysis I've done:
- If the HiZ buffer is uninitialized at the time of creation, some tests in the group fail intermittently.
- If the HiZ buffer is initialized with 0xFF or 0xF0, 35/45 tests fail. The passing tests only sample from LOD0.
- If the HiZ buffer is initialized with 0xFF, it's possible to make some tests pass by increasing the size of the ambiguate rectangle.
- If the HiZ buffer is initialized with 0xFF, it's possible to make the group pass by fast-clearing immediately before the ambiguate operation [1].
- If the HiZ buffer is initialized with 0x00 or 0x0F, all tests pass.
- I made sure to minimize the differences in the batches for the fast clear and ambiguate operations. Ambiguating twice doesn't help.