Commit Graph

72 Commits

Author SHA1 Message Date
b8f9d6f906 Merge pull request #1569 from Vonsek 2026-11-22 08:08:07 -05:00
c26caf2f08 Merge pull request #1554 from Vonsek 2026-11-22 08:08:04 -05:00
d88129e39a docs,test(runtime): check per-format SAMPLED_IMAGE_FILTER_MINMAX_BIT in descriptor test 2026-11-22 13:42:46 +01:00
65ef3d2d89 Merge remote-tracking branch 'upstream/main' into ag/d3d12-sampler-minmax 2026-11-22 13:40:53 +01:00
08986b18c8 Merge remote-tracking branch 'upstream/main' into ag/d3d12-volume-min-lod
# Conflicts:
#	docs/d3d12_vulkan.md
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/test/d3d12_descriptor_test.cpp
2026-11-22 13:39:39 +01:00
0dd6bb051c Merge pull request #1569 from Vonsek 2026-11-22 07:38:16 -05:00
bf7014999a fix(runtime): enable VkSamplerReductionModeCreateInfo for MIN/MAX samplers
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.
2026-11-22 13:18:40 +01:00
564eb48c8e fix(runtime): apply ResourceMinLODClamp to sampled 3D volume views
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.
2026-11-22 13:12:54 +01:00
017d260438 fix(runtime): bind single-layer Texture1D shader-resource views
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.
2026-11-22 12:38:59 +01:00
90c8688124 Merge pull request #1323 from Flyander 2026-11-22 05:37:41 -05:00
983862e2a8 Runtime: 96-bit R32G32B32 textures on the Vulkan layer (D3D-62)
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>
2026-11-22 11:26:48 +01:00
3974555c19 [TEST-189] Fix descriptor test compilation with clang-cl 2026-11-22 11:09:12 +01:00
d8455a7ae8 Merge pull request #1235 from Vonsek 2026-11-22 04:07:48 -05:00
cdc9ab3735 fix(runtime): respect the device limit for sampler LOD bias
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.
2026-11-22 09:43:56 +01:00
8dbf3a686c Merge pull request #1211 from Vonsek 2026-11-22 03:37:51 -05:00
a57ae52048 fix(runtime): apply the resource mip clamp to sampled cube views
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.
2026-11-22 09:21:30 +01:00
209f5e1f2a Merge pull request #1199 from quackottu 2026-11-22 03:14:28 -05:00
ea512f284c Runtime: size the bindless set's arrays from the device's descriptor limits
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.
2026-11-22 13:41:58 +05:30
fd94dba66a d3d12: register shaders' literal S#s without a heap slot (rt::d3d12::register_samplers)
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.
2026-11-22 13:21:06 +05:30
326e8490bb test(runtime): distinguish integer and fractional array LOD clamps
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.
2026-11-22 07:10:00 +01:00
a69977e76f fix(runtime): honor minimum LOD on sampled 2D array views
A Texture2DArray SRV encodes the clamp in its image descriptor. Forward it to Vulkan so sampling keeps the requested mip and array layer.
2026-11-22 06:47:50 +01:00
817a5e9f5e Tests: run the eight unregistered D3D12 GPU tests under ctest
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)
2026-11-22 00:33:45 -05:00
6845ddab45 Merge pull request #909 from Dea7hsmiles 2026-11-22 00:33:08 -05:00
ac93feef4e Merge pull request #897 from Vonsek
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 00:33:04 -05:00
482aa3c33f test: isolate typeless volume descriptors from multisample views
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.
2026-11-22 05:33:07 +01:00
fb31cc780e tests: rename the multisample levels in d3d12_descriptor_test
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.
2026-11-21 20:30:57 -08:00
46f5ce2f1d fix: sample linear and sRGB views of typeless RGBA8 volumes
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.
2026-11-22 05:23:59 +01:00
8c36677b41 chore: merge upstream query and descriptor updates 2026-11-22 04:45:39 +01:00
0b5a342f3e Merge pull request #779 from Vonsek 2026-11-21 22:37:42 -05:00
afda786c2c Merge pull request #674 from VictorJulianiR
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 22:37:39 -05:00
4428d939a6 fix(runtime): apply minimum LOD to sampled 2D views
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.
2026-11-22 04:35:39 +01:00
d3949f7798 chore: merge upstream depth plane checks
Keep both the cross-family stencil negative and the live-slot shader-access regression on the shared integration base.
2026-11-22 04:30:50 +01:00
56985b2ea6 Merge pull request #778 from ismailchaka1 2026-11-21 22:09:11 -05:00
87daf46e46 Merge pull request #767 from Derpbeat 2026-11-21 22:08:43 -05:00
316e2773f7 Merge pull request #715 from Vonsek 2026-11-21 22:08:19 -05:00
672721b3a1 Merge pull request #617 from VictorJulianiR 2026-11-21 22:08:01 -05:00
6398d46f48 chore: merge upstream volume SRV support
The texture-wide deny check now subsumes the volume-specific check. Keep the independent volume LOD restriction and its pixel coverage.
2026-11-22 04:07:10 +01:00
4859a809b3 chore(merge): integrate current Vulkan descriptor tests
Keep the upstream 3D texture uploads alongside the unaligned BC sample and preserve the expanded feature-query documentation.
2026-11-22 04:06:58 +01:00
e9a8203d45 Merge main and preserve volume views and HRESULT tracing in A8 coverage 2026-11-22 00:06:32 -03:00
123ace7c11 Runtime: stencil-plane SRVs only on their own depth-stencil family
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.
2026-11-22 02:56:29 +00:00
74c71672c0 fix: reject shader views on textures that deny shader access
Depth-stencil attachments can opt out of sampling while remaining valid resources. Leave a reused descriptor null before any view is encoded or registered.
2026-11-22 03:54:16 +01:00
ff354a556b Report and exercise A8 texture mip support 2026-11-21 23:51:24 -03:00
e36f74fc8a Name the per-format texture locals without shadowing the RGB9E5 fixture 2026-11-21 23:49:42 -03:00
50bf02723d Keep multisample test descriptors separate from volume views 2026-11-22 02:49:14 +00:00
9f755a30fa Runtime: depth-plane SRVs only on their own depth family (#678 follow-up)
#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>
2026-11-21 20:42:28 -06:00
28e2991a8c Merge pull request #672 from Vonsek 2026-11-21 21:37:46 -05:00
88dc8beac1 Runtime: bind multisampled 2D and array shader-resource views 2026-11-22 02:34:09 +00:00
94616fef20 test: cover a volume that denies shader access
Exercise the null descriptor when the layer accepts a transfer-only volume and allow a resource-creation rejection consistent with the host runtime.
2026-11-22 03:30:53 +01:00
be283d10fc Merge main and preserve stencil and depth views alongside A8 sampled textures 2026-11-21 23:29:03 -03:00
5e55015def Merge main and verify B5G5R5A1 packed sampling and native footprints 2026-11-21 23:28:57 -03:00