question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spector is hiding a bug somehow

See original GitHub issue

Spector 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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sebavancommented, Feb 25, 2021

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

0reactions
Dinidencommented, Feb 25, 2021

@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-

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top Ten Tips to Prevent or Control Bed Bugs
4. Reduce the number of hiding places -- Clean up the clutter. A cluttered home provides more places for bed bugs to hide...
Read more >
Types of Bugs & Listening Devices
A GSM bug can be a small black box that can be discreetly hidden in a room or it can be a purpose...
Read more >
Bed Bug Confidential: An Expert Explains How to Defend ...
Dry ice sprays that freeze bed bugs have limited potential to reach hidden bugs. Steam has somewhat better penetrating ability.
Read more >
How to Get Rid of Bugs Indoors
To kill bugs hiding in your lawn use Ortho® BugClear™ Lawn Insect Killer. Always follow the label directions.
Read more >
Bed Bug Biology and Behavior
Bed bugs have a cryptic lifestyle, meaning they spend the majority of their time hiding together in cracks and crevices where they will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found