undo descriptor count change

This commit is contained in:
Matthew 2025-11-23 14:41:22 +11:00
parent 9340114d02
commit f96d30ae9c

View File

@ -233,7 +233,6 @@ struct Descriptor
{ {
DescType type; DescType type;
u32 binding; u32 binding;
u32 count;
union union
{ {
Buffer buf; Buffer buf;
@ -565,11 +564,10 @@ CreatePipelineLayout(T)(Vulkan* vk, T layouts, u32 push_const_size, bool compute
} }
void void
CreateBuffer(Vulkan* vk, Descriptor* desc, BufferType type, u64 size, bool host_visible, DescType desc_type, u32 binding, u32 count = 1) CreateBuffer(Vulkan* vk, Descriptor* desc, BufferType type, u64 size, bool host_visible, DescType desc_type, u32 binding)
{ {
desc.type = desc_type; desc.type = desc_type;
desc.binding = binding; desc.binding = binding;
desc.count = count;
CreateBuffer(vk, &desc.buf, type, size, host_visible); CreateBuffer(vk, &desc.buf, type, size, host_visible);
} }
@ -963,7 +961,6 @@ CreateImageView(Vulkan* vk, Descriptor* view, u32 w, u32 h, u32 ch, u8[] data, D
ImageDescCheck(type); ImageDescCheck(type);
view.type = type; view.type = type;
view.binding = binding; view.binding = binding;
view.count = 1;
CreateImageView(vk, &view.view, w, h, ch, data); CreateImageView(vk, &view.view, w, h, ch, data);
} }
@ -1036,7 +1033,6 @@ CreateImageView(Vulkan* vk, Descriptor* desc, u32 w, u32 h, Format format, Image
ImageDescCheck(type); ImageDescCheck(type);
desc.type = type; desc.type = type;
desc.binding = binding; desc.binding = binding;
desc.count = 1;
CreateImageView(vk, &desc.view, w, h, format, usage); CreateImageView(vk, &desc.view, w, h, format, usage);
} }
@ -1170,7 +1166,6 @@ CreateBufferView(Vulkan* vk, Descriptor* desc, u64 size, Format format, DescType
VkCheckA("CreateBufferView failure: vkCreateBufferView failed", result); VkCheckA("CreateBufferView failure: vkCreateBufferView failed", result);
desc.binding = binding; desc.binding = binding;
desc.count = 1;
desc.buf_view.size = size; desc.buf_view.size = size;
} }
@ -1985,7 +1980,7 @@ PrepareWrite(Vulkan* vk, VkWriteDescriptorSet* write, DescSet set, Descriptor* d
write.descriptorType = desc.type; write.descriptorType = desc.type;
write.dstSet = set.handle; write.dstSet = set.handle;
write.dstBinding = desc.binding; write.dstBinding = desc.binding;
write.descriptorCount = desc.count; write.descriptorCount = 1;
switch(desc.type) with(DescType) switch(desc.type) with(DescType)
{ {