<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>I used byte_offset() in the previous patch like you suggested and with that we no longer need this one.</div><div><br></div><div>On Fri, 2018-12-07 at 13:09 -0600, Jason Ekstrand wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><div>And here we are.... I think I'd still like byte_offset better but, either way patches 31 and 32 are</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 4, 2018 at 1:18 AM Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">In SIMD8 we pack 2 vector components in a single SIMD register, so<br>
for example, component Y of a 16-bit vec2 starts is at byte offset<br>
16B. This means that when we compute the offset of the elements to<br>
be differentiated we should not stomp whatever base offset we have,<br>
but instead add to it.<br>
---<br>
src/intel/compiler/brw_fs_generator.cpp | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp<br>
index bffd9bc4787..d8e4bae17e0 100644<br>
--- a/src/intel/compiler/brw_fs_generator.cpp<br>
+++ b/src/intel/compiler/brw_fs_generator.cpp<br>
@@ -1259,7 +1259,7 @@ fs_generator::generate_ddx(const fs_inst *inst,<br>
struct brw_reg src0 = src;<br>
struct brw_reg src1 = src;<br>
<br>
- src0.subnr = type_sz(src.type);<br>
+ src0.subnr += type_sz(src.type);<br>
src0.vstride = vstride;<br>
src0.width = width;<br>
src0.hstride = BRW_HORIZONTAL_STRIDE_0;<br>
@@ -1325,8 +1325,8 @@ fs_generator::generate_ddy(const fs_inst *inst,<br>
/* replicate the derivative at the top-left pixel to other pixels */<br>
struct brw_reg src0 = stride(src, 4, 4, 0);<br>
struct brw_reg src1 = stride(src, 4, 4, 0);<br>
- src0.subnr = 0 * type_size;<br>
- src1.subnr = 2 * type_size;<br>
+ src0.subnr += 0 * type_size;<br>
+ src1.subnr += 2 * type_size;<br>
<br>
brw_ADD(p, dst, negate(src0), src1);<br>
}<br>
</blockquote></div></blockquote></body></html>