<div class="gmail_quote">On 22 July 2012 16:37, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This fixes piglit/fbo-deriv.<br></blockquote><div><br></div><div>Cool, I'm glad that test proved useful for more drivers than just i965 :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 24 ++++++++++++++++++++++--<br>
1 file changed, 22 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp<br>
index 45136de..fcd69b1 100644<br>
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp<br>
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp<br>
@@ -1448,9 +1448,29 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)<br>
emit(ir, TGSI_OPCODE_DDX, result_dst, op[0]);<br>
break;<br>
case ir_unop_dFdy:<br>
- op[0].negate = ~op[0].negate;<br>
- emit(ir, TGSI_OPCODE_DDY, result_dst, op[0]);<br>
+ {<br>
+ /* The X component contains 1 or -1 depending on whether the framebuffer<br>
+ * is a FBO or the window system buffer, respectively.<br>
+ * It is then multiplied with the source operand of DDY.<br>
+ */<br>
+ static const gl_state_index transform_y_state[STATE_LENGTH]<br>
+ = { STATE_INTERNAL, STATE_FB_WPOS_Y_TRANSFORM };<br>
+<br>
+ unsigned transform_y_index =<br>
+ _mesa_add_state_reference(this->prog->Parameters,<br>
+ transform_y_state);<br>
+<br>
+ st_src_reg transform_y = st_src_reg(PROGRAM_STATE_VAR,<br>
+ transform_y_index,<br>
+ glsl_type::vec4_type);<br>
+ transform_y.swizzle = SWIZZLE_XXXX;<br>
+<br>
+ st_src_reg temp = get_temp(glsl_type::vec4_type);<br>
+<br>
+ emit(ir, TGSI_OPCODE_MUL, st_dst_reg(temp), transform_y, op[0]);<br>
+ emit(ir, TGSI_OPCODE_DDY, result_dst, temp);<br>
break;<br>
+ }<br>
<br>
case ir_unop_noise: {<br>
/* At some point, a motivated person could add a better<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br>