From 1c8863ec3b638673264906f886c36269878903bf Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 31 Jul 2022 13:14:13 +0100 Subject: [PATCH] Use const references for holding pipeline state in pipeline cache Allows passing in constexpr structs to state directly --- .../gpu/cache/graphics_pipeline_cache.h | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h index 31d9a8f7..fa0d0801 100644 --- a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h +++ b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h @@ -4,7 +4,10 @@ #pragma once #include -#include + +namespace skyline::gpu { + class TextureView; +} namespace skyline::gpu::cache { /** @@ -18,14 +21,14 @@ namespace skyline::gpu::cache { */ struct PipelineState { span shaderStages; - vk::StructureChain &vertexState; - vk::PipelineInputAssemblyStateCreateInfo &inputAssemblyState; - vk::PipelineTessellationStateCreateInfo &tessellationState; - vk::PipelineViewportStateCreateInfo &viewportState; - vk::StructureChain &rasterizationState; - vk::PipelineMultisampleStateCreateInfo &multisampleState; - vk::PipelineDepthStencilStateCreateInfo &depthStencilState; - vk::PipelineColorBlendStateCreateInfo &colorBlendState; + const vk::StructureChain &vertexState; + const vk::PipelineInputAssemblyStateCreateInfo &inputAssemblyState; + const vk::PipelineTessellationStateCreateInfo &tessellationState; + const vk::PipelineViewportStateCreateInfo &viewportState; + const vk::StructureChain &rasterizationState; + const vk::PipelineMultisampleStateCreateInfo &multisampleState; + const vk::PipelineDepthStencilStateCreateInfo &depthStencilState; + const vk::PipelineColorBlendStateCreateInfo &colorBlendState; span colorAttachments; //!< All color attachments in the subpass of this pipeline TextureView *depthStencilAttachment; //!< A nullable pointer to the depth/stencil attachment in the subpass of this pipeline