mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
webgl: Ensure that framebuffers have a color attachment before reading or writing.
This commit is contained in:
parent
80ed829241
commit
d179435eab
4 changed files with 129 additions and 4 deletions
|
@ -203,6 +203,16 @@ impl WebGLFramebuffer {
|
|||
return self.status.get();
|
||||
}
|
||||
|
||||
pub fn check_status_for_rendering(&self) -> u32 {
|
||||
let result = self.check_status();
|
||||
if result == constants::FRAMEBUFFER_COMPLETE {
|
||||
if self.color.borrow().is_none() {
|
||||
return constants::FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
|
||||
}
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
pub fn renderbuffer(&self, attachment: u32, rb: Option<&WebGLRenderbuffer>) -> WebGLResult<()> {
|
||||
let binding = match attachment {
|
||||
constants::COLOR_ATTACHMENT0 => &self.color,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue