By Tim Foley1,2, Pat Hanrahan2
1Intel Corporation, 2Stanford University
In creating complex real-time shaders, programmers should be able to decompose code into independent, localized modules of their choosing. Current real-time shading languages, however, enforce a fixed decomposition into per-pipeline-stage procedures. Program concerns at other scales - including those that cross-cut multiple pipeline stages - cannot be expressed as reusable modules.
We present a shading language, Spark, and its implementation for modern graphics hardware that improves support for separation of concerns into modules. A Spark shader class can encapsulate code that maps to more than one pipeline stage, and can be extended and composed using object-oriented inheritance. In our tests, shaders written in Spark achieve performance within 2% of HLSL.
Read the SIGGRAPH paper: Spark: Modular, Composable Shaders for Graphics Hardware [PDF 3.1 MB]
Download the source code: spark-0.1.zip* [ZIP 36.3 MB];
Presented at: ACM SIGGRAPH 2011, Vancouver, B.C. Canada
Spark: Modular, Composable Shaders for Graphics Hardware. Tim Foley, Pat Hanrahan. In ACM Transactions on Graphics (SIGGRRAPH 2011 Proceedings). Volume 30, Issue 4, Article 107. 2011.
*This software is subject to the U.S. Export Administration Regulations and other U.S. law, and may not be exported or re-exported to certain countries (Burma, Cuba, Iran, North Korea, Sudan, and Syria) or to persons or entities prohibited from receiving U.S. exports (including Denied Parties, Specially Designated Nationals, and entities on the Bureau of Export Administration Entity List or involved with missile technology or nuclear, chemical or biological weapons).
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804