Ryujinx/src
riperiperi d2f3adbf69
Texture: Fix layout conversion when gobs in z is used with depth = 1 (#5220)
* Texture: Fix layout conversion when gobs in z is used with depth = 1

The size calculator methods deliberately reduce the gob size of textures if they are deemed too small for it. This is required to get correct sizes when iterating mip levels of a texture.

Rendering to a slice of a 3D texture can produce a 3D texture with depth 1, but a gob size matching a much larger texture. We _can't_ "correct" this gob size, as it is intended as a slice of a larger 3D texture. Ignoring it causes layout conversion to break on read and flush.

This caused an issue in Tears of the Kingdom where the compressed 3D texture used for the gloom would always break on OpenGL, and seemingly randomly break on Vulkan. In the first case, the data is forcibly flushed to decompress the BC4 texture on the CPU to upload it as 3D, which was broken due to the incorrect layout. In the second, the data may be randomly flushed if it falls out of the cache, but it will appear correct if it's able to form copy dependencies.

This change only allows gob sizes to be reduced once per mip level. For the purpose of aligned size, it can still be reduced infinitely as our texture cache isn't properly able to handle a view being _misaligned_.

The SizeCalculator has also been changed to reduce the size of rendered depth slices to only include the exact range a single depth slice will cover. (before, the size was way too small with gobs in z reduced to 1, and too large when using the correct value)

Gobs in Y logic remains untouched, we don't support Y slices of textures so it's fine as is.

This is probably worth testing in a few games as it also affects texture size and view logic.

* Improve wording

* Maybe a bit better
2023-06-04 20:25:57 +00:00
..
ARMeilleure Armeilleure: Fix support for Windows on ARM64 (#5202) 2023-06-03 10:23:51 +02:00
Ryujinx Check KeyboardMode in GUI (#4343) 2023-06-04 05:30:24 +02:00
Ryujinx.Audio Ryujinx.Ava: fixes for random hangs on exit (#4827) 2023-05-26 23:57:43 +02:00
Ryujinx.Audio.Backends.OpenAL Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Audio.Backends.SDL2 Fix #5108: Allow surround sound for SDL2 in more scenarios (#5131) 2023-05-29 00:07:27 +02:00
Ryujinx.Audio.Backends.SoundIo Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Ava Check KeyboardMode in GUI (#4343) 2023-06-04 05:30:24 +02:00
Ryujinx.Common [Logger] Add print with stacktrace method (#5129) 2023-06-01 13:47:53 +00:00
Ryujinx.Cpu GPU: Remove CPU region handle containers (#4817) 2023-05-05 23:40:46 +02:00
Ryujinx.Graphics.Device Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Graphics.GAL Allow BGRA images on Vulkan (#5203) 2023-06-03 03:43:00 +00:00
Ryujinx.Graphics.Gpu Texture: Fix layout conversion when gobs in z is used with depth = 1 (#5220) 2023-06-04 20:25:57 +00:00
Ryujinx.Graphics.Host1x Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Graphics.Nvdec Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Graphics.Nvdec.FFmpeg Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Graphics.Nvdec.Vp9 Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Graphics.OpenGL Add support for VK_EXT_depth_clip_control. (#5027) 2023-05-28 23:31:56 +02:00
Ryujinx.Graphics.Shader Implement shader storage buffer operations using new Load/Store instructions (#4993) 2023-06-03 20:12:18 -03:00
Ryujinx.Graphics.Texture Texture: Fix layout conversion when gobs in z is used with depth = 1 (#5220) 2023-06-04 20:25:57 +00:00
Ryujinx.Graphics.Vic Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Graphics.Video Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Graphics.Vulkan Implement shader storage buffer operations using new Load/Store instructions (#4993) 2023-06-03 20:12:18 -03:00
Ryujinx.Headless.SDL2 [Logger] Add print with stacktrace method (#5129) 2023-06-01 13:47:53 +00:00
Ryujinx.HLE Check KeyboardMode in GUI (#4343) 2023-06-04 05:30:24 +02:00
Ryujinx.Horizon Fix missing domain service object dispose (#4879) 2023-05-11 00:29:17 +00:00
Ryujinx.Horizon.Common Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Horizon.Generators IPC - Refactor Bcat service to use new ipc - Revisit (#4803) 2023-05-09 21:46:23 +00:00
Ryujinx.Horizon.Kernel.Generators Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Input Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Input.SDL2 Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Memory Linux: Automatically increase vm.max_map_count if it's too low (#4702) 2023-05-30 01:48:37 +02:00
Ryujinx.SDL2.Common Stop SDL from inhibiting sleep. (#4842) 2023-05-11 20:13:01 +02:00
Ryujinx.ShaderTools Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Tests Adjust Ryujinx.Tests.Memory namespace 2023-04-27 23:51:14 +02:00
Ryujinx.Tests.Memory Adjust Ryujinx.Tests.Memory namespace 2023-04-27 23:51:14 +02:00
Ryujinx.Tests.Unicorn Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.Ui.Common UI: Fix empty homebrew icon (#5189) 2023-06-01 18:24:00 +02:00
Ryujinx.Ui.LocaleGenerator Move solution and projects to src 2023-04-27 23:51:14 +02:00
Spv.Generator Move solution and projects to src 2023-04-27 23:51:14 +02:00