Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
e1a71a97
Commit
e1a71a97
authored
13 years ago
by
David Parks
Browse files
Options
Downloads
Patches
Plain Diff
SH-2908 Potential fix for pink textures on some OpenGL 3.1 implementations.
parent
48f5b69c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llrender/llshadermgr.cpp
+11
-7
11 additions, 7 deletions
indra/llrender/llshadermgr.cpp
with
11 additions
and
7 deletions
indra/llrender/llshadermgr.cpp
+
11
−
7
View file @
e1a71a97
...
@@ -614,6 +614,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
...
@@ -614,6 +614,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
//some implementations of GLSL 1.30 require integer precision be explicitly declared
//some implementations of GLSL 1.30 require integer precision be explicitly declared
text
[
count
++
]
=
strdup
(
"precision mediump int;
\n
"
);
text
[
count
++
]
=
strdup
(
"precision mediump int;
\n
"
);
text
[
count
++
]
=
strdup
(
"precision highp float;
\n
"
);
}
}
else
else
{
//set version to 400
{
//set version to 400
...
@@ -668,20 +669,22 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
...
@@ -668,20 +669,22 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
VARYING_FLAT ivec4 vary_texture_index;
VARYING_FLAT ivec4 vary_texture_index;
vec4 ret = vec4(1,0,1,1);
vec4 diffuseLookup(vec2 texcoord)
vec4 diffuseLookup(vec2 texcoord)
{
{
switch (vary_texture_index.r))
switch (vary_texture_index.r))
{
{
case 0: ret
urn
texture2D(tex0, texcoord);
case 0: ret
=
texture2D(tex0, texcoord);
break;
case 1: ret
urn
texture2D(tex1, texcoord);
case 1: ret
=
texture2D(tex1, texcoord);
break;
case 2: ret
urn
texture2D(tex2, texcoord);
case 2: ret
=
texture2D(tex2, texcoord);
break;
.
.
.
.
.
.
case N: return texture2D(texN, texcoord);
case N: return texture2D(texN, texcoord);
break;
}
}
return
vec4(0,0,0,0)
;
return
ret
;
}
}
*/
*/
...
@@ -708,18 +711,19 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
...
@@ -708,18 +711,19 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
}
}
else
if
(
major_version
>
1
||
minor_version
>=
30
)
else
if
(
major_version
>
1
||
minor_version
>=
30
)
{
//switches are supported in GLSL 1.30 and later
{
//switches are supported in GLSL 1.30 and later
text
[
count
++
]
=
strdup
(
"
\t
vec4 ret = vec4(1,0,1,1);
\n
"
);
text
[
count
++
]
=
strdup
(
"
\t
switch (vary_texture_index.r)
\n
"
);
text
[
count
++
]
=
strdup
(
"
\t
switch (vary_texture_index.r)
\n
"
);
text
[
count
++
]
=
strdup
(
"
\t
{
\n
"
);
text
[
count
++
]
=
strdup
(
"
\t
{
\n
"
);
//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\t
case %d: ret
urn
texture2D(tex%d, texcoord);
\n
"
,
i
,
i
);
std
::
string
case_str
=
llformat
(
"
\t\t
case %d: ret
=
texture2D(tex%d, texcoord);
break;
\n
"
,
i
,
i
);
text
[
count
++
]
=
strdup
(
case_str
.
c_str
());
text
[
count
++
]
=
strdup
(
case_str
.
c_str
());
}
}
text
[
count
++
]
=
strdup
(
"
\t
}
\n
"
);
text
[
count
++
]
=
strdup
(
"
\t
}
\n
"
);
text
[
count
++
]
=
strdup
(
"
\t
return
vec4(1,0,1,1)
;
\n
"
);
text
[
count
++
]
=
strdup
(
"
\t
return
ret
;
\n
"
);
text
[
count
++
]
=
strdup
(
"}
\n
"
);
text
[
count
++
]
=
strdup
(
"}
\n
"
);
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment