wined3d [try3]: SetDepthStencilSurface is always called when AutoDepthStencil is enabled

Henri Verbeet hverbeet at gmail.com
Sun Mar 29 14:29:26 CDT 2009


2009/3/29 David Adam <david.adam.cnrs at gmail.com>:
> +         hrc = IWineD3DDeviceParent_CreateDepthStencilSurface(This->device_parent,
> +                 NULL,
> +                 pPresentationParameters->BackBufferWidth,
> +                 pPresentationParameters->BackBufferHeight,
> +                 pPresentationParameters->AutoDepthStencilFormat,
> +                 pPresentationParameters->MultiSampleType,
> +                 pPresentationParameters->MultiSampleQuality,
> +                 FALSE,
> +                 &This->auto_depth_stencil_buffer);
Even though I don't think any implementation of
IWineD3DDeviceParent_CreateDepthStencilSurface actually uses the
second parameter, you should pass "This->parent" rather than NULL
there.

> +         if (SUCCEEDED(hrc))
> +                 IWineD3DDevice_SetDepthStencilSurface(iface, This->auto_depth_stencil_buffer);
This is redundant, the code a couple of lines down will also set the
depth stencil.

> +              else {
> +                 ERR("Failed to create the auto depth stencil\n");·
> +                 return WINED3DERR_INVALIDCALL;
> +            }
You're leaking the swapchain here. Also, not trying to be picky, but
could you please fix the indentation?



More information about the wine-devel mailing list