7 ResourceVK::ResourceVK() {}
8 ResourceVK::~ResourceVK() {}
10 bool ResourceVK::create_ds_layout(unsigned int num, VkDescriptorType type,
11 VkShaderStageFlags stage, VkSampler *sampler)
13 this->type = RES_DESC_SET;
16 VkDescriptorSetLayoutBinding bind;
18 memset(&bind, 0, sizeof bind);
20 bind.descriptorType = type;
21 bind.stageFlags = stage;
23 bind.pImmutableSamplers = sampler;
25 /* layout : for the moment:
26 * one layout per ds, (=> 1 binding point)
29 VkDescriptorSetLayoutCreateInfo dslinf;
30 memset(&dslinf, 0, sizeof dslinf);
31 dslinf.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
32 dslinf.bindingCount = 1;
33 dslinf.pBindings = &bind;
35 if(vkCreateDescriptorSetLayout(vk_device, &dslinf, 0, &layout) != VK_SUCCESS) {
36 fprintf(stderr, "Failed to create descriptor set layout.\n");