IT WORKS
This commit is contained in:
@@ -391,6 +391,7 @@ Gfx::PDescriptorSet DescriptorPool::allocateDescriptorSet()
|
||||
{
|
||||
//If it hasnt been initialized, allocate it
|
||||
VK_CHECK(vkAllocateDescriptorSets(graphics->getDevice(), &allocInfo, &cachedHandles[setIndex]->setHandle));
|
||||
std::cout << "New descriptor " << cachedHandles[setIndex]->setHandle << std::endl;
|
||||
}
|
||||
cachedHandles[setIndex]->allocate();
|
||||
|
||||
@@ -406,6 +407,7 @@ Gfx::PDescriptorSet DescriptorPool::allocateDescriptorSet()
|
||||
{
|
||||
nextAlloc = new DescriptorPool(graphics, layout);
|
||||
}
|
||||
std::cout << "Out of descriptors, forwarding" << std::endl;
|
||||
return nextAlloc->allocateDescriptorSet();
|
||||
//throw std::logic_error("Out of descriptor sets");
|
||||
}
|
||||
|
||||
@@ -332,11 +332,10 @@ void Graphics::initInstance(GraphicsInitializer initInfo)
|
||||
info.enabledExtensionCount = (uint32)extensions.size();
|
||||
info.ppEnabledExtensionNames = extensions.data();
|
||||
#if ENABLE_VALIDATION
|
||||
initInfo.layers.add("VK_LAYER_KHRONOS_validation");
|
||||
#endif
|
||||
info.enabledLayerCount = (uint32)initInfo.layers.size();
|
||||
info.ppEnabledLayerNames = initInfo.layers.data();
|
||||
#else
|
||||
info.enabledLayerCount = 0;
|
||||
#endif
|
||||
VK_CHECK(vkCreateInstance(&info, nullptr, &instance));
|
||||
}
|
||||
void Graphics::setupDebugCallback()
|
||||
|
||||
@@ -248,11 +248,9 @@ void Window::createSwapChain()
|
||||
};
|
||||
VK_CHECK(vkCreateSwapchainKHR(graphics->getDevice(), &createInfo, nullptr, &swapchain));
|
||||
|
||||
uint32 numImages;
|
||||
vkGetSwapchainImagesKHR(graphics->getDevice(), swapchain, &numImages, swapChainImages.data());
|
||||
VK_CHECK(vkGetSwapchainImagesKHR(graphics->getDevice(), swapchain, &imageCount, swapChainImages.data()));
|
||||
|
||||
assert(numImages == Gfx::numFramesBuffered);
|
||||
for (uint32 i = 0; i < numImages; ++i)
|
||||
for (uint32 i = 0; i < imageCount; ++i)
|
||||
{
|
||||
swapChainTextures[i] = new Texture2D(graphics, TextureCreateInfo{
|
||||
.format = cast(format.format),
|
||||
|
||||
Reference in New Issue
Block a user