diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2024-06-02 22:40:28 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-02 22:40:28 -0300 |
| commit | c0f2491eaee7eb1088605f5bda8055b941a14f99 (patch) | |
| tree | 4f52becd1f06d3f2dc2209be8e802f505b1d1eca /src/Ryujinx.Graphics.GAL/Multithreading | |
| parent | d7c6474729ee36875cf387629afe1389655311f8 (diff) | |
Vulkan separate descriptor set fixes (#6895)
* Ensure descriptor sets are only re-used when all command buffers using it have completed
* Fix some SPIR-V capabilities
* Set update after bind flag if we exceed limits
* Simpler fix for Intel
* Format whitespace
* Make struct readonly
* Add barriers for extra set arrays too
Diffstat (limited to 'src/Ryujinx.Graphics.GAL/Multithreading')
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs | 2 | ||||
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs | 2 | ||||
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/Commands/ImageArray/ImageArrayDisposeCommand.cs | 21 | ||||
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArrayDisposeCommand.cs | 21 | ||||
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArraySetSamplersCommand.cs (renamed from src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureAndSamplerArray/TextureArraySetSamplersCommand.cs) | 0 | ||||
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArraySetTexturesCommand.cs (renamed from src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureAndSamplerArray/TextureArraySetTexturesCommand.cs) | 0 | ||||
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedImageArray.cs | 6 | ||||
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTextureArray.cs | 6 |
8 files changed, 58 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs b/src/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs index edaae304..ef227d4a 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs @@ -66,6 +66,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading Register<CounterEventDisposeCommand>(CommandType.CounterEventDispose); Register<CounterEventFlushCommand>(CommandType.CounterEventFlush); + Register<ImageArrayDisposeCommand>(CommandType.ImageArrayDispose); Register<ImageArraySetFormatsCommand>(CommandType.ImageArraySetFormats); Register<ImageArraySetImagesCommand>(CommandType.ImageArraySetImages); @@ -88,6 +89,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading Register<TextureSetDataSliceRegionCommand>(CommandType.TextureSetDataSliceRegion); Register<TextureSetStorageCommand>(CommandType.TextureSetStorage); + Register<TextureArrayDisposeCommand>(CommandType.TextureArrayDispose); Register<TextureArraySetSamplersCommand>(CommandType.TextureArraySetSamplers); Register<TextureArraySetTexturesCommand>(CommandType.TextureArraySetTextures); diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs b/src/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs index 75869535..cf3f5d6c 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs @@ -26,6 +26,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading CounterEventDispose, CounterEventFlush, + ImageArrayDispose, ImageArraySetFormats, ImageArraySetImages, @@ -48,6 +49,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading TextureSetDataSliceRegion, TextureSetStorage, + TextureArrayDispose, TextureArraySetSamplers, TextureArraySetTextures, diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/Commands/ImageArray/ImageArrayDisposeCommand.cs b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/ImageArray/ImageArrayDisposeCommand.cs new file mode 100644 index 00000000..ac2ac933 --- /dev/null +++ b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/ImageArray/ImageArrayDisposeCommand.cs @@ -0,0 +1,21 @@ +using Ryujinx.Graphics.GAL.Multithreading.Model; +using Ryujinx.Graphics.GAL.Multithreading.Resources; + +namespace Ryujinx.Graphics.GAL.Multithreading.Commands.ImageArray +{ + struct ImageArrayDisposeCommand : IGALCommand, IGALCommand<ImageArrayDisposeCommand> + { + public readonly CommandType CommandType => CommandType.ImageArrayDispose; + private TableRef<ThreadedImageArray> _imageArray; + + public void Set(TableRef<ThreadedImageArray> imageArray) + { + _imageArray = imageArray; + } + + public static void Run(ref ImageArrayDisposeCommand command, ThreadedRenderer threaded, IRenderer renderer) + { + command._imageArray.Get(threaded).Base.Dispose(); + } + } +} diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArrayDisposeCommand.cs b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArrayDisposeCommand.cs new file mode 100644 index 00000000..fec1c48f --- /dev/null +++ b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArrayDisposeCommand.cs @@ -0,0 +1,21 @@ +using Ryujinx.Graphics.GAL.Multithreading.Model; +using Ryujinx.Graphics.GAL.Multithreading.Resources; + +namespace Ryujinx.Graphics.GAL.Multithreading.Commands.TextureArray +{ + struct TextureArrayDisposeCommand : IGALCommand, IGALCommand<TextureArrayDisposeCommand> + { + public readonly CommandType CommandType => CommandType.TextureArrayDispose; + private TableRef<ThreadedTextureArray> _textureArray; + + public void Set(TableRef<ThreadedTextureArray> textureArray) + { + _textureArray = textureArray; + } + + public static void Run(ref TextureArrayDisposeCommand command, ThreadedRenderer threaded, IRenderer renderer) + { + command._textureArray.Get(threaded).Base.Dispose(); + } + } +} diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureAndSamplerArray/TextureArraySetSamplersCommand.cs b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArraySetSamplersCommand.cs index 204ee32d..204ee32d 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureAndSamplerArray/TextureArraySetSamplersCommand.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArraySetSamplersCommand.cs diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureAndSamplerArray/TextureArraySetTexturesCommand.cs b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArraySetTexturesCommand.cs index cc94d1b6..cc94d1b6 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureAndSamplerArray/TextureArraySetTexturesCommand.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/Commands/TextureArray/TextureArraySetTexturesCommand.cs diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedImageArray.cs b/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedImageArray.cs index d26ee1fb..19bc6f23 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedImageArray.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedImageArray.cs @@ -21,6 +21,12 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Resources return new TableRef<T>(_renderer, reference); } + public void Dispose() + { + _renderer.New<ImageArrayDisposeCommand>().Set(Ref(this)); + _renderer.QueueCommand(); + } + public void SetFormats(int index, Format[] imageFormats) { _renderer.New<ImageArraySetFormatsCommand>().Set(Ref(this), index, Ref(imageFormats)); diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTextureArray.cs b/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTextureArray.cs index 82405a1f..4334c704 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTextureArray.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedTextureArray.cs @@ -22,6 +22,12 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Resources return new TableRef<T>(_renderer, reference); } + public void Dispose() + { + _renderer.New<TextureArrayDisposeCommand>().Set(Ref(this)); + _renderer.QueueCommand(); + } + public void SetSamplers(int index, ISampler[] samplers) { _renderer.New<TextureArraySetSamplersCommand>().Set(Ref(this), index, Ref(samplers.ToArray())); |
