aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/linker.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-27 11:07:33 +0000
committermarha <marha@users.sourceforge.net>2011-01-27 11:07:33 +0000
commitdc9d750132f95783d2db6fb8e08271fc0878576d (patch)
treea50266155fef4466569ee0c478da0dae2fdf092b /mesalib/src/glsl/linker.cpp
parenta58ed86fb6139585b9a5d5664c52c7e0d5cfa719 (diff)
downloadvcxsrv-dc9d750132f95783d2db6fb8e08271fc0878576d.tar.gz
vcxsrv-dc9d750132f95783d2db6fb8e08271fc0878576d.tar.bz2
vcxsrv-dc9d750132f95783d2db6fb8e08271fc0878576d.zip
pixman and mesalib git update 27 jan 2011
Diffstat (limited to 'mesalib/src/glsl/linker.cpp')
-rw-r--r--mesalib/src/glsl/linker.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index bf7a56353..4332338df 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -382,6 +382,32 @@ cross_validate_globals(struct gl_shader_program *prog,
existing->explicit_location = true;
}
+ /* Validate layout qualifiers for gl_FragDepth.
+ *
+ * From the AMD_conservative_depth spec:
+ * "If gl_FragDepth is redeclared in any fragment shader in
+ * a program, it must be redeclared in all fragment shaders in that
+ * program that have static assignments to gl_FragDepth. All
+ * redeclarations of gl_FragDepth in all fragment shaders in
+ * a single program must have the same set of qualifiers."
+ */
+ if (strcmp(var->name, "gl_FragDepth") == 0) {
+ bool layout_declared = var->depth_layout != ir_depth_layout_none;
+ bool layout_differs = var->depth_layout != existing->depth_layout;
+ if (layout_declared && layout_differs) {
+ linker_error_printf(prog,
+ "All redeclarations of gl_FragDepth in all fragment shaders "
+ "in a single program must have the same set of qualifiers.");
+ }
+ if (var->used && layout_differs) {
+ linker_error_printf(prog,
+ "If gl_FragDepth is redeclared with a layout qualifier in"
+ "any fragment shader, it must be redeclared with the same"
+ "layout qualifier in all fragment shaders that have"
+ "assignments to gl_FragDepth");
+ }
+ }
+
/* FINISHME: Handle non-constant initializers.
*/
if (var->constant_value != NULL) {