chromium/third_party/angle/src/tests/gl_tests/SimpleOperationTest.cpp

//
// Copyright 2015 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.
//
// SimpleOperationTest:
//   Basic GL commands such as linking a program, initializing a buffer, etc.

#include "test_utils/ANGLETest.h"

#include <vector>

#include "test_utils/gl_raii.h"
#include "util/EGLWindow.h"
#include "util/random_utils.h"

usingnamespaceangle;

namespace
{
constexpr char kBasicVertexShader[] =;

constexpr char kGreenFragmentShader[] =;

class SimpleOperationTest : public ANGLETest<>
{};

class SimpleOperationTest31 : public SimpleOperationTest
{};

void SimpleOperationTest::verifyBuffer(const std::vector<uint8_t> &data, GLenum binding)
{}

// Validates if culling rasterization states work. Simply draws a quad with
// cull face enabled and make sure we still render correctly.
TEST_P(SimpleOperationTest, CullFaceEnabledState)
{}

// Validates if culling rasterization states work. Simply draws a quad with
// cull face enabled with cullface front and make sure the face have not been rendered.
TEST_P(SimpleOperationTest, CullFaceFrontEnabledState)
{}

// Validates if blending render states work. Simply draws twice and verify the color have been
// added in the final output.
TEST_P(SimpleOperationTest, BlendingRenderState)
{}

// Tests getting the GL_BLEND_EQUATION integer
TEST_P(SimpleOperationTest, BlendEquationGetInteger)
{}

TEST_P(SimpleOperationTest, CompileVertexShader)
{}

TEST_P(SimpleOperationTest, CompileFragmentShaderSingleVaryingInput)
{}

// Covers a simple bug in Vulkan to do with dependencies between the Surface and the default
// Framebuffer.
TEST_P(SimpleOperationTest, ClearAndSwap)
{}

// Simple case of setting a scissor, enabled or disabled.
TEST_P(SimpleOperationTest, ScissorTest)
{}

TEST_P(SimpleOperationTest, LinkProgramShadersNoInputs)
{}

TEST_P(SimpleOperationTest, LinkProgramWithUniforms)
{}

TEST_P(SimpleOperationTest, LinkProgramWithAttributes)
{}

TEST_P(SimpleOperationTest, BufferDataWithData)
{}

TEST_P(SimpleOperationTest, BufferDataWithNoData)
{}

TEST_P(SimpleOperationTest, BufferSubData)
{}

// Simple quad test.
TEST_P(SimpleOperationTest, DrawQuad)
{}

// Simple quad test with data in client memory, not vertex buffer.
TEST_P(SimpleOperationTest, DrawQuadFromClientMemory)
{}

// Simple double quad test.
TEST_P(SimpleOperationTest, DrawQuadTwice)
{}

// Simple line test.
TEST_P(SimpleOperationTest, DrawLine)
{}

// Simple line test that will use a very large offset in the vertex attributes.
TEST_P(SimpleOperationTest, DrawLineWithLargeAttribPointerOffset)
{}

// Simple line strip test.
TEST_P(SimpleOperationTest, DrawLineStrip)
{}

class TriangleFanDrawTest : public SimpleOperationTest
{};

// Simple triangle fans test.
TEST_P(TriangleFanDrawTest, DrawTriangleFan)
{}

// Triangle fans test with index buffer.
TEST_P(TriangleFanDrawTest, DrawTriangleFanElements)
{}

// Triangle fans test with primitive restart index at the middle.
TEST_P(TriangleFanDrawTest, DrawTriangleFanPrimitiveRestartAtMiddle)
{}

// Triangle fans test with primitive restart at begin.
TEST_P(TriangleFanDrawTest, DrawTriangleFanPrimitiveRestartAtBegin)
{}

// Triangle fans test with primitive restart at end.
TEST_P(TriangleFanDrawTest, DrawTriangleFanPrimitiveRestartAtEnd)
{}

// Triangle fans test with primitive restart enabled, but no indexed draw.
TEST_P(TriangleFanDrawTest, DrawTriangleFanPrimitiveRestartNonIndexedDraw)
{}

// Simple repeated draw and swap test.
TEST_P(SimpleOperationTest, DrawQuadAndSwap)
{}

// Simple indexed quad test.
TEST_P(SimpleOperationTest, DrawIndexedQuad)
{}

// Simple repeated indexed draw and swap test.
TEST_P(SimpleOperationTest, DrawIndexedQuadAndSwap)
{}

// Draw with a fragment uniform.
TEST_P(SimpleOperationTest, DrawQuadWithFragmentUniform)
{}

// Draw with a vertex uniform.
TEST_P(SimpleOperationTest, DrawQuadWithVertexUniform)
{}

// Draw with two uniforms.
TEST_P(SimpleOperationTest, DrawQuadWithTwoUniforms)
{}

// Tests a shader program with more than one vertex attribute, with vertex buffers.
TEST_P(SimpleOperationTest, ThreeVertexAttributes)
{}

// Creates a 2D texture, no other operations.
TEST_P(SimpleOperationTest, CreateTexture2DNoData)
{}

// Creates a 2D texture, no other operations.
TEST_P(SimpleOperationTest, CreateTexture2DWithData)
{}

// Creates a cube texture, no other operations.
TEST_P(SimpleOperationTest, CreateTextureCubeNoData)
{}

// Creates a cube texture, no other operations.
TEST_P(SimpleOperationTest, CreateTextureCubeWithData)
{}

// Creates a program with a texture.
TEST_P(SimpleOperationTest, LinkProgramWithTexture)
{}

// Creates a program with a 2D texture and renders with it.
TEST_P(SimpleOperationTest, DrawWith2DTexture)
{}

template <typename T>
void SimpleOperationTest::testDrawElementsLineLoopUsingClientSideMemory(GLenum indexType,
                                                                        int windowWidth,
                                                                        int windowHeight)
{}

// Draw a line loop using a drawElement call and client side memory.
TEST_P(SimpleOperationTest, DrawElementsLineLoopUsingUShortClientSideMemory)
{}

// Draw a line loop using a drawElement call and client side memory.
TEST_P(SimpleOperationTest, DrawElementsLineLoopUsingUByteClientSideMemory)
{}

// Creates a program with a cube texture and renders with it.
TEST_P(SimpleOperationTest, DrawWithCubeTexture)
{}

// Tests rendering to a user framebuffer.
TEST_P(SimpleOperationTest, RenderToTexture)
{}

// Create a simple basic Renderbuffer.
TEST_P(SimpleOperationTest, CreateRenderbuffer)
{}

// Render to a simple color Renderbuffer.
TEST_P(SimpleOperationTest, RenderbufferAttachment)
{}

// Tests that using desktop GL_QUADS/GL_POLYGONS enums generate the correct error.
TEST_P(SimpleOperationTest, PrimitiveModeNegativeTest)
{}

// Tests that using GL_LINES_ADJACENCY should not crash the app even if the backend doesn't support
// LinesAdjacent mode.
// This is to verify that the crash in crbug.com/1457840 won't happen.
TEST_P(SimpleOperationTest, PrimitiveModeLinesAdjacentNegativeTest)
{}

// Tests all primitive modes, including some invalid ones, with a vertex shader that receives
// no data for its vertex attributes (constant values). This is a port of the test case from
// crbug.com/1457840, exercising slightly different code paths.
TEST_P(SimpleOperationTest, DrawsWithNoAttributeData)
{}

// Verify we don't crash when attempting to draw using GL_TRIANGLES without a program bound.
TEST_P(SimpleOperationTest31, DrawTrianglesWithoutProgramBound)
{}

// Verify we don't crash when attempting to draw using GL_LINE_STRIP_ADJACENCY without a program
// bound.
TEST_P(SimpleOperationTest31, DrawLineStripAdjacencyWithoutProgramBound)
{}

// Verify instanceCount == 0 is no-op
TEST_P(SimpleOperationTest, DrawArraysZeroInstanceCountIsNoOp)
{}

// Verify instanceCount == 0 is no-op
TEST_P(SimpleOperationTest, DrawElementsZeroInstanceCountIsNoOp)
{}

// Test that sample coverage does not affect single sample rendering
TEST_P(SimpleOperationTest, DrawSingleSampleWithCoverage)
{}

// Test that sample coverage affects multi sample rendering with only one sample
TEST_P(SimpleOperationTest, DrawSingleMultiSampleWithCoverage)
{}

// Test that alpha-to-coverage does not affect single-sampled rendering
TEST_P(SimpleOperationTest, DrawSingleSampleWithAlphaToCoverage)
{}

// Test that alpha-to-coverage affects multisampled rendering with only one sample
TEST_P(SimpleOperationTest, DrawSingleMultiSampleWithAlphaToCoverage)
{}

// Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against.
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND();

ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND();

ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND_ES31();

}  // namespace