fix(device): stop requiring samplerAnisotropy, and remove SamplerVulkan, the class it was required for
Device::Initialize counted samplerAnisotropy among the library's own
features because SamplerVulkan turned anisotropic filtering on (#168).
Nothing in this repository has made a SamplerVulkan since 6e94cc6,
which replaced Sponza's with a sampler-heap write. So Initialize
enabled the feature for every application where the GPU had it, and
skipped a GPU without it, for a class this repository no longer used.
Design rule 8 has the library enable only the device features its own
shaders use.
SamplerVulkan: removed. #168's other suggestion keeps it, with
deferred deletion, a clamp to maxSamplerAnisotropy and anisotropy left
to the application. But the VkSampler it makes has no way into the
heap, which takes a sampler's create-info rather than a sampler
object: vkWriteSamplerDescriptorsEXT writes the descriptor straight
from the VkSamplerCreateInfo. In descriptor-set mode the heap makes
each slot's VkSampler itself, in DescriptorHeapVulkan::WriteSamplerSets,
from the same create-info. A class that fitted the heap would hold a
SamplerSlot and that write; a one-call sampler write for code without
a UIRenderer is #177's, which asks for heap-mode writers on
DescriptorHeapVulkan for images, buffers and samplers alike. The
partition leaves project.cpp's ifaces and the umbrella module.
Device: samplerAnisotropy leaves the library's features. No sampler
the library, its tests or its examples make sets anisotropyEnable. An
application that wants anisotropic filtering asks Device::Initialize
for the feature.
Docs: AGENTS.template.md counts 40 partitions and no longer lists
:SamplerVulkan. AGENTS.consumer.md describes samplers as slots written
from a create-info: through UIRenderer::RegisterSampler, or, without a
UIRenderer, through vkWriteSamplerDescriptorsEXT as Sponza does, or
WriteSamplerSets in descriptor-set mode. It says that anisotropyEnable
needs .vulkan10.samplerAnisotropy from the application. The README
names samplerAnisotropy among the features an application asks for.
Tests: FeatureRequests checks, in its main run and in its Vulkan 1.3
child (CRAFTER_GRAPHICS_NO_VULKAN_1_4), that samplerAnisotropy is off
after a Device::Initialize that does not ask for it. With the
requirement put back, the check fails in both, on the RTX 4090 here,
which has the feature.
This commit is contained in:
parent
a9ce1a02e8
commit
594e1612f7
8 changed files with 13 additions and 58 deletions
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
// Device::Initialize's feature requests on a real GPU, end to end: a required
|
||||
// feature ends up enabled, an optional one exactly where the GPU supports it,
|
||||
// and one nobody asked for stays off. On the Vulkan 1.3 path
|
||||
// and one nobody asked for stays off, samplerAnisotropy among them, which the
|
||||
// library required for itself until #168. On the Vulkan 1.3 path
|
||||
// (CRAFTER_GRAPHICS_NO_VULKAN_1_4, run in a child process, since an instance's
|
||||
// version is fixed for the process) maintenance5 comes from
|
||||
// VK_KHR_maintenance5 and no other vulkan14 feature can be had. And a refusal
|
||||
|
|
@ -61,6 +62,11 @@ void Run(bool vulkan13) {
|
|||
std::format("{}an optional feature is enabled exactly where the GPU supports it", path));
|
||||
Check(!enabled.vulkan10.geometryShader && !enabled.vulkan12.shaderInt8,
|
||||
std::format("{}a feature nobody asked for stays off", path));
|
||||
// The library asked for this one itself until #168, for a sampler class
|
||||
// that nothing in this repository made. None of its samplers is
|
||||
// anisotropic, so the feature is the application's to ask for.
|
||||
Check(!enabled.vulkan10.samplerAnisotropy,
|
||||
std::format("{}samplerAnisotropy, which none of the library's samplers uses, stays off when the application does not ask for it", path));
|
||||
Check(enabled.vulkan12.bufferDeviceAddress && enabled.vulkan14.maintenance5,
|
||||
std::format("{}the library's own needs are on, maintenance5 among them", path));
|
||||
if (vulkan13) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue