Commit Graph

1740 Commits

Author SHA1 Message Date
34db5097da Avoid using a shared_ptr reference to cycle for command buffer submission
Somehow without this we can sometimes get crashes during appending to circular queue
2022-11-02 17:46:07 +00:00
0428e8c7da Support forcing regular descriptor sets in VK pipeline cache 2022-11-02 17:46:07 +00:00
0f394d516b Lock FenceCycle inbetween waiting on chained cycles and checking signalled
Avoids one race where we would end up hogging all the locks of chained cycles and ourself when waiting for submission of previous cycles and prevent any forward progress due to another thread locking one of the chained cycles.
2022-11-02 17:46:07 +00:00
a015fe753d Only write npad controllerInfo entry on the HID thread if it is valid 2022-11-02 17:46:07 +00:00
b5446846f7 Stub IsSixAxisSensorAtRest 2022-11-02 17:46:07 +00:00
6719572b3b Keep track of how often textures/buffers are locked on the CPU
For the upcoming preserve attachment optimisation, which will keep buffers/textures locked on the GPU between executions, we don't want to preserve any which are frequently locked on the CPU as that would result in lots of needless waiting for a resource to be unlocked by the GPU when it occasionally frees all preserve attachments when it could have been done much sooner.  By checking if a resource has ever been locked on the CPU and using that to choose whether we preserve it we can avoid such waiting.
2022-11-02 17:46:07 +00:00
993ffb56f4 Avoid waiting on texture/buffer fence with trapMutex locked
This could cause deadlocks under certain circumstances by preventing the GPFIFO from making any progress while also waiting on it at the same time.
2022-11-02 17:46:07 +00:00
3e8bd26978 Add a global gm20b channel lock
Allowing for parallel execution of channels never really benefitted many games and prevented optimisations such as keeping frequently used resources always locked to avoid the constant overhead of locking on the hot path.
2022-11-02 17:46:07 +00:00
57a4699bd1 Add IOCTL trace events 2022-11-02 17:46:07 +00:00
7861968c05 Fix memory::Buffer move constructor 2022-11-02 17:46:07 +00:00
ef0ae30667 Implement Maxwell3D texture pool management and view creation
Ontop of the TIC cache from previous code a simple index based lookup has been added which vastly speeds things up by avoding the need to hash the TIC structure every time.
2022-11-02 17:46:07 +00:00
5542459c75 Use a SpinLock for guest shader code cache trap mutex 2022-11-02 17:46:07 +00:00
3e12cde4d5 Make active Vulkan pipeline public 2022-11-02 17:46:07 +00:00
2556966ec5 Don't attach textures to the active cycle in AttachTexture 2022-11-02 17:46:07 +00:00
7dc3dde815 Introduce support for waiting for submission to FenceCycle
Introducing async record resulted in breaking the assumption that any work submitted through command scheduler would be submitted in order with graphics submits. Since async record now unlocks the texture before it's submitted a seperate mechanism is needed to ensure ordering of submits. This is achieved by building support into fence cycle itself, with a conditional variable that is waited on for submission before any fence waits occur.
2022-11-02 17:46:07 +00:00
54b85583ae Fix layout transition in Texture::CopyFrom 2022-11-02 17:46:07 +00:00
0f7c04ffb4 Use target format bpb when calculating linear mip level size 2022-11-02 17:46:07 +00:00
849184452c Add function to check if any guest texture mappings are unmapped 2022-11-02 17:46:07 +00:00
98cb94ca6c Bind an empty uniform buffer in place of unbound constant buffers 2022-11-02 17:46:07 +00:00
55b85d0691 Implement combined image samplers and make descriptor code common between quick/normal updates 2022-11-02 17:46:07 +00:00
ccf2d59351 Fixup input rate reading from packed pipeline state 2022-11-02 17:46:07 +00:00
13970a5644 Refresh pipeline cached storage buffer bindings after each execution 2022-11-02 17:46:07 +00:00
6bb2853ca0 Keep track of combined image samplers for quick bind 2022-11-02 17:46:07 +00:00
040db37a28 Fix descriptor copies to be one per descriptor type 2022-11-02 17:46:07 +00:00
d482e0ea98 Fix shader stage iteration to not miss the pixel stage 2022-11-02 17:46:07 +00:00
0b808cc22b Use Sint/Uint attribute type in place of Sscaled/Uscaled
Scaled formats are not supported by any mobile GPUs.
2022-11-02 17:46:07 +00:00
92ce220d3a Ignore constant buffer selector size for updates
Clustertruck performs a giant (0x3000 byte) update with a selector size of only 0x500, without this the update would only partially go through
2022-11-02 17:46:07 +00:00
33f16ca26e Handle unmapped blocks in CachedMappedBufferView 2022-11-02 17:46:07 +00:00
5c0e4a839d Fix SW BC2 decoding pitch 2022-11-02 17:46:07 +00:00
60863fa162 Make viewports fallback to viewport 0 when their dimensions are invalid
OpenGL games use a zero width/height for viewports 1-15 when they're unused
2022-11-02 17:46:07 +00:00
586f872655 Update indexed quad conversion for new API 2022-11-02 17:46:07 +00:00
498b4966d3 Avoid crashing on unmapped buffers
Just log a warning instead
2022-11-02 17:46:07 +00:00
9f2b20443b Implement Maxwell3D draws 2022-11-02 17:46:07 +00:00
5020478ace Always rebind pipeline if it has changed from the previous draw 2022-11-02 17:46:07 +00:00
af1b4ca4f8 Skip clears if attachments are invalid 2022-11-02 17:46:07 +00:00
01a5e95ce1 Implement non-indexed quad conversion support in new GPU
Uses memory::Buffer directly to allow for cleaner recreation and allow for removing host-only buffers from Buffer in the future.
2022-11-02 17:46:07 +00:00
d42814bdc1 Add callback for when non-Maxwell3D engines alter pipeline state
This is required so that Maxwell3D knows to restore all dynamic state before the next draw
2022-11-02 17:46:07 +00:00
7133c5d6b3 Drop exclusiveSubpass in favour of only ending RPs when attachments change
Significantly helps Mali performance by avoiding creating an excessive number of RPs.
2022-11-02 17:46:07 +00:00
a3f38c0cf7 Add perfetto tracepoints to async record 2022-11-02 17:46:07 +00:00
6dfef095e8 Up default record slot count to 6 2022-11-02 17:46:07 +00:00
7d3a117a6f Use a spinlock for descriptor set allocator 2022-11-02 17:46:07 +00:00
78ddd03d1f Mark newly allocated descriptor slots as active 2022-11-02 17:46:07 +00:00
0867c593be Support binding pipelines in state updater 2022-11-02 17:46:07 +00:00
f42a0df72c Use ctSelect register for colour targets and impl null color attachments
Some games have invalid colour attachments sandwiched inbetween valid ones, these need to be skipped in Vulkan with UNUSED_ATTACHMENT
2022-11-02 17:46:07 +00:00
38aad21d29 Share single flag variable for Maxwell3D batch draw/constant buffer update
Slightly cheaper
2022-11-02 17:46:07 +00:00
bd7eee8e2b Optimise GPFIFO command processing
GPFIFO code is very high throughput due to the sheer number of commands used for rendering. Adjust some types and switch to a if statement with hints to slightly increase processing speed.
2022-11-02 17:46:07 +00:00
2cdf6c1fe6 Add branch hint attributes to a couple branches 2022-11-02 17:46:07 +00:00
b310b99bdc Handle unmapped ranges in TranslateRange 2022-11-02 17:46:07 +00:00
acfa58ea8c State uopdater MERGEBACK desC 2022-11-02 17:46:07 +00:00
68b6b20f78 Bunch of cleanup/bugfixes for initial pipeline desc set impl
Cleans up code slightly, fixes keeping track of per-stage descriptor counts and fixes storage buffer caching + more random stuff.
2022-11-02 17:46:07 +00:00