gfx-rs/gfx

samplerFilterMinmax enabled by default

brannegan opened this issue · 6 comments

Short info header:

  • GFX version: gfx-backend-vulkan 0.7.0
  • OS: Arch Linux
  • GPU: GeForce GT 730
    Gfx and wgpu-rs examples fails with "Unknown device creation error: ERROR_FEATURE_NOT_PRESENT".
    Short investigation showed me that samplerFilterMinmax feature enabled by default here
    but for my GPU this feature is not supported.

vulkaninfo cut:
VkPhysicalDeviceVulkan12Properties:
driverID = DRIVER_ID_NVIDIA_PROPRIETARY
driverName = NVIDIA
driverInfo = 460.56
conformanceVersion = 1.2.4.0
VkPhysicalDeviceVulkan12Features:
...
runtimeDescriptorArray = true
samplerFilterMinmax = false
scalarBlockLayout = true
...

kvark commented

Oh snap, thank you for filing!
So Vulkan 1.2 includes the extension in the core, but there is still a flag to check, which we missed.
Would you want to make a PR to fix this? That would be wonderful!

What happens when sampler_filter_minmax is not supported? Since it (and imagless_framebuffer) aren't in hal::Features, would a user of gfx be able to tell if the support is available?

kvark commented

@tangmi I was thinking that we'd just not expose ImageFeature::SAMPLED_MINMAX in this case in any format.

@kvark I assume the image format feature flags we get from Vulkan just won't have SAMPLED_IMAGE_FILTER_MINMAX if the device feature is disabled.

This was definitely my mistake from the device creation refactor, I think the PR I opened addresses it.

kvark commented

@tangmi I'm afraid this may be a bit trickier than this. Vulkan clients are expected to ignore the flags they aren't supposed to know about. So if the client (which is gfx-backend-vulkan in our case) doesn't request any sampler reduction feature/extension, they can still get the format feature bits, but they are supposed to ignore them :/
This means even with the PR you made, gfx may return the SAMPLED_IMAGE_FILTER_MINMAX feature on some formats, erroneously.

@kvark Aight I'll make a follow-up PR soon to plumb supports_sampler_filter_minmax through to the image features functions