From b12697241bf6a540e0c304d8e332e7cc7aa69766 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..65fcce6df1be1 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 GLSL backend uses name matching for attribute locations, and so +// 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..83335434c79ca 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 GLSL backend uses name matching for attribute locations, and so +// 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; }