Skip to content
Snippets Groups Projects
Verified Commit 05331786 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#100] Fixed VRAM leak and added dynamic buffers to descriptor-set pool

parent 0e64fc6e
No related branches found
No related tags found
1 merge request!82Resolve "Upscaling Module"
Pipeline #26432 passed
......@@ -527,6 +527,7 @@ int main(int argc, const char** argv) {
core.writeDescriptorSet(forwardShadingDescriptorSet, forwardDescriptorWrites);
vkcv::upscaling::FSRUpscaling upscaling (core);
uint32_t fsrWidth = windowWidth, fsrHeight = windowHeight;
float fsrFactor = 1.5f;
float rcasSharpness = upscaling.getSharpness();
......@@ -566,10 +567,13 @@ int main(int argc, const char** argv) {
fsrFactor = 2.0f;
}
const auto fsrWidth = static_cast<uint32_t>(std::round(static_cast<float>(swapchainWidth) / fsrFactor));
const auto fsrHeight = static_cast<uint32_t>(std::round(static_cast<float>(swapchainHeight) / fsrFactor));
const auto width = static_cast<uint32_t>(std::round(static_cast<float>(swapchainWidth) / fsrFactor));
const auto height = static_cast<uint32_t>(std::round(static_cast<float>(swapchainHeight) / fsrFactor));
if ((fsrWidth != windowWidth) || ((fsrHeight != windowHeight))) {
if ((width != fsrWidth) || ((height != fsrHeight))) {
fsrWidth = width;
fsrHeight = height;
depthBuffer = core.createImage(depthBufferFormat, fsrWidth, fsrHeight, 1, false, false, false, msaa).getHandle();
colorBuffer = core.createImage(colorBufferFormat, fsrWidth, fsrHeight, 1, false, colorBufferRequiresStorage, true, msaa).getHandle();
......@@ -581,9 +585,6 @@ int main(int argc, const char** argv) {
swapBuffer = core.createImage(colorBufferFormat, fsrWidth, fsrHeight, 1, false, true).getHandle();
windowWidth = swapchainWidth;
windowHeight = swapchainHeight;
bloomFlares.updateImageDimensions(swapchainWidth, swapchainHeight);
}
......
......@@ -11,10 +11,14 @@ namespace vkcv
* Allocate the set size for the descriptor pools, namely 1000 units of each descriptor type below.
* Finally, create an initial pool.
*/
m_PoolSizes = { vk::DescriptorPoolSize(vk::DescriptorType::eSampler, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eSampledImage, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eUniformBuffer, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eStorageBuffer, 1000) };
m_PoolSizes = {
vk::DescriptorPoolSize(vk::DescriptorType::eSampler, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eSampledImage, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eUniformBuffer, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eStorageBuffer, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eUniformBufferDynamic, 1000),
vk::DescriptorPoolSize(vk::DescriptorType::eStorageBufferDynamic, 1000)
};
m_PoolInfo = vk::DescriptorPoolCreateInfo(
vk::DescriptorPoolCreateFlagBits::eFreeDescriptorSet,
......
......@@ -86,8 +86,8 @@ namespace vkcv {
16.0f,
false,
vk::CompareOp::eAlways,
0.0f,
16.0f,
-1000.0f,
1000.0f,
vk::BorderColor::eIntOpaqueBlack,
false
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment