shader: read raw D16 depth bits through kDepth k16UInt image loads

Co-authored-by: Artyom Zabroda <artyomzabroda@proton.me>
This commit is contained in:
nmzik
2026-10-22 18:56:26 +02:00
parent a358b847c1
commit aafe014d0c
6 changed files with 192 additions and 10 deletions
@@ -188,6 +188,12 @@ RawSignedStorageFormat(const ImageResource& image, Prospero::BufferFormat format
return Prospero::BufferFormat::kInvalid;
}
// A raw load of a kDepth k16UInt T# reads a D16 surface's codes. Vulkan cannot view D16 as
// R16Uint, so the host binds it as UNorm and the shader converts back.
[[nodiscard]] constexpr bool ReadsDepthBits(const ImageResource& image) {
return image.conversion_format == Prospero::BufferFormat::k16UInt;
}
struct SamplerResource {
static constexpr uint32_t NoIndirectSampler = UINT32_MAX;