From 9340114d02b4777ba3243ce47139c56566ea6cac Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 23 Nov 2025 14:35:53 +1100 Subject: [PATCH] add descriptor count --- vulkan.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vulkan.d b/vulkan.d index 7a2bb9d..605da38 100644 --- a/vulkan.d +++ b/vulkan.d @@ -233,6 +233,7 @@ struct Descriptor { DescType type; u32 binding; + u32 count; union { Buffer buf; @@ -564,10 +565,11 @@ CreatePipelineLayout(T)(Vulkan* vk, T layouts, u32 push_const_size, bool compute } void -CreateBuffer(Vulkan* vk, Descriptor* desc, BufferType type, u64 size, bool host_visible, DescType desc_type, u32 binding) +CreateBuffer(Vulkan* vk, Descriptor* desc, BufferType type, u64 size, bool host_visible, DescType desc_type, u32 binding, u32 count = 1) { desc.type = desc_type; desc.binding = binding; + desc.count = count; CreateBuffer(vk, &desc.buf, type, size, host_visible); } @@ -961,6 +963,7 @@ CreateImageView(Vulkan* vk, Descriptor* view, u32 w, u32 h, u32 ch, u8[] data, D ImageDescCheck(type); view.type = type; view.binding = binding; + view.count = 1; CreateImageView(vk, &view.view, w, h, ch, data); } @@ -1033,6 +1036,7 @@ CreateImageView(Vulkan* vk, Descriptor* desc, u32 w, u32 h, Format format, Image ImageDescCheck(type); desc.type = type; desc.binding = binding; + desc.count = 1; CreateImageView(vk, &desc.view, w, h, format, usage); } @@ -1166,6 +1170,7 @@ CreateBufferView(Vulkan* vk, Descriptor* desc, u64 size, Format format, DescType VkCheckA("CreateBufferView failure: vkCreateBufferView failed", result); desc.binding = binding; + desc.count = 1; desc.buf_view.size = size; } @@ -1980,7 +1985,7 @@ PrepareWrite(Vulkan* vk, VkWriteDescriptorSet* write, DescSet set, Descriptor* d write.descriptorType = desc.type; write.dstSet = set.handle; write.dstBinding = desc.binding; - write.descriptorCount = 1; + write.descriptorCount = desc.count; switch(desc.type) with(DescType) {