From 3ce9c3d021a22b6d6663d900ec3fb1698268299a Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Fri, 10 Feb 2023 17:06:23 -0800 Subject: [PATCH] [Impeller] Match position attribute name across runtime effect stages --- impeller/compiler/shader_lib/flutter/runtime_effect.glsl | 3 +++ impeller/entity/shaders/runtime_effect.vert | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/impeller/compiler/shader_lib/flutter/runtime_effect.glsl b/impeller/compiler/shader_lib/flutter/runtime_effect.glsl index 3e5740c10312c..4a06bf4553098 100644 --- a/impeller/compiler/shader_lib/flutter/runtime_effect.glsl +++ b/impeller/compiler/shader_lib/flutter/runtime_effect.glsl @@ -7,6 +7,9 @@ #if defined(IMPELLER_GRAPHICS_BACKEND) +// Note: The GLES backend uses name matching for attribute locations. This name +// must match the name of the attribute output in: +// impeller/entity/shaders/runtime_effect.vert in vec2 _fragCoord; vec2 FlutterFragCoord() { return _fragCoord; diff --git a/impeller/entity/shaders/runtime_effect.vert b/impeller/entity/shaders/runtime_effect.vert index bf69bf1ed69a7..a83fc5d41c454 100644 --- a/impeller/entity/shaders/runtime_effect.vert +++ b/impeller/entity/shaders/runtime_effect.vert @@ -10,9 +10,12 @@ uniform VertInfo { vert_info; in vec2 position; -out vec2 v_position; +// Note: The GLES backend uses name matching for attribute locations. This name +// must match the name of the attribute input in: +// impeller/compiler/shader_lib/flutter/runtime_effect.glsl +out vec2 _fragCoord; void main() { gl_Position = vert_info.mvp * vec4(position, 0.0, 1.0); - v_position = position; + _fragCoord = position; }