nir: fix denorms in unpack_half_1x16()
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 9 Jul 2018 07:46:59 +0000 (09:46 +0200)
committerAndres Gomez <agomez@igalia.com>
Tue, 17 Sep 2019 20:39:18 +0000 (23:39 +0300)
commit1e0e3ed15a8cfb98a182714bcb3e55cfab5c3df7
treef43a7a815e6e9ac306651ca21bf1ee7dd2ec79d4
parentf097247dd831da9b6e48baebc8b91efec3afcd28
nir: fix denorms in unpack_half_1x16()

According to VK_KHR_shader_float_controls:

"Denormalized values obtained via unpacking an integer into a vector
 of values with smaller bit width and interpreting those values as
 floating-point numbers must: be flushed to zero, unless the entry
 point is declared with the code:DenormPreserve execution mode."

v2:
- Add nir_op_unpack_half_2x16_flush_to_zero opcode (Connor).

v3:
- Adapt to use the new NIR lowering framework (Andres).

v4:
- Updated to renamed shader info member and enum values (Andres).

v5:
- Simplify flags logic operations (Caio).

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com> [v2]
src/compiler/nir/nir_constant_expressions.py
src/compiler/nir/nir_lower_alu_to_scalar.c
src/compiler/nir/nir_opcodes.py
src/compiler/spirv/vtn_glsl450.c