Commit Graph
13 Commits
Author SHA1 Message Date
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 <blackkn1ght1991@gmail.com>
2026-10-06 19:14:56 +03:00
kalaposfos13 cc3d367ec7 Rewrite LIB_FUNCTION and LIB_OBJ macros to call a common function to optimize binary size (#5144)
* Rewrite LIB_FUNCTION and LIB_OBJ macros to call a common function to optimize binary size

* fix tests
2026-09-27 23:44:06 +03:00
TheTurtle 9cab1ecba4 shader_recompiler: Refactor runtime info as two tagged unions (#5027)
GCN has the concept of hardware and software stages. Software stages are the shader stages exposed in graphics APIs like opengl/vulkan, and each software stage runs on a hardware stage.
Depending on how many and what software stages are used in a graphics pipeline, the hardware stage a software one is executed on can change, so the mapping is not fixed.
The following table from ACO describes the various combinations for HW-SW stages: https://gitlab.freedesktop.org/mesa/mesa/-/blob/c90ae5f7/src/amd/compiler/README.md#gfx6-8

Certain software stages like the vertex and tess eval shader can run a lot of different hardware stages, which creates problems because runtime info is a tagged union on HW stage.
Current main uses struct inheritance to make it work, but that will get clunky when more data is added to other stages. In general there is a lack of separation between what data
is required when a HW stage is used and what for SW stage.

An example is the tess_emulated_primitive variable. This is used for skipping exports in a software vertex shader when tessellation stages have been inserted after it
for Quad/RectList emulation, because it is undefined behavior to not export them from the last geometry stage. Having this data field in the HW vertex info is not semantically
correct because HW vertex is always the last geometry stage that runs. So this only works when there isnt any HW geometry shader active, as the HW vertex shader is not normally processed in that case.

Another example is shader specialization previously checked the HW vertex stage to specialize the fetch shader. This only works on simple VS+PS pipelines when HW VS runs the SW VS.
Fetch shader is part of the SW VS state, its run on first geometry stage not the last, and this issue got exposed because of the new state separation.

This commit refactors runtime info to contain two tagged unions, one from SW stage and the other HW stage. This makes it obvious what is the scope of each state.
When recompiler does a switch on sw stage, it becomes more apparent it should only access sw state members unless it also checks which hw stage it runs on, which will result in less bugs
2026-09-14 01:30:16 +03:00
Lander Gallastegiandraphaelthegreat 1cf28cbc96 shader_recompiler: split resource tracking and flatten load from buffer for sharp source (#4782)
* shader_recompiler: Split resource tracking into 2 parts and flatten load from buffer if used as sharp source

clang-format

fix inmediate sample raw

defer sharp not found asserts

flip asserts

disable aniso pattern

fix disable aniso

some fixes

non immediate

fix PushPtr

fix PushPtr for non immediate

don't assert on offset computation failures

robust bfs

some xbyak fixes

add bitwise ops

umin umax and bit extract

correct rshift lshift 0st immediate

fix and in memory

some minor code fixes

consider ReadConstBuffer as valid finding

fix xbyak

fix magic_enum for opcodes

fix building (yes, i didn't test)

don't corrupt stack when bailing out

ReadConstBuffer compute offset

use canonical inst for readconst non-imm offset

mark all readconstbuffer sharp dwords

consider r128 images

FindSharpLocation

handle non-imm offset readconstbuffer

don't handle immediates when constant folding

proper check for ReadConst to get flatbuf offset

clang-format

fix stupidity

invert condition

separate search dominant function

handle phis loke other insts in gvn

use same logic for phis in gvn than for flatten pass

apparently idk how logic works

revert back to old logic

min/max immediate in constant folding

add offset insts to gvn inst to hash args

assert that ReadConstsBuffer insts have usage as buffer sharp

separate dominance search from bfs

chang gvn phi handling

remove unused includes

fix reuse

readconst transform add address

* shader_recompiler: Move readconst address add simplification to flatten pass

* shader_recompiler: Remove unnecessary phi handling

Now sharp tracking should be much simpler since its on the unstructured control flow graph

* shader_recompiler: Only enable DMA if some ReadConst could not be flattened

* shader_recompiler: Improve phi eliminaton of readlane elimination with worklist

* shader_recompiler: Cascade flattening failure in ReadConst tree, bind null sharp when source could not be flattened

* shader_recompiler: Further improve robustness of tracking

- Track all dwords of T# with SSA
- Ensure sharp dwords are sequential in flatbuf memory
- Substitue null descriptors on tracking failures

* shader_recompiler: Add new sharp fetching object

* shader_recompiler: Add new sampler pattern

* shader_recompiler: Add texture cube to 2d array pattern

* control_flow_graph: Remove unreachable blocks

Fix bloodborne

* shader_recompiler: Add yet another sampler pattern

* shader_recompiler: Add sampler aniso pattern

* flatten_extended_userdata: Only search through allowed instructions

* some fixes

* :kek:

* tests: Fix tests compile

---------

Co-authored-by: raphaelthegreat <geoster3d@gmail.com>
2026-09-04 20:10:46 -05:00
georgemoralisandGabriele C db126323b9 Http module fixups and implementations (#4933)
* Some games open port with handle 255 , that is not an accepted port so don't complain about it

* Net: Send the User-Agent configured on the HTTP template

* simplified comment

* default http user-agent

* added dummy nputility module

* match User Agent 100% with decompile

* return result to np_auth and some more debug code

* implemented sceNpLookup*  (similar of how np_score ,np_tus) functions

* improved accept encoding for gzip

* removedd invalid test after last change , GZIP encoding is not default true

* Implemented Cached  Redirected Connection

* Inflate only when the response is actually GZIP-encoded and the flag is enabled

* simplify GetLibhttpSystemVersionString

* fixed tests

* old file removed

---------

Co-authored-by: Gabriele C <sgdc3.mail@gmail.com>
2026-09-03 00:18:12 +03:00
georgemoralis 0deda5e2a4 stubbed fs (#4879) 2026-08-19 10:27:15 -05:00
georgemoralis 46ae080038 stubbed signals (#4873) 2026-08-19 00:36:12 +03:00
kalaposfos13andgeorgemoralis 852539829a Reset controller colours on emulator shutdown (#4537)
* Reset controller colours on emulator shutdown

* bruh moment

* Don't use the destructor for this

* clang, formatter of night

* forgot to stage this file

* ffs

* fix tests

* fixed tests?

* gcn tests fixed?

* now?

* possible fixed

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-06-08 00:39:50 +03:00
georgemoralis a2c4e68d24 Http part7 (#4462)
* sceHttpAddRequestHeader

* added sceHttpRemoveRequestHeader

* implemented a few more functions

* added sceHttpSetProxy

* cleanup

* more cleanup

* fix tests?

* fix tests part2

* Added debug in SendRequest

* improved debug

* forgot

* added real http connection path

* fixes for wipeout

* add custom redirect as it doesn't match the httplib one

* more debug messages

* clang is not my friend

* argg

* make kernelstub configurable

* added url override

* fixup

* ..

* stephen's reviews

* more stephen reviews

* http tests

* fixed tests

* fixed a single tests isssue

* one more fix

* argg
2026-06-07 19:14:42 +03:00
georgemoralis 94786d70ca Http part2 (#4441)
* more uri work based on decompile and tests

* fix includes

* fix loader stubs

* cleanups

* sceHttpParseStatusLine matches decompile and tests

* sceHttpParseResponseHeader implemenation and tests

* try fixing no-internet path in sendrequest

* minimal state machine to support proper erroring of no-internet available

* more improvements

* more implementation based on stephen's comments

* some more fixes based on decompile
2026-05-17 22:54:34 +03:00
Marcin Mikołajczyk 963d10f220 Test framework for GCN pipeline (#4272)
* Test framework for GCN pipeline

* Try fixing test compilation on CI
2026-04-19 22:15:08 +03:00
Niram7777 854b291c63 Spdlog migration (#4069)
* spdlog migration

* gitmodule instead of cmake
2026-04-19 00:57:05 +03:00
georgemoralis 31b2d9ccd7 Introducing testing suite using google test (#4170)
* initial tests for testing Setting<T>

* argg

* keep switch off

* added ci

* fix ci

* merging tests to build.yml

* fixing linux ttests/?

* one more try for ci

* more linux fix for ci

* more ci fixes

* try to fix ctests now

* should fix now

* trying fixing linux tests

* some more tests

* more tests (68 tests) and clang format
2026-03-26 00:31:53 +02:00