squire_linden avatar squire_linden committed d84947d Merge

Pulled from viewer development

Comments (0)

Files changed (5)

 0c4d0c24278074f219e5a32e72b449e78301d11b 2.7.1-beta1
 9f79a6ed8fdcd2f3dac33ea6b3236eeb278dccfe 2.7.2-start
 6a3e7e403bd19e45fdfc2fcc716867af3ab80861 2.7.3-start
+6af10678de4736222b2c3f7e010e984fb5b327de 2.7.4-start

indra/llcommon/llversionviewer.h

 
 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";

indra/llrender/llshadermgr.cpp

 		}
 		else
 		{
-			LL_INFOS("ShaderLoading") << log << LL_ENDL;
+			LL_DEBUGS("ShaderLoading") << log << LL_ENDL;
 		}
 	}
 }
 	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)
 		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)
+		
+		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
 		{
-			std::string case_str = llformat("\t\tcase %d: return texture2D(tex%d, texcoord);\n", i, i);
-			text[count++] = strdup(case_str.c_str());
-		}
+			//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");
 	}

indra/newview/llviewershadermgr.cpp

 		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));

indra/newview/llvocache.cpp

 
 LLVOCacheEntry::~LLVOCacheEntry()
 {
-	if(mBuffer != mDP.getBuffer())
-	{
-		delete[] mBuffer ; //just in case
-	}
 	mDP.freeBuffer();
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.