Commit Graph

474 Commits

Author SHA1 Message Date
81ec7f74c3 d3d12: link f16 halves between the VS and the PS, which is stages[2] since #2109
#2109 made the PSO stages {vs, gs, ps}; the --f16-interp-fallback link (SHADER-378, #2389) still read the PS from
stages[1], found the empty GS slot and never ran, so d3d12_f16_halves drew nothing. With a GS the PS reads the GS's
outputs, so the VS/PS link is skipped there (logged once). Also: xgameruntime_test re-reads the package id after
clearing the LEONIDA_PACKAGE_ID override.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:41:01 -05:00
3a44e1926b Merge pull request #2736 from mrp1no 2026-11-22 13:17:27 -05:00
a44df460f3 Merge pull request #2662 from admin 2026-11-22 13:16:54 -05:00
1c3360367f Merge pull request #2591 from 0xTehuti 2026-11-22 13:16:24 -05:00
23f61f5724 Merge pull request #2563 from Ewann 2026-11-22 13:16:12 -05:00
da3861dd86 Merge pull request #2462 from mrp1no 2026-11-22 13:15:29 -05:00
84df39f34f Merge pull request #2453 from Flyander 2026-11-22 13:15:26 -05:00
0dff1b420b Merge pull request #2416 from Ewann 2026-11-22 13:15:09 -05:00
78688eab40 Merge pull request #2389 from Julio Facal
# Conflicts:
#	docs/design.md
2026-11-22 13:14:35 -05:00
e41720bac9 Merge pull request #2373 from Ewann 2026-11-22 13:14:21 -05:00
c7894a6fb7 Merge pull request #2242 from Ewann 2026-11-22 13:13:28 -05:00
c68a35bcb4 Merge pull request #2109 from TheHoracio 2026-11-22 13:13:02 -05:00
4d64f9a68f Merge pull request #2069 from AlxcBTW 2026-11-22 13:12:59 -05:00
db317bd3ee Merge pull request #1947 from Jolymmiles 2026-11-22 13:12:44 -05:00
60cc47cb79 Merge pull request #306 from IAmNotSiob 2026-11-22 13:12:26 -05:00
c226964ea0 d3d12: WriteToSubresource/ReadFromSubresource answer as the host runtime does
d3d12_subresource_copy_test runs the same 117 steps on the Vulkan-backed device
and on the host runtime: textures in write-back and write-combine custom heaps,
a volume, an array, BC1 blocks, a buffer, an upload-heap buffer, a default-heap
texture and a multisampled one; whole and boxed copies, boxes outside, empty,
inverted or cutting a block, subresources past the last, pitches too small or
0, and copies before Map. It records every HRESULT and a hash of the whole
destination of every read, once per copy path (host image copy and staging).
On main 17 steps differed (RTX 3060, driver 610.88); now none do. The host's
rules:

- a box is refused only when its right, bottom or back edge lies past the
  mip's, or it cuts a compressed block; an empty or inverted box that passes
  those checks is S_OK and copies nothing (the layer refused it);
- the row and depth pitches are not checked: rows or slices that overlap are
  copied in order (the layer refused a pitch smaller than a row or slice).

Not compared, and reported as such: null data (the host faults; the layer
still answers E_INVALIDARG), which bytes win when a read's rows overlap (the
driver's copy order, tiled on NVIDIA), and a default-heap texture, which the
host refuses and the layer copies on purpose, as docs/d3d12_vulkan.md says.

d3d12_vulkan_device_test's cpu_copies expected the old refusals for an empty
box and overlapping slices, and now expects S_OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:04:31 +01:00
ccc7cf8f3c Merge remote-tracking branch 'upstream/main' into d3d-msaa-quality-levels-host 2026-11-22 17:52:50 +00:00
90555270cb Reject R1_UNORM and keep output for unknown formats in MULTISAMPLE_QUALITY_LEVELS; fix flag type name
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 17:50:24 +00:00
a78c36ae51 d3d12: acceleration-structure state only on a device that has them
@aguedou-34 measured on #2462 that an integrated Radeon without DXR (OPTIONS5
reports no ray tracing) refuses a UAV buffer created in
RAYTRACING_ACCELERATION_STRUCTURE state, which an RTX accepts. The layer now
accepts that state only where it has acceleration structures (KHR builds, or
the XDXR records with the GPU address arena), for committed, placed and
reserved resources alike, and refuses it elsewhere.

d3d12_vulkan_device_test compares the existing committed case on the device
main builds (no acceleration structures) only with a host without ray
tracing, and two new cases on the standalone device (committed and placed)
only with a host that has it; otherwise they are reported as not comparable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:43:48 +01:00
98b0335c6c d3d12: log when an allocation spills from DEVICE_LOCAL to host memory (D3D-299) 2026-11-22 18:33:06 +01:00
7a9bebd226 Runtime: CheckFeatureSupport(FORMAT_SUPPORT) answers UNKNOWN and unlisted formats as the host does
Measured against the host D3D12 runtime (RTX 5070, driver 621.14):
UNKNOWN is a buffer format (S_OK, Support1 = BUFFER), and a value the
runtime's format table has no entry for is E_FAIL: 116-188, which
includes the planar video formats P208/V208/V408 at 130-132, and 192 and
up. The layer answered DXGI_ERROR_UNSUPPORTED for both.

compare_invalid_arguments gets 11 "format support:" cases, comparing the
HRESULT and Support1. Support2 is not compared, because the host's
TILED is a GPU capability the layer doesn't offer. The local check that
expected UNKNOWN to fail now expects the host's answer. 115, 189 and 191,
the table's edges, must not be E_FAIL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:29:43 +01:00
eac6e0cee8 Match host multisample quality level query validation
Follow RTX 5070 / 621.14 measurements from upstream #1991; preserve tiled-resource rules and cover host answers synthetically.

AI-assisted.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 17:26:17 +00:00
1ace3ac642 Merge remote-tracking branch 'origin/main' into d3d12-queues-v2
# Conflicts:
#	runtime/src/vulkan_backend.h
2026-11-22 18:21:38 +01:00
9b50f17532 Runtime: one required-subgroup-size struct per graphics stage (VS, GS, PS)
The recipe kept two VkPipelineShaderStageRequiredSubgroupSizeCreateInfo, one
per stage of the old VS+PS table; with a GS the PS's subgroup request wrote a
third one past the array, into the recipe's attribute vector (found by
@0xTehuti on #2109). The array now has three entries and a static_assert ties
it to the stage table.

d3d12_geometry_test's PS asks for a 32-wide subgroup, so a VS+GS+PS pipeline
fills the third struct: without the fix the test crashes (3 of 3 runs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:05:49 +01:00
2a015677b3 Runtime: geometry shaders in graphics PSOs (VS + GS + PS)
CreateGraphicsPipelineState refused any desc.GS, although all 195 geometry
shaders translate (triangles in, a triangle strip out; docs/design.md
"Geometry shaders"). The stage table now holds VS, GS and PS; a GS needs the
geometryShader feature (enabled on the standalone and test devices where
the GPU has it, E_NOTIMPL otherwise), and the PSO's topology type must be
TRIANGLE, the GS's input (E_INVALIDARG otherwise). The push-constant range
names the geometry stage only where the device has it. Hull, domain and
stream output stay refused.

d3d12_geometry_test (in ctest): a GS that emits each triangle twice, against
a pipeline without one, and a line topology refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:05:49 +01:00
1240e41494 Fix Windows SDK 10.0.26100 D3D12 compatibility 2026-11-22 18:05:26 +01:00
076149b744 d3d12: placed and reserved resources answer their arguments as the host does
compare_placed_reserved (d3d12_vulkan_device_test) runs 76 CreatePlacedResource
and CreateReservedResource cases against the host runtime on the standalone
device. On main 31 of them differed (RTX 3060, driver 610.88):

- CreatePlacedResource checked none of the description, initial-state and
  clear-value rules CreateCommittedResource has, and checked a plain texture's
  size against nothing: a texture larger than its heap, or past its end, was
  accepted. A small texture (4 KiB alignment) at a 4 KiB offset was refused.
- CreateReservedResource checked those rules only for textures (through the
  committed backing) and never the initial state or clear value.
- Both answered a null output with S_FALSE; the host checks the arguments,
  then answers E_UNEXPECTED.

The initial state was not checked for committed resources either. The host
takes exactly GENERIC_READ, one write state alone (RENDER_TARGET,
UNORDERED_ACCESS and DEPTH_WRITE with their flag), or a mix of read states on a
texture; any bits on a buffer except the acceleration-structure state without
UAV access. initial_state_refusal holds that rule, in committed_resource_refusal,
so committed, placed and reserved resources share it; 23 "committed: ... state"
cases pin it in compare_invalid_arguments.

A placed buffer in an upload or readback heap takes any initial state on the
host (a committed one must start in GENERIC_READ or COPY_DEST); UAV access is
refused there as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:02:11 +01:00
6670b2bca0 d3d12: order timestamp resolves after their writes on MoltenVK
On Apple GPUs MoltenVK samples a vkCmdWriteTimestamp in a blit pass of its own at the end of the current Metal
encoder. Nothing orders the vkCmdCopyQueryPoolResults resolve after that pass. The copy read the old value, or 0 for
a timestamp never written, so d3d12_vulkan_device failed under Wine on a Mac (t1 == 0). A minimal Vulkan program
reproduces it natively on MoltenVK 1.4.3 and 1.4.2: the copy was right 0 to 43 times in 200, in the same command
buffer, the next one or the next submit. KosmicKrisp and llvmpipe were right in every case.

Where driverID is MoltenVK, the queue sets and waits for a fresh VkEvent before each timestamp resolve that copies.
A submission with such a resolve also waits on the queue's timeline for the submission before it. Both measured
200/200 and 500/500. The timestamps are still the GPU's own. The events go back to a pool after a host reset once
their submission completes. d3d12_vulkan_device also checks a resolve in the execution after the write. Documented
in docs/d3d12_vulkan.md section 4.6.
2026-11-22 21:00:39 +04:00
78e83dec6f Runtime: GetCustomHeapProperties names node 0 where it has no answer, as the host does
For CUSTOM, an unknown heap type and a node mask other than node 0, the
layer answered an all-zero D3D12_HEAP_PROPERTIES. The host runtime
(RTX 5070, driver 621.14) answers the same zeros, but with node 0 in
CreationNodeMask and VisibleNodeMask. The masks are now set first, for
every answer.

d3d12_fence_timing_test compares those four cases with the host too:
CUSTOM on node masks 0 and 1, type 99 and UPLOAD on node mask 2. Before,
only DEFAULT, UPLOAD and READBACK were compared. Its local check of the
CUSTOM answer now includes the memory pool and the masks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:58:40 +01:00
64b24f69fd SHADER-378: dynamic --f16-interp-fallback packing and per-pipeline SPIR-V half linking 2026-11-22 13:57:55 -03:00
97daa1aec0 Merge origin/main into presentx-planes
Keeps the swapchain_colorspace enable and main's custom border colour extension in
create_vulkan_device_standalone; the present compose path follows main's LayoutPieces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:51:53 +01:00
f2d7501f1d Merge pull request #2308 from AREA52 Agent 2026-11-22 11:44:03 -05:00
3fd09d4ecd Merge pull request #2232 from Jolymmiles 2026-11-22 11:43:11 -05:00
b3a5411ce0 Merge pull request #2186 from fearkov
# Conflicts:
#	docs/design.md
2026-11-22 11:42:36 -05:00
2d848a33ee Merge pull request #2167 from Alex Arenas 2026-11-22 11:42:25 -05:00
e3c972d0d5 Merge pull request #2145 from KanameS 2026-11-22 11:42:13 -05:00
6f77e39793 Merge pull request #2112 from SirKingg 2026-11-22 11:41:54 -05:00
388a4723c2 Merge pull request #2103 from requiemsnkrp 2026-11-22 11:41:49 -05:00
95ac207b7b Merge pull request #2099 from Luis Baker 2026-11-22 11:41:47 -05:00
2fe08d7e18 Merge pull request #2084 from Luis Baker 2026-11-22 11:41:37 -05:00
e0b03b2721 Runtime: CheckFeatureSupport refuses the undefined shader models between 5.1 and 6.0
D3D12_FEATURE_SHADER_MODEL echoed a request of 0x52-0x5f back with S_OK.
No runtime defines a model there, and the host runtime refuses them
with E_INVALIDARG (RTX 5070, driver 621.14). Refuse them the same way.
Requests above 6.9 stay clamped to the layer's model, as newer runtimes
accept newer ones. Checked in d3d12_vulkan_device_test's main, not
against the host: the test notes the host crashed on 0x5f elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:41:18 +01:00
817de3de95 Merge pull request #2041 from fearkov 2026-11-22 11:41:08 -05:00
1e24a98cce Merge pull request #2032 from Alex Arenas 2026-11-22 11:41:04 -05:00
1241d87e4f Merge pull request #1991 from TheHoracio 2026-11-22 11:40:59 -05:00
56000c7c7f Runtime: CreateRootSignature and CreateQueryHeap answer invalid arguments as the host does
Measured against the host D3D12 runtime (RTX 5070, driver 621.14) with
d3d12_vulkan_device_test's compare_invalid_arguments, five answers
differed:

- CreateRootSignature took a node mask other than node 0 (host:
  E_INVALIDARG), took a DXBC blob passed with more bytes than its own
  size (host: E_INVALIDARG), and answered a null output with E_POINTER.
  The host answers a null output with S_FALSE before it looks at the
  blob or the node mask.
- CreateQueryHeap answered an unknown type (past PIPELINE_STATISTICS1)
  with E_NOTIMPL (host: E_INVALIDARG), and a null output with S_FALSE
  (host: E_UNEXPECTED, after the description checks).

compare_invalid_arguments gets 30 "query heap:" and "root signature:"
cases. The root signature blobs come from the host's serializer.
d3d12_vulkan_device_test's own null-output check now expects
E_UNEXPECTED. Known query types this layer has no path for stay
E_NOTIMPL, and more than 32 root dwords stay refused (pack()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:40:55 +01:00
067e0240bd Merge pull request #1935 from Tao Battarel 2026-11-22 11:40:49 -05:00
72b6218983 Merge pull request #1916 from cobalt-pebble-804 2026-11-22 11:40:47 -05:00
24796f5284 Merge pull request #1886 from Claude 2026-11-22 11:40:44 -05:00
fc2ee62c98 Merge pull request #1683 from requiemsnkrp 2026-11-22 11:40:37 -05:00
7812487acc d3d12_vulkan_device: answer Intel integrated OPTIONS1 lanes per generation (D3D-280)
Meteor Lake (Xe-LPG) hosts answer 8..32 while the D3D-121 rule pins 16..16 for every
Intel integrated GPU; keep the measured 16..16 pin on pre-Xe-LPG lines (Tiger Lake
regression-checked locally) and keep the Vulkan range on Xe-LPG+ device-ID ranges
(Meteor/Arrow Lake 0x7d40-0x7dc5, Lunar Lake 0x64a0-0x64b6).

Fixes D3D-280.
2026-11-22 17:38:00 +01:00