We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When compiling a project with typescript 5.0.2 I'm getting the following error in three places:
Argument of type '9729' is not assignable to parameter of type '9728'
https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/backgroundBlurStage.ts#L125 https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/backgroundBlurStage.ts#L133 https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/backgroundImageStage.ts#L155
The function createTexture is defined without types for magFilter and minFilter: https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/helpers/webglHelper.ts#L67
Allowed values for magFilter https://github.com/KhronosGroup/glTF/blob/main/specification/1.0/README.md#samplermagfilter
Allowed values for MinFilter https://github.com/KhronosGroup/glTF/blob/main/specification/1.0/README.md#samplerminfilter
Fix:
export function createTexture( gl: WebGL2RenderingContext, internalformat: number, width: number, height: number, minFilter: number = gl.NEAREST, magFilter: number = gl.NEAREST ) { const texture = gl.createTexture() gl.bindTexture(gl.TEXTURE_2D, texture) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter) gl.texStorage2D(gl.TEXTURE_2D, 1, internalformat, width, height) return texture }
Or
export function createTexture( gl: WebGL2RenderingContext, internalformat: number, width: number, height: number, minFilter: (WebGLRenderingContextBase['NEAREST']|WebGLRenderingContextBase['LINEAR']) = gl.NEAREST, magFilter: (WebGLRenderingContextBase['NEAREST']|WebGLRenderingContextBase['LINEAR']|WebGLRenderingContextBase['NEAREST_MIPMAP_NEAREST']|WebGLRenderingContextBase['LINEAR_MIPMAP_NEAREST']|WebGLRenderingContextBase['NEAREST_MIPMAP_LINEAR']|WebGLRenderingContextBase['LINEAR_MIPMAP_LINEAR']) = gl.NEAREST ) { const texture = gl.createTexture() gl.bindTexture(gl.TEXTURE_2D, texture) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter) gl.texStorage2D(gl.TEXTURE_2D, 1, internalformat, width, height) return texture }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When compiling a project with typescript 5.0.2 I'm getting the following error in three places:
Argument of type '9729' is not assignable to parameter of type '9728'
https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/backgroundBlurStage.ts#L125
https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/backgroundBlurStage.ts#L133
https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/backgroundImageStage.ts#L155
The function createTexture is defined without types for magFilter and minFilter:
https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/helpers/webglHelper.ts#L67
Allowed values for magFilter
https://github.com/KhronosGroup/glTF/blob/main/specification/1.0/README.md#samplermagfilter
Allowed values for MinFilter
https://github.com/KhronosGroup/glTF/blob/main/specification/1.0/README.md#samplerminfilter
Fix:
Or
The text was updated successfully, but these errors were encountered: