aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory/BufferManager.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Memory/BufferManager.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs
index 71f202ae..9f5f39a9 100644
--- a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs
+++ b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs
@@ -379,6 +379,25 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
/// <summary>
+ /// Gets the bounds of the uniform buffer currently bound at the given index.
+ /// </summary>
+ /// <param name="isCompute">Indicates whenever the uniform is requested by the 3D or compute engine</param>
+ /// <param name="stage">Index of the shader stage, if the uniform is for the 3D engine</param>
+ /// <param name="index">Index of the uniform buffer binding</param>
+ /// <returns>The uniform buffer bounds, or an undefined value if the buffer is not currently bound</returns>
+ public ref BufferBounds GetUniformBufferBounds(bool isCompute, int stage, int index)
+ {
+ if (isCompute)
+ {
+ return ref _cpUniformBuffers.Buffers[index];
+ }
+ else
+ {
+ return ref _gpUniformBuffers[stage].Buffers[index];
+ }
+ }
+
+ /// <summary>
/// Ensures that the compute engine bindings are visible to the host GPU.
/// Note: this actually performs the binding using the host graphics API.
/// </summary>