aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2019-12-31 19:09:49 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit59fdaa744b20f91928ee3fcaf5fabfcb7b409451 (patch)
treef01e21d930e456398411317784c5063c532a7215 /Ryujinx.Graphics.Gpu/Engine
parentf7bcc884e46805f4dcda4fc7d7e7bccb2a3ac316 (diff)
GPU resource disposal
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Compute.cs2
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Methods.cs16
2 files changed, 10 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Compute.cs b/Ryujinx.Graphics.Gpu/Engine/Compute.cs
index 50aac1d0..1f524671 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Compute.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Compute.cs
@@ -28,7 +28,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
// Note: A size of 0 is also invalid, the size must be at least 1.
int sharedMemorySize = Math.Clamp(dispatchParams.SharedMemorySize & 0xffff, 1, _context.Capabilities.MaximumComputeSharedMemorySize);
- ComputeShader cs = _shaderCache.GetComputeShader(
+ ComputeShader cs = ShaderCache.GetComputeShader(
shaderGpuVa,
sharedMemorySize,
dispatchParams.UnpackBlockSizeX(),
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
index 0a52bee9..12a9744c 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
@@ -18,12 +18,14 @@ namespace Ryujinx.Graphics.Gpu.Engine
partial class Methods
{
private readonly GpuContext _context;
-
- private readonly ShaderCache _shaderCache;
-
private readonly ShaderProgramInfo[] _currentProgramInfo;
/// <summary>
+ /// In-memory shader cache.
+ /// </summary>
+ public ShaderCache ShaderCache { get; }
+
+ /// <summary>
/// GPU buffer manager.
/// </summary>
public BufferManager BufferManager { get; }
@@ -44,7 +46,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
{
_context = context;
- _shaderCache = new ShaderCache(_context);
+ ShaderCache = new ShaderCache(_context);
_currentProgramInfo = new ShaderProgramInfo[Constants.TotalShaderStages];
@@ -757,13 +759,13 @@ namespace Ryujinx.Graphics.Gpu.Engine
addressesArray[index] = baseAddress + shader.Offset;
}
- GraphicsShader gs = _shaderCache.GetGraphicsShader(state, addresses);
+ GraphicsShader gs = ShaderCache.GetGraphicsShader(state, addresses);
- _vsUsesInstanceId = gs.Shader[0].Program.Info.UsesInstanceId;
+ _vsUsesInstanceId = gs.Shaders[0].Program.Info.UsesInstanceId;
for (int stage = 0; stage < Constants.TotalShaderStages; stage++)
{
- ShaderProgramInfo info = gs.Shader[stage].Program?.Info;
+ ShaderProgramInfo info = gs.Shaders[stage].Program?.Info;
_currentProgramInfo[stage] = info;