webgl: Validate that the texture should be power of two if the level is

greater than 1
This commit is contained in:
Emilio Cobos Álvarez 2016-04-19 13:09:06 +02:00
parent 5eb59935e3
commit c807cab300
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 18 additions and 4 deletions

View file

@ -227,6 +227,10 @@ impl WebGLTexture {
}
}
pub fn is_power_of_two(&self) -> bool {
self.image_info_at_face(0, 0).is_power_of_two()
}
pub fn populate_mip_chain(&self, first_level: u32, last_level: u32) -> WebGLResult<()> {
let base_image_info = self.image_info_at_face(0, first_level);
if !base_image_info.is_initialized() {