<div dir="ltr"><div>The comment above this about the cast to int can probably go away?<br><br></div>- Chris<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 10, 2015 at 2:52 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
This is the way layout(binding=xxx) works from GLSL. The old method<br>
just happened to work (and significantly predated support for<br>
layout(binding=xxx)), but future changes will break this.<br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
Cc: "10.6 11.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
---<br>
src/mesa/main/ff_fragment_shader.cpp | 3 ++-<br>
1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp<br>
index e4e2a18..f5a4fa5 100644<br>
--- a/src/mesa/main/ff_fragment_shader.cpp<br>
+++ b/src/mesa/main/ff_fragment_shader.cpp<br>
@@ -981,7 +981,8 @@ static void load_texture( texenv_fragment_program *p, GLuint unit )<br>
* NOTE: The cast to int is important. Without it, the constant will have<br>
* type uint, and things later on may get confused.<br>
*/<br>
- sampler->constant_value = new(p->mem_ctx) ir_constant(int(unit));<br>
+ sampler->data.explicit_binding = true;<br>
+ sampler->data.binding = unit;<br>
<br>
deref = new(p->mem_ctx) ir_dereference_variable(sampler);<br>
tex->set_sampler(deref, glsl_type::vec4_type);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
mesa-stable mailing list<br>
<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-stable" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-stable</a><br>
</font></span></blockquote></div><br></div>