From 47ffcdb93d6e2ac1f9d497e43e0213c98d129254 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 6 Apr 2010 16:24:08 -0500 Subject: Rigged attachments (almost works). --- indra/llrender/llglslshader.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llglslshader.cpp') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index ca92cb6580..949057df04 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -61,7 +61,7 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) LLShaderFeatures::LLShaderFeatures() : calculatesLighting(false), isShiny(false), isFullbright(false), hasWaterFog(false), -hasTransport(false), hasSkinning(false), hasAtmospherics(false), isSpecular(false), +hasTransport(false), hasSkinning(false), hasObjectSkinning(false), hasAtmospherics(false), isSpecular(false), hasGamma(false), hasLighting(false), calculatesAtmospherics(false) { } @@ -717,6 +717,18 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform) return -1; } +GLint LLGLSLShader::getAttribLocation(U32 attrib) +{ + if (attrib < mAttribute.size()) + { + return mAttribute[attrib]; + } + else + { + return -1; + } +} + void LLGLSLShader::uniform1i(const string& uniform, GLint v) { GLint location = getUniformLocation(uniform); -- cgit v1.2.3 From f324787a70b8fccc7a8ea202805bf726fba765a7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 1 May 2010 00:45:44 -0500 Subject: Rigged attachment integration WIP. --- indra/llrender/llglslshader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender/llglslshader.cpp') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 949057df04..9256e3959c 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -124,7 +124,7 @@ BOOL LLGLSLShader::createShader(vector * attributes, { GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second); LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL; - if (mShaderLevel > 0) + if (shaderhandle > 0) { attachObject(shaderhandle); } -- cgit v1.2.3 From 62943202a7c4334ce7b7be96f8f64133444ee925 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 13 Aug 2010 14:42:07 -0500 Subject: Make rigged attachments respect under water rendering. Reviewed by Nyx. --- indra/llrender/llglslshader.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llglslshader.cpp') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 9256e3959c..f59bac8c3c 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -709,7 +709,15 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform) std::map::iterator iter = mUniformMap.find(uniform); if (iter != mUniformMap.end()) { - llassert(iter->second == glGetUniformLocationARB(mProgramObject, uniform.c_str())); + if (gDebugGL) + { + stop_glerror(); + if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.c_str())) + { + llerrs << "Uniform does not match." << llendl; + } + stop_glerror(); + } return iter->second; } } @@ -900,7 +908,9 @@ void LLGLSLShader::uniformMatrix4fv(const string& uniform, U32 count, GLboolean if (location >= 0) { + stop_glerror(); glUniformMatrix4fvARB(location, count, transpose, v); + stop_glerror(); } } -- cgit v1.2.3 From 21b1b91c448b7d148a840c06d74deabc45af1819 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 6 Oct 2010 12:53:26 -0500 Subject: ATI compatibility pass --- indra/llrender/llglslshader.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/llrender/llglslshader.cpp') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index f59bac8c3c..ac56bea275 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -704,6 +704,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c GLint LLGLSLShader::getUniformLocation(const string& uniform) { + GLint ret = -1; if (mProgramObject > 0) { std::map::iterator iter = mUniformMap.find(uniform); @@ -718,11 +719,19 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform) } stop_glerror(); } - return iter->second; + ret = iter->second; } } - return -1; + if (gDebugGL) + { + if (ret == -1 && ret != glGetUniformLocationARB(mProgramObject, uniform.c_str())) + { + llerrs << "Uniform map invalid." << llendl; + } + } + + return ret; } GLint LLGLSLShader::getAttribLocation(U32 attrib) -- cgit v1.2.3 From 4fc7a221e12be5557d7df401c54b5688e8305b08 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 12 Oct 2010 17:04:41 -0500 Subject: Disable uniform map checking for now (breaks on several valid edge cases). --- indra/llrender/llglslshader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llrender/llglslshader.cpp') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index ac56bea275..23f8ed0bf0 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -723,13 +723,13 @@ GLint LLGLSLShader::getUniformLocation(const string& uniform) } } - if (gDebugGL) + /*if (gDebugGL) { if (ret == -1 && ret != glGetUniformLocationARB(mProgramObject, uniform.c_str())) { llerrs << "Uniform map invalid." << llendl; } - } + }*/ return ret; } -- cgit v1.2.3 From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/llrender/llglslshader.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/llrender/llglslshader.cpp') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 23f8ed0bf0..257bcd9380 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -2,31 +2,25 @@ * @file llglslshader.cpp * @brief GLSL helper functions and state. * - * $LicenseInfo:firstyear=2005&license=viewergpl$ - * - * Copyright (c) 2005-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, 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. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * 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. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * 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 * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3