Jump to content
  • Advertisement
Mercesa

Vulkan Descriptorpool creates descriptors though the pool should be empty

Recommended Posts

As the title says, I am explicitly creating a too small descriptor pool, which should NOT support the resources I am going to allocate from it.

 

	std::array<vk::DescriptorPoolSize, 3> type_count;
	
	// Initialize our pool with these values
	type_count[0].type = vk::DescriptorType::eCombinedImageSampler;
	type_count[0].descriptorCount = 0;

	type_count[1].type = vk::DescriptorType::eSampler;
	type_count[1].descriptorCount = 0;
	
	type_count[2].type = vk::DescriptorType::eUniformBuffer;
	type_count[2].descriptorCount = 0;



	vk::DescriptorPoolCreateInfo createInfo = vk::DescriptorPoolCreateInfo()
		.setPNext(nullptr)
		.setMaxSets(iMaxSets)
		.setPoolSizeCount(type_count.size())
		.setPPoolSizes(type_count.data());
	pool = aDevice.createDescriptorPool(createInfo);

 

I have an allocation function which looks like this, I am allocating a uniform, image-combined sampler and a regular sampler. Though if my pool is empty this should not work?

vk::DescriptorSetAllocateInfo alloc_info[1] = {};
	alloc_info[0].pNext = NULL;
	alloc_info[0].setDescriptorPool(pool);
	alloc_info[0].setDescriptorSetCount(iNumToAllocate);
	alloc_info[0].setPSetLayouts(&iDescriptorLayouts);

	std::vector<vk::DescriptorSet> tDescriptors;
	tDescriptors.resize(iNumToAllocate);

	iDevice.allocateDescriptorSets(alloc_info, tDescriptors.data());

 

Edited by Mercesa

Share this post


Link to post
Share on other sites
Advertisement

The CPP Vulkan API already does exception throwing when there is no successful result, and yes the debug layer is enabled. And I am sure it "works" is because of the fact my whole scene renders as usual, without any visual problems of any kind. 

Also tested it on a friend's pc. Also works perfectly fine, while it should not. I am expecting it to completely break down, but it just allocates descriptor sets. I have done a clean, rebuild on my project as well to make doubly sure I am not missing something.

Edited by Mercesa

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!