aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2018-08-22 15:26:32 -0400
committerJosh Matthews <josh@joshmatthews.net>2018-09-10 16:31:28 -0400
commitdf8e36aa783b9f6a50a5a16a39f7dcbd65ffde76 (patch)
tree0df67e2891b3cf797f8a25fd7768fb03b27c983c /components/script/dom/webglrenderingcontext.rs
parent690c98dda7d618d9f0a6553ca17d1dfc4a97555b (diff)
downloadservo-df8e36aa783b9f6a50a5a16a39f7dcbd65ffde76.tar.gz
servo-df8e36aa783b9f6a50a5a16a39f7dcbd65ffde76.zip
webgl: Differentiate between missing colour attachments and incomplete attachments.
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r--components/script/dom/webglrenderingcontext.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index c4ea4667cbd..db0fabf452d 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -39,7 +39,7 @@ use dom::webgl_validations::types::{TexDataType, TexFormat, TexImageTarget};
use dom::webglactiveinfo::WebGLActiveInfo;
use dom::webglbuffer::WebGLBuffer;
use dom::webglcontextevent::WebGLContextEvent;
-use dom::webglframebuffer::{WebGLFramebuffer, WebGLFramebufferAttachmentRoot};
+use dom::webglframebuffer::{WebGLFramebuffer, WebGLFramebufferAttachmentRoot, CompleteForRendering};
use dom::webglobject::WebGLObject;
use dom::webglprogram::WebGLProgram;
use dom::webglrenderbuffer::WebGLRenderbuffer;
@@ -339,10 +339,14 @@ impl WebGLRenderingContext {
// this: clear() and getParameter(IMPLEMENTATION_COLOR_READ_*).
fn validate_framebuffer(&self) -> WebGLResult<()> {
match self.bound_framebuffer.get() {
- Some(ref fb) if fb.check_status_for_rendering() != constants::FRAMEBUFFER_COMPLETE => {
- Err(InvalidFramebufferOperation)
+ Some(fb) => match fb.check_status_for_rendering() {
+ CompleteForRendering::Complete => Ok(()),
+ CompleteForRendering::Incomplete =>
+ Err(InvalidFramebufferOperation),
+ CompleteForRendering::MissingColorAttachment =>
+ Err(InvalidOperation),
},
- _ => Ok(()),
+ None => Ok(()),
}
}