// // 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. // // Some of the pointsprite tests below were ported from Khronos WebGL // conformance test suite. #include "test_utils/ANGLETest.h" #include "test_utils/gl_raii.h" #include <cmath> usingnamespaceangle; constexpr char kVertexShaderSource[] = …; constexpr GLfloat kMinMaxPointSize = …; class PointSpritesTest : public ANGLETest<> { … }; // Checks gl_PointCoord and gl_PointSize // https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/variables/gl-pointcoord.html TEST_P(PointSpritesTest, PointCoordAndPointSizeCompliance) { … } // Checks gl_PointCoord and gl_PointSize, but use the gl_PointCoord inside a function. // In Vulkan, we need to inject some code into the shader to flip the Y coordinate, and we // need to make sure this code injection works even if someone uses gl_PointCoord outside the // main function. TEST_P(PointSpritesTest, UsingPointCoordInsideFunction) { … } // Verify that drawing a point without enabling any attributes succeeds // https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-no-attributes.html TEST_P(PointSpritesTest, PointWithoutAttributesCompliance) { … } // This is a regression test for a graphics driver bug affecting end caps on roads in MapsGL // https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html TEST_P(PointSpritesTest, PointCoordRegressionTest) { … } // Verify GL_VERTEX_PROGRAM_POINT_SIZE is enabled // https://www.khronos.org/registry/webgl/sdk/tests/conformance/rendering/point-size.html TEST_P(PointSpritesTest, PointSizeEnabledCompliance) { … } // Verify that rendering works correctly when gl_PointSize is declared in a shader but isn't used TEST_P(PointSpritesTest, PointSizeDeclaredButUnused) { … } // Test to cover a bug where the D3D11 rasterizer state would not be update when switching between // draw types. This causes the cull face to potentially be incorrect when drawing emulated point // spites. TEST_P(PointSpritesTest, PointSpriteAlternatingDrawTypes) { … } // This checks for an NVIDIA driver bug where points larger than the maximum reported point size can // be drawn. Point size should be clamped to the point size range as specified in GLES 3.0.5 section // 3.4. TEST_P(PointSpritesTest, PointSizeAboveMaxIsClamped) { … } // Use this to select which configurations (e.g. which renderer, which GLES // major version) these tests should be run against. // // We test on D3D11 9_3 because the existing D3D11 PointSprite implementation // uses Geometry Shaders which are not supported for 9_3. // D3D9 and D3D11 are also tested to ensure no regressions. ANGLE_INSTANTIATE_TEST_ES2_AND(…);