Commit Graph

720 Commits

Author SHA1 Message Date
3c5f8dd876 Fix small typo 2022-12-18 14:49:54 +00:00
7c802aea46 Mark vertex buffers as dirty on limit changes 2022-12-03 22:50:56 +00:00
df19810c6c Always set vertex stride for unbound buffers 2022-12-03 22:50:56 +00:00
45b10ef776 Return whole mapping for shader code when end instrs aren't found 2022-12-03 22:50:56 +00:00
af7c54297f Cache staging buffer used for texture download 2022-12-03 22:50:56 +00:00
bba07fb101 Update for new hades 2022-12-03 22:50:56 +00:00
a16383fd4b Disable compute shaders on mali
This will need to be debugged properly at some point but its fine for now.
2022-12-03 22:50:56 +00:00
579a2d9337 Add dynamic executor slot growth 2022-12-03 22:50:56 +00:00
60169fce4c Support 0-sized constant buffers 2022-12-03 22:50:56 +00:00
b86dd99e1a Align all SSBOs to 0x40 bytes
Required by Adreno GPUs
2022-12-03 22:50:56 +00:00
bfae292fb0 Make executor slot count setting exponential 2022-12-03 22:50:56 +00:00
e0ae94be9d Enable robustness1 Vulkan feature 2022-12-03 22:50:56 +00:00
bf03f945ee Implement the Kepler compute engine
This can reuse a fair bit of the now-commonised Maxwell 3D code and mostly consists of compute-specific pipeline code which was deemed not suitable for being commonised (e.g. descriptor update code is somewhat duplicated). Of note is how compute lacks any active state at all de to its use of QMDs which bundle up all state into a single object in memory.
2022-12-03 22:50:56 +00:00
4267a6af36 Add support for parsing and compiling compute shaders to the shader manager 2022-12-03 22:50:56 +00:00
86dab65af4 Commonise maxwell3d state updater 2022-12-03 22:50:56 +00:00
a0b81d54d6 Use pitch layout for linear RTs
More likely to match in the texture cache when being sampled.
2022-12-03 22:50:56 +00:00
ac85df7b7a Start transition cache lookup with most recent one 2022-12-03 22:50:56 +00:00
62c86b7690 Move maxwell3d to common constant buffer code 2022-12-03 22:50:56 +00:00
8f0a6e78c5 Add Vulkan stride dynamic state and robustness support
Fixes the waterfall in SMO by specifying vertex buffer bounds.
2022-12-03 22:50:56 +00:00
23a7f70a8e Commonise maxwell3d guest shader caching code 2022-12-03 22:50:56 +00:00
6f6a312692 Commonise maxwell3d pipeline binding handling code
A lot of pipeline code is difficult to commonise due to the inherent difference between compute and graphics pipelines, however the binding layout is shared so we can at least commonise that
2022-12-03 22:50:56 +00:00
be8cbabd97 Commonise maxwell3d texture code
This will be shared with the compute engine implementation.
2022-12-03 22:50:56 +00:00
61e95c4b2c Commonise maxwell3d sampler code
This will be shared with the compute engine implementation, the only thing of note with this is that the binding register is now passed as a param since it is part of the compute QMD which can't be dirty tracked.
2022-12-03 22:50:56 +00:00
7f93ec3df6 Commonise maxwell3d interconnect common code for use by other engines
The compute engine will require most of this for basic functionality.
2022-12-03 22:50:56 +00:00
281838fde1 Apply GPU readback hack to both buffers and textures
And rename as appropriate.
2022-12-03 22:50:56 +00:00
7f1667de82 Avoid using trapping for frequently trapped shaders
Fall back to hashing for every shader access as that ends up being faster than applying traps for every execution.
2022-11-19 12:49:05 +00:00
97e3f7fd34 Increase max swapchain image count 2022-11-19 12:49:05 +00:00
db3c5c33c4 Clamp depth bounds into 0-1 range 2022-11-19 12:49:05 +00:00
13baf2312f Add a workaround for sampling BGRA textures with a swizzle 2022-11-19 12:49:05 +00:00
13a96c5aba Implement a helper shader for partial clears
These are not natively supported by Vulkan, so use a helper shader and colorWriteMask for the same behaviour.
2022-11-19 12:49:05 +00:00
ac0e225114 Use vkCmdBlit for texture copies when formats dont match 2022-11-19 12:49:05 +00:00
c8fc8f84ec Fallback to RGBA888 for unsupported swapchain formats as opposed to swizzle 2022-11-19 12:49:05 +00:00
e0bc0d3a97 Avoid megabuffering buffers larger than the chunk size 2022-11-19 12:49:05 +00:00
b6f49884b3 Use lower_bound to speedup texture hostMapping lookup 2022-11-19 12:49:05 +00:00
e7fda28ac6 Skip over textures in cache which have been replaced with a layer/mip match 2022-11-19 12:49:05 +00:00
88cc696c7f Only use 2D array depth targets when depth > 1 2022-11-19 12:49:05 +00:00
7fed971b2d Take firstIndex into account when calculating index (quad) buffer size
Without this we would miss any elements beyond indexCount in the index buffer and they would be filled with random garbage causing vertex bombs
2022-11-19 12:49:05 +00:00
1f9de17e98 Begin command buffers asynchronously in command executor
vkBeginCommandBuffer can take quite some time on adreno, move it to the cycle waiter thread where it won't block GPFIFO.
2022-11-19 12:49:05 +00:00
4b3e906c22 Update cached buffer execution number when megabuffering 2022-11-19 12:49:05 +00:00
3ae1e78544 Match mip layers and array layers in texture manager 2022-11-19 12:49:05 +00:00
d502adb309 Avoid WRW hazard in subpass deps 2022-11-19 12:49:05 +00:00
e9313cc291 Use view layer count over texture for attachments 2022-11-19 12:49:05 +00:00
e65ca52d91 Avoid potential buffer copy race 2022-11-19 12:49:05 +00:00
026bb04386 Impl some more texture formats 2022-11-02 17:46:07 +00:00
1d83dadefb Drop size restruction bypass for frequently synced buffers
In cases where large buffers are updated every draw this could seriously increase memory usage beyond 3GB in the megabuffer.
2022-11-02 17:46:07 +00:00
1088ed514c Introduce texture usage system to ensure RPs are split when necessary
Vulkan doesn't allow sampling a texture and using it as an RT in the same RP, by tracking the texture usage status and splitting RPs when this occurs we can avoid such potential sync errors.
2022-11-02 17:46:07 +00:00
2dd4698441 Adjust texture matching hacks 2022-11-02 17:46:07 +00:00
4f5c9047ef Add some additional texture formats used by Vulkan games 2022-11-02 17:46:07 +00:00
6a830dfac5 Use shader-compiler side {S,U}Scaled format emulation 2022-11-02 17:46:07 +00:00
579fd04117 Fixup ReadTextureType shader compiler callback 2022-11-02 17:46:07 +00:00