[vk] Fix dynamic vertex input state handling
Previously, UpdateVertexInput() was always called when has_dynamic_vertex_input was true, even if the current graphics pipeline was not created with VK_DYNAMIC_STATE_VERTEX_INPUT_EXT. This could lead to unnecessary or invalid state updates. This change: - Adds GraphicsPipeline::HasDynamicVertexInput() to check whether the pipeline was created with dynamic vertex input enabled. - Calls UpdateVertexInput() only when the current pipeline supports VK_DYNAMIC_STATE_VERTEX_INPUT_EXT. This ensures vertex input state updates are applied only when valid, improving correctness and preventing redundant updates.
This commit is contained in:
parent
4eb6d10d62
commit
a54ccec6f7
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue