Bug 1111689 - Part 1: Let EXT_shader_texture_lod play when ARB_shader_texture_lod can play. r=jgilbert draft
authorMilan Sreckovic <milan@mozilla.com>
Mon, 09 Feb 2015 17:53:38 +0800
changeset 291351 80906ad76fe8702e072f65ff96cf6537bb5ba0d6
parent 291313 dd9e40b4695909f1595814c0e79e4d55d73dc283
child 291352 04ce67347a23d0140e5a946a9c03ca9a94d03529
push id5244
push userkgilbert@mozilla.com
push dateWed, 09 Sep 2015 20:45:56 +0000
reviewersjgilbert
bugs1111689
milestone43.0a1
Bug 1111689 - Part 1: Let EXT_shader_texture_lod play when ARB_shader_texture_lod can play. r=jgilbert
dom/canvas/WebGLContextExtensions.cpp
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
gfx/gl/GLContextFeatures.cpp
--- a/dom/canvas/WebGLContextExtensions.cpp
+++ b/dom/canvas/WebGLContextExtensions.cpp
@@ -111,17 +111,18 @@ WebGLContext::IsExtensionSupported(WebGL
     // EXT_
     case WebGLExtensionID::EXT_blend_minmax:
         return WebGLExtensionBlendMinMax::IsSupported(this);
     case WebGLExtensionID::EXT_color_buffer_half_float:
         return WebGLExtensionColorBufferHalfFloat::IsSupported(this);
     case WebGLExtensionID::EXT_frag_depth:
         return WebGLExtensionFragDepth::IsSupported(this);
     case WebGLExtensionID::EXT_shader_texture_lod:
-        return gl->IsExtensionSupported(gl::GLContext::EXT_shader_texture_lod);
+        return gl->IsExtensionSupported(gl::GLContext::EXT_shader_texture_lod) ||
+               gl->IsExtensionSupported(gl::GLContext::ARB_shader_texture_lod);
     case WebGLExtensionID::EXT_sRGB:
         return WebGLExtensionSRGB::IsSupported(this);
     case WebGLExtensionID::EXT_texture_filter_anisotropic:
         return gl->IsExtensionSupported(gl::GLContext::EXT_texture_filter_anisotropic);
 
     // OES_
     case WebGLExtensionID::OES_element_index_uint:
         return gl->IsSupported(gl::GLFeature::element_index_uint);
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -94,16 +94,17 @@ static const char *sExtensionNames[] = {
     "GL_ARB_instanced_arrays",
     "GL_ARB_internalformat_query",
     "GL_ARB_invalidate_subdata",
     "GL_ARB_map_buffer_range",
     "GL_ARB_occlusion_query2",
     "GL_ARB_pixel_buffer_object",
     "GL_ARB_robustness",
     "GL_ARB_sampler_objects",
+    "GL_ARB_shader_texture_lod",
     "GL_ARB_sync",
     "GL_ARB_texture_compression",
     "GL_ARB_texture_float",
     "GL_ARB_texture_non_power_of_two",
     "GL_ARB_texture_rectangle",
     "GL_ARB_texture_storage",
     "GL_ARB_texture_swizzle",
     "GL_ARB_timer_query",
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -117,16 +117,17 @@ enum class GLFeature {
     query_objects,
     query_time_elapsed,
     read_buffer,
     renderbuffer_color_float,
     renderbuffer_color_half_float,
     robustness,
     sRGB_framebuffer,
     sRGB_texture,
+    shader_texture_lod,
     sampler_objects,
     standard_derivatives,
     sync,
     texture_3D,
     texture_3D_compressed,
     texture_3D_copy,
     texture_float,
     texture_float_linear,
@@ -404,16 +405,17 @@ public:
         ARB_instanced_arrays,
         ARB_internalformat_query,
         ARB_invalidate_subdata,
         ARB_map_buffer_range,
         ARB_occlusion_query2,
         ARB_pixel_buffer_object,
         ARB_robustness,
         ARB_sampler_objects,
+        ARB_shader_texture_lod,
         ARB_sync,
         ARB_texture_compression,
         ARB_texture_float,
         ARB_texture_non_power_of_two,
         ARB_texture_rectangle,
         ARB_texture_storage,
         ARB_texture_swizzle,
         ARB_timer_query,
--- a/gfx/gl/GLContextFeatures.cpp
+++ b/gfx/gl/GLContextFeatures.cpp
@@ -534,16 +534,27 @@ static const FeatureInfo sFeatureInfoArr
         GLContext::Extension_None,
         {
             GLContext::EXT_sRGB,
             GLContext::EXT_texture_sRGB,
             GLContext::Extensions_End
         }
     },
     {
+        "shader_texture_lod",
+        GLVersion::NONE,
+        GLESVersion::NONE,
+        GLContext::Extension_None,
+        {
+            GLContext::ARB_shader_texture_lod,
+            GLContext::EXT_shader_texture_lod,
+            GLContext::Extensions_End
+        }
+    },
+    {
         "sampler_objects",
         GLVersion::GL3_3,
         GLESVersion::ES3,
         GLContext::ARB_sampler_objects,
         {
             GLContext::Extensions_End
         }
     },