Closed Zaitsev closed 4 years ago
When creating TEXTURE_2D_ARRAY textures with createTextures and src is TypedArray instance, for ex:
TEXTURE_2D_ARRAY
u_y_data: { target : gl.TEXTURE_2D_ARRAY, src : y_data_tex_f, // Typed array like Uint16Array depth : Layers, height : 1, width : Width, },
I've got WebGL:INVALID_ENUM: texImage2D: invalid texture target I found a workaround : patch function setTextureFromArray(gl, tex, src, options)
INVALID_ENUM: texImage2D: invalid texture target
function setTextureFromArray(gl, tex, src, options)
} else if (target === gl.TEXTURE_3D || target === gl.TEXTURE_2D_ARRAY) { gl.texImage3D(target, level, internalFormat, width, height, depth, 0, format, type, src); } else {
I'm not sure I did it right....
Thanks. I think that's correct
https://github.com/greggman/twgl.js/commit/6450935a8d10b9fc7790c9d68f70e86f57e53f1f
When creating
TEXTURE_2D_ARRAY
textures with createTextures and src is TypedArray instance, for ex:I've got WebGL:
INVALID_ENUM: texImage2D: invalid texture target
I found a workaround : patchfunction setTextureFromArray(gl, tex, src, options)
I'm not sure I did it right....