From 527f8b56c218838b2c50f9adf801f645e16438e2 Mon Sep 17 00:00:00 2001 From: Morris Tseng Date: Wed, 26 Feb 2014 09:04:47 -0500 Subject: [PATCH] Bug 975937 - Crash in mozilla::layers::ShaderProgramOGL::Activate(). r=gal --- gfx/layers/opengl/OGLShaderProgram.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gfx/layers/opengl/OGLShaderProgram.cpp b/gfx/layers/opengl/OGLShaderProgram.cpp index c77c61ed0ab..6a44e80682c 100644 --- a/gfx/layers/opengl/OGLShaderProgram.cpp +++ b/gfx/layers/opengl/OGLShaderProgram.cpp @@ -183,6 +183,12 @@ ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig) vs << " gl_Position = finalPosition;" << endl; vs << "}" << endl; + if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) { + fs << "#extension GL_ARB_texture_rectangle : require" << endl; + } + if (aConfig.mFeatures & ENABLE_TEXTURE_EXTERNAL) { + fs << "#extension GL_OES_EGL_image_external : require" << endl; + } fs << "#ifdef GL_ES" << endl; fs << "precision mediump float;" << endl; fs << "#define COLOR_PRECISION lowp" << endl; @@ -213,14 +219,12 @@ ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig) const char *texture2D = "texture2D"; if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) { - fs << "#extension GL_ARB_texture_rectangle : require" << endl; fs << "uniform vec2 uTexCoordMultiplier;" << endl; sampler2D = "sampler2DRect"; texture2D = "texture2DRect"; } if (aConfig.mFeatures & ENABLE_TEXTURE_EXTERNAL) { - fs << "#extension GL_OES_EGL_image_external : require" << endl; sampler2D = "samplerExternalOES"; }