From 3cd16c84ef1f3d3241db5efa8c7341379c7c55f6 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 27 May 2013 06:46:35 +0200 Subject: [PATCH] Dirty patch Intel HD4000 shader-confusion --- indra/llrender/llrender2dutils.cpp | 1 + .../class1/interface/solidcolorIntelV.glsl | 42 +++++++++++++++++++ indra/newview/llviewershadermgr.cpp | 5 +++ 3 files changed, 48 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 044931fa1..5215202a6 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -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]; diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl new file mode 100644 index 000000000..cdafbd3e3 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl @@ -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; +} + diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 76b3298ec..b39fb6e1f 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -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];