Foreword
As developers, we often find ourselves in a position where we need to learn a new programming or markup language in order to support our primary development tasks. Desktop programmers end up learning XML and XSLT. Web programmers find SQL is a necessary part of their skillset. C programmers on microcontrollers find they really need some inline assembly for a critical section of code. HTML/JS tends to be one of those skills everyone is expected to have. And yes, Silverlight, WPF, XNA, and C++ developers find they must write HLSL to provide just the right effect at the maximum possible performance. The day of the one-trick pony is rapidly coming to an end.
Typically, these languages augment our applications; they help get us past roadblocks, and perhaps most importantly, they present a different way to think about programming. It’s this last point I consider the most important: polyglot programmers are the ones who tend to come up with the best solutions to problems, because they have a larger universe of possible ideas, approaches, and algorithms to choose from.
HLSL is different enough from our regular workhorse-language programming that we can’t help but learn some new techniques from it. Instead of explicit loops in a function, the algorithms work with individual pixels or vertices with code which is being called millions of times under external control. Instead of being spun through on a single thread on the CPU, or ...