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