diff --git a/base/VulkanglTFModel.hpp b/base/VulkanglTFModel.hpp index 4c2ca49d..3f6fb952 100644 --- a/base/VulkanglTFModel.hpp +++ b/base/VulkanglTFModel.hpp @@ -366,7 +366,7 @@ namespace vkglTF VkBuffer buffer; VkDeviceMemory memory; VkDescriptorBufferInfo descriptor; - VkDescriptorSet descriptorSet; + VkDescriptorSet descriptorSet = VK_NULL_HANDLE; void *mapped; } uniformBuffer; @@ -563,6 +563,8 @@ namespace vkglTF for (auto node : nodes) { delete node; } + vkDestroyDescriptorSetLayout(device->logicalDevice, descriptorSetLayout, nullptr); + vkDestroyDescriptorPool(device->logicalDevice, descriptorPool, nullptr); } void loadNode(vkglTF::Node *parent, const tinygltf::Node &node, uint32_t nodeIndex, const tinygltf::Model &model, std::vector& indexBuffer, std::vector& vertexBuffer, float globalscale) diff --git a/examples/conditionalrender/conditionalrender.cpp b/examples/conditionalrender/conditionalrender.cpp index 1077e67c..225a9cf9 100644 --- a/examples/conditionalrender/conditionalrender.cpp +++ b/examples/conditionalrender/conditionalrender.cpp @@ -91,7 +91,7 @@ public: } pushBlock; pushBlock.baseColorFactor = primitive->material.baseColorFactor; - vkCmdPushConstants(commandBuffer, pipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(PushBlock), &pushBlock); + vkCmdPushConstants(commandBuffer, pipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(PushBlock), &pushBlock); /* [POI] Setup the conditional rendering