removed vulkan element

This commit is contained in:
Jorijn van der Graaf 2025-04-27 23:20:52 +02:00
commit ae312807fc
11 changed files with 89 additions and 96 deletions

View file

@ -26,6 +26,17 @@ namespace Crafter {
bool occured = true;
};
export struct DescriptorSet {
VkDescriptorSet set[2];
void Write(VkWriteDescriptorSet* descriptors, std::uint32_t count) {
vkUpdateDescriptorSets(VulkanDevice::device, count, descriptors, 0, nullptr);
}
void Write(std::uint32_t stage, VkDescriptorType type, std::uint32_t binding, VkDescriptorBufferInfo* buffer) {
VkWriteDescriptorSet write = vks::initializers::writeDescriptorSet(set[stage], type, binding, buffer);
vkUpdateDescriptorSets(VulkanDevice::device, 1, &write, 0, nullptr);
}
};
export template <typename MeshShader, typename FragmentShader>
class VulkanPipeline {
private:
@ -197,9 +208,9 @@ namespace Crafter {
VulkanDevice::CHECK_VK_RESULT(vkCreateGraphicsPipelines(VulkanDevice::device, VK_NULL_HANDLE, 1, &pipelineCI, nullptr, &pipeline));
}
static void GetDescriptorSet(VkDescriptorSet* set) {
static void GetDescriptorSet(DescriptorSet& set) {
VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayout[0], 2);
VulkanDevice::CHECK_VK_RESULT(vkAllocateDescriptorSets(VulkanDevice::device, &allocInfo, set));
VulkanDevice::CHECK_VK_RESULT(vkAllocateDescriptorSets(VulkanDevice::device, &allocInfo, set.set));
}
};
}