Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getParameter(MAX_TEXTURE_MAX_ANISOTROPY_EXT) fails incorrectly on a restored WebGLContext #27

Open
WesselKroos opened this issue Feb 5, 2023 · 0 comments

Comments

@WesselKroos
Copy link

WesselKroos commented Feb 5, 2023

The first time a WebGLContext is created this goes correctly. But when a lost WebGLContext was restored by Chrome and I'm getting the MAX_TEXTURE_MAX_ANISOTROPY_EXT parameter the following error message is thrown:
error in getParameter(MAX_TEXTURE_MAX_ANISOTROPY_EXT): INVALID_ENUM

The extension is enabled because getExtension('EXT_texture_filter_anisotropic').MAX_TEXTURE_MAX_ANISOTROPY_EXT is 34047.

My code:

const tfaExt = (
  gl.getExtension('EXT_texture_filter_anisotropic') ||
  gl.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
  gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
);
if(tfaExt) {
  let max = gl.getParameter(tfaExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
}

PS: The same problem is happening with gl.texParameteri(gl.TEXTURE_2D, tfaExt.TEXTURE_MAX_ANISOTROPY_EXT, 2)) resulting in the error message: error in getParameter(MAX_TEXTURE_MAX_ANISOTROPY_EXT): INVALID_ENUM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant