aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-09-28 20:55:12 -0300
committerGitHub <noreply@github.com>2021-09-29 01:55:12 +0200
commitfd7567a6b56fcb82a52b85097582fc0a67038457 (patch)
tree175c9992d0cca4c05b80857d66af4bbdce09cba7 /Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
parent312be74861dae16311f4376e32195f8a4fd372c6 (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/Engine/Threed/StateUpdater.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
index f429ae90..f9d16803 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
@@ -6,7 +6,6 @@ using Ryujinx.Graphics.Gpu.Shader;
using Ryujinx.Graphics.Shader;
using Ryujinx.Graphics.Texture;
using System;
-using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -31,6 +30,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
private readonly ShaderProgramInfo[] _currentProgramInfo;
+ private bool _vtgWritesRtLayer;
private byte _vsClipDistancesWritten;
private bool _prevDrawIndexed;
@@ -334,6 +334,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
Image.Texture color = memoryManager.Physical.TextureCache.FindOrCreateTexture(
memoryManager,
colorState,
+ _vtgWritesRtLayer,
samplesInX,
samplesInY,
sizeHint);
@@ -956,6 +957,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
_drawState.VsUsesInstanceId = gs.Shaders[0]?.Info.UsesInstanceId ?? false;
_vsClipDistancesWritten = gs.Shaders[0]?.Info.ClipDistancesWritten ?? 0;
+ _vtgWritesRtLayer = false;
if (oldVsClipDistancesWritten != _vsClipDistancesWritten)
{
@@ -979,6 +981,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
Span<TextureBindingInfo> textureBindings = _channel.TextureManager.RentGraphicsTextureBindings(stage, info.Textures.Count);
+ if (info.UsesRtLayer)
+ {
+ _vtgWritesRtLayer = true;
+ }
+
for (int index = 0; index < info.Textures.Count; index++)
{
var descriptor = info.Textures[index];