[PATCH 2/8] wined3d: Implement depth clear in wined3d_device_clear_rendertarget_view().
Józef Kucia
joseph.kucia at gmail.com
Mon Mar 14 08:26:04 CDT 2016
On Mon, Mar 14, 2016 at 1:41 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 14 March 2016 at 00:03, Józef Kucia <jkucia at codeweavers.com> wrote:
>> @@ -4100,7 +4110,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
>> rect = &r;
>> }
>>
>> - return wined3d_rendertarget_view_clear(view, rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
>> + if (!(flags & WINED3DCLEAR_TARGET) == !(flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)))
>> + {
>> + ERR("Color and depth/stencil clears are mutually exclusive.\n");
>> + return WINED3DERR_INVALIDCALL;
>> + }
> You may not need this. The documentation suggests depth/stencil views
> can only be created on depth formats, and I'd be inclined to believe
> it. IIRC it doesn't say much about creating rendertarget views on
> depth/stencil formats, but I wouldn't be all that surprised if that's
> not allowed either. In that case you'd just need to check the flags
> against the format capabilities.
I expect this isn't needed. I've added this as a safety check. I guess
I'll add some tests for CreateDepthStencilView() and
CreateRenderTargetView().
More information about the wine-devel
mailing list