aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2015-11-16 08:43:12 +0200
committerTapani Pälli <[email protected]>2015-11-17 09:23:54 +0200
commitf4f30ad730b7dafaadafda63344012203543894c (patch)
tree9adc372331ab4ebb39fbaf08578c3c7309c52bab /src/mesa
parent023fd58fd685135bfb4ee401ac9bd1c3a3988e02 (diff)
mesa: do runtime validation of precision varyings only on ES
Precision qualifier should be ignored on desktop OpenGL. v2: include spec quote (Samuel) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/shader_query.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 58ba04153e6..14f849e0a94 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -1413,9 +1413,19 @@ _mesa_validate_pipeline_io(struct gl_pipeline_object *pipeline)
for (idx = prev + 1; idx < ARRAY_SIZE(pipeline->CurrentProgram); idx++) {
if (shProg[idx]) {
- if (!validate_io(shProg[prev]->_LinkedShaders[prev],
- shProg[idx]->_LinkedShaders[idx]))
- return false;
+ /* Since we now only validate precision, we can skip this step for
+ * desktop GLSL shaders, there precision qualifier is ignored.
+ *
+ * From OpenGL 4.50 Shading Language spec, section 4.7:
+ * "For the purposes of determining if an output from one shader
+ * stage matches an input of the next stage, the precision
+ * qualifier need not match."
+ */
+ if (shProg[prev]->IsES || shProg[idx]->IsES) {
+ if (!validate_io(shProg[prev]->_LinkedShaders[prev],
+ shProg[idx]->_LinkedShaders[idx]))
+ return false;
+ }
prev = idx;
}
}