Sparse textures

Well, i found some more issues, this time with sparse textures.

  1. For sparse residency textures with any of the block compression formats, vkGetPhysicalDeviceSparseImageFormatProperties and vkGetImageSparseMemoryRequirements return a count of 0. Sparse compressed textures are clearly supported, vkGetPhysicalDeviceImageFormatProperties reports that they are supported and in fact i am able to create, sparse bind, layout transition, upload and sample them with the correct results. So it seems they are just advertised wrong by the two functions. I tested BC4, BC5 and BC7 2D textures with optimal tiling, sampled and transfer_dst usage, single sample and sparse residency.

  2. In the fragment shader, the MinLod image operand for OpImageSampleImplicitLod has no effect. The feature shaderResourceMinLod is available and was used to create the device, the texture is only partly bound and filled, but the MinLod operand set to the lowest bound mipmap does not prevent the sampling of unbound mipmaps (indicated by the texture going black since my GPU supports residencyNonResidentStrict). Restricting VkSamplerCreateInfo::minLod for the used sampler directly avoids this. This issue is a little tricky because the SPIR-V code for the fragment shader comes from the VulkanSDK glslangValidator, which seems to generate invalid code by looking at the disassembly. Specifically, it does not generate OpCapability MinLod, even though it does add OpSourceExtension “GL_ARB_sparse_texture_clamp”, and it uses OpExecutionMode %4 OriginLowerLeft, which is invalid according to the Vulkan spec (the driver is ignoring this and uses upper left regardless). But the issue persisted even after manually fixing those two bugs in the SPIR-V code. The sampling itself works, just the MinLod operand is ignored.

Test system was again Win7 SP1 x64 with a GTX 970 with driver 356.45.

Again, if you need more information i’ll be glad to supply what i can.

Thank you for reporting this.

Could you verify whether those issues also exist with our just released 364.47 WHQL driver?

Regards,

Mathias

I just installed the 364.47 WHQL driver and i can verify that both issues are still present.

  1. has been fixed internally and will end up in a future driver release.
  2. is under investigation.

Thanks again for reporting those issues!

Regards,

Mathias

Thanks for fixing these issues in such a short cycle! If you require more information to resolve issue 2, please let me know.

If feasible, could you share the shader for issue 2) (e.g. via private message)

Thanks,

Mathias