-
Notifications
You must be signed in to change notification settings - Fork 59
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
New framebuffer broken after dropping another framebuffer on Windows #360
Comments
You’re running the |
Yea, maybe I should have mentioned that. Honestly I forgot that I was. |
Nah nah it’s all good. I’ll have a look in the day, thanks a lot for notifying! |
I hit what sounds like this bug when trying to work with dynamically created framebuffers. In case more reproductions would be useful, here's a patch to diff --git a/examples/common/src/offscreen.rs b/examples/common/src/offscreen.rs
index 9da4c64..0d78260 100644
--- a/examples/common/src/offscreen.rs
+++ b/examples/common/src/offscreen.rs
@@ -59,6 +59,7 @@ pub struct LocalExample {
triangle: Tess<Vertex>,
quad: Tess<()>,
offscreen_buffer: Framebuffer<Dim2, RGBA32F, ()>,
+ t: u16,
}
impl Example for LocalExample {
@@ -109,6 +110,7 @@ impl Example for LocalExample {
triangle,
quad,
offscreen_buffer,
+ t: 0,
}
}
@@ -131,13 +133,23 @@ impl Example for LocalExample {
}
}
+ let ref mut alt_buffer: Framebuffer<Dim2, RGBA32F, ()> = context
+ .new_framebuffer([80, 60], 0, Sampler::default())
+ .expect("alt_buffer");
+
+ self.t = self.t.wrapping_add(1);
+ let offscreen_buffer = if self.t % 60 < 30 {
+ &mut self.offscreen_buffer
+ } else {
+ alt_buffer
+ };
+
// we get an object to create pipelines (we’ll need two)
let mut builder = context.new_pipeline_gate();
let program = &mut self.program;
let copy_program = &mut self.copy_program;
let triangle = &self.triangle;
let quad = &self.quad;
- let offscreen_buffer = &mut self.offscreen_buffer;
// render the triangle in the offscreen framebuffer first
let render = builder The Test conditions:
When I was discovering the bug in my own larger code intended for headless rendering, I found that (1) the first run always succeeded, and (2) one of the factors affecting it was whether I used |
I’m going to have a look into it @kpreid , thanks! |
If I create a framebuffer, drop it, and create a second framebuffer, the second framebuffer is broken. During the call to
Framebuffer::new
, GL_INVALID_OPERATION is emitted, and the returned framebuffer won't work if you try to render to it. It just looks zeroed out.This issue went unnoticed while I was on archlinux with a Radeon GPU, but it manifested on my Windows machine which has an old Nvidia Quadro. A friend of mine who also runs Windows tried to run it and got the same errors, but I'm not sure what graphics card that was. Either Nvidia or Intel.
Unfortunately this example isn't ready-to-run code, due to the custom context and logging utils, but hopefully it shows what I'm talking about.
The text was updated successfully, but these errors were encountered: