- UAV clears of A4B4G4R4: an R4G4B4A4_PACK16 layout row (red in bits
12-15, alpha in 0-3), unit-checked in conversion_checks and cleared end
to end where the layer reports a typed UAV (the driver's call: WARP has
one, AMD's D3D12 driver doesn't).
- FORMAT_SUPPORT reports IA_VERTEX_BUFFER only for formats input layouts
accept (vertex_format), not every format Vulkan can fetch: R8/R16
SNORM/SINT (and R8G8 SNORM/SINT) have no input-layout mapping yet.
- new_format_round_trips: each render-target format is cleared to
(-3, -0.4, 0.25, 7) on the layer and on the host and the bytes compared,
which catches a mapping of the right size but the wrong numeric type
(R16_SNORM as UNORM, R8_SINT as UINT); no value is an exact half step.
The host is the Vulkan device's own adapter, as in
compare_format_support, not the default one.
- A4B4G4R4 is skipped where the Vulkan driver can't sample
R4G4B4A4_UNORM_PACK16 (Vulkan doesn't require it), by the driver's
format properties rather than the layer's answers; B4G4R4A4 and
B5G5R5A1 are never skipped.
- d3d12_copy_xfmt: D16_UNORM <-> R16_UINT and R16_SNORM copies, the new
members of depth_colour_pair, against the host and WARP.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Implements custom float and UINT sampler border colours on VK_EXT_custom_border_color in runtime/shims/d3d12_vulkan_device.cpp.
- Maintains a device-wide border colour table of up to 4000 entries.
- Assigns table indices into S# BORDER_COLOR_PTR [11:0] (with BORDER_COLOR_TYPE = table), ensuring distinct custom colours produce distinct keys in the bindless descriptor hash table while identical colours reuse existing indices.
- Chains VkSamplerCustomBorderColorCreateInfoEXT with VK_BORDER_COLOR_FLOAT_CUSTOM_EXT / VK_BORDER_COLOR_INT_CUSTOM_EXT and format = VK_FORMAT_UNDEFINED when customBorderColorWithoutFormat is enabled. Falls back to transparent black with a diagnostic warning when the extension is absent.
- Enables VK_EXT_custom_border_color in standalone device creation and vk_test_device.h.
- Updates d3d12_sampler2_test to verify table index assignment, index reuse, S# distinction between float and UINT representations, and Vulkan sampler creation.
- Documents the architecture in docs/d3d12_vulkan.md.
Tested on Windows 11, MSVC 2022 x64 (Ninja, RelWithDebInfo), NVIDIA GeForce RTX 2070 SUPER, Driver 595.79.
Clean-room verification suite (python compileall, make_game.py CLI, 27/27 CTest, d3d12_vulkan_device_test, d3d12_sampler2_test, d3d12_descriptor_test) passed with exit code 0.
Item: D3D-73 (#634)
Co-Authored-By: Antigravity <antigravity@google.com>
vulkan_format() had no entry for R16_UINT, R16_SINT, R16_SNORM, R8_UINT,
R8_SINT, R8_SNORM, R8_TYPELESS, R16G16_UNORM, R16G16_SNORM,
R16G16B16A16_SNORM or A4B4G4R4_UNORM, so CreateCommittedResource refused
them with E_INVALIDARG and FORMAT_SUPPORT answered DXGI_ERROR_UNSUPPORTED
where native D3D12 creates them (item 1 of the FORMAT_SUPPORT finding in
#1380).
A4B4G4R4_UNORM keeps alpha in bits 0-3 and red in 12-15 (cleared and
read back on native D3D12, RX 9070 XT and WARP), which is Vulkan's
R4G4B4A4_UNORM_PACK16; its T# row reads that as W, Z, Y, X.
Copies get the formats' texel sizes, D16 copies pair with R16 SNORM/UINT/
SINT like the other R16_TYPELESS members, and the colour-resolve check
refuses every integer format by numeric class instead of a list that
missed R8/R16 and the SINT forms of R8G8B8A8, R32 and R32G32B32A32.
Tests: d3d12_vulkan_device creates each format (as the host does), copies
a 4x4 upload in and back out bit for bit, and clears an A4B4G4R4 render
target to R, G, B and A; d3d12_descriptor_test samples A4B4G4R4 through
a T# alongside B4G4R4A4 and B5G5R5A1.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map B8G8R8X8_UNORM, _UNORM_SRGB and _TYPELESS to the B8G8R8A8 Vulkan formats, so
creation, copies, footprints and clears work as for BGRA8. Shader views of the family
read alpha as 1 (the T# selects one for the alpha channel), and views between the
B8G8R8X8 and B8G8R8A8 typeless families are refused, although both land on the same
VkFormat.
Compared with the host D3D12 runtime on an RX 9060 XT: it reports no typed UAV for the
family and refuses typed B8G8R8X8 textures that allow unordered access (the typeless
format is accepted). The BGRA8 image would have advertised storage, so
CheckFeatureSupport now leaves the typed UAV bits out, texture creation refuses typed
B8G8R8X8 with ALLOW_UNORDERED_ACCESS, CreateUnorderedAccessView gives a null descriptor
for the family, and its images get no storage usage. WARP writes the clear's alpha into
the X byte, as Vulkan does, so clears need no change.
Tests: d3d12_clear_test clears B8G8R8A8_UNORM and B8G8R8X8_UNORM against WARP;
d3d12_vulkan_device_test compares B8G8R8X8 footprints, the typed UAV bits and UAV/RTV
resource creation with the host runtime; d3d12_descriptor_test samples a B8G8R8X8 and a
B8G8R8A8 texture with the same bytes through the bindless set (alpha 1 against the
stored byte) and checks the refused views.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sampler_descriptor() already encodes D3D12_FILTER_REDUCTION_TYPE_MINIMUM and MAXIMUM into the S# filter_mode and gfx10_descriptors.h already provides vulkan_reduction_mode(), but bind_sampler() ignored it and logged that minimum/maximum samplers blend for now.
Enable Vulkan 1.2 samplerFilterMinmax in device creation and vk_test_device.h, chain VkSamplerReductionModeCreateInfo in bind_sampler() when supported and not combined with compareEnable (falling back to blend with a log otherwise), update docs/d3d12_vulkan.md, and add a synthetic 2x2 GPU sampling test in d3d12_descriptor_test comparing MINIMUM, MAXIMUM, and STANDARD (negative control) linear filters.
Texture3D SRVs already encode ResourceMinLODClamp into the T# descriptor, but image_descriptor() rejected non-zero clamps and bind_image() only applied VK_EXT_image_view_min_lod / empty-mip-set swizzle zeroing to 2D, 2D-array and cube colour views.
Allow non-zero ResourceMinLODClamp on sampled 3D colour views, forward the T# clamp to Vulkan in bind_image(), update docs/d3d12_vulkan.md, and add synthetic GPU sampling and negative-control checks in d3d12_descriptor_test.
The device can allocate 1D textures and set 0 has a sampled 1D binding, but default and explicit views previously sampled the fallback. Use the texture dimension and the requested mip range when registering the view.
R32G32B32_FLOAT/UINT/SINT/TYPELESS textures were refused ("texture format not
supported yet"). They are now R32G32B32A32 images on every GPU: most have no
optimal-tiling RGB32 image, and one that has would not avoid the repack, since
D3D12 places subresources at multiples of 512 bytes and Vulkan wants a copy's
buffer offset to be a multiple of the texel size
(VUID-vkCmdCopyBufferToImage-dstImage-07975).
- Footprints keep D3D12's 12-byte texels (compared with WARP).
- CopyTextureRegion between a texture and a buffer is repacked by the D24
compute pass (depth24_convert.comp modes 2 and 3, Depth24Job::rgb96): the
same scratch, parts and lifetime, texels of three words in the footprint and
four in the scratch, copied uninterpreted. depth24_convert.inc is
regenerated with the documented glslc command; the same glslc reproduces the
previous blob byte for byte from the previous source.
- WriteToSubresource/ReadFromSubresource take the staged copy, as D24-as-D32.
- A view's T# names GFX10_FORMAT_32_32_32_*, so alpha reads as one.
- Refused: unordered access and depth (as WARP), render targets (WARP has
them; not done, and FORMAT_SUPPORT and GetResourceAllocationInfo agree),
copies between a 96-bit and a four-channel texture, views of another
format family.
Tested on an RX 9070 XT (AMD 26.11.2), Windows 11: d3d12_rgb96_test matches
WARP and the expected texels bit for bit for 4 formats as 2D arrays with mips
and as volumes; d3d12_descriptor_test samples FLOAT, UINT and TYPELESS views.
Clean under the validation layer with sync validation; depth24_convert_test
and ctest (62) pass.
AI-assisted (Claude Code).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Literal GFX10 samplers can encode bias from -32 to +31. A decoded +31 exceeded the Vulkan sampler limit on both tested devices at registration. Bound the native bias while retaining the original S# for shader lookup.
Cube descriptors carry a minimum resource LOD but were excluded when building the sampled Vulkan view. Include them alongside array views so a point sample from a restricted cube cannot select an earlier mip.
Set 0's 2D, sampler and storage arrays were constexpr (4096 2D images, 1024
samplers, 256 per storage array): one full D3D12 sampler heap (2048) did
not fit and bind_image/bind_sampler fell back. They are now sized once, when
the device creates the set, from the update-after-bind or plain limits:
today's sizes as the floor, then samplers up to min(4096,
maxSamplerAllocationCount - 64), 2D images up to 65536, storage up to 4096.
Sizing at creation keeps the set layout fixed for the pipelines built on it.
Shaders that build an S# from immediates look it up through the descriptor
hash probe like any other S#, but nothing registered those keys, so they
sampled through the fallback nearest-clamp sampler. register_samplers runs
CreateSampler's path (decode, VkSampler, key in set 0) for each S# without
a heap slot; the call at pipeline creation comes with #291's shader index.
An integer image-view minimum is permitted by Vulkan and was observed on Intel. Check an effective integer minimum separately and report both view groups before returning a mismatch.
d3d12_clear, d3d12_com, d3d12_descriptor, d3d12_method_variants,
d3d12_resource_desc, d3d12_sampler2, d3d12_typeless_rtv and d3d12_uav_clear were
built but never added with add_test, so ctest and CI never ran them. Each now
exits 77 when there is no Vulkan GPU (DeviceStatus::unavailable), as
d3d12_vulkan_device_test does, and is registered with SKIP_RETURN_CODE 77.
(cherry picked from commit 2af37e5da368dd130ba23db385e812635cb1a768)
The pending multisample fixture already owns the next slots on the common heap. Give the two typeless views their own CPU descriptors so both sampling regressions can run in the same command list.
The multisample-quality check declared a local 'levels' that hid the footprint array 'levels[3]' still used later in the function, which MSVC /W4 reported as C4456. Rename the feature struct to quality_levels; no behavior change.
A committed RGBA8 typeless image already permits mutable Vulkan views. Let explicit UNORM and sRGB Texture3D SRVs select their formats so shaders can read either interpretation of the same voxels.
The T# records an absolute mip clamp, but sampled views ignored it. Preserve the exposed mip range while applying the encoded clamp and use the descriptor fallback when a logical device cannot represent it.