gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.35k stars 548 forks source link

[vk] Request VK_KHR_sampler_mirror_clamp_to_edge when Features::SAMPLER_MIRROR_CLAMP_EDGE is set #3651

Closed tangmi closed 3 years ago

tangmi commented 3 years ago

Currently the feature is checked here: https://github.com/gfx-rs/gfx/blob/a76e68713ff46f0e5a3d0c31516e20d18bf0a3ce/src/backend/vulkan/src/lib.rs#L1151-L1153

But not added to the enabled extensions list when actually opening the device here: https://github.com/gfx-rs/gfx/blob/a76e68713ff46f0e5a3d0c31516e20d18bf0a3ce/src/backend/vulkan/src/lib.rs#L780

In Vulkan 1.2 this feature has been promoted and is guaranteed to be supported. Currently gfx doesn't request the extension in < 1.2 and gfx may incorrectly say it does not have support for Features::SAMPLER_MIRROR_CLAMP_EDGE since in 1.2 support for the extension itself is optional.