add write descriptor function for array descriptors
This commit is contained in:
parent
1b4d997976
commit
d46741a480
30
vulkan.d
30
vulkan.d
@ -2247,7 +2247,7 @@ InitGlobalDescSet(Vulkan* vk)
|
||||
}
|
||||
|
||||
void
|
||||
Write(Vulkan* vk, DescSet set, ImageView* view, u32 index, DescType type)
|
||||
Write(Vulkan* vk, DescSet set, ImageView* view, u32 binding, DescType type)
|
||||
{
|
||||
VkDescriptorImageInfo info = {
|
||||
imageView: view.view,
|
||||
@ -2257,7 +2257,7 @@ Write(Vulkan* vk, DescSet set, ImageView* view, u32 index, DescType type)
|
||||
VkWriteDescriptorSet write = {
|
||||
sType: VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
|
||||
dstSet: set.handle,
|
||||
dstBinding: index,
|
||||
dstBinding: binding,
|
||||
descriptorCount: 1,
|
||||
descriptorType: type,
|
||||
pImageInfo: &info,
|
||||
@ -2267,7 +2267,7 @@ Write(Vulkan* vk, DescSet set, ImageView* view, u32 index, DescType type)
|
||||
}
|
||||
|
||||
void
|
||||
Write(Vulkan* vk, DescSet set, Buffer* buffer, u32 index, DescType type)
|
||||
Write(Vulkan* vk, DescSet set, Buffer* buffer, u32 binding, DescType type)
|
||||
{
|
||||
VkDescriptorBufferInfo info = {
|
||||
buffer: buffer.buffer,
|
||||
@ -2278,7 +2278,29 @@ Write(Vulkan* vk, DescSet set, Buffer* buffer, u32 index, DescType type)
|
||||
VkWriteDescriptorSet write = {
|
||||
sType: VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
|
||||
dstSet: set.handle,
|
||||
dstBinding: index,
|
||||
dstBinding: binding,
|
||||
descriptorCount: 1,
|
||||
descriptorType: type,
|
||||
pBufferInfo: &info,
|
||||
};
|
||||
|
||||
vkUpdateDescriptorSets(vk.device, 1, &write, 0, null);
|
||||
}
|
||||
|
||||
void
|
||||
Write(Vulkan* vk, DescSet set, Buffer* buffer, u32 binding, u32 index, DescType type)
|
||||
{
|
||||
VkDescriptorBufferInfo info = {
|
||||
buffer: buffer.buffer,
|
||||
range: buffer.size,
|
||||
offset: 0,
|
||||
};
|
||||
|
||||
VkWriteDescriptorSet write = {
|
||||
sType: VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
|
||||
dstSet: set.handle,
|
||||
dstBinding: binding,
|
||||
dstArrayElement: index,
|
||||
descriptorCount: 1,
|
||||
descriptorType: type,
|
||||
pBufferInfo: &info,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user