summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-09 13:14:24 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-09 13:14:24 -0700
commitfe734ddf07009734fcf031b7f27f57d813b12b7f (patch)
tree0062daeb147f51dd339dd19766fbd3c3f7959aa6 /indra
parent4fe71c1da4d16513fe6aa1fb8a2bfd801f6ede7d (diff)
SL-11056
Make OpenGL 3.3 cards not false alarm on version 140 shader reqs. Makes deferred rendering work on low-end GPUs more often.
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llshadermgr.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 27f9e36f0f..6cd9a93ddd 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -705,7 +705,31 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
}
else
{
- if (major_version < 4)
+ if (major_version >= 4)
+ {
+ //set version to 400
+ shader_code_text[shader_code_count++] = strdup("#version 400\n");
+ }
+ else if (major_version == 3)
+ {
+ if (minor_version < 10)
+ {
+ shader_code_text[shader_code_count++] = strdup("#version 300\n");
+ }
+ else if (minor_version <= 19)
+ {
+ shader_code_text[shader_code_count++] = strdup("#version 310\n");
+ }
+ else if (minor_version <= 29)
+ {
+ shader_code_text[shader_code_count++] = strdup("#version 320\n");
+ }
+ else
+ {
+ shader_code_text[shader_code_count++] = strdup("#version 330\n");
+ }
+ }
+ else
{
//set version to 1.30
shader_code_text[shader_code_count++] = strdup("#version 130\n");
@@ -713,10 +737,6 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
extra_code_text[extra_code_count++] = strdup("precision mediump int;\n");
extra_code_text[extra_code_count++] = strdup("precision highp float;\n");
}
- else
- { //set version to 400
- shader_code_text[shader_code_count++] = strdup("#version 400\n");
- }
extra_code_text[extra_code_count++] = strdup("#define DEFINE_GL_FRAGCOLOR 1\n");
extra_code_text[extra_code_count++] = strdup("#define FXAA_GLSL_130 1\n");