GPU Acceleration - Silverlight

There is a clearly defined set of transforms and optimizations developers can make to leverage the GPU on the phone through Silverlight. The Silverlight performance team is striving to add more hardware accelerated primitives, but at present, hardware acceleration is limited to:

  • JPEG Decoders (PNG decoders are not implemented yet)
  • Media Decoders (Video codecs, e.t.c.)
  • 4 Composition Transforms
    • Render Transform
    • Perspective Transform
    • Opacity Transform
    • Rectangular Clips

The real interesting story, however, is about pixel shaders. Though the Direct3D drivers and GPU support programmable pixel shaders, the only pixel shaders enabled and exposed to developers right now through Silverlight frameworks are blur and drop shadow shaders. These are fully hardware accelerated. Developers at present cannot write their own programmable shaders; there is no API for doing so. The Silverlight team is working hard to add additional hardware accelerated primitives, and eventually allow custom programmable pixel shaders for developers, but it likely won't be done in time for this release.

The UI thread framerate (which is essentially the device framerate we as end users care about) will be limited to 30 FPS, although the hardware is capable of in excess of 60 FPS. 30 FPS has been chosen by the WP7S team as the framerate cap for battery life concerns, and also threw in the age-old somewhat nebulous human eye response argument. Virtually all of the demos shown during MIX10 had the 30 FPS cap applied, and most if not all seemed visually smooth. There was some objection from a few developers to the 30 FPS cap, however the battery life concerns are very valid. That said, gamers are picky, and iPhone OS is capped at a faster 60 FPS - it might be worth it to sacrifice some battery if developers want that extra response.

An interesting consequence of how much the Silverlight UI is GPU accelerated, is that the emulator packaged as part of the CTP bundle at requires WDDM 1.1 for hardware acceleration on the desktop. Otherwise, everything is CPU-rendered in the emulator, resulting in some relatively laggy performance.

GPU Acceleration - XNA

Recall now that while the primary phone UI and most "normal" applications will run atop the Silverlight framework, games requiring twitchier response and wishing to leverage code reuse across PC, Xbox 360, and WP7S will run on the XNA framework. WP7S supports full hardware accelerated 3D with one exception - programmable shaders. Microsoft will eventually do so, it simply hasn't finished an API for doing so for launch. In its stead, however, XNA offers four configurable effects (which are themselves shaders) which it helps will mitigate lack of custom programmable shaders at least until it can provide a polished API. WP7S XNA developer Shawn Hargreaves blogs:

"Instead of programmable shaders, we augmented the existing BasicEffect with four new configurable effects: SkinnedEffect, EnvironmentMapEffect, DualTextureEffect, and AlphaTestEffect. These are designed to run efficiently on the mobile GPU hardware, and I think do a good job of providing enough flexibility for developers to create awesome looking games, while also meeting our goals of being able to ship a robust and well tested product on schedule."

The XNA title I demoed, "The Harvest," leverages these effects and came off looking extremely competitive as mentioned earlier. Remember the different aspect ratios and screen resolutions I was concerned about earlier?

Screen Resolutions - To Scale

Well, the XNA tools for WP7S incorporates support for an on-GPU hardware scaler. Developers can elect to detect whichever resolution the software is running on and render appropriately, or choose one, render at it across both, and scale appropriately. Touch input is even scaled appropriately as well. As a further boon, because 800 x 480 can still be challenging for mobile hardware, developers can render under resolution and scale up to 800 x 480 as a last resort.

The SoC & Hardware Requirements Emulator Findings


View All Comments

  • PsychoPif - Monday, March 22, 2010 - link

    MS will push the upgrades, not the carriers. Reply
  • shady28 - Sunday, March 21, 2010 - link

    Wow, you know there are (were) really only 5 platforms in the smartphone space - Windows Mobile, Palm WebOS, Blackberry RIM, iPhone, and Android. All of them were unique in their own way and had their own 'fanbase'.

    Now MS has removed their uniqueness. Rather than improving on WinMo, they've decided to try to go head to head against the iPhone by attempting to match up against the iPhone's strengths (ie, interface, ease of use, MP3 player integration, app store, etc).

    Naturally they've failed to best the iPhone in those categories by a long shot. Instead they essentially have made a device that is 'less than an iPhone' rather than a better WinMO device. I'd say this is the move that will kill off WinMo.
  • Johnmcl7 - Sunday, March 21, 2010 - link

    Whatever you think of S60 and Maemo, Nokia still have a large share of the smartphone market Reply
  • Azsen - Sunday, March 21, 2010 - link

    Does Microsoft seriously think that home screen user interface looks good? It looks flippen hideous!! Give me iPhone UI any day. Reply
  • straubs - Monday, March 22, 2010 - link

    No kiddding! Look at the Pre and then look at WP7S and tell me that doesn't look like something someone drew up in their basement in 1978. The single color and square corners are awful, not too mention huge amounts of wasted space everywhere. Reply
  • melgross - Sunday, March 21, 2010 - link

    One thing that wasn't clear to me is whether or not music and books will be available without going through the marketplace. Apps can only be gotten there, so ok. The same thing is true for my iPhone. But I can get books, video and music onto the phone that weren't bought through the App Store or iTunes. Would that be possible here as well?

    The article didn't touch on that from what I saw. Anyone know?
  • nerdtalker - Sunday, March 21, 2010 - link

    I touched on it, but only very briefly ;) partly because it's, you guessed it, not totally finalized. Microsoft wants everything to go through the marketplace, so that means yes, music, videos, and games are all marketplace purchases.

    A lot of developers were asking whether there was any API for them to do in-application commerce, and the answer was that this was still being worked on. Think the same way you can buy additional levels or addons in-game on the iPhone that are billed through the App Store. It isn't present in the builds of WP7S - yet.

    It's another one of those things they haven't fully fleshed out yet, and haven't decided whether they can finish in time for release.

    I didn't hear any mention of books at all, that's a great point. I'm not sure whether there's any strategy there.

  • CSMR - Sunday, March 21, 2010 - link

    It looks like there is some complex sync process to transfer special types of file.
    You can't just plug in the phone, open it up as a storage device and drag files to and fro, as you can now.
    Instead you probably need to install special sync software.
    My advice: avoid and get a phone that is recognized as a storage device and has a usable file system.
  • MGSsancho - Monday, March 22, 2010 - link

    Maybe it behaves like my ZuneHD. i just put music and audio books into my music folder and videos into my video folder. then it shows up in the Zune app. if i want to auto sync pics, vids, podcats and music it can or I can manually drag stuff the the ZuneHD device icon. oh you can either encode videos yourself or the app will do it for you Reply
  • MrPIppy - Sunday, March 21, 2010 - link

    iPhone apps are sandboxed, but they are *not* managed code. Objective-C is compiled into ARM binaries, and garbage collection is not available on iPhone. Reply

Log in

Don't have an account? Sign up now