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

Conversation

annxingyuan
Copy link
Collaborator

@annxingyuan annxingyuan commented Jul 26, 2019

This fixes the posenet demo for WeChat miniapps.

To see the logs from the Cloud Build CI, please join either
our discussion
or announcement mailing list.


This change is Reviewable

@annxingyuan annxingyuan requested review from dsmilkov and pyu10055 July 26, 2019 21:06
@annxingyuan annxingyuan self-assigned this Jul 26, 2019
Copy link
Contributor

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @annxingyuan and @dsmilkov)


src/backends/webgl/encode_matrix_gpu.ts, line 48 at r1 (raw file):

        int offset = imod(flatIndex, 4);

        flatIndex = idiv(flatIndex, 4, 1.);

if you look at the definition of idiv:

int idiv(int a, int b, float sign) {
    int res = a / b;
    int mod = a % b;
    if (sign < 0. && mod != 0) {
      res -= 1;
    }
    return res;
  }

and given that the sign is 1, it effectively translates to:

int idiv(int a, int b, float sign) {
    int res = a / b;
    return res;
 }

so there is only two possibilities:

  • either the /= operator is the culprit
  • or the 4 needs to be explicitly wrapped as an int, that is flatIndex /= int(4);

Can you test those two possibilities when you get a chance? It would be good to know which one it is so we can defend other parts of the glsl code as well.

@pyu10055
Copy link
Collaborator

pyu10055 commented Jul 27, 2019

@dsmilkov @annxingyuan good analysis, I just verified it is the /= problem.
flatIndex = flatIndex / 4 works as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants