On Wed, 21 Apr 2021 at 16:06, Jan Sikorski jsikorski@codeweavers.com wrote:
Calling it each time the pipeline changes would be wasteful. It also smells fishy to invalidate STATE_STREAMSRC inside wined3d_context_vk_update_graphics_pipeline_key for that case, although I guess it would work. I can think of a few ways to resolve it, my favourite is to directly bind the null buffer next to vkCmdBindPipeline() if we need one (and perhaps if STATE_STREAMSRC is clean). We’d probably still need to do the thing in wined3d_context_vk_bind_vertex_buffers() in case someone binds a NULL vertex buffer. Although looks like now if STATE_STREAMSRC is dirty we always go to vkCmdBindPipeline(), so maybe not, but that's a bit brittle.
It's perhaps unfortunate, but wined3d_stream_info_from_declaration() depends on information from the currently bound vertex buffers. Perhaps most notable for the Vulkan backend is the fact that we get attribute strides from there. It's probably possible to separate attribute and binding descriptions (although not necessarily trivial) but unless we also implement support for VK_EXT_extended_dynamic_state, it's still going to cause pipeline invalidation.