Sign in to follow this  
  • entries
  • comments
  • views

Beware of D3D feature level 11 in the Windows Phone emulator

Sign in to follow this  


Windows Phone 8 devices support Direct3D 11.1 feature level 9.3, but our emulator uses the WARP rasterizer, which can handle all the way up to feature level 11. This means that, if you aren't careful, it is possible to accidentally use more advanced D3D features while developing in the emulator, only to get an unpleasant surprise when these things don't work on an actual device.
Q: how to avoid unpleasant surprises?
A: make sure you explicitly select feature level 9.3, even when running in the emulator.
Starting with the Windows Phone Direct3D App project template, open up Direct3DBase.cpp, find this code in the CreateDeviceResources method: D3D_FEATURE_LEVEL featureLevels[] =
and change it to: D3D_FEATURE_LEVEL featureLevels[] =
Tada! Now you will be using 9.3 in the emulator, the same as on actual device hardware.
Right above this code, notice how the template turns on D3D11_CREATE_DEVICE_DEBUG only if the _DEBUG define is set? This enables extra validation to give more useful error messages if you make a mistake in your D3D API usage. But that validation is not free, so we only enable it in debug builds.aggbug.aspx?PostID=10366223

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now