Jump to content
  • Advertisement
Sign in to follow this  
Barguast

[SlimDX] Initialise Direct3D10.1 with WARP driver

This topic is 3006 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
WARP only supports the D3D10 DDI, there is no DX9 or DX11 support from WARP. I think that it also covers D3D10.1.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!