<div dir="ltr">On 2 December 2013 11:31, Francisco Jerez <span dir="ltr"><<a href="mailto:currojerez@riseup.net" target="_blank">currojerez@riseup.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Until now it was only being taken into account in the VEC4 back-end<br>
but not in the FS back-end. Do it in both cases.<br>
---<br>
src/mesa/drivers/dri/i965/brw_fs.h | 2 +-<br>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 10 ++++++----<br>
src/mesa/drivers/dri/i965/brw_shader.h | 7 ++++---<br>
3 files changed, 11 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h<br>
index 2c36d9f..f918f7e 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs.h<br>
@@ -615,4 +615,4 @@ bool brw_do_channel_expressions(struct exec_list *instructions);<br>
bool brw_do_vector_splitting(struct exec_list *instructions);<br>
bool brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog);<br>
<br>
-struct brw_reg brw_reg_from_fs_reg(fs_reg *reg);<br>
+struct brw_reg brw_reg_from_fs_reg(fs_reg *reg, unsigned dispatch_width);<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp<br>
index 8d310a1..1de59eb 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp<br>
@@ -981,8 +981,9 @@ static uint32_t brw_file_from_reg(fs_reg *reg)<br>
}<br>
<br>
struct brw_reg<br>
-brw_reg_from_fs_reg(fs_reg *reg)<br>
+brw_reg_from_fs_reg(fs_reg *reg, unsigned dispatch_width)<br>
{<br>
+ const int reg_size = 4 * dispatch_width;<br></blockquote><div><br></div><div>What happens when reg.type is UW and dispatch_width is 16? In that case, we would compute reg_size == 64, but the correct value seems like it's actually 32 in this case.<br>
<br>Are we perhaps relying on reg.type being a 32-bit type? If so, maybe we should add an assertion:<br><br></div><div> assert(type_sz(reg.type) == 4);<br><br></div><div>With that added, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div></div></div></div>