[PATCH v2] wined3d: Do not bind buffers in state_cb() if the shader is not set.

Henri Verbeet hverbeet at gmail.com
Wed Dec 15 04:18:00 CST 2021


On Wed, 15 Dec 2021 at 06:45, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> @@ -4579,6 +4579,10 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
>      else
>          shader_type = WINED3D_SHADER_TYPE_COMPUTE;
>
> +    /* If a shader has not been set, buffer objects are not initialised. */
> +    if (!state->shader[shader_type])
> +        return;
> +
Sure, but then we also need to make sure we don't miss any updates.
E.g., suppose an application does something like this:

    - [...]
    - Set geometry shader NULL
    - Set geometry shader constant buffer CB0
    - Draw D0
    - Set geometry shader GS0
    - [...]
    - Draw D1

We'd want CB0 to be available to GS0 during D1.



More information about the wine-devel mailing list