diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-11-02 18:17:19 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 18:17:19 -0300 |
commit | f82309fa2dd46d4339e0709ab835d927fd25361b (patch) | |
tree | f864424c938b289780f07a12dc2e52db49721da6 /Ryujinx.Graphics.Vulkan/PipelineBase.cs | |
parent | 7d8e198c33b7ad283db53315129209a2bd310f23 (diff) |
Vulkan: Implement multisample <-> non-multisample copies and depth-stencil resolve (#3723)1.1.337
* Vulkan: Implement multisample <-> non-multisample copies and depth-stencil resolve
* FramebufferParams is no longer required there
* Implement Specialization Constants and merge CopyMS Shaders (#15)
* Vulkan: Initial Specialization Constants
* Replace with specialized helper shader
* Reimplement everything
Fix nonexistant interaction with Ryu pipeline caching
Decouple specialization info from data and relocate them
Generalize mapping and add type enum to better match spv types
Use local fixed scopes instead of global unmanaged allocs
* Fix misses in initial implementation
Use correct info variable in Create2DLayerView
Add ShaderStorageImageMultisample to required feature set
* Use texture for source image
* No point in using ReadOnlyMemory
* Apply formatting feedback
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Apply formatting suggestions on shader source
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
* Support conversion with samples count that does not match the requested count, other minor changes
Co-authored-by: mageven <62494521+mageven@users.noreply.github.com>
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/PipelineBase.cs')
-rw-r--r-- | Ryujinx.Graphics.Vulkan/PipelineBase.cs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 2a376261..f333c944 100644 --- a/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -3,6 +3,8 @@ using Ryujinx.Graphics.Shader; using Silk.NET.Vulkan; using System; using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; namespace Ryujinx.Graphics.Vulkan { @@ -697,6 +699,18 @@ namespace Ryujinx.Graphics.Vulkan SignalStateChange(); } + public void Specialize<T>(in T data) where T : unmanaged + { + var dataSpan = MemoryMarshal.AsBytes(MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in data), 1)); + + if (!dataSpan.SequenceEqual(_newState.SpecializationData.Span)) + { + _newState.SpecializationData = new SpecData(dataSpan); + + SignalStateChange(); + } + } + protected virtual void SignalAttachmentChange() { } @@ -1188,14 +1202,7 @@ namespace Ryujinx.Graphics.Vulkan } } - var subpassDependency = new SubpassDependency( - 0, - 0, - PipelineStageFlags.PipelineStageAllGraphicsBit, - PipelineStageFlags.PipelineStageAllGraphicsBit, - AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessColorAttachmentWriteBit, - AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessShaderReadBit, - 0); + var subpassDependency = PipelineConverter.CreateSubpassDependency(); fixed (AttachmentDescription* pAttachmentDescs = attachmentDescs) { |