[SlimDX] Initialise Direct3D10.1 with WARP driver

Started by
15 comments, last by DieterVW 13 years, 11 months ago
Quick question - In SlimDX, how I do create a Direct3D 10 device which uses the WARP device? In unmanaged Direct3D, it seems you do it by specifying the driver type as D3D10_DRIVER_TYPE_WARP, but the equivalent SlimDX enumeration (SlimDX.Direct3D10.DriverType) has only Hardware, Software, Reference, and Null values. Thanks. :)
Using Visual C++ 7.0
Advertisement
D3D10_DRIVER_TYPE_WARP has the value of 5. To work around the fact that the enumeration seems to be missing in SlimDX, cast 5 to the DriverType type.
Quote:Original post by jpetrie
D3D10_DRIVER_TYPE_WARP has the value of 5. To work around the fact that the enumeration seems to be missing in SlimDX, cast 5 to the DriverType type.


Thanks. I assumed .NET would be more strict with casting an integer to an enum, but it certainly seems to do the trick!
Using Visual C++ 7.0
I spoke too soon - the following line doesn't work:

new Device1(null, (DriverType)5, DeviceCreationFlags.None, SlimDX.Direct3D10_1.FeatureLevel.Level_9_1);

I get an exception of 'E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809)'. Oddly enough nothing shows up in DebugView when the error occurs, but I do get a warning in DebugView saying the device wasn't disposed when the application is closed. So, it seems the device is created, but isn't usable. :(

The following line, on the other hand, does work (0 being 'Hardware')

new Device1(null, (DriverType)0, DeviceCreationFlags.None, SlimDX.Direct3D10_1.FeatureLevel.Level_9_1);

Using Visual C++ 7.0
(SEE BELOW)

[Edited by - Barguast on April 26, 2010 11:40:31 AM]
Using Visual C++ 7.0
Quote:Original post by Barguast
And yet, my attempt with Device.CreateWithSwapChain succeeds. :p


EDIT: To update, it only works when FeatureLevel is 10 or above. Does the WARP renderer not like targetting Direct3D 9 under Direct3D 10? It worked with Direct3D 11 when I tried it.
Using Visual C++ 7.0
WARP only supports the D3D10 DDI, there is no DX9 or DX11 support from WARP. I think that it also covers D3D10.1.
Quote:Original post by DieterVW
WARP only supports the D3D10 DDI, there is no DX9 or DX11 support from WARP. I think that it also covers D3D10.1.


But in Direct3D 11, it's possible to create a WARP device, targetting Direct3D 9. Does this in fact use Direct3D 10?

... This is all very confusing. :p
Using Visual C++ 7.0
That sounds like a bug in device creation to me. It does seem safe though since the shader blobs will contain a *s_4_* target.

I'm not sure why anyone would want to target 10Level9 with WARP anyway given that WARP 10 would have more features - and you're using the dx10/dx11 api anyway.
Quote:Original post by DieterVW
WARP only supports the D3D10 DDI, there is no DX9 or DX11 support from WARP. I think that it also covers D3D10.1.
That's in conflict with the documentation for the flag:
Quote:A WARP driver, which is a high-performance software rasterizer. The rasterizer supports feature level 9_1 through level 10.1 with a high performance software implementation when hardware is not available.

And I've added the WARP enum to SVN for SlimDX.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement