xref: /aosp_15_r20/external/angle/src/compiler/translator/null/TranslatorNULL.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2024 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 
7 #ifndef COMPILER_TRANSLATOR_NULL_TRANSLATORNULL_H_
8 #define COMPILER_TRANSLATOR_NULL_TRANSLATORNULL_H_
9 
10 #include "compiler/translator/Compiler.h"
11 
12 namespace sh
13 {
14 
15 class TranslatorNULL : public TCompiler
16 {
17   public:
TranslatorNULL(sh::GLenum type,ShShaderSpec spec)18     TranslatorNULL(sh::GLenum type, ShShaderSpec spec) : TCompiler(type, spec, SH_NULL_OUTPUT) {}
19 
20   protected:
initBuiltInFunctionEmulator(BuiltInFunctionEmulator * emu,const ShCompileOptions & compileOptions)21     void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
22                                      const ShCompileOptions &compileOptions) override
23     {}
24 
translate(TIntermBlock * root,const ShCompileOptions & compileOptions,PerformanceDiagnostics * perfDiagnostics)25     [[nodiscard]] bool translate(TIntermBlock *root,
26                                  const ShCompileOptions &compileOptions,
27                                  PerformanceDiagnostics *perfDiagnostics) override
28     {
29         getInfoSink().obj << "\n";
30         return true;
31     }
32 
shouldFlattenPragmaStdglInvariantAll()33     bool shouldFlattenPragmaStdglInvariantAll() override { return false; }
34 };
35 
36 }  // namespace sh
37 
38 #endif  // COMPILER_TRANSLATOR_NULL_TRANSLATORNULL_H_
39