Dirty patch Intel HD4000 shader-confusion

This commit is contained in:
Siana Gearz
2013-05-27 06:46:35 +02:00
parent c61415d785
commit 3cd16c84ef
3 changed files with 48 additions and 0 deletions

View File

@@ -451,6 +451,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
gGL.getTexUnit(0)->bind(image, true);
gGL.color4fv(color.mV);
gGL.diffuseColor4fv(color.mV); //workaround: Intel HD 4000
const S32 NUM_VERTICES = 9 * 4; // 9 quads
LLVector2 uv[NUM_VERTICES];

View File

@@ -0,0 +1,42 @@
/**
* @file solidcolorV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
uniform mat4 modelview_projection_matrix;
uniform vec4 color;
ATTRIBUTE vec3 position;
ATTRIBUTE vec2 texcoord0;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
vertex_color = color;
vary_texcoord0 = texcoord0;
}

View File

@@ -2565,6 +2565,11 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
{
gSolidColorProgram.mName = "Solid Color Shader";
gSolidColorProgram.mShaderFiles.clear();
#if LL_WINDOWS
if(gGLManager.mIsIntel && gGLManager.mGLVersion >= 4.f)
gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorIntelV.glsl", GL_VERTEX_SHADER_ARB));
else
#endif
gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorV.glsl", GL_VERTEX_SHADER_ARB));
gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER_ARB));
gSolidColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];