Use const references for holding pipeline state in pipeline cache

Allows passing in constexpr structs to state directly
This commit is contained in:
Billy Laws 2022-07-31 13:14:13 +01:00
parent b6b04fa6c5
commit 1c8863ec3b

View File

@ -4,7 +4,10 @@
#pragma once #pragma once
#include <vulkan/vulkan_raii.hpp> #include <vulkan/vulkan_raii.hpp>
#include <gpu/texture/texture.h>
namespace skyline::gpu {
class TextureView;
}
namespace skyline::gpu::cache { namespace skyline::gpu::cache {
/** /**
@ -18,14 +21,14 @@ namespace skyline::gpu::cache {
*/ */
struct PipelineState { struct PipelineState {
span<vk::PipelineShaderStageCreateInfo> shaderStages; span<vk::PipelineShaderStageCreateInfo> shaderStages;
vk::StructureChain<vk::PipelineVertexInputStateCreateInfo, vk::PipelineVertexInputDivisorStateCreateInfoEXT> &vertexState; const vk::StructureChain<vk::PipelineVertexInputStateCreateInfo, vk::PipelineVertexInputDivisorStateCreateInfoEXT> &vertexState;
vk::PipelineInputAssemblyStateCreateInfo &inputAssemblyState; const vk::PipelineInputAssemblyStateCreateInfo &inputAssemblyState;
vk::PipelineTessellationStateCreateInfo &tessellationState; const vk::PipelineTessellationStateCreateInfo &tessellationState;
vk::PipelineViewportStateCreateInfo &viewportState; const vk::PipelineViewportStateCreateInfo &viewportState;
vk::StructureChain<vk::PipelineRasterizationStateCreateInfo, vk::PipelineRasterizationProvokingVertexStateCreateInfoEXT> &rasterizationState; const vk::StructureChain<vk::PipelineRasterizationStateCreateInfo, vk::PipelineRasterizationProvokingVertexStateCreateInfoEXT> &rasterizationState;
vk::PipelineMultisampleStateCreateInfo &multisampleState; const vk::PipelineMultisampleStateCreateInfo &multisampleState;
vk::PipelineDepthStencilStateCreateInfo &depthStencilState; const vk::PipelineDepthStencilStateCreateInfo &depthStencilState;
vk::PipelineColorBlendStateCreateInfo &colorBlendState; const vk::PipelineColorBlendStateCreateInfo &colorBlendState;
span<TextureView *> colorAttachments; //!< All color attachments in the subpass of this pipeline span<TextureView *> 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 TextureView *depthStencilAttachment; //!< A nullable pointer to the depth/stencil attachment in the subpass of this pipeline