mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add initial support for WebGL 2 BlitFramebuffer (#26389)
Add initial support for the WebGL2 BlitFramebuffer call. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Istvan <istvan.miklos@h-lab.eu>
This commit is contained in:
parent
2575a0daf1
commit
c43762faea
29 changed files with 1686 additions and 31 deletions
|
@ -234,6 +234,25 @@ impl WebGLFramebuffer {
|
|||
self.size.get()
|
||||
}
|
||||
|
||||
pub fn get_attachment_formats(&self) -> WebGLResult<(Option<u32>, Option<u32>, Option<u32>)> {
|
||||
if self.check_status() != constants::FRAMEBUFFER_COMPLETE {
|
||||
return Err(WebGLError::InvalidFramebufferOperation);
|
||||
}
|
||||
let color = match self.attachment(constants::COLOR_ATTACHMENT0) {
|
||||
Some(WebGLFramebufferAttachmentRoot::Renderbuffer(rb)) => Some(rb.internal_format()),
|
||||
_ => None,
|
||||
};
|
||||
let depth = match self.attachment(constants::DEPTH_ATTACHMENT) {
|
||||
Some(WebGLFramebufferAttachmentRoot::Renderbuffer(rb)) => Some(rb.internal_format()),
|
||||
_ => None,
|
||||
};
|
||||
let stencil = match self.attachment(constants::STENCIL_ATTACHMENT) {
|
||||
Some(WebGLFramebufferAttachmentRoot::Renderbuffer(rb)) => Some(rb.internal_format()),
|
||||
_ => None,
|
||||
};
|
||||
Ok((color, depth, stencil))
|
||||
}
|
||||
|
||||
fn check_attachment_constraints<'a>(
|
||||
&self,
|
||||
attachment: &Option<WebGLFramebufferAttachment>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue