wined3d: Use backup swapchain DC for devices created with desktop window.

Matteo Bruni matteo.mystral at
Mon Sep 3 09:29:01 CDT 2012

2012/9/3 Henri Verbeet <hverbeet at>:
> On 3 September 2012 00:51, Adam Jakubek <ajakubek at> wrote:
>> Hi,
>> This patch causes wined3d to use backup swapchain DC when
>> IDirect3DDevice9 is created using the desktop window.
>> Windows allows to create such device as long its type is
>> Unpatched Wine will fail in IDirect3D9_CreateDevice method, since it
>> incorrectly uses the X root window.
>> Relevant d3d test case is included.
>> Patch closes bug #18490.
> How is actual rendering to the desktop window supposed to work?

Interpreting MSDN it looks like D3DDEVTYPE_NULLREF devices don't
actually render anything. The intended use case probably is to be able
to create and load resources which can be shared (as in D3D9Ex-like
resource sharing) with the "real" D3D device.
D3DDEVTYPE_REF would trigger the reference rasterizer, which AFAIK
isn't usually installed on user systems, so maybe this one ends up
being the same as NULLREF in the common case.

Of course this needs some tests/research.

More information about the wine-devel mailing list