On Tue, Jun 1, 2021 at 6:54 PM Henri Verbeet hverbeet@gmail.com wrote:
On Mon, 31 May 2021 at 21:13, Matteo Bruni mbruni@codeweavers.com wrote:
This fixes the non-default ARB shader backend, broken since 2ddb6b66a7cda0bf6aaddc0c6899e35cc92ceee9, although the fundamental issue was there long before that.
Originally the STATE_VDECL handler did some bookkeeping (basically, computing what is now the stream info data) that's a prerequisite for running other state handlers. For this reason a somewhat complicated dance was put in place, with the dependent handlers returning right away until the STATE_VDECL handler could prepare everything up and the STATE_VDECL handler in turn explicitly calling these "downstream" handlers so that they could do their job. With the commit mentioned above the state dirty flags are cleared after the corresponding handlers are executed, which means that the relevant handlers are skipped twice and some stuff is never set up properly.
Stream info is computed by context_apply_draw_state() before going through the state handler table for a long time now, getting rid of this obscure handler interdependency. So let's just get rid of the skipping altogether.
Although now handlers may end up getting called twice. I'm tempted to think we should clear the "dirty_graphics_states" bitmap only after all handlers have run, similar to what we do in wined3d_context_vk_apply_draw_state().
Oh, good idea! I'll try it and look through the various handlers for more weird shenanigans.