samplerAnisotropy is still required for SamplerVulkan, which nothing creates any more #175

Open
opened 2026-10-31 14:57:58 +00:00 by jorijnvdgraaf · 0 comments

Summary

Since 6e94cc6, Sponza writes its sampler into the sampler heap from a VkSamplerCreateInfo, and nothing in the tree creates a SamplerVulkan. The library still puts samplerAnisotropy among the device features it requires, because "SamplerVulkan turns anisotropic filtering on" (implementations/Crafter.Graphics-Device.cpp:977-978). So a GPU without the feature is rejected for a sampler nobody makes. Design rule 8: the library enables only the device features its own shaders use.

The requirement cannot be dropped on its own while SamplerVulkan stays exported with anisotropyEnable = VK_TRUE (interfaces/Crafter.Graphics-SamplerVulkan.cppm:30, VUID-VkSamplerCreateInfo-anisotropyEnable-01070). SamplerVulkan also never destroys the VkSampler it creates (:40). No library shader or sampler uses anisotropy: UIRenderer::RegisterLinearClampSampler leaves it off.

Both local GPUs have the feature, so nothing fails here today.

Line numbers refer to 6e94cc6.

Suggested fix

Remove the :SamplerVulkan partition (the interface file, its ifaces entry in project.cpp and the umbrella's export import) together with the requirement. An application that wants anisotropic filtering asks for samplerAnisotropy through Device::Initialize.

Found in a code review of the #163 change.

## Summary Since `6e94cc6`, Sponza writes its sampler into the sampler heap from a `VkSamplerCreateInfo`, and nothing in the tree creates a `SamplerVulkan`. The library still puts `samplerAnisotropy` among the device features it requires, because "SamplerVulkan turns anisotropic filtering on" (`implementations/Crafter.Graphics-Device.cpp:977-978`). So a GPU without the feature is rejected for a sampler nobody makes. Design rule 8: the library enables only the device features its own shaders use. The requirement cannot be dropped on its own while `SamplerVulkan` stays exported with `anisotropyEnable = VK_TRUE` (`interfaces/Crafter.Graphics-SamplerVulkan.cppm:30`, VUID-VkSamplerCreateInfo-anisotropyEnable-01070). `SamplerVulkan` also never destroys the `VkSampler` it creates (`:40`). No library shader or sampler uses anisotropy: `UIRenderer::RegisterLinearClampSampler` leaves it off. Both local GPUs have the feature, so nothing fails here today. Line numbers refer to `6e94cc6`. ## Suggested fix Remove the `:SamplerVulkan` partition (the interface file, its `ifaces` entry in `project.cpp` and the umbrella's `export import`) together with the requirement. An application that wants anisotropic filtering asks for `samplerAnisotropy` through `Device::Initialize`. Found in a code review of the #163 change.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/Crafter.Graphics#175
No description provided.