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
|
|
@ -4,7 +4,7 @@ Guidance for coding agents and contributors working on Crafter.Graphics itself.
|
|||
|
||||
## Project overview
|
||||
|
||||
Crafter.Graphics is the Crafter engine's graphics library: one C++ module, `Crafter.Graphics`, with 41 partitions, built with [crafter-build](https://forgejo.catcrafts.net/Catcrafts/Crafter.Build) from `project.cpp`. On native targets it is a Vulkan 1.3+ renderer built around `VK_EXT_descriptor_heap` (bindless, no descriptor-set layouts, push data through `vkCmdPushDataEXT`), with a bindless-descriptor-set fallback for drivers without the heap, hardware ray tracing, a compute-shader UI, a Wayland or Win32 window, and input. On `wasm32-*` targets the same C++ surface runs in a browser over WebGPU through a JS bridge, with a software wavefront ray tracer. It depends on Crafter.Event (events), Crafter.Math (vectors, matrices) and Crafter.Asset (`.cmesh`, `.ctex`), all pulled from `forgejo.catcrafts.net` unpinned, and, on native targets, on the Khronos `Vulkan-Headers` and `Vulkan-Utility-Libraries` from GitHub as header-only `ExternalDependency` entries. Its consumers are the examples under `examples/` (each a `LocalProject` of `../../project.cpp`) and the maintainer's applications, which pull `master`.
|
||||
Crafter.Graphics is the Crafter engine's graphics library: one C++ module, `Crafter.Graphics`, with 40 partitions, built with [crafter-build](https://forgejo.catcrafts.net/Catcrafts/Crafter.Build) from `project.cpp`. On native targets it is a Vulkan 1.3+ renderer built around `VK_EXT_descriptor_heap` (bindless, no descriptor-set layouts, push data through `vkCmdPushDataEXT`), with a bindless-descriptor-set fallback for drivers without the heap, hardware ray tracing, a compute-shader UI, a Wayland or Win32 window, and input. On `wasm32-*` targets the same C++ surface runs in a browser over WebGPU through a JS bridge, with a software wavefront ray tracer. It depends on Crafter.Event (events), Crafter.Math (vectors, matrices) and Crafter.Asset (`.cmesh`, `.ctex`), all pulled from `forgejo.catcrafts.net` unpinned, and, on native targets, on the Khronos `Vulkan-Headers` and `Vulkan-Utility-Libraries` from GitHub as header-only `ExternalDependency` entries. Its consumers are the examples under `examples/` (each a `LocalProject` of `../../project.cpp`) and the maintainer's applications, which pull `master`.
|
||||
|
||||
| Path | What lives there |
|
||||
|---|---|
|
||||
|
|
@ -25,7 +25,7 @@ Crafter.Graphics is the Crafter engine's graphics library: one C++ module, `Craf
|
|||
Partitions, by what they are for. Every partition file exists on every target; one that does not apply compiles to an empty module behind `#ifdef CRAFTER_GRAPHICS_WINDOW_DOM` (or `#ifndef`), and several hold both halves in one file (`Window`, `Device`, `UI`, `Mesh`, `RenderingElement3D`, `RTPass`, `RenderPass`, `Image2D`, `FontAtlas`, `RT`).
|
||||
|
||||
- Both backends: `:Types` (`FrameTime`, `TouchPoint`, `CrafterKeys`, `AlignUp`), `:Keys` (`consteval Key(CrafterKeys)` to the platform's raw code), `:Window`, `:Device`, `:Input` (named actions, rebinding), `:Gamepad`, `:Clipboard`, `:Animation`, `:Font` (stb_truetype), `:FontAtlas` (the SDF atlas), `:UI` (`UIRenderer`, the item structs, `Rect`), `:UIComponents` (Tier 3), `:InputField`, `:RenderPass`, `:RTPass`, `:Mesh`, `:RenderingElement3D`, `:Image2D`, `:RT` (portable RT PODs and flag constants), `:GraphicsTypes` (the `using` aliases `GraphicsBuffer`, `GraphicsDescriptorHeap`, `GraphicsComputeShader`, `GraphicsCommandBuffer`), `:ForwardDeclarations`.
|
||||
- Vulkan only: `:VulkanBuffer`, `:ImageVulkan`, `:SamplerVulkan`, `:DescriptorHeapVulkan` (heap and descriptor-set mode, the RAII slots), `:ComputeShader` (Tier 1), `:ShaderVulkan` (`VulkanShader` and the NVIDIA SPIR-V rewrite), `:ShaderBindingTableVulkan`, `:PipelineRTVulkan`, `:VulkanTransition`, `:Decompress` (`VK_EXT_memory_decompression`).
|
||||
- Vulkan only: `:VulkanBuffer`, `:ImageVulkan`, `:DescriptorHeapVulkan` (heap and descriptor-set mode, the RAII slots), `:ComputeShader` (Tier 1), `:ShaderVulkan` (`VulkanShader` and the NVIDIA SPIR-V rewrite), `:ShaderBindingTableVulkan`, `:PipelineRTVulkan`, `:VulkanTransition`, `:Decompress` (`VK_EXT_memory_decompression`).
|
||||
- DOM only: `:WebGPU` (the `extern "C"` bridge declarations), `:WebGPUBuffer`, `:DescriptorHeapWebGPU`, `:WebGPUComputeShader`, `:PlainComputeShader`, `:ShaderBindingTableWebGPU`, `:PipelineRTWebGPU`, `:Dom`, `:DomEvents`, `:Router`.
|
||||
|
||||
## Dev environment
|
||||
|
|
|
|||
Loading…
Reference in a new issue