Implement WEBGL_color_buffer_float and EXT_color_buffer_half_float (fixes #22113)

This commit is contained in:
Josh Matthews 2018-09-10 12:10:27 -04:00 committed by Anthony Ramine
parent 176d984b3b
commit e31462c37c
12 changed files with 240 additions and 32 deletions

View file

@ -46,11 +46,8 @@ impl WebGLExtension for OESTextureFloat {
}
fn enable(ext: &WebGLExtensions) {
// Enable FLOAT text data type
ext.enable_tex_type(webgl::FLOAT);
let needs_replace = !ext.supports_gl_extension("GL_OES_texture_float");
if needs_replace {
// Special internal formats must be used to avoid clamped float values
if !ext.supports_gl_extension("GL_OES_texture_float") {
ext.add_effective_tex_internal_format(webgl::RGBA, webgl::FLOAT, gl::RGBA32F);
ext.add_effective_tex_internal_format(webgl::RGB, webgl::FLOAT, gl::RGB32F);
ext.add_effective_tex_internal_format(