Commit Graph

1696 Commits

Author SHA1 Message Date
151c372ee1 Merge pull request #2395 from Matheus Gomes 2026-11-22 13:14:40 -05:00
78688eab40 Merge pull request #2389 from Julio Facal
# Conflicts:
#	docs/design.md
2026-11-22 13:14:35 -05:00
b01caaf086 Merge pull request #2386 from pietr 2026-11-22 13:14:30 -05:00
6579038528 Merge pull request #2383 from Sc4ros 2026-11-22 13:14:28 -05:00
e41720bac9 Merge pull request #2373 from Ewann 2026-11-22 13:14:21 -05:00
5864f1875c Merge pull request #2372 from Dominik 2026-11-22 13:14:20 -05:00
900473fcce Merge pull request #2343 from edupode 2026-11-22 13:14:02 -05:00
c5ab4bba97 Merge pull request #2327 from Dominik 2026-11-22 13:13:54 -05:00
d30267d4ed Merge pull request #2313 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 13:13:48 -05:00
c7894a6fb7 Merge pull request #2242 from Ewann 2026-11-22 13:13:28 -05:00
99e5a1da3c Merge pull request #2203 from Dominik 2026-11-22 13:13:18 -05:00
4888fbb56d Merge pull request #2199 from edupode 2026-11-22 13:13:14 -05:00
919717d178 Merge pull request #2189 from towade 2026-11-22 13:13:13 -05:00
fbd598c2d0 Merge pull request #2187 from Vonsek 2026-11-22 13:13:12 -05:00
c457e0a7bd Merge pull request #2116 from swam122yam-glitch 2026-11-22 13:13:03 -05:00
7f29bae81e Merge pull request #2111 from Thatters 2026-11-22 13:13:03 -05:00
c68a35bcb4 Merge pull request #2109 from TheHoracio 2026-11-22 13:13:02 -05:00
45a5aec292 Merge pull request #2100 from Koro4e 2026-11-22 13:13:01 -05:00
4d64f9a68f Merge pull request #2069 from AlxcBTW 2026-11-22 13:12:59 -05:00
407a53923e Merge pull request #2048 from whoalin1
# Conflicts:
#	docs/testing.md
2026-11-22 13:12:54 -05:00
0a46434246 Merge pull request #1985 from Dominik 2026-11-22 13:12:46 -05:00
db317bd3ee Merge pull request #1947 from Jolymmiles 2026-11-22 13:12:44 -05:00
ec3d4384df Merge pull request #1818 from SHAURYASANYAL3 2026-11-22 13:12:35 -05:00
c8f8c00e34 Merge pull request #1798 from SHAURYASANYAL3 2026-11-22 13:12:34 -05:00
6cfe5862ed Merge pull request #860 from adonizm 2026-11-22 13:12:29 -05:00
51d954a2cd Merge pull request #436 from S1m0ne1997 2026-11-22 13:12:27 -05:00
60cc47cb79 Merge pull request #306 from IAmNotSiob 2026-11-22 13:12:26 -05:00
64184fc835 Merge main into sdwa-dword-hi16 (#2187)
Conflicts:
	tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 18:53:24 +01:00
6e65dc9ec2 xgameruntime: resolve MSVC C4201 nameless struct and C4996 strncpy warnings 2026-11-22 23:15:27 +05:30
5ab5c208c9 xgameruntime: deny mounting game package identifier with E_ACCESSDENIED 2026-11-22 23:15:27 +05:30
4a90673850 xgameruntime: validate installed package identifiers and reject unknown packages in XPackageMount 2026-11-22 23:15:26 +05:30
cb8c6445fc xgameruntime: implement XPackageMount and handle registry for mount path getters 2026-11-22 23:15:26 +05:30
48cf34f3a8 xgameruntime: implement XPackageGetMountPathSize and validate XPackageMountHandle per GDK spec 2026-11-22 23:14:50 +05:30
fd9bc14131 dxgi: return DXGI_STATUS_OCCLUDED on CreateSwapChain fullscreen fallback and add test 2026-11-22 23:12:44 +05:30
342eef5eb5 dxgi: match native DXGI INVALID_CALL for CreateSwapChain params and E_NOINTERFACE on Factory::GetParent 2026-11-22 23:12:44 +05:30
7ec740b9be dxgi: implement Factory CreateSwapChain delegation, GetParent, and SwapChain GetCoreWindow/GetRestrictToOutput 2026-11-22 23:12:43 +05:30
b43aa8854b d3d12_state_map_test: cover the primitive-topology map
vulkan_topology (D3D12 primitive topology -> VkPrimitiveTopology) and
strip_topology (which Vulkan topologies a restart index cuts) had no test. A
wrong mapping draws the wrong primitive; a wrong strip classification restarts an
indexed strip that should not, or fails to restart one that should.

Pins both: every mapped D3D12 topology value to its VkPrimitiveTopology and strip
flag, the triangle-list fallback for list/undefined/unmapped values, and the
strip classification, with the D3D_PRIMITIVE_TOPOLOGY enum values SDK-asserted.

ctest -R d3d12_state_map passes (MSVC /W4 /permissive-, Windows SDK 10.0.26100,
Vulkan headers 1.4.363). Header-only, no GPU, no game files.
2026-11-22 14:40:03 -03:00
cde85e21e1 Runtime: stage block-compressed copies one vkCmdCopyImage cannot express
CopyTextureRegion between two block-compressed textures copies whole blocks
on the PC runtime. When a mip edge falls inside a block on one side only (a
4x4 box into a 3x3 mip, a 6x6 mip into a 12x12 one), no single Vulkan extent
is a block multiple or reaches the edge of both images, so the layer refused
the copy with invalid_copy (docs/d3d12_vulkan.md, section 3.2 known gaps).

Such a copy now goes through the transfer scratch that depth <-> colour
copies already use (vulkan_scratch.h): vkCmdCopyImageToBuffer with the
source's own cut extent into whole blocks, then vkCmdCopyBufferToImage with
the destination's. The box fits the source's padded mip, so the scratch
holds every block the destination reads. The staged emit path calls the
destination's copy_layout after the scratch write, so every earlier transfer
write is ordered before the destination's (the write-after-write @Vonsek
found under synchronization validation in the first version of #860).

- d3d12_copy_compare: the 8 BC mixed-mip cases that were printed as known
  differences must now match the host; two more shapes (a source edge inside
  the block, a destination offset to the edge).
- d3d12_state_map_test checks the staged regions on the CPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:32:05 +01:00
5620a444ad Runtime: review fixes for DisableThreadLibraryCalls
- the DisableThreadLibraryCalls table entry gets its own continued line (it
  shared FreeLibrary's, 231 columns wide), and its comment is wrapped to 120;
- dll_thread_calls_test also calls the shim with a shim pseudo-handle (the
  handle GetModuleHandleA("xmem.dll") returns), which the Windows function
  would refuse: removing the pseudo(module) branch now fails the test.
  xmem.cpp is linked into the test only to give the shims a module to own.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 18:23:23 +01: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
84f86c5a7d test: cover XMem virtual allocation APIs 2026-11-22 17:20:42 +00:00
6a2246c299 TEST-330: check presented colour via swapchain readback under Wine 2026-11-22 18:19:43 +01:00
9b17404e15 Runtime: replay overlapping statistics and binary occlusion queries (D3D-252)
D3D12 only forbids beginning the same query element twice while it runs, so a
command list may overlap two pipeline-statistics queries, or an ordinary
occlusion query and a binary one, on different slots of one heap. The replay
refused all of those with ReplayResult::unsupported. The overlapping-ordinary
occlusion machinery already virtualizes concurrent queries as non-overlapping
physical segments whose results are summed; this extends it to the remaining
cases:

- Binary occlusion joins the ordinary kind in the same physical pool (both are
  VK_QUERY_TYPE_OCCLUSION, so one physical query is open at a time and the
  shared intersection interval is counted by both logical queries). A binary
  resolve of a multi-segment query sums its segments and normalizes the total
  to 0/1 (OcclusionResolve::sum_binary; run flag needs_sum_binary).
- Overlapping pipeline-statistics queries split into the statistics pool with
  the same one-slot-per-event layout (plan_overlapping_statistics_segments);
  every non-timestamp resolve while a query runs closes and reopens the open
  segment for D3D-162's helper-dispatch exclusion. The single-list replay()
  helper still has no segment pool and refuses such lists outright instead of
  running two Vulkan queries of one type whole.

The device test's old pin of the occlusion+binary refusal now expects a
replay; vk_overlapping_occlusion adds crossing statistics queries checked
word-by-word against three unsplit references and an ordinary query around a
binary one; replay_query_predication pins the segment layouts, the composite
binary resolve and the helper's refusal without a GPU. docs/d3d12_vulkan.md
4.6 moves the case out of "Not implemented yet".

AI-assisted: yes
2026-11-22 18:10:42 +01:00
93e6513237 xgameruntime: XSystemImpl answers its inherited interface ids; sandbox id needs 16 bytes
Review (@Flyander):
- QueryInterface accepted the class id and IXSystemImpl5 only. The IDL
  chain is IXSystemImpl5 : IXSystemImpl4 : IXSystemImpl3 : IXSystemImpl2 :
  IXSystemImpl (xgameruntime include/xsystem.idl), so every one of them is
  served by the same vtable. RuntimeObject now carries a null-terminated
  list of interface ids instead of one newer id (XNetworkingImpl's list is
  IXNetworkingImpl2).
- XSystemGetXboxLiveSandboxId requires sandboxIdSize >=
  XSystemXboxLiveSandboxIdMaxBytes (16); buffers of 7-15 bytes returned
  S_OK. copy_id takes the API minimum.

Tests: a 15-byte sandbox buffer is refused, 16 accepted; all five
IXSystemImpl ids give the same object.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:10:41 +00:00
97afefdebc Merge remote-tracking branch 'origin/main' into shader-33-vs-inputs
# Conflicts:
#	tests/test_shader_checks.py
2026-11-22 18:06:20 +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
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
64b24f69fd SHADER-378: dynamic --f16-interp-fallback packing and per-pipeline SPIR-V half linking 2026-11-22 13:57:55 -03:00
33456ca4e7 fix(test): enable shaderFloat64 for compute SPIR-V that declares it
Use the existing SPIR-V capability scan to request the feature before creating the Vulkan device, or report an unsupported-device skip. Add a synthetic compute case that checks both words of a binary64 result.
2026-11-22 13:53:56 -03:00