nsCanvasRenderingContextGLWeb20::TexImage2D has if (argc != 3) return NS_ERROR_DOM_SYNTAX_ERR;, but the function actually takes 9 arguments. Also, texImage2D should be able to take a null pointer as an argument (to avoid having to create and upload a texture for an FBO.) How to reproduce: 1. gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, [0,0,0,0]) 2. gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, null) What happened: It threw an error on both. What I expected to happen: It should've uploaded a 1x1 texture.
Fixes the argc bug, adds support for NULL textures and adds the rest of GLES 2.0 valid texture targets (i.e. GL_TEXTURE_CUBE_MAP_*.)
This bug should probably be in Component "Canvas: WebGL". gl.texImage2D does still not support 'null' data when using the 9 arguemnt variant. It writes "texImage2D: argument error" on console and throws an exception. I'm using 3.7a1pre Nightly 20091123 on Linux x86_64.
moved to Canvas: WebGL
Component: Canvas: 2D → Canvas: WebGL
QA Contact: canvas.2d → canvas.webgl
looking at tip/WebGLContextGL::TexImage2D, line 3135 does a !argPixelsObj check - this is what's causing the error. It looks like the code below properly handles the argPixelsObj == NULL case, so this must have just gotten messed up in a merge.
Looks like the changes from the original patch are already in except for the null pixels arg check.
Summary: [c3d] texImage2D expects the wrong number of arguments → [webgl] texImage2D doesn't handle null pixels arg
Everything else from the old patch seems to be in already. This fixes the early null check.
Obsoleted by quickstubs (arg conversion happens earlier, null is handled explicitly)
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.