Skip to content

Commit

Permalink
native/wasm: Fix badBuffer: bindtarget error
Browse files Browse the repository at this point in the history
  • Loading branch information
not-fl3 committed Sep 10, 2024
1 parent bccef37 commit ad6e427
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/graphics/gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ impl RenderingBackend for GlContext {
}
let mut gl_fb = 0;

let mut resolves = vec![];
let mut resolves = None;
unsafe {
glGenFramebuffers(1, &mut gl_fb as *mut _);
glBindFramebuffer(GL_FRAMEBUFFER, gl_fb);
Expand Down Expand Up @@ -1035,6 +1035,8 @@ impl RenderingBackend for GlContext {
}

if let Some(resolve_img) = resolve_img {
resolves = Some(vec![]);
let resolves = resolves.as_mut().unwrap();
for (i, resolve_img) in resolve_img.iter().enumerate() {
let mut resolve_fb = 0;
glGenFramebuffers(1, &mut resolve_fb as *mut _);
Expand All @@ -1058,7 +1060,7 @@ impl RenderingBackend for GlContext {
let pass = RenderPassInternal {
gl_fb,
color_textures: color_img.to_vec(),
resolves: Some(resolves),
resolves,
depth_texture: depth_img,
};

Expand Down

0 comments on commit ad6e427

Please sign in to comment.