HackerPapers

arXiv:2109.14682cs.GR

Supporting Unified Shader Specialization by Co-opting C++ Features

Kerry A. Seitz, Theresa Foley, Serban D. Porumbescu, John D. Owens

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

Modern unified programming models (such as CUDA and SYCL) that combine host (CPU) code and GPU code into the same programming language, same file, and same lexical scope lack adequate support for GPU code specialization, which is a key optimization in real-time graphics. Furthermore, current methods used to implement specialization do not translate to a unified environment. In this paper, we create a unified shader programming environment in C++ that provides first-class support for specialization by co-opting C++'s attribute and virtual function features and reimplementing them with alternate semantics to express the services required. By co-opting existing features, we enable programmers to use familiar C++ programming techniques to write host and GPU code together, while still achieving efficient generated C++ and HLSL code via our source-to-source translator.

arXiv comments
17 pages, 1 figure, 2 tables, 3 code listings. To be published in Proceedings of the ACM on Computer Graphics and Interactive Techniques, 5, 3, Article 25 (July 2022)
Journal reference
Proceedings of the ACM on Computer Graphics and Interactive Techniques, 5, 3, Article 25 (July 2022), 17 pages
DOI
doi:10.1145/3543866
Subjects
cs.GRGraphics cs.PLProgramming Languages

On Hacker News

Linked by 1 identifiable commenter in 2 comments across 2 threads, from Feb 2022 to Mar 2022. Found in 1 HN submission from Oct 2021 to Oct 2021. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • It may be close to a technical impossibility, but the Circle compiler by Sean Baxter is attempting it. That's based on an aggressive "de-pointerization" (see [1] in particular for details). There's also academic work[2] to compile C++ to shaders. I agree that it's an open…

      raphlinusView on HNParent context

  1. A Review of Shader Languages 1 comment
    • While it has roots in C, I think it's better to consider it a separate language, especially in more modern forms (Metal is C++14). Metal is locked into Apple's proprietary platforms, but there is other work in compiling C++ to portable shaders, particularly Sean Baxter's Circle…

      raphlinusView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.