-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_parameter_framebuffer
panics when the current framebuffer is the default one
#334
Comments
I also notice that if I call let fbo = gl.get_parameter_i32(glow::DRAW_FRAMEBUFFER_BINDING);
let current_framebuffer = gl.get_parameter_framebuffer(glow::DRAW_FRAMEBUFFER_BINDING);
let framebuffer = gl.create_framebuffer()?;
gl.bind_framebuffer(glow::FRAMEBUFFER, Some(framebuffer));
let new_fbo = gl.get_parameter_i32(glow::DRAW_FRAMEBUFFER_BINDING); (Ignoring error handling for clarity.)
|
Also running into this issue unfortunately! |
@AlexandruIca I think we could fix the first issue by tracking the default framebuffer on the WebGL backend when we're creating the context initially. I'm not sure about the second issue, those should basically be raw OpenGL calls unless there's something else going on here. |
Unfortunately I had integrated it directly in a pretty complex project so I don't have a reproducible example on hand, but it was only happening on the WebGL back-end. I don't think the calls themselves are a problem, I think it's a problem related to tracking resources (maybe the key comparison isn't right?). Though I haven't looked in detail into it. |
So I noticed that
glow
tracks framebuffers created by the user, and then one is able to callget_parameter_framebuffer(glow::DRAWING_FRAMEBUFFER_BINDING)
to get the framebuffer currently in use.But it only tracks framebuffers created by
create_framebuffer
. This is a problem if I callget_parameter_framebuffer
without creating a framebuffer myself: it will return the default one, which is perfectly valid, butglow
panics because it doesn't have it in its registry. It's easy to work around it though.IIRC this should only happen on the
WebGL
back-end.The text was updated successfully, but these errors were encountered: