ryujinx-mirror/Ryujinx.Graphics.Gpu/Image
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
..
AutoDeleteCache.cs Force copy when auto-deleting a texture with dependencies (#2687) 2021-09-29 02:11:05 +02:00
FormatInfo.cs Allow swizzles to match with "undefined" components (#1538) 2020-09-11 09:48:48 +10:00
FormatTable.cs Add another Depth32F texture format (#2304) 2021-05-22 01:15:08 +02:00
ITextureDescriptor.cs shader cache: Fix invalid virtual address clean up (#1717) 2020-11-17 22:20:17 +01:00
Pool.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
ReductionFilter.cs Address PR feedback 2020-01-09 02:13:00 +01:00
Sampler.cs Add seamless cubemap flag in sampler parameters. (#1658) 2020-11-02 17:03:06 -03:00
SamplerDescriptor.cs Use a descriptor cache for faster pool invalidation. (#1977) 2021-01-29 14:19:06 +11:00
SamplerMinFilter.cs Add XML documentation to Ryujinx.Graphics.Gpu.Image 2020-01-09 02:13:00 +01:00
SamplerMipFilter.cs Add XML documentation to Ryujinx.Graphics.Gpu.Image 2020-01-09 02:13:00 +01:00
SamplerPool.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
Texture.cs Account for negative strides on DMA copy (#2623) 2021-09-11 22:54:18 +02:00
TextureBindingInfo.cs Simplify logic for bindless texture handling (#1667) 2020-11-09 19:35:04 -03:00
TextureBindingsManager.cs Share scales array for graphics and compute (#2653) 2021-09-28 23:52:27 +02:00
TextureCache.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
TextureCompatibility.cs Compare aligned size for largest mip level when considering sampler resize (#2306) 2021-05-24 17:35:26 +10:00
TextureComponent.cs Add XML documentation to Ryujinx.Graphics.Gpu.Image 2020-01-09 02:13:00 +01:00
TextureDependency.cs Texture Cache: "Texture Groups" and "Texture Dependencies" (#2001) 2021-03-02 19:30:54 -03:00
TextureDescriptor.cs Improve Buffer Textures and flush Image Stores (#2088) 2021-03-08 18:43:39 -03:00
TextureDescriptorType.cs Add XML documentation to Ryujinx.Graphics.Gpu.Image 2020-01-09 02:13:00 +01:00
TextureGroup.cs Force copy when auto-deleting a texture with dependencies (#2687) 2021-09-29 02:11:05 +02:00
TextureGroupHandle.cs Force copy when auto-deleting a texture with dependencies (#2687) 2021-09-29 02:11:05 +02:00
TextureInfo.cs Texture Cache: "Texture Groups" and "Texture Dependencies" (#2001) 2021-03-02 19:30:54 -03:00
TextureManager.cs Share scales array for graphics and compute (#2653) 2021-09-28 23:52:27 +02:00
TextureMatchQuality.cs Prefer truly perfect texture matches over fomat aliased ones (#1754) 2020-11-27 19:46:23 +01:00
TextureMsaaMode.cs Add XML documentation to Ryujinx.Graphics.Gpu.Image 2020-01-09 02:13:00 +01:00
TexturePool.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
TexturePoolCache.cs Initial support for separate GPU address spaces (#2394) 2021-06-29 19:32:02 +02:00
TextureScaleMode.cs Use "Undesired" scale mode for certain textures rather than blacklisting (#2537) 2021-08-11 22:44:51 +02:00
TextureSearchFlags.cs Fix depth stencil formats copy by matching equivalent color formats (#1198) 2020-07-13 21:41:30 +10:00
TextureTarget.cs Fix TXQ for 3D textures. (#2613) 2021-09-02 00:17:43 -03:00
TextureViewCompatibility.cs Texture/Buffer Memory Management Improvements (#1408) 2020-09-10 16:44:04 -03:00