From f82309fa2dd46d4339e0709ab835d927fd25361b Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 2 Nov 2022 18:17:19 -0300 Subject: Vulkan: Implement multisample <-> non-multisample copies and depth-stencil resolve (#3723) * Vulkan: Implement multisample <-> non-multisample copies and depth-stencil resolve * FramebufferParams is no longer required there * Implement Specialization Constants and merge CopyMS Shaders (#15) * Vulkan: Initial Specialization Constants * Replace with specialized helper shader * Reimplement everything Fix nonexistant interaction with Ryu pipeline caching Decouple specialization info from data and relocate them Generalize mapping and add type enum to better match spv types Use local fixed scopes instead of global unmanaged allocs * Fix misses in initial implementation Use correct info variable in Create2DLayerView Add ShaderStorageImageMultisample to required feature set * Use texture for source image * No point in using ReadOnlyMemory * Apply formatting feedback Co-authored-by: gdkchan * Apply formatting suggestions on shader source Co-authored-by: gdkchan Co-authored-by: gdkchan * Support conversion with samples count that does not match the requested count, other minor changes Co-authored-by: mageven <62494521+mageven@users.noreply.github.com> --- Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Gpu/Image') diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs index 5ea9ee2f..91a1a728 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs @@ -710,7 +710,12 @@ namespace Ryujinx.Graphics.Gpu.Image break; case Target.Texture2DMultisample: case Target.Texture2DMultisampleArray: - if (rhs.Target == Target.Texture2D || rhs.Target == Target.Texture2DArray) + // We don't support copy between multisample and non-multisample depth-stencil textures + // because there's no way to emulate that since most GPUs don't support writing a + // custom stencil value into the texture, among several other API limitations. + + if ((rhs.Target == Target.Texture2D || rhs.Target == Target.Texture2DArray) && + !rhs.FormatInfo.Format.IsDepthOrStencil()) { return TextureViewCompatibility.CopyOnly; } -- cgit v1.2.3