Spector is hiding a bug somehow
See original GitHub issueSpector has been wonderful for finding my problems. So I resolved all of my issues with FLOAT textures and binding them as a render target to an FBO. Works great and I get the correct rendering on my screen.
So, I start to benchmark performance, thus I disable Spector for max benefit.
Lo! My FLOAT textures don’t work as my FBOs are now saying they are invalid (with no GL_ERROR output at all).
This is what spector says my commands are running:
createTexture -> WebGLTexture - ID: 0
bindTexture: TEXTURE_2D, WebGLTexture - ID: 0
texParameteri: TEXTURE_2D, TEXTURE_MAG_FILTER, NEAREST
texParameteri: TEXTURE_2D, TEXTURE_MIN_FILTER, NEAREST
texParameteri: TEXTURE_2D, TEXTURE_WRAP_S, CLAMP_TO_EDGE
texParameteri: TEXTURE_2D, TEXTURE_WRAP_T, CLAMP_TO_EDGE
pixelStorei: UNPACK_PREMULTIPLY_ALPHA_WEBGL, false
pixelStorei: UNPACK_FLIP_Y_WEBGL, false
texImage2D: TEXTURE_2D, 0, RGBA, 2232, 1896, 0, RGBA, UNSIGNED_BYTE, null
activeTexture: TEXTURE1
createTexture -> WebGLTexture - ID: 1
bindTexture: TEXTURE_2D, WebGLTexture - ID: 1
texParameteri: TEXTURE_2D, TEXTURE_MAG_FILTER, NEAREST
texParameteri: TEXTURE_2D, TEXTURE_MIN_FILTER, NEAREST
texParameteri: TEXTURE_2D, TEXTURE_WRAP_S, CLAMP_TO_EDGE
texParameteri: TEXTURE_2D, TEXTURE_WRAP_T, CLAMP_TO_EDGE
pixelStorei: UNPACK_PREMULTIPLY_ALPHA_WEBGL, false
pixelStorei: UNPACK_FLIP_Y_WEBGL, false
texImage2D: TEXTURE_2D, 0, RGBA, 2232, 1896, 0, RGBA, UNSIGNED_BYTE, null
activeTexture: TEXTURE2
createTexture -> WebGLTexture - ID: 2
bindTexture: TEXTURE_2D, WebGLTexture - ID: 2
texParameteri: TEXTURE_2D, TEXTURE_MAG_FILTER, NEAREST
texParameteri: TEXTURE_2D, TEXTURE_MIN_FILTER, NEAREST
texImage2D: TEXTURE_2D, 0, RGBA32F, 2232, 1896, 0, RGBA, FLOAT, null
activeTexture: TEXTURE3
createTexture -> WebGLTexture - ID: 3
bindTexture: TEXTURE_2D, WebGLTexture - ID: 3
texParameteri: TEXTURE_2D, TEXTURE_MAG_FILTER, NEAREST
texParameteri: TEXTURE_2D, TEXTURE_MIN_FILTER, NEAREST
texParameteri: TEXTURE_2D, TEXTURE_WRAP_S, CLAMP_TO_EDGE
texParameteri: TEXTURE_2D, TEXTURE_WRAP_T, CLAMP_TO_EDGE
pixelStorei: UNPACK_PREMULTIPLY_ALPHA_WEBGL, false
pixelStorei: UNPACK_FLIP_Y_WEBGL, false
texImage2D: TEXTURE_2D, 0, DEPTH_COMPONENT16, 2232, 1896, 0, DEPTH_COMPONENT, UNSIGNED_SHORT, null
createFramebuffer -> WebGLFramebuffer - ID: 0
bindFramebuffer: FRAMEBUFFER, WebGLFramebuffer - ID: 0
framebufferTexture2D: FRAMEBUFFER, COLOR_ATTACHMENT0_WEBGL, TEXTURE_2D, WebGLTexture - ID: 0, 0
framebufferTexture2D: FRAMEBUFFER, COLOR_ATTACHMENT1_WEBGL, TEXTURE_2D, WebGLTexture - ID: 1, 0
framebufferTexture2D: FRAMEBUFFER, COLOR_ATTACHMENT2_WEBGL, TEXTURE_2D, WebGLTexture - ID: 2, 0
framebufferTexture2D: FRAMEBUFFER, DEPTH_ATTACHMENT, TEXTURE_2D, WebGLTexture - ID: 3, 0
checkFramebufferStatus: FRAMEBUFFER -> FRAMEBUFFER_COMPLETE
Works perfect when spector is enabled.
Disable spector and I get:
FRAMEBUFFER_INCOMPLETE_ATTACHMENT
gl-proxy.ts:1207 GL Error: No Error
So, spector is somehow masking my commands and fixing something ever so slightly? Any insights into this? Or point me toward anything that spector is “massaging” before submitting as GL calls?
And just to assert: I have narrowed it down to specifically be my FLOAT texture I am trying to attach to the FBO. Everything works fine without it in the pipeline.
BROWSERS: Firefox, Chrome OS: OSX Dedicated GPU
Oddly, it works fine in safari…
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Yup I longly struggled with this approach but the only way to no if it is supported is to query it 😃
I should maybe query it on another canvas, and report if enabled or not.
I ll think about it for the next update, thanks
@sebavan Nevermind -facepalm-
Don’t need to waste your time. I found the issue: WebGL2 also has a required extension for rendering to a FLOAT texture WEBGL_color_buffer_float. I must have missed this extension before : /
That being said: I don’t see the benefit of having Spector call extensions itself. It definitely masked an issue I had without spector. I don’t know all the reasons behind your guys reasoning though 😃 just a thought
Thanks for the rubber ducky debugging -more facepalm-