diff options
author | Squire <squire@lindenlab.com> | 2011-06-21 20:50:16 -0700 |
---|---|---|
committer | Squire <squire@lindenlab.com> | 2011-06-21 20:50:16 -0700 |
commit | 8c653512500980f2e5a3c1a0c9397351fae3bce4 (patch) | |
tree | 5cab3065439656a1be8da15318f0e5fce57eb2b8 | |
parent | 14105610c7fb295a16b3b2a88014004c62ffa265 (diff) | |
parent | ede3b577d8cebd5065514bb485e2cbd93dd5b05a (diff) |
Pulled from viewer development
-rw-r--r-- | .hgtags | 1 | ||||
-rw-r--r-- | indra/llcommon/llversionviewer.h | 2 | ||||
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 55 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llvocache.cpp | 4 |
5 files changed, 46 insertions, 17 deletions
@@ -131,3 +131,4 @@ dac76a711da5f1489a01c1fa62ec97d99c25736d 2.6.6-release 0c4d0c24278074f219e5a32e72b449e78301d11b 2.7.1-beta1 9f79a6ed8fdcd2f3dac33ea6b3236eeb278dccfe 2.7.2-start 6a3e7e403bd19e45fdfc2fcc716867af3ab80861 2.7.3-start +6af10678de4736222b2c3f7e010e984fb5b327de 2.7.4-start diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index cfafbf0470..92cd9bd46a 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -29,7 +29,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 7; -const S32 LL_VERSION_PATCH = 4; +const S32 LL_VERSION_PATCH = 5; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index e51ef8cfe7..bdc103b917 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -403,7 +403,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) } else { - LL_INFOS("ShaderLoading") << log << LL_ENDL; + LL_DEBUGS("ShaderLoading") << log << LL_ENDL; } } } @@ -462,8 +462,15 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade GLcharARB* text[1024]; GLuint count = 0; - //set version to 1.20 - text[count++] = strdup("#version 120\n"); + if (gGLManager.mGLVersion < 3.f) + { + //set version to 1.20 + text[count++] = strdup("#version 120\n"); + } + else + { //set version to 1.30 + text[count++] = strdup("#version 130\n"); + } //copy preprocessor definitions into buffer for (std::map<std::string,std::string>::iterator iter = mDefinitions.begin(); iter != mDefinitions.end(); ++iter) @@ -515,17 +522,43 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup("varying float vary_texture_index;\n"); text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n"); text[count++] = strdup("{\n"); - text[count++] = strdup("\tswitch (int(vary_texture_index+0.25))\n"); - text[count++] = strdup("\t{\n"); - //switch body - for (S32 i = 0; i < texture_index_channels; ++i) - { - std::string case_str = llformat("\t\tcase %d: return texture2D(tex%d, texcoord);\n", i, i); - text[count++] = strdup(case_str.c_str()); + + if (gGLManager.mGLVersion >= 3.f) + { + text[count++] = strdup("\tswitch (int(vary_texture_index+0.25))\n"); + text[count++] = strdup("\t{\n"); + + //switch body + for (S32 i = 0; i < texture_index_channels; ++i) + { + std::string case_str = llformat("\t\tcase %d: return texture2D(tex%d, texcoord);\n", i, i); + text[count++] = strdup(case_str.c_str()); + } + + text[count++] = strdup("\t}\n"); } + else + { + //switches aren't supported, make block that looks like: + /* + int ti = int(vary_texture_index+0.25); + if (ti == 0) return texture2D(tex0, texcoord); + if (ti == 1) return texture2D(tex1, texcoord); + . + . + . + if (ti == N) return texture2D(texN, texcoord); + */ + + text[count++] = strdup("int ti = int(vary_texture_index+0.25);\n"); + for (S32 i = 0; i < texture_index_channels; ++i) + { + std::string if_str = llformat("if (ti == %d) return texture2D(tex%d, texcoord);\n", i, i); + text[count++] = strdup(if_str.c_str()); + } + } - text[count++] = strdup("\t}\n"); text[count++] = strdup("\treturn vec4(0,0,0,0);\n"); text[count++] = strdup("}\n"); } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e3ed2d0649..da4d0548d0 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1288,7 +1288,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarEyesProgram.mFeatures.calculatesAtmospherics = true; gDeferredAvatarEyesProgram.mFeatures.hasGamma = true; gDeferredAvatarEyesProgram.mFeatures.hasTransport = true; - gDeferredAvatarEyesProgram.mFeatures.isFullbright = true; gDeferredAvatarEyesProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarEyesProgram.mShaderFiles.clear(); gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/avatarEyesV.glsl", GL_VERTEX_SHADER_ARB)); diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index bbb19a63f1..f0b5b50feb 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -137,10 +137,6 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) LLVOCacheEntry::~LLVOCacheEntry() { - if(mBuffer != mDP.getBuffer()) - { - delete[] mBuffer ; //just in case - } mDP.freeBuffer(); } |