expo/expo-three

Ignore `gl.pixelStorei` warning

Josema opened this issue · 3 comments

Josema commented

I am getting this error every time I load a texture.
LOG ABI48_0_0EXGL: gl.pixelStorei() doesn't support this parameter yet!

I load hundred of textures, is there any way to ignore or solve this issue? It makes my console.log unusable.

This fix worked for me:

<Canvas
onCreated={(state) => {
  const _gl = state.gl.getContext();
  const pixelStorei = _gl.pixelStorei.bind(_gl);
  _gl.pixelStorei = function (...args) {
    const [parameter] = args;
    switch (parameter) {
      case _gl.UNPACK_FLIP_Y_WEBGL:
        return pixelStorei(...args);
    }
  };
}}
/>
Josema commented

It works, thank you.