Closed Bug 985316 Opened 12 years ago Closed 9 years ago

Premature generation of texture will render as black warning

Categories

(Core :: Graphics: CanvasWebGL, defect)

27 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: callow.mark, Unassigned)

References

Details

The warning > Error: WebGL: A texture is going to be rendered as if it were black, as per the OpenGL ES 2.0.24 spec section 3.8.2, because it is a 2D texture, with a minification filter requiring a mipmap, and is not mipmap complete (as defined in section 3.7.10). is suffering premature ejaculation. My application does gl.bindTexture(gl.TEXTURE_2D, tex) gl.texImage2D(gl.TEXTURE_2D, ..., NULL) gl.bindTexture(gl.TEXTURE_2D, tex) gl.texSubImage2D(gl.TEXTURE_2D, 1, ...) gl.bindTexture(null) and the warning appears in the console when the final bindTexture is executed. The application then does gl.bindTexture(gl.TEXTURE_2D, tex); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); and some time later gl.drawArrays(...); So it actually has no problem.
Ok, yeah, we should only generate that warning at draw time. (Also let's change the wording a bit to make this less risque)
Summary: Premature ejaculation of texture will render as black warning → Premature generation of texture will render as black warning
I tested the FF Nightly on Linux with the following code: var testData0 = new Uint8Array([0.0, 0.0, 0.0, 0.0, 0.2, 0.2, 0.2, 0.2, 0.4, 0.4, 0.4, 0.4, 0.6, 0.6, 0.6, 0.6]); var testTexture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, testTexture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, testData0); gl.texImage2D(gl.TEXTURE_2D, 1, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, testData0); gl.bindTexture(gl.TEXTURE_2D, null); gl.bindTexture(gl.TEXTURE_2D, testTexture); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); Note that I had to change your texSubImage2D into texImage2D since the corresponding image (for level=1) has not yet been defined, so doing subImage is incorrect. This test case issues no warnings, so I consider the issue to be fixed. Please re-open if still having problems.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.