<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Nov 29, 2017 at 6:50 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">Used to enable 16-bit reads at do_untyped_vector_read, that is used on<br>
the following intrinsics:<br>
<br>
* nir_intrinsic_load_shared<br>
* nir_intrinsic_load_ssbo<br>
<br>
v2: Removed use of stride = 2 on 16-bit sources (Jason Ekstrand)<br>
<br>
v3: - Add bitsize to scattered read operation (Jason Ekstrand)<br>
- Remove implementation of 16-bit UBO read from this patch.<br>
- Avoid assertion at opt_algebraic caused by ADD of two IMM with<br>
offset with BRW_REGISTER_TYPE_UD type found on matrix tests.<br>
(Jose Maria Casanova)<br>
---<br>
src/intel/compiler/brw_fs_nir.<wbr>cpp | 13 ++++++++++++-<br>
1 file changed, 12 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/compiler/brw_fs_<wbr>nir.cpp b/src/intel/compiler/brw_fs_<wbr>nir.cpp<br>
index ff04e2468b..726b2fcee7 100644<br>
--- a/src/intel/compiler/brw_fs_<wbr>nir.cpp<br>
+++ b/src/intel/compiler/brw_fs_<wbr>nir.cpp<br>
@@ -2353,6 +2353,18 @@ do_untyped_vector_read(const fs_builder &bld,<br>
<br>
bld.ADD(read_offset, read_offset, brw_imm_ud(16));<br>
}<br>
+ } else if (type_sz(dest.type) == 2) {<br></blockquote><div><br></div><div>You could make this "if (type_sz(dest.type) <= 2)" and put it at the beginning of the ladder.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ fs_reg read_offset = bld.vgrf(BRW_REGISTER_TYPE_UD)<wbr>;<br>
+ bld.MOV(read_offset, offset_reg);<br>
+ for (unsigned i = 0; i < num_components; i++) {<br>
+ fs_reg read_reg = emit_byte_scattered_read(bld, surf_index, read_offset,<br>
+ 1 /* dims */,<br>
+ 1,<br>
+ 16 /*bit_size */,<br></blockquote><div><br></div><div>and just make this type_sz(dest.type) * 8</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ BRW_PREDICATE_NONE);<br>
+ bld.MOV(offset(dest,bld,i), subscript(read_reg, dest.type, 0));<br>
+ bld.ADD(read_offset, read_offset, brw_imm_ud(type_sz(dest.type))<wbr>);<br>
+ }<br>
} else {<br>
unreachable("Unsupported type");<br>
}<br>
@@ -3929,7 +3941,6 @@ fs_visitor::nir_emit_<wbr>intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr<br>
if (const_offset == NULL) {<br>
fs_reg base_offset = retype(get_nir_src(instr->src[<wbr>1]),<br>
BRW_REGISTER_TYPE_UD);<br>
-<br></blockquote><div><br></div><div>Spurrious change<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
for (int i = 0; i < instr->num_components; i++)<br>
VARYING_PULL_CONSTANT_LOAD(<wbr>bld, offset(dest, bld, i), surf_index,<br>
base_offset, i * type_sz(dest.type));<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></div>