Path: blob/main_old/src/tests/test_utils/ShaderCompileTreeTest.h
1693 views
//1// Copyright 2016 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// ShaderCompileTreeTest.h:6// Test that shader validation results in the correct compile status.7//89#ifndef TESTS_TEST_UTILS_SHADER_COMPILE_TREE_TEST_H_10#define TESTS_TEST_UTILS_SHADER_COMPILE_TREE_TEST_H_1112#include "GLSLANG/ShaderLang.h"13#include "angle_gl.h"14#include "compiler/translator/PoolAlloc.h"15#include "gtest/gtest.h"1617namespace sh18{1920class TIntermBlock;21class TIntermNode;22class TranslatorESSL;2324class ShaderCompileTreeTest : public testing::Test25{26public:27ShaderCompileTreeTest() : mExtraCompileOptions(0) {}2829protected:30void SetUp() override;3132void TearDown() override;3334// Return true when compilation succeeds35bool compile(const std::string &shaderString);36void compileAssumeSuccess(const std::string &shaderString);3738bool hasWarning() const;3940const std::vector<sh::ShaderVariable> &getUniforms() const;41const std::vector<sh::ShaderVariable> &getAttributes() const;4243virtual void initResources(ShBuiltInResources *resources) {}44virtual ::GLenum getShaderType() const = 0;45virtual ShShaderSpec getShaderSpec() const = 0;4647std::string mInfoLog;48ShCompileOptions mExtraCompileOptions;4950TIntermBlock *mASTRoot;5152private:53TranslatorESSL *mTranslator;5455angle::PoolAllocator mAllocator;56};5758// Returns true if the node is some kind of a zero node - either constructor or a constant union59// node.60bool IsZero(TIntermNode *node);6162} // namespace sh6364#endif // TESTS_TEST_UTILS_SHADER_COMPILE_TREE_TEST_H_656667