Tested with following tests:
- sparse texture instruction: https://github.com/yuq/gfx/tree/master/base/gbm-surface-sparse2
- sparse image instruction: https://github.com/yuq/gfx/tree/master/base/gbm-surface-sparse2-image
- multi sample texture: https://github.com/yuq/gfx/tree/master/base/gbm-surface-sparse2-ms
gfx10+ does not support multi sample texture, but ARB_sparse_texture2 need MS texture support:
if the texture target is TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY,
or TEXTURE_3D, the virtual page size for index zero is fully implementation-
(17) Should we support sparse multisample textures? If so, should we
support standard virtual page sizes?
RESOLVED: Yes, we add will support for sparse multisample textures, but
will not specify standard page sizes.
This MR relax the requirement by just report no page size available for MS texture when GFX10+ to keep the shader query capability for GFX10+. This should fail all sparse MS texture related tests in Khronos CTS.
Khronos CTS need fix https://gerrit.khronos.org/c/vk-gl-cts/+/8587, but even so, there are still three failed tests for GFX9:
- KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup: need ARB_sparse_texture_clamp to compile the shader
- AMD GPU return (0,0,0,0) instead of (0,0,0,1) for r8 image load from uncommitted region, same problem for RADV and AMDVLK. Test case: https://github.com/yuq/gfx/tree/master/vulkan/sparse
- glGenerateMipmap() fail for GL_RGB10_A2UI format, because it returns fail for integer format
- KHR-GL46.sparse_texture2_tests.StandardPageSizes: due to spec incomplete, it allows 1D/1D_ARRAY/RENDER_BUFFER to be queried for page size and return a standard one. But it's not allowed to set these targets to be sparse texture. So this CTS require to return a standard page size for these target even it's useless. I could just add a commit to do that but it's really only for CTS and not useful.
There seems no more things could be done in this MR further. So ready for review now.