ShaderTransformer: Predicting Shader Quality Via One-shot Embedding for Fast Simplification

Yuchi Huo,Shi Li,Yazhen Yuan,Xu Chen,Rui Wang,Wenting Zheng,Hai Lin,Hujun Bao
DOI: https://doi.org/10.1145/3528233.3530722
2022-01-01
Abstract:Given specific scene configurations and target functions, automatic shader simplification searches for the best simplified shader variant from an optimization space with many candidates. Although various speedup methods have been proposed, there is still a costly render-and-evaluate process to obtain variant’s performance and quality, especially when the scene changes. In this paper, we present a deep learning-based framework for predicting a shader’s simplification space, where the shader’s variants can be embedded into a metric space all at once for efficient quality evaluation. The novel framework allows the one-shot embedding of a space rather than a single instance. In addition, the simplification errors can be interpreted by mutual attention between shader fragments, presenting an informative focus-aware simplification framework that can assist experts in optimizing the codes. The results show that the new framework achieves significant speedup compared with existing search approaches. The focus-aware simplification framework reveals a new possibility of interpreting shaders for various applications.
What problem does this paper attempt to address?