File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
backends/vulkan/runtime/graph/ops/glsl Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 8
8
9
9
#version 450 core
10
10
11
+ #extension GL_EXT_shader_explicit_arithmetic_types_int16 : require
12
+
11
13
#define PRECISION ${PRECISION}
12
14
13
15
#define VEC4_T ${texel_type(DTYPE)}
14
16
15
- #define TILE_SIZE_X ${TILE_SIZE_X}
16
- #define TILE_SIZE_Y ${TILE_SIZE_Y}
17
+ #define TILE_SIZE_X uint16_t( ${TILE_SIZE_X})
18
+ #define TILE_SIZE_Y uint16_t( ${TILE_SIZE_Y})
17
19
18
20
#define op(X, A, B) ${OPERATOR}
19
21
@@ -63,11 +65,11 @@ void main() {
63
65
// +--------+--------+
64
66
// | pos[2] | pos[3] |
65
67
// +--------+--------+
66
- int pos[TILE_SIZE_X * TILE_SIZE_Y * 2 ];
67
- for (int y = 0 , i = 0 ; y < TILE_SIZE_Y; ++ y) {
68
- for (int x = 0 ; x < TILE_SIZE_X; ++ x) {
69
- pos[i * 2 ] = out_pos[0 ] * TILE_SIZE_X + x;
70
- pos[i * 2 + 1 ] = out_pos[1 ] * TILE_SIZE_Y + y;
68
+ uint16_t pos[TILE_SIZE_X * TILE_SIZE_Y * 2 ];
69
+ for (uint16_t y = uint16_t( 0 ) , i = uint16_t( 0 ) ; y < TILE_SIZE_Y; ++ y) {
70
+ for (uint16_t x = uint16_t( 0 ) ; x < TILE_SIZE_X; ++ x) {
71
+ pos[i * 2 ] = uint16_t( out_pos[0 ]) * TILE_SIZE_X + x;
72
+ pos[i * 2 + 1 ] = uint16_t( out_pos[1 ]) * TILE_SIZE_Y + y;
71
73
i++ ;
72
74
}
73
75
}
You can’t perform that action at this time.
0 commit comments