<div dir="ltr"><div dir="ltr">I just sent one more, "nir/lower_io: Add shared to get_io_offset_src" that's required for the pass to apply properly to shared vairables.</div><div dir="ltr"><br></div><div>Do we have any testing of shared variables with anything other than 32 bits?  Do we even test 64 bits?  I'm begining to think that there are basically zero tests for anything other than 32-bit. :(<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 14, 2018 at 5:48 AM Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks a lot for this work. Patches 1-7 are,<br>
<br>
  Reviewed-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>><br>
<br>
I will review patch 8 later, probably tomorrow.<br>
<br>
Sam<br>
<br>
On 14/11/2018 00:23, Jason Ekstrand wrote:<br>
> In order to properly do all the different kinds of SSBO and SLM writes that<br>
> we have in GL and Vulkan, we have to do some lowering.  The hardware<br>
> doesn't have instructions for writing a N-bit vecM with an arbitrary<br>
> write-mask.  Instead, we have byte scattered messages which work on a<br>
> scalar byte, word, or dword at an unaligned address and untyped surface<br>
> messages which work on a 32-bit vecN.  All SSBO and SLM access has to be<br>
> lowered to one of these two things.<br>
> <br>
> Previously we did this in the back-end and had separate copies for fs and<br>
> vec4.  This works but it was fairly heavily tied to the fs_surface_builder<br>
> and the way we emit typed load/store ops.  I've been interested in wiring<br>
> up the A64 messages for doing "global" reads and writes and they will need<br>
> exactly the same lowering but I'm not at all convinced I want to shove them<br>
> through the same emit_untyped_read/write helpers we have today.  In any<br>
> case, this lets us share code between vec4 and fs and I think the<br>
> implementation is over-all cleaner for it.  This series has a few other<br>
> advantages beyond just code sharing:<br>
> <br>
>  1) The new splitting code acts on ranges of bytes and is able to combine<br>
>     loads/stores in more cases than the old code could.  For example, an<br>
>     indirect u8vec3 load is now just a single dword load where we throw<br>
>     away the last 16 bits.  Another example is that a u16vec4 write with a<br>
>     YZ writemask is now written with a single unaligned dword store.<br>
> <br>
>  2) OpBitcast in SPIR-V now works correctly on 8-bit types.<br>
> <br>
>  3) Writes to 8 and 16-bit shared variables should now work.<br>
> <br>
> Cc: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>><br>
> Cc: Jose Maria Casanova Crespo <<a href="mailto:jmcasanova@igalia.com" target="_blank">jmcasanova@igalia.com</a>><br>
> <br>
> Jason Ekstrand (8):<br>
>   nir/lower_alu_to_scalar: Don't try to lower unpack_32_2x16<br>
>   nir/builder: Assert that intN_t immediates fit<br>
>   nir/builder: Add iadd_imm and imul_imm helpers<br>
>   nir/builder: Add a nir_pack/unpack/bitcast helpers<br>
>   nir/spirv: Force 32-bit for UBO and SSBO Booleans<br>
>   nir/glsl: Force 32-bit for UBO and SSBO Booleans<br>
>   nir: Add alignment parameters to SSBO, UBO, and shared access<br>
>   intel/compiler: Lower SSBO and shared loads/stores in NIR<br>
> <br>
>  src/compiler/glsl/glsl_to_nir.cpp             |  31 +-<br>
>  src/compiler/nir/nir.h                        |  41 ++<br>
>  src/compiler/nir/nir_builder.h                | 142 +++++++<br>
>  src/compiler/nir/nir_intrinsics.py            |  26 +-<br>
>  src/compiler/nir/nir_lower_alu_to_scalar.c    |   1 +<br>
>  src/compiler/nir/nir_lower_atomics_to_ssbo.c  |   4 +<br>
>  src/compiler/nir/nir_lower_io.c               |   5 +-<br>
>  src/compiler/nir/nir_print.c                  |   2 +<br>
>  src/compiler/spirv/spirv_to_nir.c             |   2 +<br>
>  src/compiler/spirv/vtn_alu.c                  | 101 ++---<br>
>  src/compiler/spirv/vtn_variables.c            |  30 +-<br>
>  src/intel/Makefile.sources                    |   1 +<br>
>  src/intel/compiler/brw_fs_nir.cpp             | 381 ++++--------------<br>
>  src/intel/compiler/brw_nir.c                  |   2 +<br>
>  src/intel/compiler/brw_nir.h                  |   2 +<br>
>  .../brw_nir_lower_mem_access_bit_sizes.c      | 313 ++++++++++++++<br>
>  src/intel/compiler/brw_vec4_nir.cpp           | 126 +-----<br>
>  src/intel/compiler/meson.build                |   1 +<br>
>  18 files changed, 702 insertions(+), 509 deletions(-)<br>
>  create mode 100644 src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c<br>
> <br>
<br>
</blockquote></div>