Skip to content

Commit 17ea956

Browse files
author
Jonah Williams
authored
[Impeller] mirror tile mode requires highp for Adreno. (flutter#163066)
Fixes flutter#162891 On Adreno GPU the mediump precision causes mirror to drop this number to zero.
1 parent e924e8c commit 17ea956

File tree

2 files changed

+89
-91
lines changed

2 files changed

+89
-91
lines changed

engine/src/flutter/impeller/compiler/shader_lib/impeller/texture.glsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ vec4 IPSampleLinear(sampler2D texture_sampler,
4545
/// returned. In all other cases, a value between 0 and 1 is returned by tiling
4646
/// `t`.
4747
/// When `t` is between [0 to 1), the original unchanged `t` is always returned.
48-
float IPFloatTile(float t, float tile_mode) {
48+
highp float IPFloatTile(highp float t, float tile_mode) {
4949
if (tile_mode == kTileModeClamp) {
5050
t = clamp(t, 0.0, 1.0);
5151
} else if (tile_mode == kTileModeRepeat) {
5252
t = fract(t);
5353
} else if (tile_mode == kTileModeMirror) {
54-
float t1 = t - 1;
55-
float t2 = t1 - 2 * floor(t1 * 0.5) - 1;
54+
highp float t1 = t - 1;
55+
highp float t2 = t1 - 2 * floor(t1 * 0.5) - 1;
5656
t = abs(t2);
5757
}
5858
return t;

0 commit comments

Comments
 (0)