diff options
Diffstat (limited to 'Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTexture.cs')
| -rw-r--r-- | Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTexture.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTexture.cs b/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTexture.cs index 634d32fa..64d8aa3b 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTexture.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTexture.cs @@ -89,6 +89,24 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Resources } } + public ReadOnlySpan<byte> GetData(int layer, int level) + { + if (_renderer.IsGpuThread()) + { + ResultBox<PinnedSpan<byte>> box = new ResultBox<PinnedSpan<byte>>(); + _renderer.New<TextureGetDataSliceCommand>().Set(Ref(this), Ref(box), layer, level); + _renderer.InvokeCommand(); + + return box.Result.Get(); + } + else + { + ThreadedHelpers.SpinUntilNonNull(ref Base); + + return Base.GetData(layer, level); + } + } + public void SetData(ReadOnlySpan<byte> data) { _renderer.New<TextureSetDataCommand>().Set(Ref(this), Ref(data.ToArray())); |
