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 developer.windowsphone.com/ 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
Comments Locked

55 Comments

View All Comments

  • lifeblood - Sunday, March 21, 2010 - link

    " Each time you run the application, WP7S will check that application's signature against the marketplace, both to check that it's valid, and that hasn't been revoked. Yes, marketplace has an application kill-switch."
    So if I'm out of range of a cell tower and I try to launch a app, it won't run because it can't call home? That's not very helpful, especially if it's a GPS app that I want to use to find my way back home.
  • erple2 - Sunday, March 21, 2010 - link

    I suspect that they'll use a similar route to how the Zune works for its subscription based music. You can still play those songs for a while (a few days?) before having to connect the Zune to a WiFi network.
  • cditty - Sunday, March 21, 2010 - link

    I'm sure it will launch the app if it can't make contact. No doubt that they thought of this.
  • at80eighty - Sunday, March 21, 2010 - link

    good catch - hope it's not true, because win7 phone had all the trappings of a promising platform & they seem to be castrating it steadily with every press release
  • Johnmcl7 - Sunday, March 21, 2010 - link

    "There's also the fact that existing SoCs are barely powerful enough to make running a single application feel quick. It won't be until we get multicore Cortex A9 or Intel Moorestown class hardware before we have the horsepower to multitask without a tangible performance impact.
    "

    Maybe that's what Microsoft/Apple would like to think but it's clearly not the case at all with several current phones having no problems supporting multitasking without performance issues. There are limits to the number of apps that can be handled simultaneously before it impacts performance but my current phone can easily handle 5 to 6 apps with no impact to the current app in use.

    The lack of SD card slot is concerning as it removes an easy way to back up on the move, while it's easy to have plenty of onboard memory it can be a pain in the neck if the device dies as you lose access to it. Of course you can still back up to a PC but with the increasing capabilities of smartphones, they're generally moving away from being connected to the PC.

    John
  • fcx56 - Tuesday, March 23, 2010 - link

    Microsoft wants (for better or worse) your information backed up in the cloud. If you re-read the bit about the SMS app it gives a cloud backup error message.
  • darwinosx - Sunday, March 21, 2010 - link

    As usual Microsoft interface design is different for no reason other than to be different. They are also too little too late. So the choice remains to either get an iPhone and put up with AT&T or Android. Android is a lame copy of the iPhone with crap hardware and if Apple wins the lawsuit or an injunction then Android becomes an even poorer copy of the iPhone.
  • zinfamous - Sunday, March 21, 2010 - link

    come on, reader1/perks! couldn't you just use the same username here as you do in DailyTech? It makes it easier for the rest of us to know the content of your post rather than having to waste our precious 20 seconds reading them, when all it will be is yet another baitish, everything-but-Apple, FUD-ridden marketing ploy.
  • FITCamaro - Sunday, March 21, 2010 - link

    So the fact that the Droid shares much of the same hardware as the iPhone and that there are other Android phones with even more powerful hardware than the iPhone makes it crap?
  • at80eighty - Sunday, March 21, 2010 - link

    Android is a lame copy of the iPhone with crap hardware

    well alright then - looks like the Brainwash2000 MAChinery did a good job with you

Log in

Don't have an account? Sign up now