“A system for rapid exploration of shader optimization choices” by He, Foley and Fatahalian

  • ©Yong He, Tim Foley, and Kayvon Fatahalian




    A system for rapid exploration of shader optimization choices





    We present Spire, a shading language and compiler framework that facilitates rapid exploration of shader optimization choices (such as frequency reduction and algorithmic approximation) afforded by modern real-time graphics engines. Our design combines ideas from rate-based shader programming with new language features that expand the scope of shader execution beyond traditional GPU hardware pipelines, and enable a diverse set of shader optimizations to be described by a single mechanism: overloading shader terms at various spatio-temporal computation rates provided by the pipeline. In contrast to prior work, neither the shading language’s design, nor our compiler framework’s implementation, is specific to the capabilities of any one rendering pipeline, thus Spire establishes architectural separation between the shading system and the implementation of modern rendering engines (allowing different rendering pipelines to utilize its services). We demonstrate use of Spire to author complex shaders that are portable across different rendering pipelines and to rapidly explore shader optimization decisions that span multiple compute and graphics passes and even offline asset preprocessing. We further demonstrate the utility of Spire by developing a shader level-of-detail library and shader auto-tuning system on top of its abstractions, and demonstrate rapid, automatic re-optimization of shaders for different target hardware platforms.


    1. Ansel, J., Chan, C., Wong, Y. L., Olszewski, M., Zhao, Q., Edelman, A., and Amarasinghe, S. 2009. Petabricks: A language and compiler for algorithmic choice. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, ACM, New York, NY, USA, PLDI ’09, 38–49. Google ScholarDigital Library
    2. Austin, C., and Reiners, D. 2005. Renaissance: A functional shading language. In Proceedings of Graphics Hardware 2005, ACM, New York, NY, USA, 1–8.Google Scholar
    3. Bauer, M., Treichler, S., Slaughter, E., and Aiken, A. 2012. Legion: Expressing locality and independence with logical regions. In Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis, IEEE Computer Society Press, SC ’12, 66:1–66:11. Google ScholarDigital Library
    4. Bungie, 2014. Destiny computer game. Available at http://www.destinythegame.com.Google Scholar
    5. Clarberg, P., Toth, R., Hasselgren, J., Nilsson, J., and Akenine-Möller, T. 2014. Amfs: Adaptive multi-frequency shading for future graphics processors. ACM Trans. Graph. 33, 4 (July), 141:1–141:12. Google ScholarDigital Library
    6. Epic Games, 2015. Unreal Engine 4 documentation. Available at http://docs.unrealengine.com.Google Scholar
    7. Epic Games, 2015. Unreal Engine 4 Marketplace Web Site. http://www.unrealengine.com/marketplace.Google Scholar
    8. Fatahalian, K., Horn, D. R., Knight, T. J., Leem, L., Houston, M., Park, J. Y., Erez, M., Ren, M., Aiken, A., Dally, W. J., and Hanrahan, P. 2006. Sequoia: programming the memory hierarchy. In Proceedings of the 2006 ACM/IEEE conference on Supercomputing, ACM, SC ’06. Google ScholarDigital Library
    9. Foley, T., and Hanrahan, P. 2011. Spark: modular, compos-able shaders for graphics hardware. ACM Trans. Graph. 30, 4 (July), 107:1–107:12. Google ScholarDigital Library
    10. Hanrahan, P., and Lawson, J. 1990. A language for shading and lighting calculations. SIGGRAPH Comput. Graph. 24, 4 (Sept.), 289–298. Google ScholarDigital Library
    11. He, Y., Gu, Y., and Fatahalian, K. 2014. Extending the graphics pipeline with adaptive, multi-rate shading. ACM Trans. Graph. 33, 4 (July), 142:1–142:12. Google ScholarDigital Library
    12. He, Y., Foley, T., Tatarchuk, N., and Fatahalian, K. 2015. A system for rapid, automatic shader level-of-detail. ACM Trans. Graph. 34, 6 (Oct.), 187:1–187:12. Google ScholarDigital Library
    13. Kavan, L., Bargteil, A. W., and Sloan, P.-P. 2011. Least squares vertex baking. In Proceedings of the Twenty-second Eurographics Conference on Rendering, Eurographics Association, Aire-la-Ville, Switzerland, Switzerland, EGSR ’11, 1319–1326. Google ScholarDigital Library
    14. Kessenich, J., Baldwin, D., and Rost, R., 2014. The OpenGL shading language language version 4.4. Available at https://www.opengl.org.Google Scholar
    15. Lalonde, P., and Schenk, E. 2002. Shader-driven compilation of rendering assets. ACM Trans. Graph. 21, 3 (July), 713–720. Google ScholarDigital Library
    16. Mark, W. R., Glanville, R. S., Akeley, K., and Kilgard, M. J. 2003. Cg: A system for programming graphics hardware in a c-like language. ACM Trans. Graph. 22, 3 (July), 896–907. Google ScholarDigital Library
    17. McCool, M. D. 2000. SMASH: A next-generation API for programmable graphics accelerators. Tech. Rep. CS-2000-14, University of Waterloo, August.Google Scholar
    18. Microsoft, 2016. HLSL shader model 5 documentation. Available at https://msdn.microsoft.com.Google Scholar
    19. Patney, A., Tzeng, S., Seitz, Jr., K. A., and Owens, J. D. 2015. Piko: A framework for authoring programmable graphics pipelines. ACM Trans. Graph. 34, 4 (July), 147:1–147:13. Google ScholarDigital Library
    20. Proudfoot, K., Mark, W. R., Tzvetkov, S., and Hanrahan, P. 2001. A real-time procedural shading system for programmable graphics hardware. In Proceedings of SIGGRAPH 01, Annual Conference Series, ACM, New York, NY, USA, 159–170. Google ScholarDigital Library
    21. Ragan-Kelley, J., Adams, A., Paris, S., Levoy, M., Amarasinghe, S., and Durand, F. 2012. Decoupling algorithms from schedules for easy optimization of image processing pipelines. ACM Trans. Graph. 31, 4 (July), 32:1–32:12. Google ScholarDigital Library
    22. Shopf, J., 2009. Mixed resolution rendering. Game Developers Conference 2009 slides.Google Scholar
    23. Sitthi-Amorn, P., Modly, N., Weimer, W., and Lawrence, J. 2011. Genetic programming for shader simplification. ACM Trans. Graph. 30, 6 (Dec.), 152:1–152:12. Google ScholarDigital Library
    24. Sugerman, J., Fatahalian, K., Boulos, S., Akeley, K., and Hanrahan, P. 2009. GRAMPS: A programming model for graphics pipelines. ACM Transactions on Graphics 28, 1, 4:1–4:11. Google ScholarDigital Library
    25. Vaidyanathan, K., Salvi, M., Toth, R., Foley, T., Akenine-Möller, T., Nilsson, J., Munkberg, J., Hasselgren, J., Sugihara, M., Clarberg, P., Janczak, T., and Lefohn, A. 2014. Coarse pixel shading. In High Performance Graphics 2014, 10.Google Scholar
    26. Wang, R., Yang, X., Yuan, Y., Chen, W., Bala, K., and Bao, H. 2014. Automatic shader simplification using surface signal approximation. ACM Trans. Graph. 33, 6 (Nov.), 226:1–226:11. Google ScholarDigital Library
    27. Yang, L., Sander, P. V., and Lawrence, J. 2008. Geometry-aware framebuffer level of detail. In Proceedings of the Nineteenth Eurographics Conference on Rendering, Eurographics Association, EGSR’08, 1183–1188. Google ScholarDigital Library

ACM Digital Library Publication: