[vk] Fix dynamic vertex input state handling (#295)

only applies vertex input state if the pipeline was created with it

Reviewed-on: eden-emu/eden#295
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Co-authored-by: Shinmegumi <shinmegumi@eden-emu.dev>
Co-committed-by: Shinmegumi <shinmegumi@eden-emu.dev>
This commit is contained in:
Shinmegumi 2025-08-23 20:34:05 +02:00 committed by crueter
parent 4eb6d10d62
commit eb72a358e3
Signed by untrusted user: crueter
GPG key ID: 425ACD2D4830EBC6
2 changed files with 6 additions and 2 deletions

View file

@ -80,7 +80,8 @@ public:
PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache,
const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages,
const std::array<const Shader::Info*, NUM_STAGES>& infos);
// True if this pipeline was created with VK_DYNAMIC_STATE_VERTEX_INPUT_EXT
bool HasDynamicVertexInput() const noexcept { return key.state.dynamic_vertex_input; }
GraphicsPipeline& operator=(GraphicsPipeline&&) noexcept = delete;
GraphicsPipeline(GraphicsPipeline&&) noexcept = delete;

View file

@ -1002,7 +1002,10 @@ void RasterizerVulkan::UpdateDynamicStates() {
}
}
if (features.has_dynamic_vertex_input) {
UpdateVertexInput(regs);
if (auto* gp = pipeline_cache.CurrentGraphicsPipeline();
gp && gp->HasDynamicVertexInput()) {
UpdateVertexInput(regs);
}
}
}