diff options
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 9f30edac79c..25e5bf4baa1 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -1510,6 +1510,11 @@ impl WebGLRenderingContext { // FIXME: https://github.com/servo/servo/issues/13710 } + + pub fn valid_color_attachment_enum(&self, attachment: u32) -> bool { + let last_slot = constants::COLOR_ATTACHMENT0 + self.limits().max_color_attachments - 1; + constants::COLOR_ATTACHMENT0 <= attachment && attachment <= last_slot + } } #[cfg(not(feature = "webgl_backtrace"))] |