Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ void main() {
// +--------+--------+
// | pos[2] | pos[3] |
// +--------+--------+
u16vec3 pos[TILE_SIZE * TILE_SIZE];
u16vec2 pos[TILE_SIZE * TILE_SIZE];
for (int y = 0, i = 0; y < TILE_SIZE; ++y) {
for (int x = 0; x < TILE_SIZE; ++x) {
pos[i] = u16vec3(
gpos.x * TILE_SIZE + x, gpos.y * TILE_SIZE + y, gpos.z);
pos[i] = u16vec2(
gpos.x * TILE_SIZE + x, gpos.y * TILE_SIZE + y);
i++;
}
}

// If the top left position is out of bounds, then this invocation will have
// no work to do.
if (any(greaterThanEqual(pos[0], out_limits))) {
if (any(greaterThanEqual(u16vec3(pos[0], gpos.z), out_limits))) {
return;
}

Expand Down Expand Up @@ -138,8 +138,8 @@ void main() {
}

for (int i = 0; i < TILE_SIZE * TILE_SIZE; ++i) {
if (all(lessThan(pos[i], out_limits))) {
imageStore(t_out, pos[i], op(sum[i], out_min, out_max));
if (all(lessThan(u16vec3(pos[i], gpos.z), out_limits))) {
imageStore(t_out, u16vec3(pos[i], gpos.z), op(sum[i], out_min, out_max));
}
}
}