Commit Graph

311 Commits

Author SHA1 Message Date
c4ca576150 Merge pull request #2910 from c0pperlane/doc-d3d12-vulkan-stale-status
docs/d3d12_vulkan.md: drop stale "not implemented" status for buffer SRVs, streams, mesh PSOs and WriteBufferImmediate (DOC-D3D12-VULKAN-STALE-STATUS)
2026-12-01 22:45:03 +01:00
f051ae5183 d3d12/tests: fix Windows MSVC build, CopyMemory collision, copy parity guard, and --no-ftz32 probe 2026-11-29 11:41:49 -05:00
3a2820b3bf Merge main c1e1ef0b8 into RT-POST-LOAD-GPU-MEMORY (#2098)
Two conflicts:

- d3d12_com.cpp, note_direct_heap_indexing: main's console_descriptor_table_va(cbv_srv_uav_base_) for the tracked
  table, with this branch's per-site once() flag instead of note_once on every draw.
- d3d12_vulkan_device.cpp, PipelineState::build_compute: this branch's body (build_compute_pipeline, journal, compile
  helper). main's dev_status::Build around the compute create moves into build_compute_pipeline, next to the
  pipeline_profile::DriverCall, so the status line still names the compute pipeline in the driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:36:19 -05:00
34945a64a9 docs/d3d12_vulkan.md: drop stale "not implemented" status for buffer SRVs, streams, mesh PSOs and WriteBufferImmediate (DOC-D3D12-VULKAN-STALE-STATUS)
The status paragraph said buffer SRVs, CreatePipelineState streams and mesh
shaders were missing; the device writes buffer V#s, parses streams and reports
MeshShaderTier 1 where the GPU has VK_EXT_mesh_shader. WriteBufferImmediate was
described as refused because no buffer had a GPU VA; buffers have VAs and the
device test writes through a placed buffer's. Section 4.6's "Not implemented
yet" contradicted the D3D-399 paragraph above it and listed mesh statistics
twice. The device test's comment on the unresolved write gets the real reason.
2026-11-25 21:31:30 +01:00
9f98dcc617 Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)
Fall back to a dedicated buffer allocation when the shared arena fills.
Update console descriptors and resource backing, preserve pipeline cache
entries, and replay mesh records using bounded indirect arguments. Keep
scripted input available until read and cover the runtime and translator
paths with synthetic tests.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 14:30:51 -06:00
369bb1c753 d3d12: gate SO_STATISTICS pools and refuse per-stream overlap (D3D-302)
The three review points on #1630:

- prepare() refuses two overlapping SO_STATISTICS queries on one stream: two
  active indexed queries in one pool break
  VUID-vkCmdBeginQueryIndexedEXT-queryPool-04753. Queries on different streams
  are fine.
- The transform-feedback pool now also needs the transformFeedbackQueries
  property, and a stream at or above maxTransformFeedbackStreams runs nothing
  and resolves zero instead of issuing an invalid indexed begin.
- replay_query_predication case 18 fails without both: the overlapping-stream
  list is invalid_query and a stream past the pool's stream count fills zeros.

Tested: d3d12_vulkan_device, d3d12_state_map and replay_query_predication pass
plain and with LEONIDA_VK_VALIDATION=1 (RTX 3080 Ti, driver 616.64). AI-assisted.
2026-11-25 14:24:41 -05:00
e5a4976224 d3d12: real SO_STATISTICS query pools (D3D-302)
With VK_EXT_transform_feedback enabled on the device, an SO_STATISTICS heap is a real VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT pool, begun and ended indexed on the stream (vkCmdBeginQueryIndexedEXT / vkCmdEndQueryIndexedEXT). ResolveQueryData copies the two 64-bit results (NumPrimitivesWritten, PrimitivesStorageNeeded) in the same order. The layer still refuses StreamOutput PSOs and still does not implement SOSetTargets, so no primitive reaches a stream yet and the counts stay 0; without the feature the heap is made without a VkQueryPool and resolves zeros, as before.
2026-11-25 09:56:34 -05:00
39879ce0fd Merge main into RT-PROTON-STORY-LOAD (#984)
Merges main at 1154976d4 into the integration branch at 273b3bdf9 (merge base ece4ba5b3). 42 files conflicted;
this commit is the resolution only. Build and test repairs follow in their own commits.

Rule of resolution: where both sides added different things, both stay; where both made the same change in two
forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two
changed the same code for different purposes, both purposes are kept.

Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, registry.cpp):
- d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device
  routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device
  slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the
  console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and
  list slot 139 (#396).
- Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's
  completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is
  attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider
  pc_resource_desc, S_OK for queue slots past the PC table.
- Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its
  undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base
  list proxy, its null-view slot 70 and its refusing slot 133.

Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp):
- Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra
  cases added; main's --env-slots-74 and #984's --env-slots-70.
- Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy,
  the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases.

D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h,
frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp,
d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp,
vk_pipeline_check.cpp, vk_test_device.h):
- Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's
  ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's
  origin, so both pools run on disjoint sets of textures.
- frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter.
- main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4
  stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980).
- shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it.
- Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count
  refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it.

Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp,
runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp):
- ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on
  ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file.
- gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries.
- Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped.

Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1,
make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py,
runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md,
runtime/README.md):
- Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake.
- rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's
  restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped.
- shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags.
- shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants.

One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC
compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:38:04 -05:00
706f5429e1 Merge pull request #1154 from PyZikYG/copy-queue-timestamp-support
Merging.

**Why merged:** D3D-COPY-TIMESTAMP-CAPS: timestamp bits are tracked per queue family, and transfer-only families count as 0 bits because they can't reset or resolve queries. This was the first native Windows run of the fixed head; madhyn's Wine run was on an older head, and KernelSmoker ran vk_queue on Linux. Behaviour change: OPTIONS3.CopyQueueTimestampQueriesSupported can now be TRUE, and a copy queue that gets a transfer-only family returns E_FAIL from GetTimestampFrequency and GetClockCalibration instead of borrowing the graphics family's bits.

**Why it's good:** d3d12_vulkan_device, d3d12_query_rules, vk_queue, vk_queue_query_sync and vk_queue_constructor_oom: 5/5 both plain and under validation on the 4070 SUPER.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 19:02:38 -05:00
bd53fcee30 Runtime: port #3077's forced host-transfer retry into the staging fallback
Ported from @gustavorafaelschmidt's #3077 commit 2612b150 (author credited
below). With their go-ahead on #4682, keep one fix for both the empty-mask
driver case and the allocation-failure case this PR already handled:

- VulkanDeviceInfo::force_host_transfer_retry (tests only) forces the
  no-memory-type branch on any GPU, so d3d12_vulkan_device_test and
  d3d12_subresource_copy_test run their CPU copies through a third path.
- create_image() is a lambda that leaves image_ null after a failed create
  (the handle is undefined on failure and ~Resource destroys any non-null
  one), and log_once reports when the fallback fires.
- After dropping host-transfer usage, check_image_support is re-run before
  the image is made again; this PR's allocation/bind-failure retry is kept
  alongside it.
- docs/d3d12_vulkan.md and docs/testing.md record the Pascal measurement and
  the tier-1 host note.

The tier-1 heap/WARP comparison changes in #3077 are not part of this port:
they belong to D3D-504 (#5000). Tests on GTX 1060 / 582.78: both executables
built with MSVC 19.44; d3d12_subresource_copy_test OK with all three paths
(109 compared steps, 0 mismatches each); d3d12_vulkan_device_test's three
CPU-copy paths matched, with only the known pre-existing tier-1
heap_mismatches assert (D3D-504) still failing. No game data.

AI-assisted (OpenCode).

Original commit by Gustavo Rafael Schmidt <204491080+gustavorafaelschmidt@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:48:51 +02:00
a8ed98c231 d3d12: report copy queue timestamp support from Vulkan queue capabilities 2026-11-25 00:17:38 +05:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06:00
a7d86d8c76 d3d12: separate front and back stencil masks (D3D-STENCIL-FACE-MASKS)
A DEPTH_STENCIL2 subobject whose FrontFace and BackFace masks differ was
refused with E_NOTIMPL, and OPTIONS14 reported
IndependentFrontAndBackStencilRefMaskSupported = FALSE although the
per-face references of OMSetFrontAndBackStencilRef already reach the
draw. Vulkan has a compare and a write mask per face in VkStencilOpState.

parse_pipeline_stream keeps the front face's masks in the description and
the back face's beside it (PipelineStream::back_stencil), create_graphics
takes them as an optional argument for depth.back, and OPTIONS14 now
reports the cap. The classic CreateGraphicsPipelineState path and its
cached-PSO key are unchanged: D3D12_DEPTH_STENCIL_DESC has one mask pair.

d3d12_state_sweep_test builds 16 more PSOs from a stream with
DEPTH_STENCIL2 (same, split, front-only and back-only masks; one reference
or two through OMSetFrontAndBackStencilRef; front- and back-facing) and
compares the colour and stencil readback with the host D3D12 device: 498
cases, 0 differ on an RTX 5070 Ti. Giving the back face the front face's
masks makes 6 of them differ. d3d12_vulkan_device_test expects the cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:49:09 +05:00
56245df40c Merge pull request #360 from ubiquitarianism/feat/xs-device-vm-options
d3d12_vulkan_device: accept the console's 0x40-byte D3D12_OPTIONS query (RT-XS-DEVICE-VM-OPTIONS)
2026-11-24 08:44:20 -05:00
bff649b34d Merge remote-tracking branch 'ubiq/main' into feat/xs-device-vm-options
# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
#	runtime/shims/d3d12_xs_device.h
#	runtime/test/xs_proxy_mock_test.cpp
2026-11-24 03:01:27 -03:00
86ba7556ba test: gate VIDEO_ENCODE allocator parity on host video support 2026-11-24 08:58:15 +03:00
028001c829 d3d12_xs: fill D3D12ConfigureVirtualMemoryX VA bounds, 0x40-byte D3D12_OPTIONS and Xbox slots 81/86/108 (RT-XS-DEVICE-VM-OPTIONS) 2026-11-24 00:53:33 -03:00
5ab00f8003 d3d12_vulkan_device_test: shorter comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:58:09 -06:00
fadad913ec d3d12_vulkan_device_test: CreateReservedResource2 through the inner device, not the Xbox proxy
2dbcb882c (#6935) routes the Xbox-ABI device proxy's slot 78 to the console's SetFrameIntervalX. On the PC
ABI that slot is ID3D12Device10::CreateReservedResource2, which this test called through the proxy, so the
call answered S_OK with a null resource and GetResourceTiling of it gave 0: "line 6576: tiles == 1"
("d3d12_xs: device slot 78 routed to SetFrameIntervalX" in the log).

The Device10 call now goes through the inner Vulkan device, and the test checks that both resources were
created, so a success without an object fails at the call instead of at the tile count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:54:29 -06:00
e56d97950f Merge pull request #2498 from iasmitionsalvatore/pr/footprint-base-offset
d3d12: GetCopyableFootprints aligns from BaseOffset
2026-11-23 23:47:26 +01:00
1599683caf d3d12: reset predication in ClearState and align SetPredication / AtomicCopyBuffer validation (#6815)
Squash-merged after diff review of PR #6815
2026-11-23 12:32:05 -06:00
b036470cea D3D12_FEATURE_D3D12_OPTIONS: answer the five booleans from the enabled Vulkan features (#6578)
Squash-merged after diff review of PR #6578
2026-11-23 12:25:31 -06:00
4da716493f d3d12: reject null arrays and invalid lists in ExecuteCommandLists (#6610)
Squash-merged after diff review of PR #6610
2026-11-23 11:16:29 -06:00
0a08dbb02b d3d12 Vulkan: align copyable footprints from BaseOffset, not from 0
GetCopyableFootprints started the layout at BaseOffset and aligned every
subresource to D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT as an absolute
address. The PC runtime lays the subresources out from 0 and adds the base
afterwards: with base 513 the host returns offset 513 for subresource 0,
ours returned 1024, and the totals differed by the gap.
GetCopyableFootprints1 wraps the same function.

compare_footprints now also runs bases 513 and 2^32 + 1 (both unaligned)
next to 0 and 1024. Against the hardware host device on an AMD Radeon
RX 7600, on main 561b65a8, the old code gives 652 mismatching fields
(offsets and totals), all at the two new bases: with only 0 and 1024 it
gives none, which is why this went unnoticed. With the fix there are none
at any base. No caller in the runtime passes an unaligned base (the only
internal caller is GetCopyableFootprints1).

AI-assisted. Tested on AMD Radeon RX 7600, driver 26.11.2 (LLPC),
Windows 10 22H2 (in-box d3d12core 10.0.19041), MSVC 14.44.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 09:31:05 -03:00
57c175391d Revert #2490: its console-ABI list proxy breaks run_tiny_frame (please rebase and split)
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:42:53 -05:00
6735a52038 Merge pull request #4667 from Clavert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:17:00 -05:00
7cf7fa7c4d Merge pull request #4508 from SHAURYASANYAL3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:23 -05:00
5426b0eacc Merge pull request #4489 from Nicolas Abosch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:11 -05:00
59cba88743 Merge pull request #4454 from gabsilvs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/d3d12_vulkan.md
#	runtime/README.md
2026-11-22 23:14:52 -05:00
43f41a1d8d Merge pull request #4101 from Exopus
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:11:17 -05:00
433f4e12e1 Merge pull request #4088 from Exopus
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:11:09 -05:00
b102d827d2 Merge pull request #4065 from mohamedsaad.lahlou
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:10:58 -05:00
65ab2bcccf Merge pull request #3833 from gertify
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:44 -05:00
336733ccc5 Merge pull request #2490 from Nolan Cotter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:42 -05:00
d16bf9924a Merge pull request #521 from NWX10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:04:51 -05:00
89ef9b9d95 Merge pull request #497 from Luis Baker
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:04:51 -05:00
31d2798239 d3d12_vulkan_device_test: tell Windows 11 23H2's runtime apart by ID3D12Device11
Windows 11 23H2's in-box runtime (D3D12Core 10.0.22621.5415) has
ID3D12Device10 but not ID3D12Device11, and still answers six cases as
Windows 10 does: the HARDWARE_PROTECTED heap (committed and heap), resource
flag 0x400 on a buffer and on a texture, 2049 shader-visible samplers, and a
type -1 command list. The test told Windows 10 apart by a missing
ID3D12Device10, so it failed on 23H2 at argument_mismatches and then at
heap_mismatches.

Those five comparable cases now need ID3D12Device11 on the host, and
windows10_refusal() excuses its one pair on a host without ID3D12Device11.
The other ID3D12Device10 cases agree on 23H2 and are unchanged.
2026-11-23 04:53:33 +01:00
fa5f26db8e Merge origin/main: DXGI device fields coexist with the console-ABI device state 2026-11-22 20:39:59 -07:00
b1fffe8357 d3d12: GetResourceAllocationInfo resource flag and sample quality parity (D3D-467) 2026-11-23 07:24:34 +05:30
f4e0cf2baa tests: read the realtime queue desc on the real queue; tools: check prebuilt .spv magic
Two leftovers from the console-ABI review round:

- PC GetDesc shares console slot 18 with the newer layout's
  GetTimestampFrequency; the proxy deliberately serves the frequency
  getter while the layout is undetected, so the GLOBAL_REALTIME
  priority check reads the desc on the real queue instead of trusting
  an 8-byte frequency written into a desc-shaped out-buffer.
- shaders_into() accepted any two files named vs.spv/ps.spv when
  spirv-as was absent; a stray file would reach vk_harness and fail
  far from the cause. The prebuilt pair is now checked against the
  SPIR-V magic first.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 18:53:55 -07:00
0f0c85ccbc d3d12: committed resources accept ALLOW_SHADER_ATOMICS with a UAV
CreateCommittedResource refused D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS on
every resource. On an RTX 4070 Laptop (621.24) and WARP the host accepts it
on buffers and textures with ALLOW_UNORDERED_ACCESS, refuses it without,
and keeps it in GetHeapProperties. Match that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:45:39 -03:00
7cc353106f d3d12_xs: PC-shaped lists for PC callers, atomic queue layout, S_OK queue tail
Review findings from shdann's Windows run of the new console queue/list
work:

- d3d12_debug_markers (and every GPU harness compiled against the PC
  headers) drove lists through the console-shaped proxy, so PC slots past
  26 — including the PIX markers at 56-58, which have no console
  counterpart — reached unrelated console methods or were dropped.
  create_device_proxy gains console_lists: false hands the real
  (PC-shaped) list back from CreateCommandList. The GPU tests pass false;
  the title path keeps the console default.
- queue_proxy asserted E_NOTIMPL for the queue's console tail, but those
  slots deliberately answer S_OK now — frame pacing flows through them.
  The test's contract is updated; the fence tail stays refused.
- ChildProxy::queue_layout was a plain unsigned char read and written
  from many threads; it is atomic like the device-wide detection it
  caches.

xs_proxy_mock_test and loader_test pass under Wine; the modified test
objects compile clean under clang-cl. The GPU harnesses need a real
adapter — covered by shdann's Windows run.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 18:41:23 -07:00
c43942fddf d3d12: 1D render targets and depth buffers
CreateCommittedResource refused every TEXTURE1D with ALLOW_RENDER_TARGET or
ALLOW_DEPTH_STENCIL ("1D texture cannot be an attachment"), although the PC
runtime creates them: on an RX 6750 XT the AMD adapter and WARP both accept
64 color formats as 1D render targets and 20 as 1D depth-stencils. The 1D
RTV/DSV code already on main was unreachable.

Accepting them also needs a valid attachment view: VulkanBackend::view made
every attachment view VK_IMAGE_VIEW_TYPE_2D_ARRAY, which a VK_IMAGE_TYPE_1D
image can't take (VUID-VkImageViewCreateInfo-subResourceRange-01021). That
already hit rectangle clears of 1D UAV textures on main, whose UAV images
get color-attachment usage. ResourceBinding now records a 1D image, and its
attachment views are 1D arrays. A driver without the 1D attachment image
still refuses through check_image_support.

d3d12_texture1d_target_test compares creation with the host adapter and
WARP, and reads back clears through 1D and 1D-array RTVs and DSVs (whole and
rectangles, mips, slice ranges) and a 1D UAV rectangle clear against WARP.
d3d12_typeless_families_test runs its draws on a 1D target too.
d3d12_vulkan_device_test expected the old refusal.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015z45kpgzff6KvVjAnLtc4h
2026-11-22 22:30:25 -03:00
fdbb95d6db Runtime: compare fence and queue semantics with the host (D3D-48)
Add a comparison test that runs the same Signal/SetEventOnCompletion/GetCompletedValue sequence on both the shim and the host PC runtime and asserts their completed value and HRESULT agree. A signal of an already-passed (lower) value is a documented deviation (the shim stays monotonic because a Vulkan timeline cannot go back), so it is checked against the documented behaviour rather than the host. No game files; runs on WARP or any D3D12/Vulkan GPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:37:32 +01:00
099bcf8f3d d3d12: GetCopyableFootprints wraps a mip shift past 32 as the host does, without UB
GetCopyableFootprints sized a mip with desc->Height >> mip and
depth >> mip on 32-bit values, and desc->Width >> mip on 64 bits. D3D12
accepts any MipLevels, so a shift count of 32 (64 for the width) or more
is reachable, and C++ leaves it undefined. Measured on an RTX 5060 Ti,
the PC runtime's own shift wraps: a 16x16 texture with 40 mips reports
subresource 32 as 1x16 and 33 as 1x8, a 40-mip volume 16 slices at mip
32. The layer matched only because MSVC's x64 shift masks the count the
same way; the counts are now masked explicitly (& 31, & 63), which gives
the same answers by definition.

compare_footprints: a 40-mip 2D texture, a 70-mip 1D texture and a
40-mip volume, every subresource compared with the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:26:47 +01:00
e01d37d656 d3d12: ID3D12Heap::GetDesc reports the resolved alignment and node 1
ID3D12Heap::GetDesc returned the creation description unchanged. The
host runtime reports the alignment the heap was placed with (64 KiB for
an Alignment of 0) and the one node for a node mask of 0, as the layer
already does for resources, descriptor heaps and queues: measured on an
RTX 5060 Ti, 19 of 20 heaps (default, default with 4 MiB alignment,
upload, readback, custom; each node-mask pair) read back differently.

d3d12_vulkan_device_test: compare_heap_descs creates each heap on the
layer's arena device and on the host and compares the whole GetDesc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:23:27 +01:00
15f9dc6eb8 D3D12: report A8_UNORM shader gather support 2026-11-23 00:12:36 +01:00
18a785d51f Merge main (aa2988cc) into the D3D-45 clear branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:45:24 +03:00
93e543d18e Merge pull request #3774 from MeNoSkills 2026-11-22 17:03:42 -05:00
fe5b522fa9 Merge pull request #3653 from Claude 2026-11-22 17:03:12 -05:00