Commit Graph

2577 Commits

Author SHA1 Message Date
IndecisiveTurtle
dc6ef99dc7 vector_memory: Handle immediate but non zero offset too
Signed-off-by: georgemoralis <giorgosmrls@gmail.com>
2025-07-09 18:40:05 +03:00
TheTurtle
7d4b875ee3
Random fixes (#3216)
* buffer_cache: Handle inline data to flexible memory

* control_flow: Fix single instruction scopes edge case

Fixes the following pattern

v_cmpx_gt_u32 cond
buffer_store_dword value
.LABEL:

Before
buffer[index] = value;

After
if (cond)
{
    buffer[index] = value;
}

* vector_memory: Handle soffset when offen is false

When offen is not used we can substitute the offset argument with soffset and have it handled correctly

* scalar_alu: Handle sharp moves with S_MOV_B64

This fixes unable to track sharp errors when this pattern is used in a shader

* emulator: Add log

* video_core: Bump binary info search range and buffer num
2025-07-09 17:00:06 +03:00
Paris Oplopoios
f5336358ea
Zero top bits in INSERTQ/EXTRQ (#3217)
* Zero top bits in INSERTQ/EXTRQ

* Clang-format

* Don't assert
2025-07-09 13:55:21 +03:00
kalaposfos13
e5f899aae3
Fix brace elision for designated initializer warning (#3215) 2025-07-08 18:38:28 -07:00
TheTurtle
2d1a2982df
buffer_cache: Bring back upload batching and temporary buffer (#3211)
* buffer_cache: Bring back upload batching and temporary buffer

Because that PR fused the write and read protections under a single function call, it was a requirement to move the actual memory copy part inside the lambda to perform it before the read protection kicks in. However on certain large data transfers it had potential for data corruption. If, for example, an upload had two copies, a 400MB and a 300MB one, the first one would fit in the staging buffer, very likely with an induced stall. However the second one wouldn't have space to fit alongside the other data, but it's also small enough for the buffer to fit it, so the staging buffer would cause a flush and wait to copy it, overwriting the previous transfer.

To address this the upload function has been reworked to allow for batching like previously but with the new locking behavior. Also the condition to use temporary buffers has been expanded to also include cases when staging buffer will stall, which should increase performance a little in some cases.

* buffer_cache: Move buffer barriers and copy outside of lock range
2025-07-08 10:32:39 +03:00
Valdis Bogdāns
ddede4a52d
IME fixes (#3207)
- Moved enums, flags, and structs to ime_common.h to simplify usage with Ime and ImeDialog
- Updated Ime to use an enum as the return type, consistent with ImeDialog
- Removed duplicate definition of OrbisImeKeycode
- Added OrbisImeLanguage as a flags enum
- Added missing options to OrbisImeOption
- Removed OrbisImeDialogOption; OrbisImeOption should be used instead
- Added OrbisImeTextAreaMode
- Updated OrbisImeTextAreaMode
- Fixed OrbisImeEventParam by adding the missing member OrbisImePanelType panel_type
- Updated the sceImeOpen declaration to use extended parameters (not yet implemented)
-Fixed Diablo III (CUSA00434) assertion failure on ImeDialog initialization

Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
2025-07-08 01:04:16 +03:00
Fire Cube
80f7ec2681
video_out: Internal Resolution Support (#3194)
* impl

* clang

* clang+

* update total_entries too
2025-07-07 19:17:56 +03:00
TheTurtle
7fedbd52e0
texture_cache: Async download of GPU modified linear images (#3204)
* texture_cache: Async download of GPU modified linear images

* liverpool: Back to less submits

* texture_cache: Don't download depth images

* config: Add option for linear image readback
2025-07-07 16:23:20 +03:00
georgemoralis
d6163a6edb uber fix 2025-07-07 13:37:08 +03:00
Paris Oplopoios
4eaa992aff
Rename 'AddCary' to 'AddCarry' (#3206) 2025-07-07 13:29:11 +03:00
squidbus
70eef0de90
texture_cache: Change depth resolve new image back to max of resources. (#3205) 2025-07-07 13:03:19 +03:00
Paris Oplopoios
146e81a56a
Fix V_ADDC_U32 carry-out edge cases (#3200)
* Fix V_ADDC_U32 carry-out edge cases

* Use IAddCarry instead
2025-07-07 12:44:06 +03:00
Marcin Mikołajczyk
5eef2fd28a
mmap executable memory (#3201) 2025-07-07 12:26:27 +03:00
Stephen Miller
d1f5a7e8fb
libkernel mprotect export (#3199) 2025-07-06 22:03:59 +02:00
kalaposfos13
78cb5334cf started 0.10.1 WIP 2025-07-06 20:54:56 +02:00
georgemoralis
41b05ce7ed
New Crowdin updates (#3175)
* New translations en_us.ts (Catalan)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Albanian)
2025-07-06 11:30:39 +03:00
Stephen Miller
a63db68114
Core: Update config files on startup (#3181)
* Organize settings and fix defaults

setDefaultValues was missing several rather important config options, and some of the defaults were inaccurate.

* Set alternative settings based on defaults

Reduces how many times we redefine the defaults for each setting.
I avoided changing behavior for installDirs and installDirsEnabled because I don't want to introduce any changes I can't easily test.

* Run save after loading to fill in missing config entries

A fix for the growing complaints about config files not updating when new settings are added.
Thanks to the prior changes, default settings are new properly defined everywhere, so running save here will properly fill in missing values with their expected defaults instead of the weird settings load would sometimes use.

* Clang

* Only update config when necessary

Instead of updating the config on each emulator boot, calculate the number of entries stored in the config and compare to a hardcoded constant.
If the config doesn't have the right number of entries, then regenerate it.

* Clang

* Clang
2025-07-06 11:30:10 +03:00
georgemoralis
4f99f304e6
Revert "Avoid clearing depth on partial HTILE writes (#3167)" (#3190)
This reverts commit 59dd73492b.
2025-07-04 09:57:01 +03:00
Stephen Miller
a050c9d65b
Only use TRACK_ALLOC for non-reserved mappings (#3188) 2025-07-04 01:01:07 +03:00
TheTurtle
b22da77f9a
buffer_cache: Fix various thread races on data upload and invalidation (#3186)
* buffer_cache: Fix various thread races on data upload and invalidation

* memory_tracker: Improve locking more on invalidation

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2025-07-03 22:36:01 +02:00
TheTurtle
df22c4225e
config: Add toggle for DMA (#3185)
* config: Add toggle for DMA

* config: Log new config
2025-07-03 20:03:06 +03:00
TheTurtle
48460d1cbe
vector_alu: Improve handling of mbcnt append/consume patterns (#3184)
* vector_alu: Improve handling of mbcnt append/consume patterns

The existing implementation was written to handle a single pattern of mbcnt before the DS_APPEND instruction

v_mbcnt_hi_u32_b32 vX, exec_hi, 0
v_mbcnt_lo_u32_b32 vX, exec_lo, vX
ds_append       vY offset:4 gds
v_add_i32       vX, vcc, vY, vX

In this case however the DS_APPEND is before the mbcnt pattern

ds_append       vX gds
v_mbcnt_hi_u32_b32 vY, exec_hi, vX
v_mbcnt_lo_u32_b32 vZ, exec_lo, vY

The mbcnt instructions are always in pairs of hi/lo and in general are quite flexible. But they assume the subgroup size is 64 so they are not recompiled literally. Together with DS_APPEND they are used to derive a unique per thread index in a buffer (different from using thread_id as order could be random). DS_APPEND instruction works on per subgroup level, by adding number of active threads of subgroup to the GDS counter, essentially giving a multiple-of-64 base index to all threads. Then each thread executes the mbcnt pair which returns the number of active threads with id less than the itself and adds it with the base.

The recompiler translates DS_APPEND into an atomic increment of a storage buffer counter, which already gives the desired unique index, so this pattern is a no-op. On main it was set to zero as per the first pattern to avoid altering the DS_APPEND result. The new handling passes through the initial value of the pattern instead, which has the same effect but works on either case.

* vk_rasterizer: Always sync DMA buffers
2025-07-03 13:19:38 +03:00
Marcin Mikołajczyk
7431b30005
Support for BUFFER_ATOMIC_S/UMIN_X2 (#3182)
* Fix BufferAtomicS/UMax64 SPIR-V emitting

* Support for BUFFER_ATOMIC_S/UMIN_X2
2025-07-02 18:13:07 -07:00
nickci2002
9eae6b57ce
V_CMP_EQ_U64 support (#3153)
* Added V_CMP_EQ_U64 shader opcode support and added 64-bit relational operators (<,>,<=,>=)

* Fixed clang-format crying because I typed xargs clang-format instead of xargs clang-format-19

* Replaced V_CMP_EQ_U64 code to match V_CMP_U32 to test

* Updated V_CMP_U64 for future addons
2025-07-02 19:22:30 +03:00
Lander Gallastegi
efa7093f34
Use shared_first_mutex (#3179) 2025-07-02 16:54:14 +03:00
TheTurtle
0594dac405
Readbacks proof of concept rebased (#3178)
* Readbacks proof of concept

* liverpool: Use span for acb too

* config: Add readbacks config option

* config: Log readbacks
2025-07-01 23:41:00 +03:00
kalaposfos13
5789fd881c Remove accidentally left in debug logging from touchpad input emulation 2025-06-30 21:53:45 +02:00
Marcin Mikołajczyk
1757dfaf5a
buffer_atomic_imax_x2 (#3130)
* buffer_atomic_imax_x2

* Define Int64Atomics SPIR-V capability
2025-06-29 16:16:47 -07:00
georgemoralis
7f727340aa
New Crowdin updates (#3165)
* New translations en_us.ts (Turkish)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Persian)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Serbian (Latin))

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Romanian)

* New translations en_us.ts (French)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Danish)

* New translations en_us.ts (German)

* New translations en_us.ts (Greek)

* New translations en_us.ts (Finnish)

* New translations en_us.ts (Hungarian)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Japanese)

* New translations en_us.ts (Korean)

* New translations en_us.ts (Lithuanian)

* New translations en_us.ts (Dutch)

* New translations en_us.ts (Polish)

* New translations en_us.ts (Portuguese)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Slovenian)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Chinese Traditional)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Indonesian)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Dutch)

* New translations en_us.ts (Turkish)

* New translations en_us.ts (Turkish)

* New translations en_us.ts (Portuguese, Brazilian)
2025-06-29 11:48:44 +03:00
TheTurtle
59dd73492b
Avoid clearing depth on partial HTILE writes (#3167)
* vk_rasterizer: Avoid full depth clear in case of partial HTILE update

* resource_tracking: Mark image as written when its used with atomics
2025-06-29 00:53:14 +03:00
georgemoralis
83056712e0
[ci skip] Qt GUI: Update Translation. (#3164)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
2025-06-28 09:39:59 +03:00
rainmakerv2
fa32537f40
Controller Remapping GUI v2 (#3144)
* Remapping GUI V2 - initial commit

* Unmap button with escape key

* Allow combination inputs

* Use separate class for SDL event signals so that i can work with the SDL window event loop

* Automatically pause game when GUI open to better manage event queue

* Move sd;_gamepad_added event from remap object to GUI object to avoid conflicts with sdl window

* Use signals on button/trigger to release to make GUI more responsive

* pause game while KBM window is open for consistency

* don't check gamepad when game is running to avoid conflicts

* Block all other sdl events instead of pausing game, automatic parse inputs after saving

* Don't block window restored or window exposed cases

* Properly exit event loop thread on exit
2025-06-27 15:55:52 +02:00
rainmakerv2
09b584b23f
Kbm GUI - minor fixes (#3146)
* KBM Gui fixes

* remove unneeded activate window calls
2025-06-27 16:49:31 +03:00
nickci2002
4bfd8b967b
Changed symbol bindings to their names (#3158)
* Changed symbol bindings to their names

* Fixed kakposfos' requests on GitHub

* Fine, I'll do it myself.

---------

Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
2025-06-27 12:55:12 +02:00
georgemoralis
52bd92b97d
New Crowdin updates (#3152)
* New translations en_us.ts (Turkish)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Persian)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Serbian (Latin))

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Romanian)

* New translations en_us.ts (French)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Danish)

* New translations en_us.ts (German)

* New translations en_us.ts (Greek)

* New translations en_us.ts (Finnish)

* New translations en_us.ts (Hungarian)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Japanese)

* New translations en_us.ts (Korean)

* New translations en_us.ts (Lithuanian)

* New translations en_us.ts (Dutch)

* New translations en_us.ts (Polish)

* New translations en_us.ts (Portuguese)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Slovenian)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Chinese Traditional)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Indonesian)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Turkish)

* New translations en_us.ts (Turkish)

* New translations en_us.ts (Portuguese, Brazilian)
2025-06-27 09:36:47 +03:00
TheTurtle
8e44a7099f
bit_array: Remove non const operator~ (#3161) 2025-06-26 18:07:56 -07:00
Stephen Miller
0a58ead5f6
Add alternate code paths for handling legacy struct behavior in sceVideodec2GetPictureInfo (#3154)
Older games aren't fond of how our sceVideodec2GetPictureInfo implementation outputs AVC picture info after the struct size increase.
Adding the old struct, and additional code using it for these games works around this problem.
2025-06-26 20:16:23 +03:00
Lander Gallastegi
9f37ede336
video_core: Page manager and memory tracker improvenets (#3155)
* I don't know what to put here

* clang-format

* clang-format 2.0

* Deadlock free locking

* Por boost range lock implementation

* clang-format
2025-06-26 18:38:53 +02:00
TheTurtle
a49b13fe66
shader_recompiler: Optimize general case of buffer addressing (#3159)
* shader_recompiler: Simplify dma types

Only U32 is needed for S_LOAD_DWORD

* shader_recompiler: Perform address shift on IR level

Buffer instructions now expect address in the data unit they work on. Doing the shift on IR level will allow us to optimize some operations away on common case

* shader_recompiler: Optimize common buffer access pattern

* emit_spirv: Use 32-bit integer ops for fault buffer

Not many GPUs have 8-bit bitwise or operations so that would probably require some overhead to emulate from the driver

* resource_tracking_pass: Fix texel buffer shift
2025-06-26 12:14:36 +03:00
georgemoralis
075d6425e2
[ci skip] Qt GUI: Update Translation. (#3151)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
2025-06-23 12:44:26 +03:00
georgemoralis
70e4f81655
New Crowdin updates (#3140)
* New translations en_us.ts (Swedish)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Japanese)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Vietnamese)
2025-06-23 12:44:05 +03:00
Stephen Miller
12198f9255
libkernel: Check returned module in sceKernelGetModuleInfoFromAddr (#3147)
* Error if the module doesn't exist

Fixes another thing kalaposfos found

* Fix error returns

Based on 11.00 libkernel decomp.
2025-06-23 01:32:43 -07:00
davidantunes23
4bfa8c9fc7
Favorites in the game list (#2649) (#3071)
* Favorites in the game list (#2649)

Changed how favorites are saved to match PR #2984. Adjusted the favorite
icon size. Fixed bug where favorites were inconsistent when changing to
list mode. Instantly sort list when adding or removing a favorite.

Co-authored-by: David Antunes <david.f.antunes@tecnico.ulisboa.pt>

* fix formatting

* Favorites in the game list (#2649)

Fixed issue where background change was inconsistent while adding
favorites, unselect row when adding favorites, cleaned code, changed
right click menu options to match the game's favorite status.

* fixed right click bug

* keep row selection when adding favorites

* fixed sorting on game grid after using search bar

* change the way favorites are saved to match #3119
2025-06-22 12:53:47 +03:00
squidbus
669b19c2f3
shader_recompiler: Fix handling unbound depth image. (#3143)
* shader_recompiler: Fix handling unbound depth image.

* shader_recompiler: Consolidate unbound image handling.
2025-06-21 22:18:00 -07:00
Stephen Miller
d9dac05db2
Core: MapMemory fixes (#3142)
* Validate requested dmem range in MapMemory

Handles a rare edge case that only comes up when modding Driveclub

* Specify type

auto has failed us once again.

* Types cleanup

Just some basic tidying up.

* Clang
2025-06-21 19:22:03 -07:00
georgemoralis
802124309d
New Crowdin updates (#3134)
* New translations en_us.ts (Turkish)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Persian)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Serbian (Latin))

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Romanian)

* New translations en_us.ts (French)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Danish)

* New translations en_us.ts (German)

* New translations en_us.ts (Greek)

* New translations en_us.ts (Finnish)

* New translations en_us.ts (Hungarian)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Japanese)

* New translations en_us.ts (Korean)

* New translations en_us.ts (Lithuanian)

* New translations en_us.ts (Dutch)

* New translations en_us.ts (Polish)

* New translations en_us.ts (Portuguese)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Slovenian)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Chinese Traditional)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Indonesian)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Russian)
2025-06-21 20:31:26 +03:00
kalaposfos13
54163ffaa5
Initialize system handle in HLE Ngs2 library (#3137) 2025-06-21 20:30:49 +03:00
kalaposfos13
2d335f436c
Stub out SetGPO and GetGPI (#3135) 2025-06-21 05:23:14 -07:00
georgemoralis
1fc95bf44b
[ci skip] Qt GUI: Update Translation. (#3133)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
2025-06-21 10:04:57 +03:00
georgemoralis
0bb1ee167f
New Crowdin updates (#3128)
* New translations en_us.ts (Albanian)

* New translations en_us.ts (Italian)
2025-06-21 10:04:23 +03:00