Archived
1
0
Fork 0
forked from Mirror/Ryujinx
This repository has been archived on 2024-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
jinx/Ryujinx.Graphics.Gpu/Engine
riperiperi d92fff541b
Replace CacheResourceWrite with more general "precise" write (#2684)
* Replace CacheResourceWrite with more general "precise" write

The goal of CacheResourceWrite was to notify GPU resources when they were modified directly, by looking up the modified address/size in a structure and calling a method on each resource. The downside of this is that each resource cache has to be queried individually, they all have to implement their own way to do this, and it can only signal to resources using the same PhysicalMemory instance.

This PR adds the ability to signal a write as "precise" on the tracking, which signals a special handler (if present) which can be used to avoid unnecessary flush actions, or maybe even more. For buffers, precise writes specifically do not flush, and instead punch a hole in the modified range list to indicate that the data on GPU has been replaced.

The downside is that precise actions must ignore the page protection bits and always signal - as they need to notify the target resource to ignore the sequence number optimization.

I had to reintroduce the sequence number increment after I2M, as removing it was causing issues in rabbids kingdom battle. However - all resources modified by I2M are notified directly to lower their sequence number, so the problem is likely that another unrelated resource is not being properly updated. Thankfully, doing this does not affect performance in the games I tested.

This should fix regressions from #2624. Test any games that were broken by that. (RF4, rabbids kingdom battle)

I've also added a sequence number increment to ThreedClass.IncrementSyncpoint, as it seems to fix buffer corruption in OpenGL homebrew. (this was a regression from removing sequence number increment from constant buffer update - another unrelated resource thing)

* Add tests.

* Add XML docs for GpuRegionHandle

* Skip UpdateProtection if only precise actions were called

This allows precise actions to skip reprotection costs.
2021-09-29 02:27:03 +02:00
..
Compute Set texture/image bindings in place rather than allocating and passing an array (#2647) 2021-09-19 14:03:05 +02:00
Dma Account for negative strides on DMA copy (#2623) 2021-09-11 22:54:18 +02:00
GPFifo Add support for HLE macros and accelerate MultiDrawElementsIndirectCount #2 (#2557) 2021-08-26 23:50:28 +02:00
InlineToMemory Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
MME Handle indirect draw counts with non-zero draw starts properly (#2593) 2021-08-29 16:52:38 -03:00
Threed Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
Twod Lift textures in the AutoDeleteCache for all modifications. (#2615) 2021-09-11 21:52:54 +02:00
Types Separate GPU engines (part 2/2) (#2440) 2021-07-11 17:20:40 -03:00
ConditionalRenderEnabled.cs Separate GPU engines (part 2/2) (#2440) 2021-07-11 17:20:40 -03:00
DeviceStateWithShadow.cs Separate GPU engines (part 2/2) (#2440) 2021-07-11 17:20:40 -03:00
MmeShadowScratch.cs Separate GPU engines (part 2/2) (#2440) 2021-07-11 17:20:40 -03:00
SetMmeShadowRamControlMode.cs Separate GPU engines (part 2/2) (#2440) 2021-07-11 17:20:40 -03:00
ShaderTexture.cs Fix image binding format (#1625) 2020-10-20 19:03:20 -03:00