[Mesa-dev] [PATCH 00/28] Add VK_KHR_shader_float_controls support to anv

Samuel Iglesias Gonsálvez siglesias at igalia.com
Wed Dec 5 15:55:15 UTC 2018


Hello,

This patch series implements the support for
VK_KHR_shader_float_controls for Intel platforms (Broadwell and
later).

This extension enables efficient use of floating-point computations
through the ability to query and override the implementation's default
behavior for rounding modes, denormals, signed zero, and infinity.

This patch series depends on Iago's patch series implementing
VK_KHR_shader_float16_int8 support on ANV [0] for the float16 support.

If you want to test this patch series, you can clone this branch (it
already includes Iago's patch series):

$ git clone -b siglesias/VK_KHR_shader_float_controls \
https://github.com/Igalia/mesa.git

Thanks!

Sam

[0] https://lists.freedesktop.org/archives/mesa-dev/2018-December/210896.html


Samuel Iglesias Gonsálvez (28):
  spirv: Update SPIR-V json and headers to Khronos master
  spirv: check support for SPV_KHR_shader_float_controls capabilities
  spirv/nir: keep track of SPV_KHR_shader_float_controls execution modes
  nir: add support for flushing to zero denorm constants
  Revert "spirv: Don’t check for NaN for most OpFOrd* comparisons"
  spirv/glsl450: fix atan2(0,0) lowering
  spirv/glsl450: fix atan2(x, x) case
  spirv/glsl450: fix reflect(denorm, denorm) FTZ = 0.0 case
  nir/algebraic: fix (inf - inf) = NaN case
  nir: create new conversion opcodes with floating point rounding modes
  util: added float to float16 conversions with RTZ and RTNE
  util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding
    modes
  nir: take into account rounding modes in conversions
  nir: fix denorms in unpack_half_1x16()
  nir: support for denorm flush-to-zero in nir_lower_double_ops
  nir: fix fmin/fmax support for doubles
  intel/nir: call nir_opt_constant_folding before nir_opt_algebraic is
    executed
  intel/nir: call nir_opt_constant_folding before
    brw_nir_apply_trig_workarounds
  i965/fs: add nir_op_f2f*_{rtne,rtz}
  i965/fs/nir: add nir_op_unpack_half_2x16_split_*_flush_to_zero
  i965/fs/generator: add support to set floating points modes in control
    register
  i965/fs: define emit_shader_float_controls_execution_mode() and aux
    functions
  i965/fs: emit shader float controls execution modes as first
    instruction of shaders
  i965/fs: remove brw_rounding_mode() and use brw_float_controls_mode()
    instead
  i965/fs: add support for shader float control to
    remove_extra_rounding_modes()
  anv: add support for
    VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR
  anv: enable support for SPV_KHR_shader_float_controls capabilities
  anv: enable VK_KHR_shader_float_controls extension

 src/compiler/nir/nir.h                       |  15 +
 src/compiler/nir/nir_constant_expressions.py |  59 +++-
 src/compiler/nir/nir_lower_alu_to_scalar.c   |  10 +-
 src/compiler/nir/nir_lower_double_ops.c      |  12 +
 src/compiler/nir/nir_opcodes.py              |  11 +-
 src/compiler/nir/nir_opcodes_c.py            |   4 +-
 src/compiler/nir/nir_opt_algebraic.py        |   2 -
 src/compiler/nir/nir_opt_constant_folding.c  |  74 ++++-
 src/compiler/shader_enums.h                  |  14 +
 src/compiler/shader_info.h                   |   4 +
 src/compiler/spirv/spirv.core.grammar.json   | 316 ++++++++++++++-----
 src/compiler/spirv/spirv.h                   |  84 +++--
 src/compiler/spirv/spirv_to_nir.c            |  33 ++
 src/compiler/spirv/vtn_alu.c                 |  33 +-
 src/compiler/spirv/vtn_glsl450.c             |  26 +-
 src/intel/compiler/brw_eu.h                  |   4 +-
 src/intel/compiler/brw_eu_defines.h          |  10 +
 src/intel/compiler/brw_eu_emit.c             |  52 ++-
 src/intel/compiler/brw_fs.cpp                |  20 +-
 src/intel/compiler/brw_fs.h                  |   1 +
 src/intel/compiler/brw_fs_generator.cpp      |  19 +-
 src/intel/compiler/brw_fs_nir.cpp            |  40 ++-
 src/intel/compiler/brw_fs_visitor.cpp        |  52 +++
 src/intel/compiler/brw_nir.c                 |   6 +-
 src/intel/compiler/brw_shader.cpp            |   3 +
 src/intel/vulkan/anv_device.c                |  31 ++
 src/intel/vulkan/anv_extensions.py           |   1 +
 src/intel/vulkan/anv_pipeline.c              |   1 +
 src/util/Makefile.sources                    |   2 +
 src/util/double.c                            | 197 ++++++++++++
 src/util/double.h                            |  46 +++
 src/util/half_float.c                        |  74 +++++
 src/util/half_float.h                        |   7 +
 src/util/meson.build                         |   2 +
 34 files changed, 1072 insertions(+), 193 deletions(-)
 create mode 100644 src/util/double.c
 create mode 100644 src/util/double.h

-- 
2.19.1



More information about the mesa-dev mailing list