Skip to content
Snippets Groups Projects
Commit 446d0cbf authored by David Parks's avatar David Parks
Browse files

SL-19655 Clean up some missed "texture2D" vs "texture" (thanks Rye)

parent c827d32e
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -678,13 +678,13 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev ...@@ -678,13 +678,13 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
{ {
switch (vary_texture_index) switch (vary_texture_index)
{ {
case 0: ret = texture2D(tex0, texcoord); break; case 0: ret = texture(tex0, texcoord); break;
case 1: ret = texture2D(tex1, texcoord); break; case 1: ret = texture(tex1, texcoord); break;
case 2: ret = texture2D(tex2, texcoord); break; case 2: ret = texture(tex2, texcoord); break;
. .
. .
. .
case N: return texture2D(texN, texcoord); break; case N: return texture(texN, texcoord); break;
} }
return ret; return ret;
...@@ -711,7 +711,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev ...@@ -711,7 +711,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
if (texture_index_channels == 1) if (texture_index_channels == 1)
{ //don't use flow control, that's silly { //don't use flow control, that's silly
extra_code_text[extra_code_count++] = strdup("return texture2D(tex0, texcoord);\n"); extra_code_text[extra_code_count++] = strdup("return texture(tex0, texcoord);\n");
extra_code_text[extra_code_count++] = strdup("}\n"); extra_code_text[extra_code_count++] = strdup("}\n");
} }
else if (major_version > 1 || minor_version >= 30) else if (major_version > 1 || minor_version >= 30)
...@@ -720,7 +720,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev ...@@ -720,7 +720,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
{ //switches are unreliable on some NVIDIA drivers { //switches are unreliable on some NVIDIA drivers
for (U32 i = 0; i < texture_index_channels; ++i) for (U32 i = 0; i < texture_index_channels; ++i)
{ {
std::string if_string = llformat("\t%sif (vary_texture_index == %d) { return texture2D(tex%d, texcoord); }\n", i > 0 ? "else " : "", i, i); std::string if_string = llformat("\t%sif (vary_texture_index == %d) { return texture(tex%d, texcoord); }\n", i > 0 ? "else " : "", i, i);
extra_code_text[extra_code_count++] = strdup(if_string.c_str()); extra_code_text[extra_code_count++] = strdup(if_string.c_str());
} }
extra_code_text[extra_code_count++] = strdup("\treturn vec4(1,0,1,1);\n"); extra_code_text[extra_code_count++] = strdup("\treturn vec4(1,0,1,1);\n");
...@@ -735,7 +735,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev ...@@ -735,7 +735,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
//switch body //switch body
for (S32 i = 0; i < texture_index_channels; ++i) 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); std::string case_str = llformat("\t\tcase %d: return texture(tex%d, texcoord);\n", i, i);
extra_code_text[extra_code_count++] = strdup(case_str.c_str()); extra_code_text[extra_code_count++] = strdup(case_str.c_str());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment