Commit d55d283c by Jamie Madill

Add a test for flat shader 'provoking vertex'.

The provoking vertex, or leading vertex, is the vertex in a triangle which produces the value that gets used for a flat-shaded triangle. Flat shading means the same value gets used for the entire triangle. It seems as though D3D and OpenGL have different definitions of which vertex is the leading/provoking one; GL says it is the *last* vertex of a primitive, while while D3D says it is the first. Additional complexity comes about from triangle strips, which switch winding order, and primitive restart, which defines new primitives in the middle of prior primitives. BUG=angleproject:754 Change-Id: If1217cba33dabf3b1e4ad13fd639d049cb16fe44 Reviewed-on: https://chromium-review.googlesource.com/309152Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f541f529
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
'<(angle_path)/src/tests/gl_tests/PbufferTest.cpp', '<(angle_path)/src/tests/gl_tests/PbufferTest.cpp',
'<(angle_path)/src/tests/gl_tests/PBOExtensionTest.cpp', '<(angle_path)/src/tests/gl_tests/PBOExtensionTest.cpp',
'<(angle_path)/src/tests/gl_tests/PointSpritesTest.cpp', '<(angle_path)/src/tests/gl_tests/PointSpritesTest.cpp',
'<(angle_path)/src/tests/gl_tests/ProvokingVertexTest.cpp',
'<(angle_path)/src/tests/gl_tests/OcclusionQueriesTest.cpp', '<(angle_path)/src/tests/gl_tests/OcclusionQueriesTest.cpp',
'<(angle_path)/src/tests/gl_tests/ProgramBinaryTest.cpp', '<(angle_path)/src/tests/gl_tests/ProgramBinaryTest.cpp',
'<(angle_path)/src/tests/gl_tests/ReadPixelsTest.cpp', '<(angle_path)/src/tests/gl_tests/ReadPixelsTest.cpp',
......
...@@ -292,6 +292,12 @@ bool ANGLETest::isNVidia() const ...@@ -292,6 +292,12 @@ bool ANGLETest::isNVidia() const
return (rendererString.find("NVIDIA") != std::string::npos); return (rendererString.find("NVIDIA") != std::string::npos);
} }
bool ANGLETest::isD3D11() const
{
std::string rendererString(reinterpret_cast<const char *>(glGetString(GL_RENDERER)));
return (rendererString.find("Direct3D11 vs_5_0") != std::string::npos);
}
EGLint ANGLETest::getPlatformRenderer() const EGLint ANGLETest::getPlatformRenderer() const
{ {
assert(mEGLWindow); assert(mEGLWindow);
......
...@@ -98,6 +98,8 @@ class ANGLETest : public ::testing::TestWithParam<angle::PlatformParameters> ...@@ -98,6 +98,8 @@ class ANGLETest : public ::testing::TestWithParam<angle::PlatformParameters>
bool isIntel() const; bool isIntel() const;
bool isAMD() const; bool isAMD() const;
bool isNVidia() const; bool isNVidia() const;
// Note: FL9_3 is explicitly *not* considered D3D11.
bool isD3D11() const;
EGLint getPlatformRenderer() const; EGLint getPlatformRenderer() const;
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment