~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyImageView(device, attachments.color.view, nullptr); vkDestroyImage(device, attachments.color.image, nullptr); vkFreeMemory(device, attachments.color.memory, nullptr); vkDestroyImageView(device, attachments.depth.view, nullptr); vkDestroyImage(device, attachments.depth.image, nullptr); vkFreeMemory(device, attachments.depth.memory, nullptr); vkDestroyPipeline(device, pipelines.attachmentRead, nullptr); vkDestroyPipeline(device, pipelines.attachmentWrite, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.attachmentWrite, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.attachmentRead, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.attachmentWrite, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.attachmentRead, nullptr); vkDestroyRenderPass(device, uiRenderPass, nullptr); scene.destroy(); uniformBuffers.matrices.destroy(); uniformBuffers.params.destroy(); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyPipeline(device, pipelines.terrain, nullptr); if (pipelines.wireframe != VK_NULL_HANDLE) { vkDestroyPipeline(device, pipelines.wireframe, nullptr); } vkDestroyPipeline(device, pipelines.skysphere, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.skysphere, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.terrain, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.terrain, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.skysphere, nullptr); models.terrain.destroy(); models.skysphere.destroy(); uniformBuffers.skysphereVertex.destroy(); uniformBuffers.terrainTessellation.destroy(); textures.heightMap.destroy(); textures.skySphere.destroy(); textures.terrainArray.destroy(); if (queryPool != VK_NULL_HANDLE) { vkDestroyQueryPool(device, queryPool, nullptr); vkDestroyBuffer(device, queryResult.buffer, nullptr); vkFreeMemory(device, queryResult.memory, nullptr); } }
void VulkanTexturedQuad::ShutdownImpl() { vkDestroyPipeline(device_, pipeline_, nullptr); vkDestroyPipelineLayout(device_, pipelineLayout_, nullptr); vkDestroyBuffer(device_, vertexBuffer_, nullptr); vkDestroyBuffer(device_, indexBuffer_, nullptr); vkFreeMemory(device_, deviceBufferMemory_, nullptr); vkDestroyImageView (device_, rubyImageView_, nullptr); vkDestroyImage (device_, rubyImage_, nullptr); vkFreeMemory (device_, deviceImageMemory_, nullptr); vkDestroyBuffer (device_, uploadImageBuffer_, nullptr); vkFreeMemory (device_, uploadImageMemory_, nullptr); vkDestroyBuffer (device_, uploadBufferBuffer_, nullptr); vkFreeMemory (device_, uploadBufferMemory_, nullptr); vkDestroyDescriptorSetLayout (device_, descriptorSetLayout_, nullptr); vkDestroyDescriptorPool (device_, descriptorPool_, nullptr); vkDestroySampler (device_, sampler_, nullptr); vkDestroyShaderModule(device_, vertexShader_, nullptr); vkDestroyShaderModule(device_, fragmentShader_, nullptr); VulkanSample::ShutdownImpl(); }
void Copy_To_Swapchain::destroy() { vkDestroyDescriptorSetLayout(vk.device, set_layout, nullptr); vkDestroyPipelineLayout(vk.device, pipeline_layout, nullptr); vkDestroyPipeline(vk.device, pipeline, nullptr); vkDestroySampler(vk.device, point_sampler, nullptr); sets.clear(); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyPipeline(device, pipelines.logos, nullptr); vkDestroyPipeline(device, pipelines.models, nullptr); vkDestroyPipeline(device, pipelines.skybox, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); vkTools::destroyUniformData(device, &uniformData.meshVS); for (auto& mesh : meshes) { vkDestroyBuffer(device, mesh->vertexBuffer.buf, nullptr); vkFreeMemory(device, mesh->vertexBuffer.mem, nullptr); vkDestroyBuffer(device, mesh->indexBuffer.buf, nullptr); vkFreeMemory(device, mesh->indexBuffer.mem, nullptr); } textureLoader->destroyTexture(textures.skybox); delete(demoMeshes.logos); delete(demoMeshes.background); delete(demoMeshes.models); delete(demoMeshes.skybox); }
/** * Destroy the graphics pipeline. */ VkcPipeline::~VkcPipeline() { if (logicalDevice != VK_NULL_HANDLE) { if (descriptorSet != VK_NULL_HANDLE) vkFreeDescriptorSets(logicalDevice, descriptorPool, 1, &descriptorSet); if (setLayout != VK_NULL_HANDLE) vkDestroyDescriptorSetLayout(logicalDevice, setLayout, nullptr); if (descriptorPool != VK_NULL_HANDLE) vkDestroyDescriptorPool(logicalDevice, descriptorPool, nullptr); if (vertShader != VK_NULL_HANDLE) vkDestroyShaderModule(logicalDevice, vertShader, nullptr); if (fragShader != VK_NULL_HANDLE) vkDestroyShaderModule(logicalDevice, fragShader, nullptr); if (layout != VK_NULL_HANDLE) vkDestroyPipelineLayout(logicalDevice, layout, nullptr); if (handle != VK_NULL_HANDLE) vkDestroyPipeline(logicalDevice, handle, nullptr); } }
void ImGui_ImplGlfwVulkan_InvalidateDeviceObjects() { ImGui_ImplGlfwVulkan_InvalidateFontUploadObjects(); for (int i=0; i<IMGUI_VK_QUEUED_FRAMES; i++) { if (g_VertexBuffer[i]) vkDestroyBuffer(g_Device, g_VertexBuffer[i], g_Allocator); if (g_VertexBufferMemory[i]) vkFreeMemory(g_Device, g_VertexBufferMemory[i], g_Allocator); if (g_IndexBuffer[i]) vkDestroyBuffer(g_Device, g_IndexBuffer[i], g_Allocator); if (g_IndexBufferMemory[i]) vkFreeMemory(g_Device, g_IndexBufferMemory[i], g_Allocator); } if (g_FontView) vkDestroyImageView(g_Device, g_FontView, g_Allocator); if (g_FontImage) vkDestroyImage(g_Device, g_FontImage, g_Allocator); if (g_FontMemory) vkFreeMemory(g_Device, g_FontMemory, g_Allocator); if (g_FontSampler) vkDestroySampler(g_Device, g_FontSampler, g_Allocator); if (g_DescriptorSetLayout) vkDestroyDescriptorSetLayout(g_Device, g_DescriptorSetLayout, g_Allocator); if (g_PipelineLayout) vkDestroyPipelineLayout(g_Device, g_PipelineLayout, g_Allocator); if (g_Pipeline) vkDestroyPipeline(g_Device, g_Pipeline, g_Allocator); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class // Clean up texture resources vkDestroyImageView(device, cubeMap.view, nullptr); vkDestroyImage(device, cubeMap.image, nullptr); vkDestroySampler(device, cubeMap.sampler, nullptr); vkFreeMemory(device, cubeMap.deviceMemory, nullptr); vkDestroyPipeline(device, pipelines.skybox, nullptr); vkDestroyPipeline(device, pipelines.reflect, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); for (auto& model : models.objects) { model.destroy(); } models.skybox.destroy(); uniformBuffers.object.destroy(); uniformBuffers.skybox.destroy(); }
Vulkan2D::~Vulkan2D() { VkDevice device = vulkan_->GetDevice(); for (int i = 0; i < 2; i++) { vulkan_->Delete().QueueDeleteDescriptorPool(frameData_[i].descPool); } vkDestroyDescriptorSetLayout(device, descriptorSetLayout_, nullptr); vkDestroyPipelineLayout(device, pipelineLayout_, nullptr); }
void ObjectCache::DestroyPipelineLayouts() { for (VkPipelineLayout layout : m_pipeline_layouts) { if (layout != VK_NULL_HANDLE) vkDestroyPipelineLayout(g_vulkan_context->GetDevice(), layout, nullptr); } }
~VulkanExample() { vkDestroyPipeline(device, pipeline, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); uniformBuffer.destroy(); conditionalBuffer.destroy(); }
~VulkanExample() { vkDestroyPipeline(device, pipeline, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); textures.CW.destroy(); textures.CCW.destroy(); quad.destroy(); }
PipelineLayout::~PipelineLayout() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handle_scope(isolate); puts("PipelineLayout::~PipelineLayout()"); vkDestroyPipelineLayout(ObjectWrap::Unwrap<Device>(parent_device.Get(isolate))->vulkan_handle, vulkan_handle, nullptr); }
void cleanupVulkan() { prepared = false; vkDestroyPipeline(device, pipelines.solid, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyPipelineLayout(device, computePipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); vkDestroyDescriptorSetLayout(device, computeDescriptorSetLayout, nullptr); vkDestroyBuffer(device, uniformDataCompute.buffer, nullptr); vkFreeMemory(device, uniformDataCompute.memory, nullptr); vkDestroyBuffer(device, computeStorageBuffer.buffer, nullptr); vkFreeMemory(device, computeStorageBuffer.memory, nullptr); destroyTextureImage(&texture); vkFreeCommandBuffers(device, cmdPool, 1, &computeCmdBuffer); VulkanExample::cleanUpVulkan(); }
void Renderer::_DeInitGraphicsPipeline() { vkDestroyPipelineLayout(_device, _pipeline_layout, nullptr); _pipeline_layout = nullptr; vkDestroyShaderModule(_device, _frag_module, nullptr); _frag_module = nullptr; vkDestroyShaderModule(_device, _vert_module, nullptr); _vert_module = nullptr; vkDestroyPipeline(_device, _graphics_pipeline, nullptr); _graphics_pipeline = nullptr; }
//------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ bool RendererVk::terminateGraphics() { if(!m_bValid) return true; // destroy the super-sampling pass system m_nvFBOBox.Finish(); // destroys commandBuffers: but not really needed since m_cmdPool later gets destroyed nvk.vkDestroyFence(m_sceneFence[0]); m_sceneFence[0] = NULL; nvk.vkDestroyFence(m_sceneFence[1]); m_sceneFence[1] = NULL; nvk.vkFreeCommandBuffer(m_cmdPool, m_cmdScene[0]); m_cmdScene[0] = NULL; nvk.vkFreeCommandBuffer(m_cmdPool, m_cmdScene[1]); m_cmdScene[1] = NULL; nvk.vkDestroyCommandPool(m_cmdPool); // destroys commands that are inside, obviously for(int i=0; i<DSET_TOTALAMOUNT; i++) { vkDestroyDescriptorSetLayout(nvk.m_device, m_descriptorSetLayouts[i], NULL); // general layout and objects layout m_descriptorSetLayouts[i] = 0; } //vkFreeDescriptorSets(nvk.m_device, m_descPool, 1, &m_descriptorSetGlobal); // no really necessary: we will destroy the pool after that m_descriptorSetGlobal = NULL; vkDestroyDescriptorPool(nvk.m_device, m_descPool, NULL); m_descPool = NULL; vkDestroyPipelineLayout(nvk.m_device, m_pipelineLayout, NULL); m_pipelineLayout = NULL; vkDestroyPipeline(nvk.m_device, m_pipelinefur, NULL); m_pipelinefur = NULL; m_furBuffer.release(); m_matrix.release(); deinitTimers(); nvk.vkDestroySemaphore(m_semOpenGLReadDone); nvk.vkDestroySemaphore(m_semVKRenderingDone); m_semOpenGLReadDone = NULL; m_semVKRenderingDone = NULL; //glGetVkInstanceProcAddrNV = NULL; glWaitVkSemaphoreNV = NULL; glSignalVkSemaphoreNV = NULL; glSignalVkFenceNV = NULL; glDrawVkImageNV = NULL; nvk.DestroyDevice(); m_bValid = false; return false; }
VKComputePipeline::~VKComputePipeline () { if (!_dev.ptr ()) return; VkDevice dev_id = _dev->get_dev_id (); if (XCAM_IS_VALID_VK_ID (_pipe_layout)) vkDestroyPipelineLayout (dev_id, _pipe_layout, _allocator.ptr ()); if (XCAM_IS_VALID_VK_ID (_desc_layout)) vkDestroyDescriptorSetLayout (dev_id, _desc_layout, _allocator.ptr ()); }
~VulkanExample() { vkDestroyPipeline(device, pipeline, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); vkDestroyQueryPool(device, queryPool, nullptr); uniformBuffers.VS.destroy(); for (auto& model : models.objects) { model.destroy(); } }
~VulkanExample() { vkDestroyPipeline(device, pipelines.skybox, nullptr); vkDestroyPipeline(device, pipelines.reflect, nullptr); vkDestroyPipeline(device, pipelines.composition, nullptr); vkDestroyPipeline(device, pipelines.bloom[0], nullptr); vkDestroyPipeline(device, pipelines.bloom[1], nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.models, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.composition, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.bloomFilter, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.models, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.composition, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.bloomFilter, nullptr); vkDestroySemaphore(device, offscreen.semaphore, nullptr); vkDestroyRenderPass(device, offscreen.renderPass, nullptr); vkDestroyRenderPass(device, filterPass.renderPass, nullptr); vkDestroyFramebuffer(device, offscreen.frameBuffer, nullptr); vkDestroyFramebuffer(device, filterPass.frameBuffer, nullptr); vkDestroySampler(device, offscreen.sampler, nullptr); vkDestroySampler(device, filterPass.sampler, nullptr); offscreen.depth.destroy(device); offscreen.color[0].destroy(device); offscreen.color[1].destroy(device); filterPass.color[0].destroy(device); for (auto& model : models.objects) { model.destroy(); } models.skybox.destroy(); uniformBuffers.matrices.destroy(); uniformBuffers.params.destroy(); textures.envmap.destroy(); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyPipeline(device, pipeline, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); models.object.destroy(); uniformBuffer.destroy(); }
~VulkanExample() { vkDestroyPipeline(device, pipeline, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.scene, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.object, nullptr); model.destroy(); uniformBuffers.scene.destroy(); }
void Shadow::Destroy() { vkDestroySemaphore(gDevice.VkHandle(), shadowMapCompleteSemaphore, nullptr); mDepthImage.Destroy(); vkDestroyPipelineLayout(gDevice.VkHandle(), mPipelineLayout, nullptr); vkDestroyRenderPass(gDevice.VkHandle(), mRenderPass, nullptr); vkDestroyPipeline(gDevice.VkHandle(), mPipeline, nullptr); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyPipeline(device, pipelines.postCompute, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); vkDestroyBuffer(device, computeStorageBuffer.buffer, nullptr); vkFreeMemory(device, computeStorageBuffer.memory, nullptr); vkTools::destroyUniformData(device, &uniformData.computeShader.ubo); vkDestroyPipelineLayout(device, computePipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, computeDescriptorSetLayout, nullptr); vkDestroyPipeline(device, pipelines.compute, nullptr); textureLoader->destroyTexture(textures.particle); textureLoader->destroyTexture(textures.gradient); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class // Texture target textureLoader->destroyTexture(offScreenFrameBuf.textureTarget); // Frame buffer // Color attachment vkDestroyImageView(device, offScreenFrameBuf.color.view, nullptr); vkDestroyImage(device, offScreenFrameBuf.color.image, nullptr); vkFreeMemory(device, offScreenFrameBuf.color.mem, nullptr); // Depth attachment vkDestroyImageView(device, offScreenFrameBuf.depth.view, nullptr); vkDestroyImage(device, offScreenFrameBuf.depth.image, nullptr); vkFreeMemory(device, offScreenFrameBuf.depth.mem, nullptr); vkDestroyFramebuffer(device, offScreenFrameBuf.frameBuffer, nullptr); vkDestroyPipeline(device, pipelines.quad, nullptr); vkDestroyPipeline(device, pipelines.offscreen, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.quad, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.offscreen, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); // Meshes vkMeshLoader::freeMeshBufferResources(device, &meshes.scene); vkMeshLoader::freeMeshBufferResources(device, &meshes.quad); // Uniform buffers vkTools::destroyUniformData(device, &uniformDataVS); vkTools::destroyUniformData(device, &uniformDataOffscreenVS); vkFreeCommandBuffers(device, cmdPool, 1, &offScreenCmdBuffer); }
~VulkanExample() { destroyTextureImage(texture); vkDestroyPipeline(device, pipelines.solid, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); uniformBufferVS.destroy(); for (auto sampler : samplers) { vkDestroySampler(device, sampler, nullptr); } vkMeshLoader::freeMeshBufferResources(device, &meshes.tunnel); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyPipeline(device, pipelines.solid, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); vkMeshLoader::freeMeshBufferResources(device, &meshes.scene); vkTools::destroyUniformData(device, &uniformData.vertexShader); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class // Frame buffer // Color attachment vkDestroyImageView(device, offscreenPass.color.view, nullptr); vkDestroyImage(device, offscreenPass.color.image, nullptr); vkFreeMemory(device, offscreenPass.color.mem, nullptr); // Depth attachment vkDestroyImageView(device, offscreenPass.depth.view, nullptr); vkDestroyImage(device, offscreenPass.depth.image, nullptr); vkFreeMemory(device, offscreenPass.depth.mem, nullptr); vkDestroyRenderPass(device, offscreenPass.renderPass, nullptr); vkDestroySampler(device, offscreenPass.sampler, nullptr); vkDestroyFramebuffer(device, offscreenPass.frameBuffer, nullptr); vkDestroyPipeline(device, pipelines.radialBlur, nullptr); vkDestroyPipeline(device, pipelines.phongPass, nullptr); vkDestroyPipeline(device, pipelines.colorPass, nullptr); vkDestroyPipeline(device, pipelines.offscreenDisplay, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.radialBlur, nullptr); vkDestroyPipelineLayout(device, pipelineLayouts.scene, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.scene, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.radialBlur, nullptr); models.example.destroy(); uniformBuffers.scene.destroy(); uniformBuffers.blurParams.destroy(); textures.gradient.destroy(); }
~VulkanExample() { vkDestroyPipeline(device, pipelines.phong, nullptr); vkDestroyPipeline(device, pipelines.textured, nullptr); vkDestroyPipeline(device, pipelines.toon, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); models.cube.destroy(); textures.colormap.destroy(); uniformBuffer.destroy(); }
void VulkanQuad::ShutdownImpl () { vkDestroyPipeline (device_, pipeline_, nullptr); vkDestroyPipelineLayout (device_, pipelineLayout_, nullptr); vkDestroyBuffer (device_, vertexBuffer_, nullptr); vkDestroyBuffer (device_, indexBuffer_, nullptr); vkFreeMemory (device_, deviceMemory_, nullptr); vkDestroyShaderModule (device_, vertexShader_, nullptr); vkDestroyShaderModule (device_, fragmentShader_, nullptr); VulkanSample::ShutdownImpl (); }
~VulkanExample() { // Clean up used Vulkan resources // Note : Inherited destructor cleans up resources stored in base class vkDestroyPipeline(device, pipelines.solid, nullptr); vkDestroyPipelineLayout(device, pipelineLayout, nullptr); vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr); for (auto& gear : gears) { delete(gear); } }