External gles framebuffer (#7671)

This commit is contained in:
Doublonmousse authored and GitHub committed 2025-05-30 19:16:47 +00:00
1 parent 70b06b19a1
commit 1da7cd4811
4 files changed
+22

No files matched your search

+2
View File
@@ -523,6 +523,8 @@ impl crate::CommandEncoder for super::CommandEncoder {
.any(|at| match at.target.view.inner {
#[cfg(webgl)]
super::TextureInner::ExternalFramebuffer { .. } => true,
#[cfg(native)]
super::TextureInner::ExternalNativeFramebuffer { .. } => true,
_ => false,
});
+2
View File
@@ -969,6 +969,8 @@ impl crate::Device for super::Device {
}
#[cfg(webgl)]
super::TextureInner::ExternalFramebuffer { .. } => {}
#[cfg(native)]
super::TextureInner::ExternalNativeFramebuffer { .. } => {}
}
}
+14
View File
@@ -366,9 +366,21 @@ pub enum TextureInner {
target: BindTarget,
},
#[cfg(webgl)]
/// Render to a `WebGLFramebuffer`
///
/// This is a web feature
ExternalFramebuffer {
inner: web_sys::WebGlFramebuffer,
},
#[cfg(native)]
/// Render to a `glow::NativeFramebuffer`
/// Useful when the framebuffer to draw to
/// has a non-zero framebuffer ID
///
/// This is a native feature
ExternalNativeFramebuffer {
inner: glow::NativeFramebuffer,
},
}
#[cfg(send_sync)]
@@ -385,6 +397,8 @@ impl TextureInner {
Self::Texture { raw, target } => (raw, target),
#[cfg(webgl)]
Self::ExternalFramebuffer { .. } => panic!("Unexpected external framebuffer"),
#[cfg(native)]
Self::ExternalNativeFramebuffer { .. } => panic!("unexpected external framebuffer"),
}
}
}
+4
View File
@@ -158,6 +158,10 @@ impl super::Queue {
super::TextureInner::ExternalFramebuffer { ref inner } => unsafe {
gl.bind_external_framebuffer(glow::FRAMEBUFFER, inner);
},
#[cfg(native)]
super::TextureInner::ExternalNativeFramebuffer { ref inner } => unsafe {
gl.bind_framebuffer(glow::FRAMEBUFFER, Some(*inner));
},
}
}