Refactor test shader style.
This change enforces a lot more consistency. We pass const char * to
the Compile functions instead of std::string. Also fixes the
indentation of C++11 block comments to be more consistent.
Bug: angleproject:2995
Change-Id: Id6e5ea94055d8cbd420df4ea2e81b2d96cb5ce78
Reviewed-on: https://chromium-review.googlesource.com/c/1357103
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/tests/gl_tests/CopyTextureTest.cpp b/src/tests/gl_tests/CopyTextureTest.cpp
index 4ef46ff..4f1ac47 100644
--- a/src/tests/gl_tests/CopyTextureTest.cpp
+++ b/src/tests/gl_tests/CopyTextureTest.cpp
@@ -1222,7 +1222,7 @@
}
auto testOutput = [this](GLuint texture, const GLColor &expectedColor) {
- const std::string vs =
+ constexpr char kVS[] =
"#version 300 es\n"
"in vec4 position;\n"
"out vec2 texcoord;\n"
@@ -1232,7 +1232,7 @@
" texcoord = (position.xy * 0.5) + 0.5;\n"
"}\n";
- const std::string fs =
+ constexpr char kFS[] =
"#version 300 es\n"
"precision mediump float;\n"
"uniform sampler2D tex;\n"
@@ -1243,7 +1243,7 @@
" color = texture(tex, texcoord);\n"
"}\n";
- ANGLE_GL_PROGRAM(program, vs, fs);
+ ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
GLRenderbuffer rbo;
@@ -1361,7 +1361,7 @@
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_color_buffer_float"));
auto testOutput = [this](GLuint texture, const GLColor32F &expectedColor) {
- const std::string vs =
+ constexpr char kVS[] =
"#version 300 es\n"
"in vec4 position;\n"
"out vec2 texcoord;\n"
@@ -1371,7 +1371,7 @@
" texcoord = (position.xy * 0.5) + 0.5;\n"
"}\n";
- const std::string fs =
+ constexpr char kFS[] =
"#version 300 es\n"
"precision mediump float;\n"
"uniform sampler2D tex;\n"
@@ -1382,7 +1382,7 @@
" color = texture(tex, texcoord);\n"
"}\n";
- ANGLE_GL_PROGRAM(program, vs, fs);
+ ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
GLRenderbuffer rbo;
@@ -1484,7 +1484,7 @@
using GLColor32U = std::tuple<GLuint, GLuint, GLuint, GLuint>;
auto testOutput = [this](GLuint texture, const GLColor32U &expectedColor) {
- const std::string vs =
+ constexpr char kVS[] =
"#version 300 es\n"
"in vec4 position;\n"
"out vec2 texcoord;\n"
@@ -1494,7 +1494,7 @@
" texcoord = (position.xy * 0.5) + 0.5;\n"
"}\n";
- std::string fs =
+ constexpr char kFS[] =
"#version 300 es\n"
"precision mediump float;\n"
"precision mediump usampler2D;\n"
@@ -1506,7 +1506,7 @@
" color = texture(tex, texcoord);\n"
"}\n";
- ANGLE_GL_PROGRAM(program, vs, fs);
+ ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
GLRenderbuffer rbo;