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/PipelineConverter.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/PipelineConverter.cs')
-rw-r--r-- | Ryujinx.Graphics.Vulkan/PipelineConverter.cs | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.Vulkan/PipelineConverter.cs b/Ryujinx.Graphics.Vulkan/PipelineConverter.cs index 55d29ffa..a01c5ad7 100644 --- a/Ryujinx.Graphics.Vulkan/PipelineConverter.cs +++ b/Ryujinx.Graphics.Vulkan/PipelineConverter.cs @@ -6,6 +6,9 @@ namespace Ryujinx.Graphics.Vulkan { static class PipelineConverter { + private const AccessFlags SubpassSrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessColorAttachmentWriteBit; + private const AccessFlags SubpassDstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessShaderReadBit; + public static unsafe DisposableRenderPass ToRenderPass(this ProgramPipelineState state, VulkanRenderer gd, Device device) { const int MaxAttachments = Constants.MaxRenderTargets + 1; @@ -100,14 +103,7 @@ namespace Ryujinx.Graphics.Vulkan } } - var subpassDependency = new SubpassDependency( - 0, - 0, - PipelineStageFlags.PipelineStageAllGraphicsBit, - PipelineStageFlags.PipelineStageAllGraphicsBit, - AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit, - AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit, - 0); + var subpassDependency = CreateSubpassDependency(); fixed (AttachmentDescription* pAttachmentDescs = attachmentDescs) { @@ -128,6 +124,32 @@ namespace Ryujinx.Graphics.Vulkan } } + public static SubpassDependency CreateSubpassDependency() + { + return new SubpassDependency( + 0, + 0, + PipelineStageFlags.PipelineStageAllGraphicsBit, + PipelineStageFlags.PipelineStageAllGraphicsBit, + SubpassSrcAccessMask, + SubpassDstAccessMask, + 0); + } + + public unsafe static SubpassDependency2 CreateSubpassDependency2() + { + return new SubpassDependency2( + StructureType.SubpassDependency2, + null, + 0, + 0, + PipelineStageFlags.PipelineStageAllGraphicsBit, + PipelineStageFlags.PipelineStageAllGraphicsBit, + SubpassSrcAccessMask, + SubpassDstAccessMask, + 0); + } + public static PipelineState ToVulkanPipelineState(this ProgramPipelineState state, VulkanRenderer gd) { PipelineState pipeline = new PipelineState(); |