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/BufferDataTest.cpp b/src/tests/gl_tests/BufferDataTest.cpp
index e63b5b2..456b1fc 100644
--- a/src/tests/gl_tests/BufferDataTest.cpp
+++ b/src/tests/gl_tests/BufferDataTest.cpp
@@ -35,27 +35,23 @@
{
ANGLETest::SetUp();
- const char * vsSource = SHADER_SOURCE
- (
- attribute vec4 position;
+ const char *vsSource =
+ R"(attribute vec4 position;
attribute float in_attrib;
varying float v_attrib;
void main()
{
v_attrib = in_attrib;
gl_Position = position;
- }
- );
+ })";
- const char * fsSource = SHADER_SOURCE
- (
- precision mediump float;
+ const char *fsSource =
+ R"(precision mediump float;
varying float v_attrib;
void main()
{
gl_FragColor = vec4(v_attrib, 0, 0, 1);
- }
- );
+ })";
glGenBuffers(1, &mBuffer);
ASSERT_NE(mBuffer, 0U);
@@ -253,27 +249,23 @@
{
ANGLETest::SetUp();
- const char * vsSource = SHADER_SOURCE
- (
- attribute vec3 in_attrib;
+ const char *vsSource =
+ R"(attribute vec3 in_attrib;
varying vec3 v_attrib;
void main()
{
v_attrib = in_attrib;
gl_Position = vec4(0.0, 0.0, 0.5, 1.0);
gl_PointSize = 100.0;
- }
- );
+ })";
- const char * fsSource = SHADER_SOURCE
- (
- precision mediump float;
+ const char *fsSource =
+ R"(precision mediump float;
varying vec3 v_attrib;
void main()
{
gl_FragColor = vec4(v_attrib, 1);
- }
- );
+ })";
glGenBuffers(2, mBuffers);
ASSERT_NE(mBuffers[0], 0U);