1 // 2 // Copyright 2002 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 // Scalarize vector and matrix constructor args, so that vectors built from components don't have 7 // matrix arguments, and matrices built from components don't have vector arguments. This avoids 8 // driver bugs around vector and matrix constructors. 9 // 10 11 #ifndef COMPILER_TRANSLATOR_TREEOPS_GLSL_SCALARIZEVECANDMATCONSTRUCTORARGS_H_ 12 #define COMPILER_TRANSLATOR_TREEOPS_GLSL_SCALARIZEVECANDMATCONSTRUCTORARGS_H_ 13 14 #include "GLSLANG/ShaderLang.h" 15 #include "common/angleutils.h" 16 #include "common/debug.h" 17 18 namespace sh 19 { 20 class TCompiler; 21 class TIntermBlock; 22 class TSymbolTable; 23 24 #ifdef ANGLE_ENABLE_GLSL 25 [[nodiscard]] bool ScalarizeVecAndMatConstructorArgs(TCompiler *compiler, 26 TIntermBlock *root, 27 TSymbolTable *symbolTable); 28 #else ScalarizeVecAndMatConstructorArgs(TCompiler * compiler,TIntermBlock * root,TSymbolTable * symbolTable)29[[nodiscard]] ANGLE_INLINE bool ScalarizeVecAndMatConstructorArgs(TCompiler *compiler, 30 TIntermBlock *root, 31 TSymbolTable *symbolTable) 32 { 33 UNREACHABLE(); 34 return false; 35 } 36 #endif 37 38 } // namespace sh 39 40 #endif // COMPILER_TRANSLATOR_TREEOPS_GLSL_SCALARIZEVECANDMATCONSTRUCTORARGS_H_ 41