forked from flutter-team-archive/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtiled_texture_fill.frag
More file actions
32 lines (26 loc) · 886 Bytes
/
Copy pathtiled_texture_fill.frag
File metadata and controls
32 lines (26 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;
uniform FragInfo {
float texture_sampler_y_coord_scale;
float x_tile_mode;
float y_tile_mode;
float alpha;
}
frag_info;
in vec2 v_texture_coords;
out vec4 frag_color;
void main() {
frag_color =
IPSampleWithTileMode(
texture_sampler, // sampler
v_texture_coords, // texture coordinates
frag_info.texture_sampler_y_coord_scale, // y coordinate scale
frag_info.x_tile_mode, // x tile mode
frag_info.y_tile_mode // y tile mode
) *
frag_info.alpha;
}