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.
The stencil side of #767. image_descriptor accepted X24_TYPELESS_G8_UINT
and X32_TYPELESS_G8X24_UINT plane-1 views on either family, so an
R32G8X24_TYPELESS texture with an X24_TYPELESS_G8_UINT view (or the
other way round) got a live 8_UINT T# where D3D12 refuses the view.
Each stencil view format is now accepted on its own DXGI family only:
X24_TYPELESS_G8_UINT on R24G8_TYPELESS / D24_UNORM_S8_UINT,
X32_TYPELESS_G8X24_UINT on R32G8X24_TYPELESS / D32_FLOAT_S8X24_UINT. The
family is the DXGI format, not the Vulkan one behind it.
d3d12_descriptor_test checks that the other family's stencil view
format leaves the slot null on both textures; on main that check fails.
Depth-stencil attachments can opt out of sampling while remaining valid resources. Leave a reused descriptor null before any view is encoded or registered.
#678 (D3D-84) took R24_UNORM_X8_TYPELESS and R32_FLOAT_X8X24_TYPELESS on any
texture with a depth aspect, so the other family's view (an X8X24 view of an
R24G8 texture, or the reverse) got a live descriptor of the texture's own
depth format. D3D12 refuses both. Each depth view format now belongs to its
own DXGI family only (R24G8_TYPELESS / D24_UNORM_S8_UINT, R32G8X24_TYPELESS /
D32_FLOAT_S8X24_UINT), checked on the resource's DXGI format, so a D24
texture backed by D32_SFLOAT_S8_UINT still takes the R24 view. The other
family's view falls through to the existing "view format not supported"
path and leaves the slot null.
d3d12_descriptor_test checks both cross pairs give a null descriptor, and
takes the expected depth T# from the texture's backing: a GPU without a
usable D24 (the layer's depth_usable rule) backs R24G8 with
D32_SFLOAT_S8_UINT, where the old expectation of 8_24_UNORM failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>