Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8ad3a87

Browse files
author
Jonah Williams
authored
[Impeller] Ignore warnign about shader stages not consuming outputs. (#51822)
Otherwise it really complicates runtime_effect, as we'd need two vertex shaders. Fixes flutter/flutter#145860
1 parent 404fe66 commit 8ad3a87

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

impeller/renderer/backend/vulkan/debug_report_vk.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ DebugReportVK::Result DebugReportVK::OnDebugCallback(
110110
if (data->messageIdNumber == 0x2c36905d) {
111111
return Result::kContinue;
112112
}
113+
// This is a performance warning when a fragment stage does not consume all
114+
// varyings from the vertex stage. We ignore this as we want to use a single
115+
// vertex stage for the runtime effect shader without trying to determine if
116+
// the fragment consumes it or not.
117+
if (data->messageIdNumber == 0x609A13B) {
118+
return Result::kContinue;
119+
}
113120

114121
std::vector<std::pair<std::string, std::string>> items;
115122

impeller/scene/shaders/unlit.frag

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ in vec4 v_color;
1717

1818
out vec4 frag_color;
1919

20-
float consume_unused() {
21-
return (v_position.x + v_tangent_space[0][0]) * 0.001;
22-
}
23-
2420
void main() {
2521
vec4 vertex_color = mix(vec4(1), v_color, frag_info.vertex_color_weight);
2622
frag_color = texture(base_color_texture, v_texture_coords) * vertex_color *
27-
frag_info.color +
28-
consume_unused();
23+
frag_info.color;
2924
}

0 commit comments

Comments
 (0)