Commit Graph

1118 Commits

Author SHA1 Message Date
8dbf3a686c Merge pull request #1211 from Vonsek 2026-11-22 03:37:51 -05:00
9055393d88 Merge pull request #1204 from quackottu 2026-11-22 03:37:48 -05:00
29345889be Runtime: capture full 64-bit predication values on the GPU 2026-11-22 04:34:35 -04:00
be0e227dbd D3D12: refuse query calls the list type can't hold, and CreateQueryHeap node masks above 1 2026-11-22 13:54:34 +05:30
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
15aa49c006 d3d12: GetResourceAllocationInfo follows the PC runtime's 4 KiB, totals and flag rules
4 KiB alignment now counts the 4 KiB tiles covering the top mip of one
slice (at most 16; a volume's depth counts), instead of fitting the whole
image in 64 KiB. Multi-resource totals round up to the largest alignment,
saturate instead of wrapping, and an empty query is {0, 1}. Simultaneous
access with depth-stencil or MSAA, and a depth-stencil volume, are refused.
All measured against the host runtime on an RTX 5070 and WARP.
2026-11-22 13:45:20 +05:30
209f5e1f2a Merge pull request #1199 from quackottu 2026-11-22 03:14:28 -05:00
60fec60c6d Merge pull request #1169 from quackottu 2026-11-22 03:14:20 -05:00
2a333b5c69 Merge pull request #1155 from quackottu 2026-11-22 03:14:16 -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
7afab7fa00 Merge origin/main into d3d90-castable-placed (standalone surface fix ff697417; keep draw/dispatch replay fields) 2026-11-22 00:10:14 -08:00
bb36812235 perf(vulkan): conditional Sync2 readback flush, O(1) deferred deletion, lock split, TDR safety, and centralized FenceWaitDispatcher 2026-11-22 05:05:36 -03:00
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
73dd6d7dce Runtime: depth and stencil resolves in ResolveSubresourceRegion
MIN and MAX of either plane, and AVERAGE of the depth plane when Format is
the plane's own format, as the PC runtime accepts them (RTX 5070 and WARP).
Each resolve is a vkCmdBeginRendering scope with no draws: the MSAA plane
is the depth or stencil attachment and the destination plane its resolve
target, checked at record time against D3D12's rules and the device's
supported resolve modes. Colour resolves are unchanged.
2026-11-22 13:14:43 +05:30
36d073f79d Merge remote-tracking branch 'origin/main' into pr1083-merge-main
# Conflicts:
#	runtime/src/vulkan_backend.h
#	runtime/src/vulkan_replay.h
2026-11-21 23:26:25 -08:00
2933767eac Merge origin/main into d3d90-castable-placed (resolve #1083 conflicts)
Keep-both resolutions per #313's conflict analysis: main's ExecuteIndirect /
acceleration-structure / debug-marker / depth24 / node-mask features alongside
the stack's arena, compute and draw paths. Main's indirect and AS offsets gain
the arena's buffer_offset / heap_base compensation; AS resources on default
heaps get their GENERIC structure over the arena range. Reset clears
stencil_ref_set_ next to reset_state, and OMSetStencilRef sets it. README takes
main's (the crypto-token lines stay deleted).
2026-11-21 23:23:18 -08:00
77f18926ae Merge pull request #1027 from sanuk369 2026-11-22 02:08:55 -05:00
21bf8c3d79 Merge binary occlusion and share queue resolve resources 2026-11-22 04:05:44 -03:00
ff697417c1 Runtime: the standalone Vulkan instance keeps its surface extensions next to debug utils
create_vulkan_device_standalone builds inst_exts with VK_KHR_surface and
VK_KHR_win32_surface for DXGI presentation (D3D-2), then the D3D-24 block
replaced the instance's extension list with VK_EXT_debug_utils alone
whenever the loader has it, which it does wherever the Vulkan SDK is
installed. The device still enabled VK_KHR_swapchain, so validation
reported VUID-vkCreateDevice-ppEnabledExtensionNames-01387, and the
instance had no surface extension for the DXGI swapchain.

Both now go in one list, and VK_KHR_swapchain is enabled only when the
surface extensions are on the instance.
2026-11-22 12:12:38 +05:30
9c7e223a3c D3D-90: castable formats on placed resources (CreatePlacedResource2)
The placed half of D3D-85: CreatePlacedResource1/2 wrap the placed path, and 2 carries NumCastableFormats/pCastableFormats exactly as CreateCommittedResource3 does. The castable list is mapped by a shared helper (also used by the committed path) that refuses unmapped formats and casts whose texel size differs from the resource's, matching the host's E_INVALIDARG and avoiding a size-mismatched VkImageFormatListCreateInfo. A typed UNORM texture with a castable list also accepts an RTV in a listed RGBA8 family format, cleared through the same reinterpretation a typeless RTV uses.
2026-11-21 22:40:16 -08:00
86ef2454a8 Merge pull request #1069 from undeadhuman37 2026-11-22 01:38:14 -05:00
8e6afb23fd Merge runtime indirect and ray-tracing changes into the occlusion branch 2026-11-22 03:32:16 -03:00
532f854184 Merge main indirect and ray tracing changes into binary occlusion fix 2026-11-22 03:31:47 -03:00
55bf9d0328 D3D-122: GetCopyableFootprints refuses the descriptions the host refuses
The buffer branch only checked first/count and the texture branch never
looked at Width, Height, DepthOrArraySize or SampleDesc, turning a zero
extent into 1. The PC runtime gives the failure answer (every output all
ones) for these; measured on WARP, and @quackottu's subset on an NVIDIA GPU.

Buffers: Width 0, or any of Height, DepthOrArraySize, MipLevels, Format,
Layout, SampleDesc or Alignment other than its one valid value. Textures:
a zero extent, Count 0, or more than one sample outside a single-mip,
non-ROW_MAJOR 2D render target or depth stencil, or a count that is not a
power of two. Left unchecked because the host accepts them or adapters
differ: Flags on buffers, extra mips, 2D ROW_MAJOR, Quality at one sample,
extent limits, texture alignment, multisample quality and format support.

d3d12_vulkan_device_test: footprint_validity_cases() is compared with the
host runtime when there is one and checked on its own otherwise.

AI-assisted
2026-11-22 09:21:11 +03:00
d2b9d9da3d Merge main into binary occlusion fix 2026-11-22 03:21:07 -03:00
3ec79019ac Merge main into the overlapping occlusion branch 2026-11-22 03:20:06 -03:00
075b0a312a Merge pull request #1015 from Vonsek 2026-11-22 01:08:22 -05:00
294deab8c3 Merge pull request #991 from sanuk369 2026-11-22 01:08:12 -05:00
998924fea8 feat(d3d12): add ExecuteIndirect CountBuffer and optional BLAS/TLAS/RayQueryKHR support 2026-11-22 03:04:35 -03:00
01c0a56485 d3d12: accept castable formats on committed textures
Keep the creation-time castable list on the resource, reject an SRV format
that is neither the resource format nor listed, and allow listed same-size
cross-family casts such as R8G8B8A8_UINT to R32_UINT.
2026-11-21 21:56:17 -08: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
7a6b97c946 Revert "Merge pull request #895 from cobalt-pebble-804"
#895's CBV/SRV/UAV views write placeholder tags (1, 2, 3) into the descriptor heap, and its new check in
d3d12_vulkan_device_test expects an SRV's first dword to be 2. main's SRVs are GFX10 T# words (D3D-72 and the
descriptor table), so the device test failed at line 2211. The PR needs a rebase onto main's descriptor model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:39:08 -05:00
ac93feef4e Merge pull request #897 from Vonsek
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 00:33:04 -05:00
6ac93b21f0 Merge pull request #895 from cobalt-pebble-804 2026-11-22 00:33:02 -05:00
944d75bf5a Merge pull request #775 from JavierBlanco23
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 00:32:53 -05:00
7a406ccfc0 Merge pull request #763 from cemalyakla 2026-11-22 00:32:51 -05:00
3400c5659d Merge pull request #742 from totonii 2026-11-22 00:32:51 -05:00
61bcc969c4 D3D-86: answer CheckFeatureSupport OPTIONS2-5, 7, 9, 11, 13-16, 18-21 2026-11-22 06:29:05 +01:00
7b11673e33 CheckFeatureSupport(FEATURE_LEVELS): an empty or missing list is E_INVALIDARG
NumFeatureLevels 0 returned DXGI_ERROR_UNSUPPORTED, and a null
pFeatureLevelsRequested with a count was read. The host D3D12 runtime
(NVIDIA and WARP) returns E_INVALIDARG for both. When no requested level
is supported the host also writes MaxSupportedFeatureLevel 0 next to
DXGI_ERROR_UNSUPPORTED; the layer left the field as it was.
2026-11-22 10:58:38 +05:30
9363490570 feat(dxgi): add Vulkan-backed IDXGIFactory4 and IDXGISwapChain3 COM shim with HWND GPU test 2026-11-22 02:06:28 -03:00
69fe9d3752 Merge remote-tracking branch 'origin/main' into claude/d3d-24-debug-markers-457bab
# Conflicts:
#	runtime/CMakeLists.txt
#	runtime/shims/d3d12_com.cpp
#	runtime/shims/d3d12_com.h
2026-11-22 05:01:46 +00:00
747d1c34c0 Support overlapping ordinary occlusion in Vulkan replay 2026-11-22 01:59:55 -03:00
5517ed7ac0 Merge remote-tracking branch 'origin/main' into presentx-core-v2
# Conflicts:
#	runtime/CMakeLists.txt
#	runtime/shims/d3d12_com.h
2026-11-22 05:28:42 +01:00
7677932bdf presenter: format-feature checks, srgb state set after recreate, abortable acquire
Blit support comes from vkGetPhysicalDeviceFormatProperties (BLIT_SRC source,
BLIT_DST swapchain, linear filter only with SAMPLED_IMAGE_FILTER_LINEAR), cached
per format. The swapchain encoding is recorded only once the new swapchain
exists, so a failed recreate is retried. The image acquire polls an abort
callback every 50 ms instead of waiting for ever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:28:34 +01:00
4d62f48a5c presenter: source rectangle, blank present, sRGB swapchain format, frame capture
VulkanPresenter::present takes an optional source rectangle (stretched to the
window), present_blank clears the swapchain image, the swapchain format follows
the source (an sRGB source gets an sRGB swapchain, every other a UNORM one), and
enable_capture/read_back copy each presented frame to host memory for tests.
Integer, block-compressed and multisampled sources are refused. WindowPresenter
forwards all of it. Also renames the device-extension counters in
create_vulkan_device_standalone that the merge left shadowing each other (C4456).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:28:06 +01:00
70f184a636 feat(runtime): add D3D12 CBV/SRV/UAV buffer views and VkPipelineLayout root signatures 2026-11-22 01:27:04 -03:00
5aef74c8c6 Merge remote-tracking branch 'origin/main' into m15-translated-draw-v2
# Conflicts:
#	runtime/CMakeLists.txt
#	runtime/shims/d3d12_com.h
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-22 05:25:09 +01:00
ff84376255 Standalone Vulkan device: enable shaderDrawParameters when supported; log a missing shaderInt64
PR 436's translated vertex shaders read BaseVertex/BaseInstance, so the production device
must enable shaderDrawParameters before 436 lands (same lines as 436, so they merge). A GPU
without shaderInt64 cannot load any translated shader (all declare Int64): say so once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:24:55 +01: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
5ff488901c Merge pull request #861 from adonizm 2026-11-21 23:15:35 -05:00