diff options
author | gdkchan <gab.dark.100@gmail.com> | 2021-09-28 20:55:12 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 01:55:12 +0200 |
commit | fd7567a6b56fcb82a52b85097582fc0a67038457 (patch) | |
tree | 175c9992d0cca4c05b80857d66af4bbdce09cba7 /Ryujinx.Graphics.Gpu/Image/TextureCache.cs | |
parent | 312be74861dae16311f4376e32195f8a4fd372c6 (diff) |
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
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCache.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureCache.cs | 13 |
1 files changed, 10 insertions, 3 deletions
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 /// </summary> /// <param name="memoryManager">GPU memory manager where the texture is mapped</param> /// <param name="colorState">Color buffer texture to find or create</param> + /// <param name="layered">Indicates if the texture might be accessed with a non-zero layer index</param> /// <param name="samplesInX">Number of samples in the X direction, for MSAA</param> /// <param name="samplesInY">Number of samples in the Y direction, for MSAA</param> /// <param name="sizeHint">A hint indicating the minimum used size for the texture</param> /// <returns>The texture</returns> - 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; } |