Lejdfors, CalleOhlsson, LennartIk Soo Lim and Wen Tang2014-01-312014-01-312008978-3-905673-67-8https://doi.org/10.2312/LocalChapterEvents/TPCG/TPCG08/145-150The graphics processing units (GPUs) used in todays personal computers can be programmed to compute the visual appearance of three-dimensional objects in real time. Such programs are called shaders and are written in high-level domain-specific languages that can produce very efficient programs. However, to exploit this efficiency, the programmer must explicitly express space transformations necessary to implement a computation. Unfortunately, this makes programming GPUs more error prone and reduces portability of the shader programs. In this paper we show that these explicit transformations can be removed without sacrificing performance. Instead we can automatically infer the set of transformations necessary to implement the shader in the same way as an experienced programmer would. This enables shaders to be written in a cleaner, more portable, manner and to be more readily reused. Furthermore, errors resulting from incorrect transformation usage or space assumptions are eliminated. In the paper we present an inferencing algorithm as well as a prototype space-free shading language implemented as an embedded language in Python.Keywords: Shading language, graphics processing unit (GPU), optimization, inference, embedded languageSpace-free Shader Programming: Automatic Space Inference and Optimization for Real-time Shaders