1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-13 11:16:42 +00:00
Ryujinx/Ryujinx.Graphics.Gpu/Image
riperiperi d64594ec74
Fix various issues with texture sync (#3302)
* Fix various issues with texture sync

A variable called _actionRegistered is used to keep track of whether a tracking action has been registered for a given texture group handle. This variable is set when the action is registered, and should be unset when it is consumed. This is used to skip registering the tracking action if it's already registered, saving some time for render targets that are modified very often.

There were two issues with this. The worst issue was that the tracking action handler exits early if the handle's modified flag is false... which means that it never reset _actionRegistered, as that was done within the Sync() method called later. The second issue was that this variable was set true after the sync action was registered, so it was technically possible for the action to run immediately, set the flag to false, then set it to true.

Both situations would lead to the action never being registered again, as the texture group handle would be sure the action is already registered. This breaks the texture for the remaining runtime, or until it is disposed.

It was also possible for a texture to register sync once, then on future frames the last modified sync number did not update. This may have caused some more minor issues.

Seems to fix the Xenoblade flashing bug. Obviously this needs a lot of testing, since it was random chance. I typically had the most luck getting it to happen by switching time of day on the event theatre screen for a while, then entering the equipment screen by pressing X on an event.

May also fix weird things like random chance air swimming in BOTW, maybe a few texture streaming bugs.

* Exchange rather than CompareExchange
2022-04-29 18:34:11 -03:00
..
AutoDeleteCache.cs Texture Sync, incompatible overlap handling, data flush improvements. (#2971) 2022-01-09 13:28:48 -03:00
FormatInfo.cs
FormatTable.cs Implement S8D24 texture format and tweak depth range detection (#2458) 2022-03-15 03:42:08 +01:00
ITextureDescriptor.cs
Pool.cs Replace CacheResourceWrite with more general "precise" write (#2684) 2021-09-29 02:27:03 +02:00
ReductionFilter.cs
Sampler.cs Move texture anisotropy check to SetInfo (#2843) 2021-12-08 18:09:36 -03:00
SamplerDescriptor.cs
SamplerMinFilter.cs
SamplerMipFilter.cs
SamplerPool.cs Limit Custom Anisotropic Filtering to mipmapped textures with many levels (#2832) 2021-11-13 16:04:21 -03:00
Texture.cs Allow copy texture views to have mismatching multisample state (#3152) 2022-04-08 11:26:48 +02:00
TextureBindingInfo.cs
TextureBindingsManager.cs Fix res scale parameters not being updated in vertex shader (#3046) 2022-01-27 14:17:13 -03:00
TextureCache.cs Allow copy texture views to have mismatching multisample state (#3152) 2022-04-08 11:26:48 +02:00
TextureCompatibility.cs Implement S8D24 texture format and tweak depth range detection (#2458) 2022-03-15 03:42:08 +01:00
TextureComponent.cs
TextureDependency.cs
TextureDescriptor.cs
TextureDescriptorType.cs
TextureGroup.cs Fix various issues with texture sync (#3302) 2022-04-29 18:34:11 -03:00
TextureGroupHandle.cs Fix various issues with texture sync (#3302) 2022-04-29 18:34:11 -03:00
TextureInfo.cs
TextureManager.cs Fix bug that could cause depth buffer to be missing after clear (#3067) 2022-01-31 00:11:43 -03:00
TextureMatchQuality.cs
TextureMsaaMode.cs
TexturePool.cs Implement S8D24 texture format and tweak depth range detection (#2458) 2022-03-15 03:42:08 +01: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 Perform unscaled 2d engine copy on CPU if source texture isn't in cache. (#3112) 2022-02-22 11:21:29 -03:00
TextureTarget.cs Fix TXQ for 3D textures. (#2613) 2021-09-02 00:17:43 -03:00
TextureViewCompatibility.cs Texture Sync, incompatible overlap handling, data flush improvements. (#2971) 2022-01-09 13:28:48 -03:00