Re: wined3d: Use backup swapchain DC for devices created with desktop window. (try 2)

2012-11-14 Thread Jeff Cook
Hello

Is there a status update on this patch? I am curious to know if it
will be merged, and if not, what correction is needed to make it
mergeable.

Thanks
Jeff

On Mon, Sep 3, 2012 at 1:51 PM, Adam Jakubek  wrote:
> On Mon, Sep 3, 2012 at 6:29 PM, Stefan Dösinger 
> wrote:
>>
>> I skimmed bug #18490, and I'm wondering about two things: Does the app
>> create
>> a D3DDEVTYPE_REF or D3DDEVTYPE_NULLREF device? Once the device is created,
>> what does it to with it? A +d3d log would provide some answers.
>
>
> Ok, this needs a little correction on my part. The game actually creates
> D3DEVTYPE_HAL (I somehow previously concluded it wouldn't work, since on my
> test machine it required software vertex processing).
> Here is the relevant log line:
> trace:d3d:wined3d_device_create wined3d 0x235ce558, adapter_idx 0,
> device_type 0x1, focus_window 0x20026, flags 0x22, device_parent 0x2284cc0c,
> device 0x2284cc14.
>
> Focus window is the desktop handle. Presentation parameters specify windowed
> mode and hDeviceWindow=NULL, so in the end it uses the desktop window.
>
> It seems to be some kind of short-lived auxiliary device for texture
> operations. It's not used for rendering at all.
> The only operations on that device I could find is a series of CreateTexture
> calls:
> trace:d3d9:d3d9_device_CreateTexture iface 0x2284cc08, width 2048, height
> 2048, levels 1, usage 0, format 0x15, pool 0x2, texture 0x33be40,
> shared_handle (nil).
>
> They are followed by several LockRect/UnlockRect calls, after which the
> textures are released.
> The device is released immediately after that.
>
> Originally I suspected this might be used to generate mip-maps or load
> textures with d3dx, but the presence of D3DPOOL_SYSTEMMEM excludes both.
>
> I admit that it's a very non-standard way of creating a D3D device, since it
> can't render anything. However it seems to work for this particular use
> case.
>
> Regards,
> Adam Jakubek
>
>
>
>




Re: wined3d: Use backup swapchain DC for devices created with desktop window. (try 2)

2012-09-03 Thread Adam Jakubek
On Mon, Sep 3, 2012 at 6:29 PM, Stefan Dösinger wrote:

> I skimmed bug #18490, and I'm wondering about two things: Does the app
> create
> a D3DDEVTYPE_REF or D3DDEVTYPE_NULLREF device? Once the device is created,
> what does it to with it? A +d3d log would provide some answers.
>

Ok, this needs a little correction on my part. The game actually creates
D3DEVTYPE_HAL (I somehow previously concluded it wouldn't work, since on my
test machine it required software vertex processing).
Here is the relevant log line:
trace:d3d:wined3d_device_create wined3d 0x235ce558, adapter_idx 0,
device_type 0x1, focus_window 0x20026, flags 0x22, device_parent
0x2284cc0c, device 0x2284cc14.

Focus window is the desktop handle. Presentation parameters specify
windowed mode and hDeviceWindow=NULL, so in the end it uses the desktop
window.

It seems to be some kind of short-lived auxiliary device for texture
operations. It's not used for rendering at all.
The only operations on that device I could find is a series of
CreateTexture calls:
trace:d3d9:d3d9_device_CreateTexture iface 0x2284cc08, width 2048, height
2048, levels 1, usage 0, format 0x15, pool 0x2, texture 0x33be40,
shared_handle (nil).

They are followed by several LockRect/UnlockRect calls, after which the
textures are released.
The device is released immediately after that.

Originally I suspected this might be used to generate mip-maps or load
textures with d3dx, but the presence of D3DPOOL_SYSTEMMEM excludes both.

I admit that it's a very non-standard way of creating a D3D device, since
it can't render anything. However it seems to work for this particular use
case.

Regards,
Adam Jakubek



Re: wined3d: Use backup swapchain DC for devices created with desktop window. (try 2)

2012-09-03 Thread Stefan Dösinger
Am Montag, 3. September 2012, 04:06:01 schrieb Adam Jakubek:
> Previous version failed on test bots.
> Added test case skipping when no device can be created with normal
> (non-desktop) window.
I skimmed bug #18490, and I'm wondering about two things: Does the app create 
a D3DDEVTYPE_REF or D3DDEVTYPE_NULLREF device? Once the device is created, 
what does it to with it? A +d3d log would provide some answers.

This is some guesswork: I don't think the game creates a _REF device because 
REF devices require the user to install the reference rasterizer dll, as 
Matteo already mentioned. If it's a NULLREF device I wonder what the game is 
able to do with it. The bug report has a link which promises some clues, but 
the link is dead.

Stefan

signature.asc
Description: This is a digitally signed message part.



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

2012-09-03 Thread Matteo Bruni
2012/9/3 Henri Verbeet :
> On 3 September 2012 00:51, Adam Jakubek  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
>> D3DDEVTYPE_REF or D3DDEVTYPE_NULLREF.
>>
>> 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.




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

2012-09-02 Thread Henri Verbeet
On 3 September 2012 00:51, Adam Jakubek  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
> D3DDEVTYPE_REF or D3DDEVTYPE_NULLREF.
>
> 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?




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

2012-09-02 Thread Marvin
Hi,

While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
http://testbot.winehq.org/JobDetails.pl?Key=21350

Your paranoid android.


=== WXPPROSP3 (32 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== W2K3R2SESP2 (32 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== WVISTAADM (32 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== W2K8SE (32 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== W7PRO (32 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== W7PROX64 (32 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== TEST64_W7SP1 (32 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== W7PROX64 (64 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.

=== TEST64_W7SP1 (64 bit device) ===
device.c:3541: Test failed: Failed to create REF device using desktop window, 
hr 0x8876086a.