chromium/gpu/command_buffer/tests/gl_ext_blend_func_extended_unittest.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <GLES3/gl3.h>
#include <stdint.h>

#include <algorithm>

#include "base/command_line.h"
#include "build/build_config.h"
#include "gpu/command_buffer/service/service_utils.h"
#include "gpu/command_buffer/tests/gl_manager.h"
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include "gpu/config/gpu_test_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

#define SHADER(Src)
#define BFE_SHADER(Src)

namespace {
// Partial implementation of weight function for GLES 2 blend equation that
// is dual-source aware.
template <int factor, int index>
float Weight(float /*dst*/[4], float src[4], float src1[4]) {}

// Implementation of GLES 2 blend equation that is dual-source aware.
template <int RGBs, int RGBd, int As, int Ad>
void BlendEquationFuncAdd(float dst[4],
                          float src[4],
                          float src1[4],
                          uint8_t result[4]) {}

}  // namespace

namespace gpu {

class EXTBlendFuncExtendedTest : public testing::Test {};

TEST_F(EXTBlendFuncExtendedTest, TestMaxDualSourceDrawBuffers) {}

class EXTBlendFuncExtendedDrawTest : public testing::TestWithParam<bool> {};

TEST_P(EXTBlendFuncExtendedDrawTest, ESSL1FragColor) {}

TEST_P(EXTBlendFuncExtendedDrawTest, ESSL1FragData) {}

class EXTBlendFuncExtendedES3DrawTest : public EXTBlendFuncExtendedDrawTest {};

TEST_P(EXTBlendFuncExtendedES3DrawTest, ESSL3Var) {}

TEST_P(EXTBlendFuncExtendedES3DrawTest, ESSL3BindArrayWithSimpleName) {}

TEST_P(EXTBlendFuncExtendedES3DrawTest, ESSL3BindSimpleVarAsArrayNoBind) {}

TEST_P(EXTBlendFuncExtendedES3DrawTest, ESSL3BindArrayAsArray) {}

TEST_P(EXTBlendFuncExtendedES3DrawTest, ES3Getters) {}

// Test that tests glBindFragDataLocationEXT, glBindFragDataLocationIndexedEXT,
// glGetFragDataLocation, glGetFragDataIndexEXT work correctly with
// GLSL array output variables. The output variable can be bound by
// referring to the variable name with or without the first element array
// accessor. The getters can query location of the individual elements in
// the array. The test does not actually use the base test drawing,
// since the drivers at the time of writing do not support multiple
// buffers and dual source blending.
TEST_P(EXTBlendFuncExtendedES3DrawTest, ES3GettersArray) {}

// Test that tests glBindFragDataLocationEXT, glBindFragDataLocationIndexedEXT
// conflicts
// with GLSL output variables.
TEST_P(EXTBlendFuncExtendedES3DrawTest, ES3Conflicts) {}

// Test that tests glBindFragDataLocationEXT conflicts
// with GLSL array output variables.
TEST_P(EXTBlendFuncExtendedES3DrawTest, ES3ConflictsArray) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

}  // namespace gpu