mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
webgl: Emulate some renderbuffer formats in non-GLES.
This commit is contained in:
parent
3334e477c1
commit
03eb7e4dd2
11 changed files with 176 additions and 53 deletions
|
@ -6,7 +6,7 @@ use canvas_traits::webgl::WebGLVersion;
|
|||
use dom::bindings::codegen::Bindings::EXTShaderTextureLodBinding;
|
||||
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
|
||||
use dom::bindings::root::DomRoot;
|
||||
use dom::webglrenderingcontext::WebGLRenderingContext;
|
||||
use dom::webglrenderingcontext::{WebGLRenderingContext, is_gles};
|
||||
use dom_struct::dom_struct;
|
||||
use super::{WebGLExtension, WebGLExtensions, WebGLExtensionSpec};
|
||||
|
||||
|
@ -37,11 +37,8 @@ impl WebGLExtension for EXTShaderTextureLod {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
if cfg!(any(target_os = "android", target_os = "ios")) {
|
||||
return ext.supports_gl_extension("GL_EXT_shader_texture_lod");
|
||||
}
|
||||
// This extension is always available on desktop GL.
|
||||
true
|
||||
!is_gles() || ext.supports_gl_extension("GL_EXT_shader_texture_lod")
|
||||
}
|
||||
|
||||
fn enable(_ext: &WebGLExtensions) {}
|
||||
|
|
|
@ -6,7 +6,7 @@ use canvas_traits::webgl::WebGLVersion;
|
|||
use dom::bindings::codegen::Bindings::OESElementIndexUintBinding;
|
||||
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
|
||||
use dom::bindings::root::DomRoot;
|
||||
use dom::webglrenderingcontext::WebGLRenderingContext;
|
||||
use dom::webglrenderingcontext::{WebGLRenderingContext, is_gles};
|
||||
use dom_struct::dom_struct;
|
||||
use super::{WebGLExtension, WebGLExtensions, WebGLExtensionSpec};
|
||||
|
||||
|
@ -37,11 +37,8 @@ impl WebGLExtension for OESElementIndexUint {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
if cfg!(any(target_os = "android", target_os = "ios")) {
|
||||
return ext.supports_gl_extension("GL_OES_element_index_uint");
|
||||
}
|
||||
// This extension is always available in desktop OpenGL.
|
||||
true
|
||||
!is_gles() || ext.supports_gl_extension("GL_OES_element_index_uint")
|
||||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
|
|
|
@ -7,7 +7,7 @@ use dom::bindings::codegen::Bindings::OESStandardDerivativesBinding;
|
|||
use dom::bindings::codegen::Bindings::OESStandardDerivativesBinding::OESStandardDerivativesConstants;
|
||||
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
|
||||
use dom::bindings::root::DomRoot;
|
||||
use dom::webglrenderingcontext::WebGLRenderingContext;
|
||||
use dom::webglrenderingcontext::{WebGLRenderingContext, is_gles};
|
||||
use dom_struct::dom_struct;
|
||||
use super::{WebGLExtension, WebGLExtensions, WebGLExtensionSpec};
|
||||
|
||||
|
@ -37,11 +37,8 @@ impl WebGLExtension for OESStandardDerivatives {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
if cfg!(any(target_os = "android", target_os = "ios")) {
|
||||
return ext.supports_any_gl_extension(&["GL_OES_standard_derivatives"]);
|
||||
}
|
||||
// The standard derivatives are always available in desktop OpenGL.
|
||||
true
|
||||
!is_gles() || ext.supports_any_gl_extension(&["GL_OES_standard_derivatives"])
|
||||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue