Browse Source
[vk] Fix dynamic vertex input state handling (#295 )
only applies vertex input state if the pipeline was created with it
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/295
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Co-authored-by: Shinmegumi <shinmegumi@eden-emu.dev>
Co-committed-by: Shinmegumi <shinmegumi@eden-emu.dev>
pull/293/head
Shinmegumi
4 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
2 changed files with
6 additions and
2 deletions
src/video_core/renderer_vulkan/vk_graphics_pipeline.h
src/video_core/renderer_vulkan/vk_rasterizer.cpp
@ -80,7 +80,8 @@ 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 ;
@ -1002,7 +1002,10 @@ void RasterizerVulkan::UpdateDynamicStates() {
}
}
}
}
if ( features . has_dynamic_vertex_input ) {
if ( features . has_dynamic_vertex_input ) {
UpdateVertexInput ( regs ) ;
if ( auto * gp = pipeline_cache . CurrentGraphicsPipeline ( ) ;
gp & & gp - > HasDynamicVertexInput ( ) ) {
UpdateVertexInput ( regs ) ;
}
}
}
}
}