Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
fix (#1858)
Browse files Browse the repository at this point in the history
  • Loading branch information
annxingyuan authored and pyu10055 committed Jul 26, 2019
1 parent 8361f6a commit 225c9b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/backends/webgl/encode_matrix_gpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class EncodeMatrixProgram implements GPGPUProgram {
int flatIndex = getFlatIndex(coords);
int offset = imod(flatIndex, 4);
flatIndex /= 4;
flatIndex = idiv(flatIndex, 4, 1.);
int r = flatIndex / ${width};
int c = imod(flatIndex, ${width});
vec2 uv = (vec2(c, r) + halfCR) / vec2(${width}.0, ${height}.0);
Expand Down
3 changes: 2 additions & 1 deletion src/backends/webgl/encode_matrix_packed_gpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export class EncodeMatrixPackedProgram implements GPGPUProgram {
flatIndex = getFlatIndex(localCoords);
offset = imod(flatIndex, 4);
flatIndex /= 4;
flatIndex = idiv(flatIndex, 4, 1.);
r = flatIndex / ${width};
c = imod(flatIndex, ${width});
uv = (vec2(c, r) + halfCR) / vec2(${width}.0, ${height}.0);
Expand Down

0 comments on commit 225c9b1

Please sign in to comment.