示例#1
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadAssets();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorSets();
		buildCommandBuffers();
		prepared = true;
	}
示例#2
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadAssets();
		prepareConditionalRendering();
		prepareUniformBuffers();
		setupDescriptorSets();
		preparePipelines();
		buildCommandBuffers();
		prepared = true;
	}
示例#3
0
文件: gears.cpp 项目: Qjames/Vulkan
	void prepare()
	{
		VulkanExampleBase::prepare();
		prepareVertices();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSets();
		updateUniformBuffers();
		buildCommandBuffers();
		prepared = true;
	}
示例#4
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadTextures();
		loadMeshes();
		setupVertexDescriptions();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSets();
		buildCommandBuffers();
		prepared = true;
	}
示例#5
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadMeshes();
		setupVertexDescriptions();
		prepareUniformBuffers();
		loadTexture(
			"./../data/textures/cubemap_yokohama.ktx",
			VK_FORMAT_BC3_UNORM_BLOCK,
			false);
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSets();
		buildCommandBuffers();
		prepared = true;
	}
示例#6
0
			VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
			VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
	}

	void prepare()
	{
		VulkanExampleBase::prepare();
		generateQuad();
		loadMeshes();
		setupVertexDescriptions();
		prepareUniformBuffers();
		prepareTextureTarget(TEX_DIM, TEX_DIM, DEPTH_FORMAT);
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSets();
		prepareOffscreenFramebuffer();
            bool VKRenderPass::Initialize(const std::string& fileName)
            {
                ////Load resources
                m_renderPassResourceHandle = Resource::RenderPass::GetHandleFromFileName(fileName);

                if (!m_renderPassResourceHandle.IsValid())
                {
                    HT_DEBUG_PRINTF("Error: Tried to load VKRenderPass but the resource handle was invalid!\n");
                    return false;
                }
                
                std::vector<Resource::RenderPass::InputTarget> inputTargets = m_renderPassResourceHandle->GetInputTargets();
                std::vector<std::string> outputPaths = m_renderPassResourceHandle->GetOutputPaths();

                //Create a structure to map set index to maps of binding indicies and render target handles
                std::map<uint32_t, std::map<uint32_t, VKRenderTargetHandle>> mappedInputTargets;

                for (size_t i = 0; i < inputTargets.size(); i++)
                {
                    std::string targetPath = inputTargets[i].path;
                    uint32_t targetSetIndex = inputTargets[i].set;
                    uint32_t targetBindingIndex = inputTargets[i].binding;

                    VKRenderTargetHandle inputTargetHandle = VKRenderTarget::GetHandle(targetPath, targetPath);

                    mappedInputTargets[targetSetIndex][targetBindingIndex] = inputTargetHandle;
                }

                for (size_t i = 0; i < outputPaths.size(); i++)
                {
                    IRenderTargetHandle outputTargetHandle = VKRenderTarget::GetHandle(outputPaths[i], outputPaths[i]).StaticCastHandle<IRenderTarget>();
                    m_outputRenderTargets.push_back(outputTargetHandle);
                }

                if (!setupAttachmentImages())
                    return false;
                if (!setupRenderPass())
                    return false;
                if (!setupFramebuffer())
                    return false;
                if (!setupDescriptorSets(mappedInputTargets))
                    return false;

                return true;
            }