<div dir="ltr">Looks good to me.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 5, 2017 at 3:47 PM, Jose Maria Casanova Crespo <span dir="ltr"><<a href="mailto:jmcasanova@igalia.com" target="_blank">jmcasanova@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
<br>
load_ubo is using 32-bit loads as uniforms surfaces have a 32-bit<br>
surface format defined. So when reading 16-bit components with the<br>
sampler we need to unshuffle two 16-bit components from each 32-bit<br>
component.<br>
<br>
Using the sampler avoids the use of the byte_scattered_read message<br>
that needs one message for each component and is supposed to be<br>
slower.<br>
<br>
v2: (Jason Ekstrand)<br>
- Simplify component selection and unshuffling for different bitsizes<br>
- Remove SKL optimization of reading only two 32-bit components when<br>
reading 16-bits types.<br>
<br>
Reviewed-by: Jose Maria Casanova Crespo <<a href="mailto:jmcasanova@igalia.com">jmcasanova@igalia.com</a>><br>
---<br>
src/intel/compiler/brw_fs.cpp | 21 ++++++++++++++-------<br>
1 file changed, 14 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_fs.<wbr>cpp b/src/intel/compiler/brw_fs.<wbr>cpp<br>
index 91399c6c1d..93bb6b4673 100644<br>
--- a/src/intel/compiler/brw_fs.<wbr>cpp<br>
+++ b/src/intel/compiler/brw_fs.<wbr>cpp<br>
@@ -191,14 +191,21 @@ fs_visitor::VARYING_PULL_<wbr>CONSTANT_LOAD(const fs_builder &bld,<br>
vec4_result, surf_index, vec4_offset);<br>
inst->size_written = 4 * vec4_result.component_size(<wbr>inst->exec_size);<br>
<br>
- if (type_sz(dst.type) == 8) {<br>
- shuffle_32bit_load_result_to_<wbr>64bit_data(<br>
- bld, retype(vec4_result, dst.type), vec4_result, 2);<br>
+ fs_reg dw = offset(vec4_result, bld, (const_offset & 0xf) / 4);<br>
+ switch (type_sz(dst.type)) {<br>
+ case 2:<br>
+ shuffle_32bit_load_result_to_<wbr>16bit_data(bld, dst, dw, 1);<br>
+ bld.MOV(dst, subscript(dw, dst.type, (const_offset / 2) & 1));<br>
+ break;<br>
+ case 4:<br>
+ bld.MOV(dst, retype(dw, dst.type));<br>
+ break;<br>
+ case 8:<br>
+ shuffle_32bit_load_result_to_<wbr>64bit_data(bld, dst, dw, 1);<br>
+ break;<br>
+ default:<br>
+ unreachable("Unsupported bit_size");<br>
}<br>
-<br>
- vec4_result.type = dst.type;<br>
- bld.MOV(dst, offset(vec4_result, bld,<br>
- (const_offset & 0xf) / type_sz(vec4_result.type)));<br>
}<br>
<br>
/**<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>