HLSL Compiler support for Symbolic Derivatives

In the DirectX SDK (June 2010) release, the HLSL compiler was updated from the August 2009 version. As part of this update, the HLSL complier now supports a new feature: symbolic derivatives. If you are interested in learning more about what this feature is and what you can do with it, you should check out this paper from Microsoft Research: Symbolic Differentiation in GPU Shaders

Update:  The researcher's home page contains more information and the sample is on the MSR download site. Note that the tools make use of the XNA Game Studio 3.1 assemblies, and the redistributable package can be obtained directly from MS Downloads.

There is also a Game Developer Conference 2011 presentation on this topic (US / UK).

Comments (2)

  1. Andrew McDonald says:

    Wow. How come this wasn't mentioned at the time?

  2. David Black says:

    This is very cool, however a couple of observations from using this to handle branching better for my node=>shader generator:

    * It would be very helpful if derivative were pre-defined for pixel shader interpolators with respect to screen xy, ie ddx(texCoord) or ddy(worldPosition).

    * Is there a comprehensive list of HLSL functions and operators for which derivatives are defined. At the moment I am guessing as to which nodes cause the system to fallback to plain Sample() and branch removal.

Skip to main content