Commit Graph

8206 Commits

Author SHA1 Message Date
Herman S.
a092551735 [Vulkan/D3D12] Validate upload range bounds before vastcpy
The D3D12 backend's existing check only validated the last page of the
range. The Vulkan backend had no check at all and did not respect the
gpu_allow_invalid_upload_range cvar. Both now verify start and
end pages are mapped before copying, preventing access violations when
games reference unmapped guest physical memory during transitions.
2026-02-17 21:22:48 +09:00
Herman S.
3e1b0c715a [Vulkan] Vertex buffer residency caching
Cache vertex buffer address/size per fetch constant, invalidate on fetch
constant write, reset at frame boundaries
2026-02-17 21:22:00 +09:00
Herman S.
2ad412a141 [Vulkan] Add support for vkPipelineCache 2026-02-17 21:21:56 +09:00
Herman S.
6057b0a7c7 [Vulkan] Implement ClearCache to clear upload_buffer_pool 2026-02-17 21:10:38 +09:00
Herman S.
4d15f0afea [Vulkan] Implement same vastcpy upload_buffer optimization as d3d12 2026-02-17 21:10:13 +09:00
Herman S.
ef505fbe3d [Vulkan] add no_discard_stencil_in_transfer_pipelines support 2026-02-17 17:54:01 +09:00
Herman S.
24f90c0efc [Vulkan] Fix stencil bit transfer shaders not discarding pixels
"packed" was never set because source_depth_texture isn't created for
stencil bit output. This caused the discard logic to be skipped
resulting in stencil being incorrectly incremented on every transfer
draw until it saturated at 0xFF.

Fixes many remaining Vulkan rendering issues, e.g. Brothers, Orange Box,
Arkham Origins, many others.
2026-02-17 17:44:23 +09:00
Herman S.
878de4c352 [Vulkan] Fix sampler params 2026-02-17 17:44:08 +09:00
Herman S.
dc66d67a31 [Vulkan] Use VK_FORMAT_A2B10G10R10 for xenos::ColorRenderTargetFormat::k_2_10_10_10
Aligns with D3D12's DXGI_FORMAT_R10G10B10A2_UNORM
2026-02-17 17:43:55 +09:00
Herman S.
1a4b78e377 [Vulkan] Invalidate descriptor set bindings for incompatible sets
The code to do this was set up but it seems it was never implemented.
2026-02-17 17:43:45 +09:00
Herman S.
a716dc6fac [Vulkan] Fix kComputeWrite access mask
Access mask was incorrectly set to VK_ACCESS_SHADER_READ_BIT
2026-02-17 17:41:21 +09:00
Herman S.
5be503da77 [Vulkan] Don't try to create geometry shader for rectangle list 2026-02-17 17:40:59 +09:00
Herman S.
ec5816a278 [Vulkan] Use vertex_fetch_bitmap instead of vertex_bindings()
Avoids using cached/stale vertex binding indices
2026-02-17 17:40:26 +09:00
Herman S.
16f842038b [Build] Automatically detect VULKAN_SDK - ported from edge 2026-02-17 17:29:33 +09:00
Herman S.
434644c301 Merge commit 'f2fabfdf0' into canary_experimental
Sync changes from master up to before the recent GPU changes, those will be
merged later
2026-02-17 16:59:38 +09:00
Herman S.
20b226dbdf [Vulkan] Update glslang to 16.0.0 and introduce compat layer 2026-02-17 15:34:23 +09:00
Herman S.
f722b6b85f [Vulkan] Workaround for glslang 11.6.0+ change in accesschain semantics 2026-02-17 14:58:10 +09:00
Herman S.
8d76331df5 [3PP] Update vulkan related submodules 2026-02-17 14:42:01 +09:00
Herman S.
2d6b7c6ca1 [XMA] Fix dedicated thread stalls by blocking guest audio thread
Includes various other thread safety and timing related adjustments
2026-02-17 13:57:32 +09:00
Herman S.
6e5b2a95b0 [XMA] Fix multiple audio issues in new decoder
- Handle XMA2 frames with headers split across packet boundaries
  (fixes audio cutoff in Capcom games)
- Output buffer minimum space check using actual frame size instead
  of SDC-based formula, allowing tight-buffer contexts to decode
  (fixes PGR4 engine sounds)
- Gate consume-only context clearing with tight-buffer heuristic to
  prevent disrupting playback while still allowing stream completion
  signaling (fixes Borderlands 2 dialog)
- Clamp read offset 0 to packet header size to prevent decode rejection
  loop (fixes Dirt 2 crashes)
2026-02-17 13:56:24 +09:00
Herman S.
7213f7e69b [XMA] Fix consume-only context clear being overwritten in new decoder 2026-02-17 13:54:19 +09:00
Herman S.
ea056849fa [XMA] Fix recursive lock acquisition in new decoder 2026-02-17 13:54:05 +09:00
Adrian
abaa0e4c96 [XBDM] Implemented DmGetConsoleType 2026-02-16 21:33:13 +01:00
Adrian
bf5ddc6b71 [APP] Added memory unit (MU) mount option 2026-02-16 19:52:49 +01:00
Herman S.
f9d4dbc8e9 [Build] Use clang 20 for clang format consistently across Win/Lin 2026-02-15 01:25:43 +09:00
Herman S.
a769d70761 [CPU] Detect FPSCR exceptions in UpdateFPSCR for Rc=1 FPU instructions
Implement SNaN detection and FPSCR exception tracking so that Rc=1 FPU
instructions (fadds., fmadds., etc.) correctly update CR1 with FPSCR
exception summary bits (FX, FEX, VX, OX). Previously these were
hardcoded to zero. Enable ~2k tests that were previously disabled.
2026-02-15 00:59:27 +09:00
Herman S.
0202be1af1 [Testing] Reset MXCSR state between test cases
...to prevent denormal flush leaking
2026-02-15 00:59:19 +09:00
Herman S.
eb8386c5f5 [Build] Use available clang version >= 19 for clang format 2026-02-14 23:52:22 +09:00
Herman S.
563a6459d3 [CPU] Fix ppc-opcode-gen script and regen the opcodes 2026-02-14 23:48:21 +09:00
Herman S.
9b41d1d614 [Testing] Remove tests for unimplemented instructions 2026-02-14 23:48:21 +09:00
Herman S.
c741b31378 [Testing] add skip file support to cpu/ppc tests 2026-02-14 23:48:16 +09:00
Herman S.
8bee63e010 Merge remote-tracking branch 'xenia-master/gen_tests' into canary_experimental 2026-02-14 18:32:53 +09:00
Herman S.
b2ba98ade7 [Testing] Use the same binutils on windows and linux 2026-02-14 17:40:45 +09:00
Herman S.
92b341e50c [Testing] Add support for building binutils with mingw64 2026-02-14 17:40:40 +09:00
Herman S.
f2b9b57e18 Reapply "[x64] Zero extend on mov to 8bit register"
This reverts commit 3a6f63f34f.

(The issue wasn't xbyak but rather cherrypick order wrt to
other commits, xbyak upgrade was a red herring)
2026-02-14 02:23:58 +09:00
Herman S.
f5afafaec0 Ensure stack allocations maintain 16-byte alignment for AVX instructions 2026-02-14 02:02:40 +09:00
Herman S.
1548b4e11c [CPU/PPC] Add VX128_2 VC field support for vperm128
Add 3-bit VC field to VX128_2 format structure to support
instructions like vperm128 that use 4 distinct vector operands.

The VC field occupies bits 6-8 of the instruction encoding.
2026-02-14 01:57:22 +09:00
Herman S.
f4af1e2a77 [CPU/PPC] Implement and fix FPSCR-related instructions
mcrfs: Implement Move CR from FPSCR instruction
Copies a 4-bit FPSCR field to CR and clears the FPSCR exception bits.

mffsx: Fix Rc bit handling
Properly update CR1 from FPSCR when Rc=1 instead of returning error.
Previously treated Rc=1 as unimplemented.

fcfidx: Fix Rc field access
Use i.X.Rc instead of i.A.Rc for correct instruction format.
fcfid uses X format, not A format.
2026-02-14 01:55:54 +09:00
Herman S.
fb76cbb291 [CPU/PPC] Implement mcrxr instruction
Implement mcrxr (Move to Condition Register from XER).

Copies XER condition bits (SO, OV, CA) to a CR field and
clears those bits in XER. This was previously unimplemented.
2026-02-14 01:45:44 +09:00
Herman S.
b5d2eea07b [CPU/PPC] Fix mfvscr/mtvscr instruction format
Correct mfvscr and mtvscr to use VX format instead of VX128_1.

These instructions operate on the standard Altivec VSCR register,
not VMX128 extended registers. The previous VX128_1 format was
incorrectly accessing the RB field instead of VD/VB.
2026-02-14 01:44:33 +09:00
Herman S.
9369464396 [PPC] vsubcuw is actually implemented, enable it 2026-02-14 01:39:00 +09:00
Herman S.
7e66a85f43 [x64/Linux] More return __m128i by value in xmm0 rather than pointer 2026-02-14 01:38:53 +09:00
Herman S.
0921a4fb04 [x64/Linux] Return __m128i by value in xmm0 rather than a pointer 2026-02-14 01:35:12 +09:00
Herman S.
2abf91603e [x64/Linux] Ensure EmitHostToGuestThunk saves rsi 2026-02-14 01:34:59 +09:00
Herman S.
83ff0c501b [CPU] Set VSCR NJ (non-Java) bit 2026-02-14 00:59:45 +09:00
Herman S.
11815400cd [CPU] Fix f16 pack rounding and SHORT_2 test input
Add round-to-nearest-even to the fast float16 pack path by folding a
0xFFF rounding bias into XMMF16PackLCPI0 and extracting bit 13 of the
source as the tie-breaker, matching the software fallback behavior.

Fix PACK_SHORT_2 test to use pre-biased float input (0x40400000 = 3.0)
as the hardware expects, rather than raw 0.0f which is out of range.
2026-02-14 00:48:16 +09:00
Herman S.
bb70e5c651 [CPU] Fix incorrect all_same detection in constant vector shift paths
The loop conditions `n < 8 - n` and `n < 4 - n` terminated early,
only checking the first half of elements. This caused EmitInt16 and
EmitInt32 to incorrectly take the uniform shift path when trailing
elements had different shift amounts.

Resolves potential issues in SHL, SHR, and SHA.
2026-02-14 00:35:09 +09:00
Herman S.
10e8224a63 [CPU] Use RAII lock_guard in GuestTrampolineGroup 2026-02-14 00:17:45 +09:00
Herman S.
643c13668d [CPU] Correctly zero extend instead of sign extending
When performing unsigned multiplication on Linux/GCC,
the code incorrectly cast constant.i64 (which is a signed int64_t)
to unsigned __int128. This caused sign extension when
the value should be treated as unsigned.
2026-02-13 23:54:51 +09:00
Herman S.
7912eab85e [CPU] Check for null when returning machine code ptr 2026-02-13 23:53:01 +09:00