Commit Graph

1636 Commits

Author SHA1 Message Date
Billy Laws
5542459c75 Use a SpinLock for guest shader code cache trap mutex 2022-11-02 17:46:07 +00:00
Billy Laws
3e12cde4d5 Make active Vulkan pipeline public 2022-11-02 17:46:07 +00:00
Billy Laws
2556966ec5 Don't attach textures to the active cycle in AttachTexture 2022-11-02 17:46:07 +00:00
Billy Laws
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
Billy Laws
54b85583ae Fix layout transition in Texture::CopyFrom 2022-11-02 17:46:07 +00:00
Billy Laws
0f7c04ffb4 Use target format bpb when calculating linear mip level size 2022-11-02 17:46:07 +00:00
Billy Laws
849184452c Add function to check if any guest texture mappings are unmapped 2022-11-02 17:46:07 +00:00
Billy Laws
98cb94ca6c Bind an empty uniform buffer in place of unbound constant buffers 2022-11-02 17:46:07 +00:00
Billy Laws
55b85d0691 Implement combined image samplers and make descriptor code common between quick/normal updates 2022-11-02 17:46:07 +00:00
Billy Laws
ccf2d59351 Fixup input rate reading from packed pipeline state 2022-11-02 17:46:07 +00:00
Billy Laws
13970a5644 Refresh pipeline cached storage buffer bindings after each execution 2022-11-02 17:46:07 +00:00
Billy Laws
6bb2853ca0 Keep track of combined image samplers for quick bind 2022-11-02 17:46:07 +00:00
Billy Laws
040db37a28 Fix descriptor copies to be one per descriptor type 2022-11-02 17:46:07 +00:00
Billy Laws
d482e0ea98 Fix shader stage iteration to not miss the pixel stage 2022-11-02 17:46:07 +00:00
Billy Laws
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
Billy Laws
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
Billy Laws
33f16ca26e Handle unmapped blocks in CachedMappedBufferView 2022-11-02 17:46:07 +00:00
Billy Laws
5c0e4a839d Fix SW BC2 decoding pitch 2022-11-02 17:46:07 +00:00
Billy Laws
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
Billy Laws
586f872655 Update indexed quad conversion for new API 2022-11-02 17:46:07 +00:00
Billy Laws
498b4966d3 Avoid crashing on unmapped buffers
Just log a warning instead
2022-11-02 17:46:07 +00:00
Billy Laws
9f2b20443b Implement Maxwell3D draws 2022-11-02 17:46:07 +00:00
Billy Laws
5020478ace Always rebind pipeline if it has changed from the previous draw 2022-11-02 17:46:07 +00:00
Billy Laws
af1b4ca4f8 Skip clears if attachments are invalid 2022-11-02 17:46:07 +00:00
Billy Laws
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
Billy Laws
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
Billy Laws
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
Billy Laws
a3f38c0cf7 Add perfetto tracepoints to async record 2022-11-02 17:46:07 +00:00
Billy Laws
6dfef095e8 Up default record slot count to 6 2022-11-02 17:46:07 +00:00
Billy Laws
7d3a117a6f Use a spinlock for descriptor set allocator 2022-11-02 17:46:07 +00:00
Billy Laws
78ddd03d1f Mark newly allocated descriptor slots as active 2022-11-02 17:46:07 +00:00
Billy Laws
0867c593be Support binding pipelines in state updater 2022-11-02 17:46:07 +00:00
Billy Laws
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
Billy Laws
38aad21d29 Share single flag variable for Maxwell3D batch draw/constant buffer update
Slightly cheaper
2022-11-02 17:46:07 +00:00
Billy Laws
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
Billy Laws
2cdf6c1fe6 Add branch hint attributes to a couple branches 2022-11-02 17:46:07 +00:00
Billy Laws
b310b99bdc Handle unmapped ranges in TranslateRange 2022-11-02 17:46:07 +00:00
Billy Laws
acfa58ea8c State uopdater MERGEBACK desC 2022-11-02 17:46:07 +00:00
Billy Laws
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
Billy Laws
eb4a9bab11 Mark freshly allocated descriptor slots as active 2022-11-02 17:46:07 +00:00
Billy Laws
f3184cdff1 Reorder active descriptor set slots to end of list
Speeds up allocations by significantly reducing the number of needed atomic ops per alloc. Could be optimised further in the future if needed.
2022-11-02 17:46:07 +00:00
Billy Laws
128b68d8b2 Avoid resetting command buffers manually it's implicit
Somewhat costly on adreno, and with the one time submit flag the reset is implicit for the next beginCommandBuffers call.
2022-11-02 17:46:07 +00:00
Billy Laws
e1717ed811 Implement Maxwell samplers 2022-11-02 17:46:07 +00:00
Billy Laws
f1600f5ad0 Support allocating into spans in the linear allocator 2022-11-02 17:46:07 +00:00
Billy Laws
04cea9239f Implement descriptor set updating through StateUpdater
Will automatically resolve buffer views at record-time into descriptor write/copy structures then apply the write and bind the set.
2022-11-02 17:46:07 +00:00
Billy Laws
d174ca950b Revert "Reset executor command buffers asynchronously"
This reverts commit fc7956df4ff56fdb2afc4b2bb0bbca82196179ca.
2022-11-02 17:46:07 +00:00
Billy Laws
2bbe975ea7 Reset executor command buffers asynchronously
This took a little while to do on qcom drivers, moving it to the cycle waiter thread gives a tiny speedup.
2022-11-02 17:46:07 +00:00
Billy Laws
054d32567d Allow mutation of input data by callback in CircularQueue::AppendTranform 2022-11-02 17:46:07 +00:00
Billy Laws
7c9212743c Implement asynchronous command recording
Recording of command nodes into Vulkan command buffers is very easily parallelisable as it can effectively be treated as part of the GPU execution, which is inherently async. By moving it to a seperate thread we can shave off about 20% of GPFIFO execution time. It should be noted that the command scheduler command buffer infra is no longer used, since we need to record texture updates on the GPFIFO thread (while another slot is being recorded on the record thread) and then use the same command buffer on the record thread later. This ends up requiring a pool per slot, which is reasonable considering we only have four slots by default.
2022-11-02 17:46:07 +00:00
Billy Laws
a197dd2b28 Allow for creating signalled fence cycles 2022-11-02 17:46:07 +00:00