[Mesa-dev] [PATCH 3/4] linker: Use app-specified fragment data location during linking

Ian Romanick idr at freedesktop.org
Fri Nov 4 16:40:59 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Fixes piglit's bindfragdata-link-error.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/linker.cpp |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 915d5bb..3492045 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1381,6 +1381,13 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
 	    assert(binding >= VERT_ATTRIB_GENERIC0);
 	    var->location = binding;
 	 }
+      } else if (target_index == MESA_SHADER_FRAGMENT) {
+	 unsigned binding;
+
+	 if (prog->FragDataBindings->get(binding, var->name)) {
+	    assert(binding >= FRAG_RESULT_DATA0);
+	    var->location = binding;
+	 }
       }
 
       /* If the variable is not a built-in and has a location statically
-- 
1.7.6.4



More information about the mesa-dev mailing list