From fd7567a6b56fcb82a52b85097582fc0a67038457 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 28 Sep 2021 20:55:12 -0300 Subject: Only make render target 2D textures layered if needed (#2646) * Only make render target 2D textures layered if needed * Shader cache version bump * Ensure topology is updated on channel swap --- Ryujinx.Graphics.Gpu/Image/TextureCache.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCache.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs index a6fa9652..cc6867a6 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs @@ -244,11 +244,18 @@ namespace Ryujinx.Graphics.Gpu.Image /// /// GPU memory manager where the texture is mapped /// Color buffer texture to find or create + /// Indicates if the texture might be accessed with a non-zero layer index /// Number of samples in the X direction, for MSAA /// Number of samples in the Y direction, for MSAA /// A hint indicating the minimum used size for the texture /// The texture - public Texture FindOrCreateTexture(MemoryManager memoryManager, RtColorState colorState, int samplesInX, int samplesInY, Size sizeHint) + public Texture FindOrCreateTexture( + MemoryManager memoryManager, + RtColorState colorState, + bool layered, + int samplesInX, + int samplesInY, + Size sizeHint) { bool isLinear = colorState.MemoryLayout.UnpackIsLinear(); @@ -263,13 +270,13 @@ namespace Ryujinx.Graphics.Gpu.Image } else if ((samplesInX | samplesInY) != 1) { - target = colorState.Depth > 1 + target = colorState.Depth > 1 && layered ? Target.Texture2DMultisampleArray : Target.Texture2DMultisample; } else { - target = colorState.Depth > 1 + target = colorState.Depth > 1 && layered ? Target.Texture2DArray : Target.Texture2D; } -- cgit v1.2.3