Commit Graph

3571 Commits

Author SHA1 Message Date
squidbus
673b2afaa8 vk_platform: Remove workaround to use Vulkan loader on macOS. (#3484) 2025-08-29 18:29:34 -07:00
squidbus
32244c097c shader_recompiler: Implement V_ADD_F64 and loading 64-bit float from SGPR. (#3483) 2025-08-29 18:11:21 -07:00
squidbus
bfa5c508ce constant_propagation_pass: Handle a few more bitwise instructions. (#3482)
Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2025-08-29 18:11:14 -07:00
squidbus
62ddc0664b vk_scheduler: Properly initialize vulkan structures in RenderState. (#3479) 2025-08-29 17:28:20 -07:00
Stephen Miller
56626111ab Properly use float type for float buffer atomics (#3480)
Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2025-08-29 17:18:10 -07:00
Stephen Miller
6f26f66d77 Handle ExecLo source in S_FF1_I32_B64 (#3481)
Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2025-08-29 16:59:11 -07:00
Stephen Miller
ae89a492ea shader_recompiler: Initialize all ClipDistance and CullDistance values (#3478)
* Initialize all values in clip_distances

Co-Authored-By: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>

* Clang

* Apply initializer for CullDistance

---------

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2025-08-29 16:47:30 -07:00
Stephen Miller
90757d6d09 Handle S_LSHL_B32 in ParseCopyShader (#3477)
Fixes an assert in My First Gran Turismo

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2025-08-29 16:33:19 -07:00
Stephen Miller
412355aab4 shader_recompiler: Support multiple attributes using the same load in vertex fetch shaders (#3475)
* Support multiple uses of the same load.

Co-Authored-By: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>

* Keep base_sgpr as a s32

Requires manually casting to s32 now.

---------

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2025-08-29 16:06:40 -07:00
TheTurtle
8ae45559fc vector_interpolation: Address some assertions (#3473) 2025-08-29 13:44:45 -07:00
Missake212
d4a2ca01bf QT version in the Windows build instructions (#3474) 2025-08-29 13:43:24 -07:00
squidbus
e85308c011 vk_pipeline_cache: Add storage images to descriptor heaps. (#3472) 2025-08-29 08:03:14 -07:00
squidbus
8ed6572393 vk_graphics_pipeline: Prioritize depth clip when separate clip/clamp control is not supported. (#3471) 2025-08-29 07:45:53 -07:00
squidbus
1d459474a2 externals: Update SDL3 (#3466) 2025-08-27 21:42:24 -07:00
kalaposfos13
10afc6b3c6 Replace direct usage of wrgsbase and rdgsbase with a more portable solution (#3464) 2025-08-27 03:12:39 -07:00
rainmakerv2
adcf4d9749 test 6.9.2 update (#3463) 2025-08-26 22:41:17 -07:00
Stephen Miller
e172323dd0 Libraries: libSceVrTracker stubs (#3462)
* libSceVrTracker stubs, structs, enums, and errors

* sceVrTrackerQueryMemory

* Clang and slight struct cleanup

* Implement sceVrTrackerInit

* Store memory pointers and sizes

Mainly for future developers, since I doubt these memory areas will be particularly useful for these stubs.

* sceVrTrackerRegisterDevice

I haven't really identified the difference between the two register device functions, but I do know that they both internally call the internal function with slightly different parameters.

* sceVrTrackerUnregisterDevice

Also changes Hmd and Move handles to be values closer to what real hardware returns, since this function seemingly relies on handles being different for all these device types.

* sceVrTrackerTerm

* Additional error checks in sceVrTrackerRegisterDeviceInternal

* sceVrTrackerGetTime

* sceVrTrackerRecalibrate

Recalibration succeeds on real hardware (at least for some device types), so I've left the stub log intact.

* Update vr_tracker.cpp

* sceVrTrackerSetDurationUntilStatusNotTracking stub

Only handled the error checks, so I left the stub log intact.

* sceVrTrackerGpu* functions

Most of these can't succeed without a camera attached.
2025-08-26 17:16:10 -07:00
Stephen Miller
dcb256c930 libSceHmdSetupDialog stubs (#3460)
Basic stubs designed to get some VR-optional titles further.
2025-08-25 18:11:35 -07:00
Stephen Miller
1b2ac916f1 Filesystem: Abstract handling of directory files (#3455)
* Rename SceKernelIovec to OrbisKernelIovec

Fixes the naming scheme to match the rest of the project.

* Type fixups

Noticed this while working on the actual thing this PR is about.

* More type fixups

* Update file_system.cpp

* Abstract directory handling

* Clang

* Directory fstat

* Fix dirent loading logic

* PfsDirectory size

Seemed to be hardcoded when I ran tests, so I've hardcoded it here.
Also fixed up the reclen-aligning logic based on hardware observations.

* GetDents cleanup

Bring back the bytes < 512 error return from before, as that's still something that can be checked for out here.
I've also swapped the file type stuff to run from a switch case, so that the check for invalid file type can be used as the default case

* Support reading directories

* getdents

For PfsDirectory, getdents behaves like read does on normal directories. Since dirents are stored internally with a different struct, this means getdents has to convert the dirents before returning data.
For NormalDirectory, getdents is identical to read, so it can just call read and set the basep output.

* Directory readv

* Directory preadv

Since the file mutex is locked before these calls, messing with dirents_index like this shouldn't cause any weird side effects.

* return ORBIS_OK instead of 0

to better align with our coding standards.

* Directory lseek

* Un-modify CMakePresets.json

I keep this modified locally for Linux, but accidentally pushed it.

* Clang

* Fix mac compile

* Potential windows compile fix?

* Filename fix

* Fix normal directory d_reclen

* Comment cleanup

* Remove unnecessary dirent conversion logic

On real hardware, the records are still returned with the same reclen, despite the change in structure.

* PfsDirectory dirents_index fixes

Some weird stuff happens once you reach eof on directories.
Thankfully, PfsDirectories are rather tame in this regard.

* Change comment

* Rewrite normal directory reads

The logic for these seems to behave like a normal file, so instead of tracking a dirents_index, keep an internal buffer representing the file contents, and copy that to output buffers as needed.

* Update pfs_directory.cpp

* Clang

* Fix normal dirents

When rewriting the code, I forgot to account for the increased reclen value for the last dirent in the buffer.

* PfsDirectory::lseek fixes

Based on some additional tests, it seems like lseek unconditionally returns dirents_index, not the actual file position.
Also fixed some bugs with the logic for calculating the proper offset when games do wonky things, and fixed a potential area where games could crash.

* Downgrade stat and fstat log to debug

These functions can get pretty spammy.

* PfsDirectory: Properly track if end of file is reached

Using the metric `dirents_index < directory_content_size` fails when `directory_content_size` is larger than the actual directory size we report.
Since, from what I can tell, PfsDirectories shouldn't ever report more than 0x10000 bytes for size, this change is necessary.

* Revert "PfsDirectory: Properly track if end of file is reached"

I need to do some hardware tests to see if all this excess logic is actually necessary.

* Fix PfsDirectory directory_size

Turns out, if your game has over 1000 files in a folder, it will actually cause the size to increase.

* Update copyright date

* Move devices and directories into file_sys

I've also updated the copyright dates on all these files.

* C++ style type casts

* Remove unnecessary memset

* Use a vector for the data buffer

Simplifies logic for freeing the buffer, based on review suggestions.

* Fix potential oob array access

* Change type casts in Create function

* Clang

* std::memcpy instead of memcpy

* NormalDirectory::lseek cleanup

* Create constants for directory alignment values.

* Use const wherever possible

* Includes cleanup
2025-08-25 23:41:24 +03:00
Randomuser8219
56599bcba4 Certain changes to README (#3456)
* README updates

Several improvements

* Update README.md
2025-08-25 18:54:57 +03:00
squidbus
25d1defb5b shader_recompiler: Do not emit Layer when emulating primitive type with tessellation. (#3457)
Layer must be output from the final pre-rasterization stage, so when tessellation is
being used the vertex shader cannot set it. We could pass it through to the tessellation
shaders in some way, but unless it becomes an issue that's more effort than it's worth.
2025-08-25 04:17:20 -07:00
squidbus
875724a982 memory_patcher: Fix isEnabled not being reset between patches. (#3458) 2025-08-25 12:17:08 +02:00
TheTurtle
c90781d3e2 renderer_vulkan: Resore color write dynamic state (#3453) 2025-08-24 14:30:59 -07:00
TheTurtle
6d98a5ab60 vk_pipeline_cache: Cleanup graphics key refresh (#3449)
* vk_pipeline_cache: Cleanup graphics key refresh

* position: Don't assert on None mapping

Also check outputs in runtime info so shader is recompiled if they change
2025-08-23 17:16:58 -07:00
squidbus
6590f07772 video_core: Fix some struct comparisons. (#3450) 2025-08-23 17:16:52 -07:00
TheTurtle
6dd2b3090c shader_recompiler: Improve shader exports accuracy (part 1) (#3447)
* video_core: support for RT layer outputs

- support for RT layer outputs
- refactor for handling of export attributes
- move output->attribute mapping to a separate header

* export: Rework render target exports

- Centralize all code related to MRT exports into a single function to make it easier to follow
- Apply swizzle to output RGBA colors instead of the render target channel.
  This fixes swizzles on formats with < 4 channels

For example with render target format R8_UNORM and COMP_SWAP ALT_REV the previous code would output

frag_color.a = color.r;

instead of

frag_color.r = color.a;

which would result in incorrect output in some cases

* vk_pipeline_cache: Apply swizzle to write masks

---------

Co-authored-by: polyproxy <47796739+polybiusproxy@users.noreply.github.com>
2025-08-23 14:39:59 -07:00
georgemoralis
d42f4fcc4f New Crowdin updates (#3427)
* New translations en_us.ts (Korean)

* New translations en_us.ts (Turkish)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Polish)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (German)

* New translations en_us.ts (Greek)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Indonesian)

* New translations en_us.ts (Romanian)

* New translations en_us.ts (French)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Danish)

* 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 (Portuguese)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Slovenian)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Chinese Traditional)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Persian)

* New translations en_us.ts (Norwegian Bokmal)

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

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Russian)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Turkish)

* New translations en_us.ts (Turkish)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Polish)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (German)

* New translations en_us.ts (Greek)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Indonesian)

* New translations en_us.ts (Romanian)

* New translations en_us.ts (French)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Danish)

* 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 (Portuguese)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Slovenian)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Chinese Traditional)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Persian)

* New translations en_us.ts (Norwegian Bokmal)

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

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Polish)
2025-08-23 22:12:27 +03:00
marecl
babe19dcd4 "Common Config" in keyboard/pad settings is translated now (#3448) 2025-08-23 22:11:32 +03:00
Stephen Miller
7165772e9b Only queue image downloads if the image address is greater than zero. (#3446)
If the image address is zero, that means we're trying to download a null image, which causes other issues down the line.
2025-08-23 04:18:40 -07:00
Missake212
788228c0f3 Getting rid of "Outdated config" message (#3445) 2025-08-22 08:36:32 -07:00
georgemoralis
975166e5e1 [ci skip] Qt GUI: Update Translation. (#3444)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
2025-08-22 17:33:43 +03:00
Stephen Miller
709a9ac0c8 Libraries: Improved libSceHmd stubs (#3442)
* Initial work

* More work

* More stuff

* Update hmd.cpp

* Separate Reprojection and Distortion functions

Mainly doing this to clean up the code, since these sub-libraries are fairly self-contained.

* Fix weird Git issue

* Improve error documentation

After thorough decompilation, it seems clear that Sony didn't really put much thought into how libSceHmd behaves with no headset connected.

* Fix sceHmdGet2DEyeOffset

* Update hmd.cpp

* Add sceHmdInternalGetDeviceInformation and sceHmdInternalGetDeviceInformationByHandle

Based entirely off decompilation, these two functions are internally the cause of much of my trouble with this library.
They're also called by libSceVrTracker, but I don't think we'll be LLE'ing that anytime soon.

* Cleanup

* sceHmdGetAssyError

Struct isn't fully decompiled, but since it goes entirely unused when PSVR is disconnected, it doesn't matter too much.
I'm pretty certain it's 4 floats though, based on what I've decompiled of this function.

* More organization and fixes

* sceHmdGetInertialSensorData

Behavior should be fully accurate, but I've left the stub log since I haven't decompiled the parameters properly.
Also gave NID aTg7K0466r8 a proper name, based on what I've seen while decompiling. It behaves identically to sceHmdGetInertialSensorData, but with a slight difference in the params used for an internal function call.

* Update hmd.cpp

* Revert name change

* Organizational changes

These two functions modify internal variables used exclusively by reprojection functions.

* Remove internal device information calls

* Log PSVR-related attributes from param.sfo

Would mainly be helpful for compatibility list moderation, since these notices will be much more reliable for games that crash instantly.

* Remove unnecessary includes
2025-08-22 01:49:05 +03:00
Missake212
630fba2822 Dropping "SDL audio queue backed up..." to INFO (#3437)
* Update sdl_audio.cpp

* clang (I hope)

* clang
2025-08-21 04:47:43 -07:00
Missake212
165f3e1e78 Make shadps4 default repo for patches (#3431)
* make shadps4 default repo for patches

* if present, put shadPS4 patches on top of listview

* Update cheats_patches.cpp

---------

Co-authored-by: rainmakerv2 <30595646+rainmakerv3@users.noreply.github.com>
2025-08-21 04:23:34 -07:00
kalaposfos13
8a84f1b778 Implement V_CMP_GT_U64 (#3352)
* Implement V_CMP_GT_U64

* Add GroupAny

* Use GroupAny

* Add assert

* clang
2025-08-20 19:53:54 -07:00
rainmakerv2
2d98adef17 Fix stop hotkey (#3438) 2025-08-20 19:45:02 -07:00
kalaposfos13
8e8f359b56 Implement ORBIS_NET_SO_ERROR_EX in GetSocketOptions (#3365) 2025-08-20 18:36:08 -07:00
Missake212
a166e0c2e9 Update settings_dialog.cpp (#3436) 2025-08-20 18:29:04 -07:00
squidbus
defd826a73 externals: Update MoltenVK (#3435) 2025-08-19 19:05:15 -07:00
Stephen Miller
07bae57a16 Libraries: Better libSceCamera stubs (#3434)
* Initial work on improved stubs

Simulates library behaviors for when a camera is not connected.

* Get* functions complete

I ended up leaving some stubs behind, but most of what I didn't do seem to be internal functions called by other libraries we'd be running HLE anyway.

* Finished stubs

Everything I can reasonably confirm the behavior of should behave as expected, emulating the behavior of a PS4 with no camera attached.

* sceCameraStart firmware check

This check only applies to higher eboot firmwares, since my previous test eboots used firmware 1.00 I completely missed this.

* sceCameraGetAutoExposureGain fix

When option is provided and valid, size is also set to 0.

* Track opened handles

Extremely basic for now, if the library was ever properly implemented this could be swapped for a map of some kind instead.

* Fix errors for sceCameraStart

The firmware-related parameter checks come after the library opened check.

* Promote sceCameraIsAttached log to info

Since you don't need to initialize the library to call this function, some games will call sceCameraIsAttached before anything else.
2025-08-19 18:36:07 -07:00
Stephen Miller
68e35d57d2 Libraries: Better libSceMove stubs (#3433)
* Improved libSceMove stubs

These should more accurately represent how an actual PS4 behaves when a game calls libSceMove functions while no move controllers are connected.

* Clang

* Change sceMoveGetExtensionPortInfo stub

Not entirely sure the ExtensionPortData struct is for this one, but the struct itself isn't exactly important for now anyway.

* Fix sceMoveTerm

* Update move.cpp
2025-08-18 17:41:50 -07:00
TheTurtle
0b02364f97 ir: Perform degamma in shader when sampler sets force_degamma (#3420)
* ir: Perform degamma in shader when sampler sets force_degamma

* specialization: Add srgb if image is sampled

Might fix cases where sampler force_degamma is used with srgb image
2025-08-18 17:41:41 -07:00
Missake212
2d53d1a1e2 remove wolf (#3432) 2025-08-18 19:38:46 +03:00
baggins183
670067c001 Improve heuristic for attributes passed via ring buffers. (#3426)
Previously a buffer load in a vertex shader could be treated like a ring access, dropping offen vgpr and possibly asserting during resource tracking because of mismatch between types (u32x2 vs U32), caused by inconsistencies in flags (index_enable and offset_enable)
2025-08-17 23:22:40 +03:00
georgemoralis
72db53a257 [ci skip] Qt GUI: Update Translation. (#3425)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
2025-08-17 11:03:24 +03:00
rainmakerv2
3a929515e7 Config: toggle background controller inputs (#3424) 2025-08-16 19:45:54 +03:00
georgemoralis
e93fd00dc7 New Crowdin updates (#3412)
* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (French)
2025-08-15 20:16:11 +03:00
Missake212
8deefa63b0 Update building-windows.md (#3422) 2025-08-15 20:16:00 +03:00
Stephen Miller
1c0a5c60ea Memory: Align size and address in posix_munmap (#3418)
* Properly align address and size in munmap

Based on observations of FreeBSD source code, fixes a Windows-related memory issue in War Thunder (CUSA00224)

* Format len and phys_addr in mmap

This should make logs slightly easier to understand, since we format these parameters in other memory calls.

* Update memory.cpp
2025-08-15 12:21:59 +03:00
Alexandre Bouvier
51559033ef hwinfo: track the correct commit (#3419) 2025-08-15 11:29:53 +03:00