Use C++11 raw string literals instead of SHADER_SOURCE macro
This is better in many ways:
1. It doesn't confuse clang format
2. \n doesn't need to be included after preprocessor directives like
the version directive.
3. It's using built-in functionality instead of something custom.
Raw string literals should be the preferred way to include shader
source in C++ files going forward.
BUG=angleproject:2157
TEST=angle_end2end_tests
Change-Id: I8b236a6e2d5c25d920297e5bc5b5b143eddeba1f
Reviewed-on: https://chromium-review.googlesource.com/671046
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/tests/gl_tests/IndexedPointsTest.cpp b/src/tests/gl_tests/IndexedPointsTest.cpp
index 4858f20..9199947 100644
--- a/src/tests/gl_tests/IndexedPointsTest.cpp
+++ b/src/tests/gl_tests/IndexedPointsTest.cpp
@@ -32,34 +32,45 @@
ANGLETest::SetUp();
const std::string vertexShaderSource =
- SHADER_SOURCE(precision highp float; attribute vec2 position;
+ R"(precision highp float;
+ attribute vec2 position;
- void main() {
- gl_PointSize = 5.0;
- gl_Position = vec4(position, 0.0, 1.0);
- });
+ void main() {
+ gl_PointSize = 5.0;
+ gl_Position = vec4(position, 0.0, 1.0);
+ })";
const std::string fragmentShaderSource =
- SHADER_SOURCE(precision highp float;
+ R"(precision highp float;
- void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); });
+ void main()
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ })";
mProgram = CompileProgram(vertexShaderSource, fragmentShaderSource);
ASSERT_NE(0u, mProgram);
const std::string vertexShaderSource2 =
- SHADER_SOURCE(precision highp float; attribute vec2 position; attribute vec4 color;
- varying vec4 vcolor;
+ R"(precision highp float;
+ attribute vec2 position;
+ attribute vec4 color;
+ varying vec4 vcolor;
- void main() {
- gl_PointSize = 5.0;
- gl_Position = vec4(position, 0.0, 1.0);
- vcolor = color;
- });
+ void main() {
+ gl_PointSize = 5.0;
+ gl_Position = vec4(position, 0.0, 1.0);
+ vcolor = color;
+ })";
const std::string fragmentShaderSource2 =
- SHADER_SOURCE(precision highp float; varying vec4 vcolor;
- void main() { gl_FragColor = vec4(vcolor.xyz, 1.0); });
+ R"(precision highp float;
+ varying vec4 vcolor;
+
+ void main()
+ {
+ gl_FragColor = vec4(vcolor.xyz, 1.0);
+ })";
mVertexWithColorBufferProgram = CompileProgram(vertexShaderSource2, fragmentShaderSource2);
ASSERT_NE(0u, mVertexWithColorBufferProgram);