Path: blob/main_old/src/tests/compiler_tests/NV_draw_buffers_test.cpp
1693 views
//1// Copyright 2014 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// NV_draw_buffers_test.cpp:6// Test for NV_draw_buffers setting7//89#include "GLSLANG/ShaderLang.h"10#include "angle_gl.h"11#include "gtest/gtest.h"12#include "tests/test_utils/compiler_test.h"1314using namespace sh;1516class NVDrawBuffersTest : public MatchOutputCodeTest17{18public:19NVDrawBuffersTest() : MatchOutputCodeTest(GL_FRAGMENT_SHADER, 0, SH_ESSL_OUTPUT)20{21ShBuiltInResources *resources = getResources();22resources->MaxDrawBuffers = 8;23resources->EXT_draw_buffers = 1;24resources->NV_draw_buffers = 1;25}26};2728TEST_F(NVDrawBuffersTest, NVDrawBuffers)29{30const std::string &shaderString =31"#extension GL_EXT_draw_buffers : require\n"32"precision mediump float;\n"33"void main() {\n"34" gl_FragData[0] = vec4(1.0);\n"35" gl_FragData[1] = vec4(0.0);\n"36"}\n";37compile(shaderString);38ASSERT_TRUE(foundInCode("GL_NV_draw_buffers"));39ASSERT_FALSE(foundInCode("GL_EXT_draw_buffers"));40}414243