aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Compute.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-04-21 20:35:28 -0300
committerGitHub <noreply@github.com>2020-04-22 09:35:28 +1000
commit03711dd7b5d44e20fb45c728803ea6b9599dec87 (patch)
tree2930956a377d9f79df2750aa06ce1f1928cd30e6 /Ryujinx.Graphics.Gpu/Engine/Compute.cs
parent4738113f293ac2477a553225a24b6c489c6855f1 (diff)
Implement SULD shader instruction (#1117)
* Implement SULD shader instruction * Some nits
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Compute.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Compute.cs39
1 files changed, 20 insertions, 19 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Compute.cs b/Ryujinx.Graphics.Gpu/Engine/Compute.cs
index fc257f99..920cf0dd 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Compute.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Compute.cs
@@ -29,7 +29,26 @@ namespace Ryujinx.Graphics.Gpu.Engine
int sharedMemorySize = Math.Min(qmd.SharedMemorySize, _context.Capabilities.MaximumComputeSharedMemorySize);
+ uint sbEnableMask = 0;
+ uint ubEnableMask = 0;
+
+ for (int index = 0; index < Constants.TotalCpUniformBuffers; index++)
+ {
+ if (!qmd.ConstantBufferValid(index))
+ {
+ continue;
+ }
+
+ ubEnableMask |= 1u << index;
+
+ ulong gpuVa = (uint)qmd.ConstantBufferAddrLower(index) | (ulong)qmd.ConstantBufferAddrUpper(index) << 32;
+ ulong size = (ulong)qmd.ConstantBufferSize(index);
+
+ BufferManager.SetComputeUniformBuffer(index, gpuVa, size);
+ }
+
ComputeShader cs = ShaderCache.GetComputeShader(
+ state,
shaderGpuVa,
qmd.CtaThreadDimension0,
qmd.CtaThreadDimension1,
@@ -49,25 +68,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
TextureManager.SetComputeTextureBufferIndex(state.Get<int>(MethodOffset.TextureBufferIndex));
- ShaderProgramInfo info = cs.Shader.Program.Info;
-
- uint sbEnableMask = 0;
- uint ubEnableMask = 0;
-
- for (int index = 0; index < Constants.TotalCpUniformBuffers; index++)
- {
- if (!qmd.ConstantBufferValid(index))
- {
- continue;
- }
-
- ubEnableMask |= 1u << index;
-
- ulong gpuVa = (uint)qmd.ConstantBufferAddrLower(index) | (ulong)qmd.ConstantBufferAddrUpper(index) << 32;
- ulong size = (ulong)qmd.ConstantBufferSize(index);
-
- BufferManager.SetComputeUniformBuffer(index, gpuVa, size);
- }
+ ShaderProgramInfo info = cs.Shader.Program.Info;
for (int index = 0; index < info.CBuffers.Count; index++)
{