Commit Graph
4421 Commits
Author SHA1 Message Date
Claudio GodoiandClaude Opus 5.5 14ada48a13 vk_rasterizer: Apply pending fast clears on FMASK decompress (#5283)
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-06 20:24:36 +03:00
georgemoralisandMetr1k 2a2f1003b0 Major net rewrite (#5236)
* p2p crypto schema

* adding p2p keyring

* p2p framing and testing

* fixups

* test fix

* missing definations

* implementation of host functions

* tcp/transport of p2p packets

* improvements in binding

* guest_net ,improvements and  test cases

* all mighty clang

* fixing macOS tests failures

* misc

* net_rewrite : net_errors , types and translation schemas

* updated fixed chunks transfer on windows

* bye bye old net

* small updates for the new net

* settings and tests

* net lib first draft

* allow more than 1 P2P instances on from same pc

* improved shadnet replies

* possible fix for jojo

* cleanup

* move net files to libaries/net

* fixed macOS tests

* mighty clang

* fixed cmakelists

* don't cosume inviation event on client (test code)

* fix macOS tests

* Large multi-file rework for Signaling and Matching2 network handling / optimization.  Consolidates Matching2-signaling and signaling to one process (signaling_handler)

General cleanup and consolidation of matching2 context management > nphandler

Removal of a lot

SIgnaling overall structure cleanup.

Matching2: added get and set roommemberdatainternal and the proper type / shadnet call / request / reply.

Consolidated signaling/matching2 typedefs to np_types2

Utilized Codex as a reviewer and for general cleanup.

* all mighty clang

* fixed member attributes

* fixed MAPPED address for matching signaling

* Fixed sceNpMatching2SignalingGetLocalNetInfo

* fixups on net core/library based on fw

* improved errno

* spilt p2p to net_p2p

* some cleanups

* fix for localinfo

* clang

* fix up

* cleanups

* cleanups

* added KernelFstat

* fixed fstat

* one more fix for fstat...

* cleanup old deprecated code

* cleanup

* General logging cleanup across NP changes.  Thanks Stephen!

* cleanup based on stephen's suggestions

* fixup

* fixing tests

* blah

* fixup

* improve memory pools

* cleaunp

* force https disable option

* clang

* @stephen's fixes

* added network field in settings and ported old network ones

---------

Co-authored-by: Metr1k <[email protected]>
2026-10-06 19:14:56 +03:00
Paris Oplopoios 235dcabf94 cpu_patches: Patch (V)RCPPS and (V)RSQRTPS on Intel (#5241)
* cpu_patches: Patch (V)RCPPS and (V)RSQRTPS on Intel

* Address review
2026-10-06 05:44:46 -05:00
artemkaVG c34ca21f12 shader_recompiler: Preserve EXEC scope after empty branch (#5220) 2026-10-06 02:29:18 +03:00
Paris Oplopoios 63098710de Chore: Fix includes for fmt 12.2 (#5276) 2026-10-05 23:23:25 +03:00
kiwakiwaa c5dd8b8b50 video_core: Emulate zero/one MIN/MAX blend factors (#5197)
* Use equivalent add operations for UNORM & sRGB targets after blend factor substitutions
2026-10-05 23:23:07 +03:00
Chris Chreece c679ce6092 texture_cache: initialize added depth-overlap subresources (#5229)
* texture_cache: initialize added depth-overlap subresources [skip ci]

AI-assisted extraction and verification by Codex.
Human code/comment review and human-written PR text required before upstream submission.
Source integration: e6cf874a170c528068627bb43f2c6bc2e89e4375.
Original commits: e78385ae.

* tests: remove depth-overlap fixture after review [skip ci]

Remove the standalone depth-growth CMake target and modeled regression fixture as requested in upstream PR #5229. The five-line production initialization fix is unchanged.

Validation: inspected the exact file diff; no new build or test run because only the standalone test files were removed. The prior fixture results and limitations remain in the earlier commit history.

AI-assisted change by Codex.
2026-10-05 23:14:16 +03:00
Lucas Daniel Duarte Cabral 12c5978f6a liverpool: free the frames of nested indirect buffer tasks (#5258)
* liverpool: free the frames of nested indirect buffer tasks

IndirectBuffer (graphics and compute) and IndirectBufferConst run their
target as a nested coroutine and wait for it to finish, but the finished
task stays suspended at final_suspend and its frame is never destroyed.
Every indirect buffer leaked about 600 bytes of host heap.

In inFAMOUS Second Son that is ~440 nested tasks per second, so committed
memory grew by ~15 MB per minute (~0.9 GB per hour) without bound. With
the frames destroyed it stays flat after warm-up.

* liverpool: drop comments on nested task destroy
2026-10-05 23:12:57 +03:00
TheTurtle 99e33b7e0a region_manager: Add lock free bypass check when no state update is required (#5277)
* region_manager: Add lock free bypass check when no state update is required

The lock takes a non insignificant part of CPU time so attempt to avoid taking it if no update is needed
To make this correct, the state update bits must be performed strictly after page manager updates
so split UpdateStateAndProtection into UpdateState and UpdateProtection and run former after page manager

* region_manager: Use summary bits
2026-10-05 23:12:31 +03:00
Chris Chreece 10393d2c3b shader_recompiler: allow step rates with base instance (#5274) 2026-10-05 18:10:18 +03:00
TheTurtle dade3afda7 vk_rasterizer: Restore image copy fast path (#5272) 2026-10-05 12:39:12 +03:00
Ultra b5ce969003 Free pr (#5270)
* Update sysmodule_internal.cpp

* Update sysmodule_internal.h
2026-10-05 11:19:16 +03:00
Marcin Mituraandgeorgemoralis beda45d7b3 ajm: Fix MP3 parser OOB and support Xing/VBRI headers (#5254)
Co-authored-by: georgemoralis <[email protected]>
2026-10-05 11:04:08 +03:00
Stephen Miller 4ddaada81d Increase num buffers (#5265)
For some reason, the inlineFetchShader config option increases how many buffers we need for some games. Thankfully, the removal of userdata regs from PushData means we can store significantly more of these in here than we could before.
2026-10-05 04:18:26 +03:00
TheTurtle 7d28d2790b shader_recompiler: Enable early fragment testing when configured (#5264)
According to this table https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/drivers/radeonsi/gfx/si_state_shaders.cpp#L1717
the value of DEPTH_BEFORE_SHADER should be authoratative on whether the guest program requests early z testing or not.
Z_ORDER seems to be more of a hint in comparison
2026-10-05 03:09:56 +03:00
TheTurtle c09fa46a85 vk_rasterizer: Track vertex, index and indirect buffers properly (#5262) 2026-10-05 01:36:08 +03:00
TheTurtle 92c7a8843c vk_runtime: Use buffer copies to copy between D32 and D32S8 (#5261)
This can cause a device lost otherwise
2026-10-05 00:49:28 +03:00
TheTurtle 7721a1eff6 translate: Apply unbiasing to all instance id uses (#5260)
On main only plain instance id loads got the unbiased value, do this for every instance id type. Also fix a bug in fetch shader check
2026-10-05 00:21:09 +03:00
TheTurtle c495290879 shader_recompiler: Improve NaN handling (#5257)
* translate: Handle NaN semantics of legacy instruction variants

* translate: Use unordered float compares for v_cmp_n* instructions

The ACO compiler in mesa emits those variants for unordered compares so use those to get correct NaN behavior

* spirv_emit_float_point: Proper NaN semantics for three number compare instructions

Manual mentions DX10 NaN handling for all of them and for V_MED3_F32 specifically if any input is NaN it fallbacks to MIN3 instruction so implement those properly using NMin/NMax

* translate: Honor DX10_CLAMP mode bit

Switch FPSaturate to using NClamp instead of FClamp, to match HLSL saturate which returns 0.f with NaN input. Otherwise use normal FClamp which propagates the NaN instead

* emit_spirv_floating_pont: Dont use amd extension
2026-10-04 13:37:56 -07:00
Paris Oplopoios 16e79a4296 cpu_patches: Enable static patching on Linux (#5253) 2026-10-04 12:41:49 -07:00
Ultra 9f796b30ba fix reuse (#5256) 2026-10-04 17:41:11 +02:00
TheTurtle 098292a23c buffer_cache: Remove duplicate SynchronizeMemoryFromImage (#5255) 2026-10-04 18:10:19 +03:00
Marcin Mikołajczyk b3452cf6a9 Add AGENTS.md (#5242) 2026-10-04 12:15:51 +02:00
Chris Chreece 1ac65aa7a2 buffer_cache: allocate sparse backing with device address support (#5233)
* buffer_cache: allocate sparse backing with device address support [skip ci]

AI-assisted extraction and verification by Codex.
Human code/comment review and human-written PR text required before upstream submission.
Source integration: e6cf874a170c528068627bb43f2c6bc2e89e4375.
Original commits: 1e6bb5a6.

* buffer_cache: remove allocation comment after review [skip ci]

Remove the two-line comment requested in upstream PR #5233. No executable code changes.

Validation: exact diff review only; no rebuild or tests for comment removal.

AI-assisted edit by Codex.
2026-10-04 13:00:55 +03:00
Stephen Millerandmetr1k-91 f73709cada Shutdown NpHandler before restarting (#5244)
Co-authored-by: metr1k-91 <[email protected]>
2026-10-03 22:23:49 -05:00
Lucas Daniel Duarte Cabral 145932bf59 texture_cache: scan only the first page in FindImageFromRange (#5240)
* texture_cache: scan only the first page in FindImageFromRange

FindImageFromRange only accepts images whose guest address equals the
requested address, and every image is registered in all of its pages, so
the candidates are always found in the first page. Walking every page and
image of a large texel buffer range cost ~35-45 us per call and showed up as
the top per-draw cost in inFamous Second Son.

Also skip the lock in RegionManager::ForEachModifiedRange when no bit of
the requested type is set; the caller would be a no-op in that case.

inFamous Second Son (Salmon Bay dock): 23.2 -> 30.7 FPS.

* texture_cache: add ForEachImageWithAddress, drop region_manager change

Look up only the bucket of the first page and only images with the exact
address, as suggested in review. The lockless early out in
ForEachModifiedRange is removed since ChangeRegionState updates the state
bits before the tracker.

* texture_cache: drop redundant address check and comment

Image addresses are 256-byte aligned, so a matching key already implies the
same address.
2026-10-04 02:21:45 +03:00
Chris Chreece 43e4c4703e renderer_vulkan: cover presentation waits and fragment texture reads [skip ci] (#5231)
AI-assisted extraction and verification by Codex.
Human code/comment review and human-written PR text required before upstream submission.
Source integration: e6cf874a170c528068627bb43f2c6bc2e89e4375.
Original commits: 287e0d09.
2026-10-03 23:13:01 +03:00
Stephen Miller f572b33883 Common: Fix incorrect log class names (#5237)
Missed these when fixing the other cases
2026-10-03 09:52:29 -07:00
kalaposfos13 9a8ae4417b Camera code cleanup and fixes (#5211)
* Split the HLE camera library into multiple source files for readability

* copyright 2026

* calibration functions

* Pull out camera config type table to a separate header

* Do not assume the base format is always RGBA8888 for RAW8/RAW16 outputs
If a game registers YUV422 for eye 1 and RAW16 for eye 2, that made the HLE library register YUY2 as the SDL format before, but then tried to use it as RGBA88888, which lead to overidexing and reading from unmapped pages

* Cleanup Turtle's cleanup

* copyright 2024-2026

* the loathsome clang-formatter

* sir clang offnir, the all formatting
2026-10-03 16:31:45 +03:00
TheTurtle 8e23388af8 video_core: Renderer optimizations pt2 (texture cache edition) (#5219)
* texture_cache: Use common small vector

* texture_cache: Remove unused functions

* texture_cache: Remove tail/head track functions

They can be integrated into main Track with much less code

* texture_cache: Remove samplers mutex

Samplers are only accessed by gpu thread so no need for this

* texture_cache: Move locking to per image

The only functions that run from different threads are InvalidateMemory and UnmapMemory, in both the overlapping images are untracked. Untracking must be an atomic operation, i.e a the gpu thread cannot observe the image as untracked (track_addr/track_addr_end == 0) before the image drops its page references from the page manager. So only these two need to be put under a critical section

Also includes a change to make ForEachImageInRange stateless, otherwise a lock would be required for this as well

* texture_cache: Store image address/size inside bucket entry

This avoids looking up the image data itself and taking a cache miss every time you want to test if image overlaps. We only pay the access cost for an image that will actually participate in overlap resolution

* vk_rasterizer: Dont use piecewise_construct for image bindings

Optimize some overhead out

* image_info: Move image info size and mip layour calculation into a standalone constexpr function

We can now use it to build a constexpr table

* image_info: Precompile common BCn configurations for faster size calculation

* image_info: Optimize construction and intrusive LRU cache

* Move functions like SurfaceFormat and NumBitsPerBlock to headers to allow them to inline here
* Load sharp to a local temporary as the start to avoid the compiler constantly reloading the pointer due to aliasing dangers
  This could also be resolved with __restrict but this is more idiomatic c++
* Store props with a single byte store instead of doing individial bit insertions
* Remove redudant zero initializations that added extra instructions at the start

Now UpdateSize is also tail-called. Construction dropped by 0.5% cpu time

LRU cache had overhead on every Touch call, so make it intrusive to the objects themselves to avoid extra storage and deque indexing overhead

* clang format

* fix linux build

* fix linux gcc build
2026-10-03 09:08:26 +03:00
rainmakerv2 8cd2ea8c41 Big picture: recursive folder scanning (#5223)
* add recursive scanning - force depth 2 for now, make configurable later

* make setting configurable

* match item widths

* correctly load language as specific, fix profile button naming with multiple same titleid entries

* catch fs errors, while ensuring all other items are scanned
2026-10-03 08:51:03 +03:00
junminlee2004 ead912cf95 cpu_patches: Apply comprehensive SSE4a CPU patches on macOS (#5216)
* cpu_patches: Apply CPU patches ahead of time on macOS

* module: Use one static patching flag for Windows and macOS

* cpu_patches: Patch SSE4a instructions between the functions of the EH frame table

* emulator: Log the red zone patching setting on macOS

* Revert "emulator: Log the red zone patching setting on macOS"

* module: Share one static patching block between Windows and macOS
2026-10-02 13:49:03 -07:00
Marcin Mitura 62653e388c kernel/time: Implement monotonic real-time network clock (#5217) 2026-10-02 13:19:15 -07:00
georgemoralis bf794b3fe7 started 0.19.1 WIP 2026-10-02 17:05:15 +03:00
georgemoralis c7e065d1b4 tagged 0.19.0 release v.0.19.0 2026-10-02 16:24:13 +03:00
squidbus 3912336fdf externals: Update mesa-kosmickrisp (#5214) 2026-10-01 19:42:03 -07:00
Marcin Mitura 4355d9eb73 kernel: Fix sceKernelReserveVirtualRange alignment and add ClearName (#5208)
- Fix alignment validation in sceKernelReserveVirtualRange to check both power-of-2 and 16KB page alignment per libkernel.sprx (0x1861e)
- Enforce 2GB maximum alignment bound per libkernel.sprx
- Implement sceKernelClearVirtualRangeName (NID mkgXxsoxWHg)
2026-10-01 17:15:43 -07:00
TheTurtle 0f6d1b870e common: Rework slot vector (#5212) 2026-10-01 16:39:47 -07:00
Kravickas ef08b1e1fd V_ALIGNBIT_B32 / V_ALIGNBYTE_B32 fixup (#5186) 2026-10-02 01:40:59 +03:00
Marcin Mitura d8548fc36b kernel: Implement sceKernelReleaseFlexibleMemory and POSIX mlock/munlock aliases (#5182)
- Match libkernel 16 KB page alignment and madvise/VirtualAlloc(MEM_RESET) page release semantics
- Return ORBIS_KERNEL_ERROR_EINVAL on failure or invalid parameters
- Add posix_mlock/munlock with parameter checks and wrap sceKernelMlock/munlock
- Register POSIX and SCE NID mappings in libkernel and libScePosix
2026-10-01 15:39:48 -07:00
nikmparis217-ux 7e77898756 video_core: Fix mip layout and detiling of tiled textures (#5196) 2026-10-02 01:16:18 +03:00
artemkaVGandClaude Opus 5.5 fecfbed092 texture_cache: Avoid associating color images with stencil (#5118)
* vk_rasterizer: Only redirect stencil reads for stencil-compatible formats

The stencil-to-depth association is keyed on the stencil plane address
alone, so it also lands on unrelated surfaces that reuse that memory.
Following it for a non-stencil format builds a view of the depth-stencil
image in another compatibility class with a Depth|Stencil aspect, and
storage writes through that view corrupt the depth buffer. Only redirect
when the request can actually be a stencil view.

Together with readbacks set to Precise this fixes the missing world
geometry in Uncharted: Drake's Fortune Remastered (CUSA03280).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* texture_cache: Only link stencil images with a stencil format

Don't associate a color image with the depth buffer in the first place,
as suggested in review, instead of skipping the redirect in BindTextures.
FindDepthTarget now only links the placeholder or an image with a stencil
compatible format at the stencil address, and doesn't create a
placeholder over a color image. The BindTextures check is reverted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* texture_cache: Keep dummy stencil associations at reused addresses

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-01 17:08:11 +03:00
Kravickas dd43d1cac9 V_CVT_PK_U8_F32 fixup (#5194) 2026-10-01 14:45:59 +03:00
squidbus 5ae2caf310 shader_recompiler: Fix OpImageTexelPointer coords for 1D (#5203) 2026-10-01 14:38:35 +03:00
Stephen Miller d9cf41ba0a Allow InverseBallot folding to fail on unhandled immediate arguments (#5202)
InverseBallotEliminationPass is mainly an optimization. Makes no sense to crash the emulator when this wouldn't actually cause issues.
2026-09-30 21:12:52 -05:00
squidbus 12927c1b9a shader_recompiler: Remove unused IAddCarry32 (#5201) 2026-09-30 18:52:36 -07:00
TheTurtle 259e815af1 resource_patching: Patch thread id add instead of id itself (#5199)
* resource_patching: Patch thread id add instead of id itself

* constant_propagation: Fold ISub32 with zero right arg
2026-10-01 03:02:41 +03:00
TheTurtle d1cb90dbbe translate: Restore simplier ADDC implementation (#5200) 2026-10-01 03:02:36 +03:00
Marcin Mitura 2338a06f92 video_core: Fix sparse backing offsets, barriers, and memory budgeting (#5193)
- Fix sparse backing offset calculation in BufferCache (block shift)
- Enforce image memory barriers when previous state contains write flags
- Adjust dynamic GC pressure and staging buffer trim thresholds
- Track GDS buffer write access in Rasterizer buffer binding
- Ensure a minimum physical memory floor on integrated GPUs
2026-09-30 16:19:33 +03:00
artemkaVGandClaude Opus 5.5 3f21ee0bec shader_recompiler: Lower PackedAncillary from attribute loads (#5141)
* shader_recompiler: Zero PackedAncillary left over after lowering

LowerPackedAncillary replaces the raw ancillary VGPR value with zero once
it lowers a bitfield extract from it. Since #5116 moved
LowerHardwareIntrinsics after dead code elimination, a dead extract is
already gone at that point, so the raw value is never zeroed and reaches
the SPIR-V emitter, which cannot emit it. God of War III (CUSA01715)
crashes on fs 0xeb50917148e7d775, where the shader reuses VGPR4 and one
path still carries the ancillary value into a Phi.

Zero any GetAttributeU32 PackedAncillary still left after the lowering
loop. The pass order from #5116 is kept, and shaders that compiled
before are unaffected, since the emitter could not handle the raw value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* shader_recompiler: Lower PackedAncillary from its load

Start from the GetAttributeU32 that loads PackedAncillary, lower the
bitfield extracts that use it and then always replace the load with
zero, as suggested in review. This no longer depends on an extract
surviving DCE, so the separate loop after lowering is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-09-30 13:07:00 +03:00