[resend PATCH v3 1/4] wined3d: Support AMD alpha to coverage state.

Henri Verbeet hverbeet at gmail.com
Thu Feb 13 08:30:42 CST 2020


On Wed, 12 Feb 2020 at 18:24, Paul Gofman <gofmanp at gmail.com> wrote:
> @@ -5759,12 +5772,23 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined
>      struct wined3d_adapter *adapter = wined3d->adapters[adapter_idx];
>      const struct wined3d_fragment_pipe_ops *fragment_pipeline;
>      const struct wined3d_vertex_pipe_ops *vertex_pipeline;
> +    struct wined3d_blend_state_desc blend_state_desc;
>      unsigned int i;
>      HRESULT hr;
>
>      if (!wined3d_select_feature_level(adapter, levels, level_count, &device->feature_level))
>          return E_FAIL;
>
> +    memset(&blend_state_desc, 0, sizeof(blend_state_desc));
> +    blend_state_desc.alpha_to_coverage = TRUE;
> +
> +    if (FAILED(hr = wined3d_blend_state_create(device, &blend_state_desc,
> +            NULL, &wined3d_null_parent_ops, &device->blend_state_atoc_enabled)))
> +    {
> +        ERR("Could not create blend state object.\n");
> +        return hr;
> +    }
> +
>      TRACE("Device feature level %s.\n", wined3d_debug_feature_level(device->feature_level));
>
>      device->ref = 1;
This leaks the blend state object on error paths.

You also don't reference count the blend state pointer in the
wined3d_stateblock_state structure. That's not strictly required
because the lifetime of the "blend_state_atoc_enabled" object is
otherwise managed by the device, but it's also inconsistent with other
objects in the wined3d_stateblock_state structure, which makes it a
little ugly.



More information about the wine-devel mailing list