<div dir="ltr">FYI: I'm planning to review this some time this week. Probably not today though.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 12, 2017 at 11:37 AM, 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">Hello,<br>
<br>
this is the V3 series for the implementation of the<br>
SPV_KHR_16bit_storage and VK_KHR_16bit_storage extensions on the anv<br>
vulkan driver, in addition to the GLSL and NIR support needed.<br>
<br>
The original series can be found here [1], and the V2 is available<br>
here [2].<br>
<br>
In short V3 includes the following:<br>
<br>
* Updates on several patches after the review of the V2 series.<br>
This includes some squashes, and specially changes so 16-bit<br>
types are always packed, not using stride 2 by default.<br>
This implied a re-implementation of all load_input/store_output<br>
intrinsics for 16-bit. New solution shuffles and unshuffles<br>
16-bit components in 32-bit URB write and read operations. This<br>
saves space in the URB writes and reduces the register pressure<br>
just using half of the space.<br>
<br>
* 5 patches have been removed from v2 series because now we not<br>
assume the stride 2 for 16-bit registers. We also removed the<br>
patch of reuse_16bit_conversion_<wbr>register. The problems related<br>
to spilling that motivate that patch were better addressed by<br>
Curro's liveness patch.<br>
<br>
i965/fs: Set stride 2 when dealing with 16-bit floats/ints<br>
i965/fs: Retype 16-bit/stride2 movs to UD on nir_op_vecX<br>
i965/fs: Need to allocate as minimum 32-bit register<br>
i965/fs: Update assertion on copy propagation<br>
i965/fs: Add reuse_16bit_conversions_<wbr>register optimization<br>
<br>
Finally an updated overview of the patches:<br>
<br>
Patches 1-2 add 16-bit float, int and uint types to GLSL. This is<br>
needed because NIR uses GLSL types internally. We use the enums<br>
already defined at AMD_gpu_shader_half_float and NV_gpu_shader<br>
extensions. Patch 4 updates mesa/st, in order to avoid warnings for<br>
types not handled on a switch.<br>
<br>
Patches 3-6 add NIR support for those new GLSL 16-bit types,<br>
conversion opcodes, and rounding modes for float to half-float<br>
conversions.<br>
<br>
Patches 7-9 add the SPIR-V (SPV_KHR_16bit_storage) to NIR support.<br>
<br>
Patches 10-13 add general 16-bit support for i965. This includes<br>
handling of new types on several general purpose methods,<br>
update/remove some asserts.<br>
<br>
Patches 14-18 add support for 32 to 16-bit conversions for i965,<br>
including rounding mode opcodes (needed for float to half-float<br>
conversions), and an optimization that removes superfluous rounding<br>
mode sets.<br>
<br>
Patch 19 adds 16-bit support for constant location.<br>
<br>
Patches 20-24 add and use two new messages: byte scattered read and<br>
write. Those were needed because untyped surface message has a fixed<br>
32-bit write size. Those messages are used on the 16-bit support of<br>
store SSBO, load SSBO, load UBO and load shared.<br>
<br>
Patches 25-29 implement 16-bit vertex attribute inputs support on<br>
i965. These include changes on anv. This was needed because 16-bit<br>
surface formats do implicit conversion to 32-bit. To workaround this,<br>
we override the 16-bit surface format, and use 32-bit ones.<br>
<br>
Patch 30 implements load input and load store for all intra stage.<br>
This patch substitutes the previous simple patch i965/fs: Set stride 2<br>
when dealing with 16-bit floats/ints.<br>
<br>
Patch 31-37 implements 16-bit store output support for fragment<br>
shaders on i965.<br>
<br>
Patches 38-41 are the new patches included in V2. Three of them are<br>
improvements over V1 that doesn't fix any execution problem, but they<br>
improve performance reducing the use of multiple scattered messages<br>
for untyped read/write opreations. 16bit CTS tests passes without them.<br>
The other one would fix a real problem (patch 41), but unfourtunately<br>
no CTS test yet catching it.<br>
<br>
Patches 42-43 enable both extensions on anv vulkan driver.<br>
<br>
[1] <a href="https://lists.freedesktop.org/archives/mesa-dev/2017-July/162791.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2017-July/<wbr>162791.html</a><br>
[2] <a href="https://lists.freedesktop.org/archives/mesa-dev/2017-August/167455.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2017-August/<wbr>167455.html</a><br>
<br>
Alejandro Piñeiro (14):<br>
i965/vec4: Handle 16-bit types at type_size_xvec4<br>
i965/fs: Add brw_reg_type_from_bit_size utility method<br>
i965/fs: Remove BRW_REGISTER_TYPE_HF assert at get_exec_type<br>
i965/fs: Handle 32-bit to 16-bit conversions<br>
i965/fs: Define new shader opcode to set rounding modes<br>
i965/fs: Enable rounding mode on f2f16 ops<br>
i965/fs: Add remove_extra_rounding_modes optimization<br>
i965/fs: Adjust type_size/type_slots on store_ssbo<br>
i965/fs: Use byte_scattered_write on 16-bit store_ssbo<br>
anv/pipeline: Use 32-bit surface formats for 16-bit formats<br>
anv/cmd_buffer: Add a padding to the vertex buffer<br>
i965/fs: Use half_precision data_format on 16-bit fb writes<br>
i965/fs: Predicate byte scattered writes if needed<br>
anv: Enable VK_KHR_16bit_storage<br>
<br>
Eduardo Lima Mitev (8):<br>
glsl: Add 16-bit types<br>
mesa/st: Handle 16-bit types at st_glsl_storage_type_size()<br>
nir: Add support for 16-bit types (half float, int16 and uint16)<br>
nir: Populate conversion opcodes to/from 16-bit types<br>
spirv/nir: Handle 16-bit types<br>
spirv/nir: Add support for SPV_KHR_16bit_storage<br>
i965/fs: Optimize 16-bit SSBO stores by packing two into a 32-bit reg<br>
anv: Enable SPV_KHR_16bit_storage on gen 8+<br>
<br>
Jose Maria Casanova Crespo (21):<br>
nir: Add rounding modes enum<br>
nir: Handle fp16 rounding modes at nir_type_conversion_op<br>
spirv: Enable FPRoundingMode decorator to nir operations<br>
i965: Support for 16-bit base types in helper functions<br>
i965: Add support for control register<br>
i965/fs: Support push constants of 16-bit types<br>
i965/fs: Add byte scattered write message and fs support<br>
i965/fs: Add byte scattered read message and fs support<br>
i965/fs: Use byte scattered read<br>
compiler: Mark when input/ouput attribute at VS uses 16-bit<br>
i965/compiler: includes 16-bit vertex input<br>
i965/fs: Unpack 16-bit from 32-bit components in VS load_input<br>
i965/fs: Support 16-bit types at load_input and store_output<br>
i965/fs: Enable Render Target Write for 16-bit outputs<br>
i965/fs: Include support for SEND data_format bit for Render Targets<br>
i965/disasm: Show half-precision data_format on rt_writes<br>
i965/fs: Mark 16-bit outputs on FS store_output<br>
i965/fs: 16-bit source payloads always use 1 register<br>
i965/fs: Enable 16-bit render target write on SKL and CHV<br>
i965/fs: Enables 16-bit load_ubo with sampler<br>
i965/fs: Use untyped_surface_read for 16-bit load_ssbo<br>
<br>
src/compiler/builtin_type_<wbr>macros.h | 26 ++<br>
src/compiler/glsl/ast_to_hir.<wbr>cpp | 3 +<br>
src/compiler/glsl/glsl_to_nir.<wbr>cpp | 9 +-<br>
src/compiler/glsl/ir_clone.cpp | 3 +<br>
src/compiler/glsl/link_<wbr>uniform_initializers.cpp | 3 +<br>
src/compiler/glsl/lower_<wbr>buffer_access.cpp | 3 +-<br>
src/compiler/glsl_types.cpp | 93 ++++-<br>
src/compiler/glsl_types.h | 34 +-<br>
src/compiler/nir/nir.c | 6 +<br>
src/compiler/nir/nir.h | 22 +-<br>
src/compiler/nir/nir_gather_<wbr>info.c | 23 +-<br>
src/compiler/nir/nir_opcodes.<wbr>py | 10 +-<br>
src/compiler/nir/nir_opcodes_<wbr>c.py | 17 +-<br>
src/compiler/nir/nir_split_<wbr>var_copies.c | 6 +<br>
src/compiler/nir_types.cpp | 24 ++<br>
src/compiler/nir_types.h | 9 +<br>
src/compiler/shader_info.h | 2 +<br>
src/compiler/spirv/nir_spirv.h | 1 +<br>
src/compiler/spirv/spirv_to_<wbr>nir.c | 53 ++-<br>
src/compiler/spirv/vtn_alu.c | 34 +-<br>
src/compiler/spirv/vtn_<wbr>variables.c | 21 ++<br>
src/intel/compiler/brw_<wbr>compiler.h | 1 +<br>
src/intel/compiler/brw_disasm.<wbr>c | 4 +<br>
src/intel/compiler/brw_eu.h | 23 +-<br>
src/intel/compiler/brw_eu_<wbr>defines.h | 36 ++<br>
src/intel/compiler/brw_eu_<wbr>emit.c | 188 +++++++++-<br>
src/intel/compiler/brw_fs.cpp | 128 ++++++-<br>
src/intel/compiler/brw_fs.h | 12 +<br>
src/intel/compiler/brw_fs_<wbr>copy_propagation.cpp | 8 +-<br>
src/intel/compiler/brw_fs_<wbr>generator.cpp | 28 +-<br>
src/intel/compiler/brw_fs_nir.<wbr>cpp | 458 ++++++++++++++++++++++--<br>
src/intel/compiler/brw_fs_<wbr>surface_builder.cpp | 32 +-<br>
src/intel/compiler/brw_fs_<wbr>surface_builder.h | 14 +<br>
src/intel/compiler/brw_fs_<wbr>visitor.cpp | 6 +<br>
src/intel/compiler/brw_inst.h | 1 +<br>
src/intel/compiler/brw_ir_fs.h | 3 -<br>
src/intel/compiler/brw_nir.c | 16 +<br>
src/intel/compiler/brw_reg.h | 6 +<br>
src/intel/compiler/brw_shader.<wbr>cpp | 23 ++<br>
src/intel/compiler/brw_shader.<wbr>h | 7 +<br>
src/intel/compiler/brw_vec4.<wbr>cpp | 1 +<br>
src/intel/compiler/brw_vec4_<wbr>generator.cpp | 3 +-<br>
src/intel/compiler/brw_vec4_<wbr>visitor.cpp | 3 +<br>
src/intel/vulkan/anv_device.c | 13 +<br>
src/intel/vulkan/anv_<wbr>extensions.py | 1 +<br>
src/intel/vulkan/anv_pipeline.<wbr>c | 1 +<br>
src/intel/vulkan/genX_cmd_<wbr>buffer.c | 20 +-<br>
src/intel/vulkan/genX_<wbr>pipeline.c | 47 +++<br>
src/mesa/program/ir_to_mesa.<wbr>cpp | 6 +<br>
src/mesa/state_tracker/st_<wbr>glsl_types.cpp | 3 +<br>
50 files changed, 1403 insertions(+), 91 deletions(-)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.13.6<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>