Пример #1
0
	~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();
	}
Пример #2
0
	void loadAssets()
	{
		model.loadFromFile(getAssetPath() + "models/geosphere.obj", vertexLayout, OBJ_DIM, vulkanDevice, queue);

		// Setup random materials for every object in the scene
		for (uint32_t i = 0; i < objects.size(); i++) {
			objects[i].setRandomMaterial();
		}
	}
Пример #3
0
	~VulkanExample()
	{
		vkDestroyPipeline(device, pipeline, nullptr);

		vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
		vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.scene, nullptr);
		vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.object, nullptr);

		model.destroy();

		uniformBuffers.scene.destroy();
	}
Пример #4
0
	void loadAssets()
	{
		scene.loadFromFile(getAssetPath() + "models/samplebuilding.dae", vertexLayout, 1.0f, vulkanDevice, queue);
	}