Properly check the right internal formats in gl.renderbufferStorage

This commit is contained in:
Anthony Ramine 2018-04-05 18:01:32 +02:00
parent ac85d1255d
commit e8f19fa7fc
2 changed files with 18 additions and 7 deletions

View file

@ -95,11 +95,14 @@ impl WebGLRenderbuffer {
// validation.
match internal_format {
constants::RGBA4 |
constants::DEPTH_STENCIL |
constants::RGB565 |
constants::RGB5_A1 |
constants::DEPTH_COMPONENT16 |
constants::STENCIL_INDEX8 =>
self.internal_format.set(Some(internal_format)),
constants::STENCIL_INDEX8 |
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.7
constants::DEPTH_STENCIL => {
self.internal_format.set(Some(internal_format))
}
_ => return Err(WebGLError::InvalidEnum),
};