diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2024-02-17 00:41:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-16 21:41:30 -0300 |
| commit | 4218311e6aa2a6b134e56f4206f9ef87d863419e (patch) | |
| tree | 5f08a48c00545dd100b91eb520e6bebe5083e021 /src/Ryujinx.Graphics.Vulkan/DescriptorSetTemplateUpdater.cs | |
| parent | e37735ed2630a807c709d2d3e2099f6c1f2b10fe (diff) | |
Vulkan: Use push descriptors for uniform bindings when possible (#6154)
* Fix Push Descriptors
* Use push descriptor templates
* Use reserved bindings
* Formatting
* Disable when using MVK
("my heart will go on" starts playing as thousands of mac users shed a tear in unison)
* Introduce limit on push descriptor binding number
The bitmask used for updating push descriptors is ulong, so only 64 bindings can be tracked for now.
* Address feedback
* Fix logic for binding rejection
Should only offset limit when reserved bindings are less than the requested one.
* Workaround pascal and older nv bug
* Add GPU number detection for nvidia
* Only do workaround if it's valid to do so.
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/DescriptorSetTemplateUpdater.cs')
| -rw-r--r-- | src/Ryujinx.Graphics.Vulkan/DescriptorSetTemplateUpdater.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/DescriptorSetTemplateUpdater.cs b/src/Ryujinx.Graphics.Vulkan/DescriptorSetTemplateUpdater.cs index 1eb9dce7..88db7e76 100644 --- a/src/Ryujinx.Graphics.Vulkan/DescriptorSetTemplateUpdater.cs +++ b/src/Ryujinx.Graphics.Vulkan/DescriptorSetTemplateUpdater.cs @@ -52,11 +52,23 @@ namespace Ryujinx.Graphics.Vulkan return new DescriptorSetTemplateWriter(new Span<byte>(_data.Pointer, template.Size)); } + public DescriptorSetTemplateWriter Begin(int maxSize) + { + EnsureSize(maxSize); + + return new DescriptorSetTemplateWriter(new Span<byte>(_data.Pointer, maxSize)); + } + public void Commit(VulkanRenderer gd, Device device, DescriptorSet set) { gd.Api.UpdateDescriptorSetWithTemplate(device, set, _activeTemplate.Template, _data.Pointer); } + public void CommitPushDescriptor(VulkanRenderer gd, CommandBufferScoped cbs, DescriptorSetTemplate template, PipelineLayout layout) + { + gd.PushDescriptorApi.CmdPushDescriptorSetWithTemplate(cbs.CommandBuffer, template.Template, layout, 0, _data.Pointer); + } + public void Dispose() { _data?.Dispose(); |
