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

Commit d02b15e

Browse files
[Impeller] Fix text jitter on Vulkan. (#42792)
Fixes flutter/flutter#128624
1 parent 3b560aa commit d02b15e

File tree

4 files changed

+58
-57
lines changed

4 files changed

+58
-57
lines changed

impeller/entity/shaders/glyph_atlas.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ uniform FragInfo {
1111
}
1212
frag_info;
1313

14-
in vec2 v_uv;
14+
in highp vec2 v_uv;
1515

1616
out f16vec4 frag_color;
1717

impeller/entity/shaders/glyph_atlas.vert

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33
// found in the LICENSE file.
44

55
#include <impeller/transform.glsl>
6-
#include <impeller/types.glsl>
6+
7+
precision highp float;
78

89
uniform FrameInfo {
9-
mat4 mvp;
10-
mat4 entity_transform;
11-
vec2 atlas_size;
12-
vec2 offset;
10+
highp mat4 mvp;
11+
highp mat4 entity_transform;
12+
highp vec2 atlas_size;
13+
highp vec2 offset;
1314
float is_translation_scale;
1415
}
1516
frame_info;
1617

1718
// XYWH.
18-
in vec4 atlas_glyph_bounds;
19+
in highp vec4 atlas_glyph_bounds;
1920
// XYWH
20-
in vec4 glyph_bounds;
21+
in highp vec4 glyph_bounds;
2122

22-
in vec2 unit_position;
23+
in highp vec2 unit_position;
2324
in highp vec2 glyph_position;
2425

2526
out highp vec2 v_uv;

impeller/entity/shaders/glyph_atlas_color.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ uniform FragInfo {
1111
}
1212
frag_info;
1313

14-
in vec2 v_uv;
14+
in highp vec2 v_uv;
1515

1616
out f16vec4 frag_color;
1717

impeller/tools/malioc.json

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7557,16 +7557,16 @@
75577557
"type": "Vertex",
75587558
"variants": {
75597559
"Position": {
7560-
"fp16_arithmetic": 57,
7560+
"fp16_arithmetic": 0,
75617561
"has_stack_spilling": false,
75627562
"performance": {
75637563
"longest_path_bound_pipelines": [
75647564
"load_store"
75657565
],
75667566
"longest_path_cycles": [
7567-
0.359375,
7568-
0.359375,
7569-
0.171875,
7567+
0.515625,
7568+
0.515625,
7569+
0.140625,
75707570
0.0,
75717571
4.0,
75727572
0.0
@@ -7583,9 +7583,9 @@
75837583
"load_store"
75847584
],
75857585
"shortest_path_cycles": [
7586-
0.375,
7587-
0.375,
7588-
0.078125,
7586+
0.484375,
7587+
0.484375,
7588+
0.03125,
75897589
0.0,
75907590
4.0,
75917591
0.0
@@ -7594,30 +7594,30 @@
75947594
"load_store"
75957595
],
75967596
"total_cycles": [
7597-
0.59375,
7598-
0.59375,
7599-
0.1875,
7597+
0.737500011920929,
7598+
0.737500011920929,
7599+
0.15625,
76007600
0.0,
76017601
4.0,
76027602
0.0
76037603
]
76047604
},
76057605
"stack_spill_bytes": 0,
76067606
"thread_occupancy": 100,
7607-
"uniform_registers_used": 30,
7607+
"uniform_registers_used": 44,
76087608
"work_registers_used": 32
76097609
},
76107610
"Varying": {
7611-
"fp16_arithmetic": 100,
7611+
"fp16_arithmetic": 0,
76127612
"has_stack_spilling": false,
76137613
"performance": {
76147614
"longest_path_bound_pipelines": [
76157615
"load_store"
76167616
],
76177617
"longest_path_cycles": [
7618-
0.078125,
7619-
0.078125,
7620-
0.03125,
7618+
0.15625,
7619+
0.15625,
7620+
0.0,
76217621
0.0,
76227622
4.0,
76237623
0.0
@@ -7634,9 +7634,9 @@
76347634
"load_store"
76357635
],
76367636
"shortest_path_cycles": [
7637-
0.078125,
7638-
0.078125,
7639-
0.03125,
7637+
0.15625,
7638+
0.15625,
7639+
0.0,
76407640
0.0,
76417641
4.0,
76427642
0.0
@@ -7645,18 +7645,18 @@
76457645
"load_store"
76467646
],
76477647
"total_cycles": [
7648-
0.078125,
7649-
0.078125,
7650-
0.03125,
7648+
0.15625,
7649+
0.15625,
7650+
0.0,
76517651
0.0,
76527652
4.0,
76537653
0.0
76547654
]
76557655
},
76567656
"stack_spill_bytes": 0,
76577657
"thread_occupancy": 100,
7658-
"uniform_registers_used": 12,
7659-
"work_registers_used": 9
7658+
"uniform_registers_used": 14,
7659+
"work_registers_used": 11
76607660
}
76617661
}
76627662
},
@@ -7670,10 +7670,10 @@
76707670
"has_stack_spilling": false,
76717671
"performance": {
76727672
"longest_path_bound_pipelines": [
7673-
"arithmetic"
7673+
"load_store"
76747674
],
76757675
"longest_path_cycles": [
7676-
7.260000228881836,
7676+
6.929999828338623,
76777677
7.0,
76787678
0.0
76797679
],
@@ -7686,21 +7686,21 @@
76867686
"load_store"
76877687
],
76887688
"shortest_path_cycles": [
7689-
6.269999980926514,
7689+
5.940000057220459,
76907690
7.0,
76917691
0.0
76927692
],
76937693
"total_bound_pipelines": [
76947694
"arithmetic"
76957695
],
76967696
"total_cycles": [
7697-
9.333333015441895,
7697+
9.0,
76987698
7.0,
76997699
0.0
77007700
]
77017701
},
77027702
"thread_occupancy": 100,
7703-
"uniform_registers_used": 7,
7703+
"uniform_registers_used": 11,
77047704
"work_registers_used": 3
77057705
}
77067706
}
@@ -10964,16 +10964,16 @@
1096410964
"type": "Vertex",
1096510965
"variants": {
1096610966
"Position": {
10967-
"fp16_arithmetic": 51,
10967+
"fp16_arithmetic": 0,
1096810968
"has_stack_spilling": false,
1096910969
"performance": {
1097010970
"longest_path_bound_pipelines": [
1097110971
"load_store"
1097210972
],
1097310973
"longest_path_cycles": [
10974-
0.328125,
10975-
0.328125,
10976-
0.15625,
10974+
0.5,
10975+
0.5,
10976+
0.140625,
1097710977
0.0,
1097810978
4.0,
1097910979
0.0
@@ -10990,9 +10990,9 @@
1099010990
"load_store"
1099110991
],
1099210992
"shortest_path_cycles": [
10993-
0.34375,
10994-
0.34375,
10995-
0.09375,
10993+
0.46875,
10994+
0.46875,
10995+
0.03125,
1099610996
0.0,
1099710997
4.0,
1099810998
0.0
@@ -11001,29 +11001,29 @@
1100111001
"load_store"
1100211002
],
1100311003
"total_cycles": [
11004-
0.546875,
11005-
0.546875,
11006-
0.171875,
11004+
0.71875,
11005+
0.71875,
11006+
0.15625,
1100711007
0.0,
1100811008
4.0,
1100911009
0.0
1101011010
]
1101111011
},
1101211012
"stack_spill_bytes": 0,
1101311013
"thread_occupancy": 100,
11014-
"uniform_registers_used": 40,
11014+
"uniform_registers_used": 52,
1101511015
"work_registers_used": 32
1101611016
},
1101711017
"Varying": {
11018-
"fp16_arithmetic": 66,
11018+
"fp16_arithmetic": 0,
1101911019
"has_stack_spilling": false,
1102011020
"performance": {
1102111021
"longest_path_bound_pipelines": [
1102211022
"load_store"
1102311023
],
1102411024
"longest_path_cycles": [
11025-
0.09375,
11026-
0.09375,
11025+
0.15625,
11026+
0.15625,
1102711027
0.0,
1102811028
0.0,
1102911029
4.0,
@@ -11041,8 +11041,8 @@
1104111041
"load_store"
1104211042
],
1104311043
"shortest_path_cycles": [
11044-
0.09375,
11045-
0.09375,
11044+
0.15625,
11045+
0.15625,
1104611046
0.0,
1104711047
0.0,
1104811048
4.0,
@@ -11052,8 +11052,8 @@
1105211052
"load_store"
1105311053
],
1105411054
"total_cycles": [
11055-
0.09375,
11056-
0.09375,
11055+
0.15625,
11056+
0.15625,
1105711057
0.0,
1105811058
0.0,
1105911059
4.0,
@@ -11062,7 +11062,7 @@
1106211062
},
1106311063
"stack_spill_bytes": 0,
1106411064
"thread_occupancy": 100,
11065-
"uniform_registers_used": 34,
11065+
"uniform_registers_used": 44,
1106611066
"work_registers_used": 11
1106711067
}
1106811068
}

0 commit comments

Comments
 (0)