提交 c6415e52 编写于 作者: J Joel

textures as well

上级 2ce22ef1
......@@ -7,7 +7,7 @@ import { _Math } from '../../math/Math.js';
function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {
var _videoTextures = {};
var _videoTextures = new WeakMap();
var _canvas;
//
......@@ -189,7 +189,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if ( texture.isVideoTexture ) {
delete _videoTextures[ texture.id ];
_videoTextures.delete( texture );
}
......@@ -1098,14 +1098,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
function updateVideoTexture( texture ) {
var id = texture.id;
var frame = info.render.frame;
// Check the last frame we updated the VideoTexture
if ( _videoTextures[ id ] !== frame ) {
if ( _videoTextures.get( texture ) !== frame ) {
_videoTextures[ id ] = frame;
_videoTextures.set( texture, frame );
texture.update();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册