For the last few years, I've been working on the HLSL compiler. Now that Windows 10 is out the door, I finally have the opportunity to come back to blogging for a while, and hopefully help other developers build successful apps and games.
My first topic is a simple reminder that when your app is launched, you have a limited time to set things up for display. There is a timeout imposed to ensure that the user isn't left looking at the splash screen for an app that is hung. You need to be thoughtful about what work you're going to do at this point - first impressions matter!
An important point for games that is sometimes overlooked is that it's generally a bad idea to compile all your shaders during the limited window of time you have on startup. This type of work is best avoided altogether, or at least done in the background.
You'll be using CPU to compile and/or create shaders, and possible doing I/O to get the bytecode, and it's a much better strategy to simply do this work as a background or deferred bit of work.
Remember: just because it's fast on your computer doesn't mean it will be fast everywhere. CPU, I/O and even the work the graphics driver will do when creating a shader can vary quite a bit depending on what hardware the user has and what the rest of the system is doing at the time. Play it safe!
Some references you'll want to be familiar with include these.
- App lifecycle. This will explain what transitions your app will go through and what you should do at each point.
- Creating a fast and fluid app launch experience. Great walk-through of some patterns on how to approach the launch experience.
- Display a splash screen for more time. This shows you how to extend the time for your splash screen if you're waiting for background work to finish.