The developer SDK for Windows Phone 8 (codename Apollo) is now available for download from an internet near you. Which means I can finally talk about what I’ve been working on this past year! I am dev lead for graphics, so I’ll probably have most to say about that area, but knowing me I’m sure I’ll find other topics to write about too.
This first post is basically just a bullet list summarizing the graphics capabilities of the platform:
- Write games in high performance native C++
- Or you can interop between XAML and C++/D3D, similar to the Silverlight/XNA interop feature in Mango
- Graphics APIs are a subset of Windows 8, so it’s easy to move code back and forth between phones, tablets, and desktop PCs
- Direct3D 11.1 API, targeting feature level 9.3 hardware capabilities
- DirectXMath provides high performance SIMD vector math, optimized for SSE and NEON
- XAudio2 provides game focused audio playback, mixing, and effects (ok, you got me, this one isn’t graphics)
- Not all Windows graphics components are supported on phone
What does D3D11 feature level 9.3 give you?
- Shader model 4_0_level_9_3
- Max texture size 4096
- BC1-BC3 texture compression
- Floating point texture formats
- Conditional non-power-of-2 textures (can’t use wrap addressing or have mipmaps)
- Multiple rendertargets
- Hardware instancing
- Occlusion queries
- Separate alpha blend
Yes, you read that right. Shader model 4_0_level_9_3 means that programmable shaders are now fully supported on Windows Phone. But what is this 4_0_level_9_3 thing, you may well ask?
- Not quite the same as D3D9 shader model 2.0
- Uses HLSL 4.0 syntax
- Similar features to vs_2_a and ps_2_b (think of it as 2.0 turned up to 11
- Long pixel shaders (512 instructions)
- Dynamic flow control
- Gradient instructions
So what notable D3D11 features are NOT included in feature level 9.3?
- No geometry shaders
- No hull/domain shaders
- No DirectCompute
- No resource arrays
- No BC4–BC7 compression
- No vertex texture fetch
Another way to think of this: feature level 9.3 is basically the same as the XNA HiDef profile, except without vertex texture fetch.
Anything else important you should know?
Windows Phone 8 uses a tiled GPU architecture, so for best performance you’ll need to understand how to use the D3D11_MAP_WRITE and D3D11_COPY flags to specify DISCARD and NOOVERWRITE behaviors, and when to call ID3D11DeviceContext1::DiscardView (ooh, good topic for future articles)
Native D3D apps handle their own rotation: this isn’t automatic like in XNA.
- Windows Phone 8 device manufacturers can choose one of three screen resolutions:
Windows Phone 8 includes the same hardware scaler feature as WP7. Use this to draw at the same resolution on all devices (simplifying development) or to draw fewer pixels for better performance. Use the new DXGI_SCALING_ASPECT_RATIO_STRETCHED mode.
I think this is a pretty exciting set of capabilities, and am looking forward to seeing what y’all will be able to do with it. To whet your appetite, check out these screenshots from an HDR rendering demo created by my colleague Adrian. It’s crazy that this does on a phone what would have been impossible on a high end gaming console of just 10 years ago, and at a higher resolution to boot!