未验证 提交 92785481 编写于 作者: M Michael Herzog 提交者: GitHub

WebGLTextures: Fix mips gen for 3D render targets. (#22072)

上级 8fb030c0
......@@ -122,13 +122,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
}
function generateMipmap( target, texture, width, height ) {
function generateMipmap( target, texture, width, height, depth = 1 ) {
_gl.generateMipmap( target );
const textureProperties = properties.get( texture );
textureProperties.__maxMipLevel = Math.log2( Math.max( width, height ) );
textureProperties.__maxMipLevel = Math.log2( Math.max( width, height, depth ) );
}
......@@ -1230,11 +1230,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {
generateMipmap( _gl.TEXTURE_2D, texture, renderTarget.width, renderTarget.height );
generateMipmap( glTextureType, texture, renderTarget.width, renderTarget.height, renderTarget.depth );
}
state.bindTexture( _gl.TEXTURE_2D, null );
state.bindTexture( glTextureType, null );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册