[Mesa-dev] [PATCH] glsl: Add a citation for uniform precision matching.
Kenneth Graunke
kenneth at whitecape.org
Tue Sep 6 19:18:46 UTC 2016
Ian added this check in commit 259fc505454ea6a67aeacf6cdebf1398d9947759.
While reviewing the rules, I found a citation which spells this out
clearly, so I figured I'd send a patch to add it as a comment.
Cc: idr at freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/compiler/glsl/linker.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index c95edf3..78c9ea8 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -1154,6 +1154,14 @@ cross_validate_globals(struct gl_shader_program *prog,
return;
}
+ /* The GLSL ES 3.2 specification says:
+ *
+ * "Uniforms in shaders all share a single global name space when
+ * linked into a program or separable program. Hence, the types,
+ * precisions and any location specifiers of all declared uniform
+ * variables with the same name must match across shaders that
+ * are linked into a single program."
+ */
if (prog->IsES && existing->data.precision != var->data.precision) {
linker_error(prog, "declarations for %s `%s` have "
"mismatching precision qualifiers\n",
--
2.9.3
More information about the mesa-dev
mailing list