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

View File

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

View File

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