Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/src/tests/compiler_tests/GLSLCompatibilityOutput_test.cpp
1693 views
1
//
2
// Copyright 2016 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
// GLSLCompatibilityOutputTest.cpp
7
// Test compiler output for glsl compatibility mode
8
//
9
10
#include "GLSLANG/ShaderLang.h"
11
#include "angle_gl.h"
12
#include "gtest/gtest.h"
13
#include "tests/test_utils/compiler_test.h"
14
15
using namespace sh;
16
17
class GLSLCompatibilityOutputTest : public MatchOutputCodeTest
18
{
19
public:
20
GLSLCompatibilityOutputTest()
21
: MatchOutputCodeTest(GL_VERTEX_SHADER, SH_VARIABLES, SH_GLSL_COMPATIBILITY_OUTPUT)
22
{}
23
};
24
25
// Verify gl_Position is written when compiling in compatibility mode
26
TEST_F(GLSLCompatibilityOutputTest, GLPositionWrittenTest)
27
{
28
const std::string &shaderString =
29
"precision mediump float;\n"
30
"void main() {\n"
31
"}";
32
compile(shaderString);
33
EXPECT_TRUE(foundInCode("gl_Position"));
34
}
35
36