#VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: VK_ERROR_OUT_OF_POOL_MEMORY

1 messages · Page 1 of 1 (latest)

crimson zealot
#

show the code you're using for creating the descriptor pool and set layout

summer tartan
# crimson zealot show the code you're using for creating the descriptor pool and set layout
  descSets.resize(descNum);
  
  //DescriptorPools
  std::vector<VkDescriptorPoolSize> poolSizes;

  if (uniBuffs.size() > 0) {
    VkDescriptorPoolSize pSize{};
    pSize.type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
    pSize.descriptorCount = descNum;
    poolSizes.push_back(pSize);
  } //uniBuffSize
  if (imageBuffs.size() > 0) {
    VkDescriptorPoolSize pSize{};
    pSize.type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
    pSize.descriptorCount = descNum;
    poolSizes.push_back(pSize);
  } //uniBuffSize
  if (computeImages.size() > 0) {
    VkDescriptorPoolSize pSize{};
    pSize.type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
    pSize.descriptorCount = descNum;
    poolSizes.push_back(pSize);
  } //uniBuffSize

  descPoolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
  descPoolInfo.poolSizeCount = poolSizes.size();
  descPoolInfo.pPoolSizes = poolSizes.data();
  descPoolInfo.maxSets = descNum;
  descPoolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;

  auto result = vkCreateDescriptorPool(externalProgram->device, &descPoolInfo, nullptr, &descPool);
  errorHandler->ConfirmSuccess(result, "Creating Descriptor Pool");

  //DescriptorSets
  std::vector<VkDescriptorSetLayout> layouts(descNum, descSetLayout);
  
  VkDescriptorSetAllocateInfo allocInfo = {};
  allocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
  allocInfo.descriptorPool = descPool;
  allocInfo.descriptorSetCount = descNum;
  allocInfo.pSetLayouts = layouts.data();
  result = vkAllocateDescriptorSets(externalProgram->device, &allocInfo, descSets.data());
  errorHandler->ConfirmSuccess(result, "Allocating DescriptorSets");
summer tartan