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

@ -47,12 +47,9 @@ impl WebGLExtension for OESTextureHalfFloat {
}
fn enable(ext: &WebGLExtensions) {
// Enable FLOAT text data type
let hf = OESTextureHalfFloatConstants::HALF_FLOAT_OES;
ext.enable_tex_type(hf);
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_half_float") {
ext.add_effective_tex_internal_format(webgl::RGBA, hf, gl::RGBA16F);
ext.add_effective_tex_internal_format(webgl::RGB, hf, gl::RGB16F);
ext.add_effective_tex_internal_format(webgl::LUMINANCE, hf, gl::LUMINANCE16F_ARB);