add array index to descriptor struct

This commit is contained in:
Matthew 2025-12-26 18:51:36 +11:00
parent 11cf96b799
commit e412227cfc

View File

@ -232,8 +232,6 @@ struct Buffer
struct Descriptor struct Descriptor
{ {
DescType type;
u32 binding;
union union
{ {
Buffer buf; Buffer buf;
@ -242,6 +240,10 @@ struct Descriptor
BufferView buf_view; BufferView buf_view;
VkSampler sampler; VkSampler sampler;
} }
DescType type;
u32 binding;
u32 index;
bool array_elem;
} }
enum MipmapMode : VkSamplerMipmapMode enum MipmapMode : VkSamplerMipmapMode
@ -2021,6 +2023,11 @@ PrepareWrite(Vulkan* vk, VkWriteDescriptorSet* write, DescSet set, Descriptor* d
write.dstBinding = desc.binding; write.dstBinding = desc.binding;
write.descriptorCount = 1; write.descriptorCount = 1;
if(desc.array_elem)
{
write.dstArrayElement = desc.index;
}
switch(desc.type) with(DescType) switch(desc.type) with(DescType)
{ {
case Image, StorageImage, InputAttach: case Image, StorageImage, InputAttach: