1 // 2 // Copyright 2020 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // RewriteSampleMaskVariable.cpp: Find any references to gl_SampleMask and gl_SampleMaskIn, and 7 // rewrite it with ANGLESampleMask or ANGLESampleMaskIn. 8 // 9 10 #ifndef COMPILER_TRANSLATOR_TREEUTIL_REWRITESAMPLEMASKVARIABLE_H_ 11 #define COMPILER_TRANSLATOR_TREEUTIL_REWRITESAMPLEMASKVARIABLE_H_ 12 13 #include "common/angleutils.h" 14 15 namespace sh 16 { 17 18 class TCompiler; 19 class TIntermBlock; 20 class TSymbolTable; 21 class TIntermTyped; 22 23 // Rewrite every gl_SampleMask or gl_SampleMaskIn to "ANGLESampleMask" or "ANGLESampleMaskIn", then 24 // at the end of shader re-assign the values of this global variable to gl_SampleMask and 25 // gl_SampleMaskIn. This to solve the problem which the non constant index is used for the unsized 26 // array problem. 27 ANGLE_NO_DISCARD bool RewriteSampleMask(TCompiler *compiler, 28 TIntermBlock *root, 29 TSymbolTable *symbolTable, 30 const TIntermTyped *numSamplesUniform); 31 32 ANGLE_NO_DISCARD bool RewriteSampleMaskIn(TCompiler *compiler, 33 TIntermBlock *root, 34 TSymbolTable *symbolTable); 35 36 } // namespace sh 37 38 #endif // COMPILER_TRANSLATOR_TREEUTIL_REWRITESAMPLEMASKVARIABLE_H_ 39