Add dynamic state support to VK graphics pipeline cache

This commit is contained in:
Billy Laws 2022-09-14 21:50:59 +01:00
parent ad045058ee
commit 2f2b615780
3 changed files with 6 additions and 1 deletions

View File

@ -280,6 +280,8 @@ namespace skyline::gpu::cache {
KEYNEQ(depthStencilState.maxDepthBounds)
)
RETF(ARREQ(dynamicState.pDynamicStates, dynamicState.dynamicStateCount))
RETF(KEYNEQ(colorBlendState.flags) ||
KEYNEQ(colorBlendState.logicOpEnable) ||
KEYNEQ(colorBlendState.logicOp) ||
@ -392,7 +394,7 @@ namespace skyline::gpu::cache {
.pMultisampleState = &state.multisampleState,
.pDepthStencilState = &state.depthStencilState,
.pColorBlendState = &state.colorBlendState,
.pDynamicState = nullptr,
.pDynamicState = &state.dynamicState,
.layout = *pipelineLayout,
.renderPass = *renderPass,
.subpass = 0,

View File

@ -29,6 +29,7 @@ namespace skyline::gpu::cache {
const vk::PipelineMultisampleStateCreateInfo &multisampleState;
const vk::PipelineDepthStencilStateCreateInfo &depthStencilState;
const vk::PipelineColorBlendStateCreateInfo &colorBlendState;
const vk::PipelineDynamicStateCreateInfo &dynamicState;
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
@ -87,6 +88,7 @@ namespace skyline::gpu::cache {
vk::PipelineMultisampleStateCreateInfo multisampleState;
vk::PipelineDepthStencilStateCreateInfo depthStencilState;
vk::PipelineColorBlendStateCreateInfo colorBlendState;
vk::PipelineDynamicStateCreateInfo dynamicState;
std::vector<vk::PipelineColorBlendAttachmentState> colorBlendAttachments;
std::vector<AttachmentMetadata> colorAttachments;

View File

@ -132,6 +132,7 @@ namespace skyline::gpu {
.multisampleState = multisampleState,
.depthStencilState = depthStencilState,
.colorBlendState = blendState,
.dynamicState = {},
.colorAttachments = span<TextureView *>{colorAttachment},
.depthStencilAttachment = nullptr,
}, layoutBindings, pushConstantRanges);