[PATCH v2 1/2] wined3d: Support AMD alpha to coverage state.

Henri Verbeet hverbeet at gmail.com
Tue Feb 11 10:32:31 CST 2020


On Mon, 10 Feb 2020 at 20:41, Paul Gofman <gofmanp at gmail.com> wrote:
> -static void state_blend_object(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
> +void state_atoc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
>  {
Why the rename? This is still the handler for blend state objects.

> +    else
> +    {
> +        if (context->amd_atoc_enabled
> +                && state->render_states[WINED3D_RS_POINTSIZE] != WINED3D_ALPHA_TO_COVERAGE_DISABLE)
> +            return;
> +
> +        if (state->render_states[WINED3D_RS_POINTSIZE] == WINED3D_ALPHA_TO_COVERAGE_ENABLE)
> +        {
> +            alpha_to_coverage = TRUE;
> +            context->amd_atoc_enabled = 1;
> +        }
> +        else
> +        {
> +            alpha_to_coverage = FALSE;
> +            context->amd_atoc_enabled = 0;
> +        }
> +    }
Does this imply that the current alpha to coverage state is supposed
to stick as long as WINED3D_RS_POINTSIZE isn't set to either
WINED3D_ALPHA_TO_COVERAGE_ENABLE or WINED3D_ALPHA_TO_COVERAGE_DISABLE?
(And likewise that setting either of those shouldn't change the
current point size?) If that's the case, you can't handle this here;
d3d9 state is only flushed to wined3d on draws, so you'd miss
intermediate states.

> @@ -1532,6 +1549,8 @@ static void state_pscale(struct wined3d_context *context, const struct wined3d_s
>
>      gl_info->gl_ops.gl.p_glPointSize(max(pointsize, FLT_MIN));
>      checkGLcall("glPointSize(...);");
> +
> +    state_atoc(context, state, state_id);
>  }
We'd typically guard that by "!isStateDirty(context, STATE_BLEND)",
and perhaps a check on the value of WINED3D_RS_POINTSIZE.



More information about the wine-devel mailing list