mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-03 14:09:33 +03:00
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>
This commit is contained in:
@@ -39,9 +39,8 @@ class PostSubBufferSample : public SampleApplication
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::string vs = SHADER_SOURCE
|
||||
(
|
||||
uniform mat4 u_mvpMatrix;
|
||||
const std::string vs =
|
||||
R"(uniform mat4 u_mvpMatrix;
|
||||
attribute vec4 a_position;
|
||||
attribute vec2 a_texcoord;
|
||||
varying vec2 v_texcoord;
|
||||
@@ -49,18 +48,15 @@ class PostSubBufferSample : public SampleApplication
|
||||
{
|
||||
gl_Position = u_mvpMatrix * a_position;
|
||||
v_texcoord = a_texcoord;
|
||||
}
|
||||
);
|
||||
})";
|
||||
|
||||
const std::string fs = SHADER_SOURCE
|
||||
(
|
||||
precision mediump float;
|
||||
const std::string fs =
|
||||
R"(precision mediump float;
|
||||
varying vec2 v_texcoord;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(v_texcoord.x, v_texcoord.y, 1.0, 1.0);
|
||||
}
|
||||
);
|
||||
})";
|
||||
|
||||
mProgram = CompileProgram(vs, fs);
|
||||
if (!mProgram)
|
||||
|
||||
Reference in New Issue
Block a user