[resend PATCH v3 2/4] wined3d: Support Nvidia alpha to coverage state.

Henri Verbeet hverbeet at gmail.com
Thu Feb 13 09:37:23 CST 2020


On Thu, 13 Feb 2020 at 18:28, Paul Gofman <gofmanp at gmail.com> wrote:
> On 2/13/20 17:30, Henri Verbeet wrote:
> > That works, but it seems tempting to handle the NVIDIA variant in the
> > stateblock as well.
>
> Do you mean bringing in the state trigger behaviour just as for AMD or
> just move the logic present in this patch to stateblocks somehow? Both
> variants look less straightforward to me at the moment, as unlike AMD we
> don't have a pseudo-unique off trigger for Nvidia and it is not
> immediately clear how to decide when to turn the ATOC state off. For
> instance, states being set in current stateblock could have never
> triggered ATOC state but that state can be already set on device
> previously and the application of stateblock is supposed to turn the
> state off. I. e., setting the 'changed.blend_state' flag for turning off
> Nvidia ATOC state becomes cumbersome.
>
I was thinking of simply taking WINED3D_RS_ADAPTIVETESS_Y into account
when setting the blend state in wined3d_device_apply_stateblock().
I.e., some variant of the following:

    if (changed->blend_state || state_changed(changed->renderState,
WINED3D_RS_ADAPTIVETESS_Y))
    {
        blend_state = state->blend_state;
        if (state->rs[WINED3D_RS_ADAPTIVETESS_Y] == WINED3DFMT_ATOC)
            blend_state = device->blend_state_atoc_enabled;
        ...
        wined3d_device_set_blend_state(..., blend_state, ...);
    }



More information about the wine-devel mailing list