revert 7571a36993
All checks were successful
eden-license / license-header (pull_request) Successful in 21s

revert [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:
Shinmegumi 2025-08-21 21:52:52 +02:00 committed by crueter
parent bc893d361d
commit 194031096e
2 changed files with 2 additions and 6 deletions

View file

@ -80,8 +80,7 @@ public:
PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache,
const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages, const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages,
const std::array<const Shader::Info*, NUM_STAGES>& infos); 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& operator=(GraphicsPipeline&&) noexcept = delete;
GraphicsPipeline(GraphicsPipeline&&) noexcept = delete; GraphicsPipeline(GraphicsPipeline&&) noexcept = delete;

View file

@ -1002,12 +1002,9 @@ void RasterizerVulkan::UpdateDynamicStates() {
} }
} }
if (features.has_dynamic_vertex_input) { if (features.has_dynamic_vertex_input) {
if (auto* gp = pipeline_cache.CurrentGraphicsPipeline();
gp && gp->HasDynamicVertexInput()) {
UpdateVertexInput(regs); UpdateVertexInput(regs);
} }
} }
}
void RasterizerVulkan::HandleTransformFeedback() { void RasterizerVulkan::HandleTransformFeedback() {
static std::once_flag warn_unsupported; static std::once_flag warn_unsupported;