From 12892a87c27c8bb6e80a94387f5b204723c4b801 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Mon, 12 Feb 2024 10:23:56 +0100 Subject: [PATCH] Use no. of model images for pool size --- examples/raytracinggltf/raytracinggltf.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/raytracinggltf/raytracinggltf.cpp b/examples/raytracinggltf/raytracinggltf.cpp index e23732a2..65f929a8 100644 --- a/examples/raytracinggltf/raytracinggltf.cpp +++ b/examples/raytracinggltf/raytracinggltf.cpp @@ -1,7 +1,7 @@ /* * Vulkan Example - Rendering a glTF model using hardware accelerated ray tracing example (for proper transparency, this sample does frame accumulation) * - * Copyright (C) 2023 by Sascha Willems - www.saschawillems.de + * Copyright (C) 2023-2024 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -519,15 +519,12 @@ public: */ void createDescriptorSets() { - // @todo - uint32_t imageCount{ 0 }; - imageCount = static_cast(model.textures.size()); - + uint32_t imageCount = static_cast(model.textures.size()); std::vector poolSizes = { { VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, 1 }, { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1 }, { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1 }, - { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1 } + { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, static_cast(model.textures.size()) } }; VkDescriptorPoolCreateInfo descriptorPoolCreateInfo = vks::initializers::descriptorPoolCreateInfo(poolSizes, 1); VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolCreateInfo, nullptr, &descriptorPool));