// // Copyright 2019 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // ANGLE_base_vertex_base_instance.cpp: // Test for ANGLE_base_vertex_base_instance extension // #include "GLSLANG/ShaderLang.h" #include "angle_gl.h" #include "compiler/translator/tree_ops/EmulateMultiDrawShaderBuiltins.h" #include "gtest/gtest.h" #include "tests/test_utils/compiler_test.h" usingnamespacesh; class EmulateGLBaseVertexBaseInstanceTest : public MatchOutputCodeTest { … }; // Check that compilation fails if the compile option to emulate gl_BaseVertex and gl_BaseInstance // is not set TEST_F(EmulateGLBaseVertexBaseInstanceTest, RequiresEmulation) { … } // Check that compiling with emulation with gl_BaseVertex and gl_BaseInstance works TEST_F(EmulateGLBaseVertexBaseInstanceTest, CheckCompile) { … } // Check that compiling with the old extension doesn't work TEST_F(EmulateGLBaseVertexBaseInstanceTest, CheckCompileOldExtension) { … } // Check that gl_BaseVertex and gl_BaseInstance is properly emulated TEST_F(EmulateGLBaseVertexBaseInstanceTest, EmulatesUniform) { … } // Check that a user-defined "gl_BaseVertex" or "gl_BaseInstance" is not permitted TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID) { … } // gl_BaseVertex and gl_BaseInstance are translated to angle_BaseVertex and angle_BaseInstance // internally. Check that a user-defined angle_BaseVertex or angle_BaseInstance is permitted TEST_F(EmulateGLBaseVertexBaseInstanceTest, AllowsUserDefinedANGLEDrawID) { … }