[Mesa-dev] [PATCH 1/2] nir: Add a fquantize2f16 opcode

Jason Ekstrand jason at jlekstrand.net
Tue Jan 12 15:35:55 PST 2016


This opcode simply takes a 32-bit floating-point value and reduces its
effective precision to 16 bits.
---
 src/glsl/nir/nir_opcodes.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
index d31507f..9dbb341 100644
--- a/src/glsl/nir/nir_opcodes.py
+++ b/src/glsl/nir/nir_opcodes.py
@@ -176,6 +176,7 @@ unop("ffloor", tfloat, "floorf(src0)")
 unop("ffract", tfloat, "src0 - floorf(src0)")
 unop("fround_even", tfloat, "_mesa_roundevenf(src0)")
 
+unop("fquantize2f16", tfloat, "_mesa_half_to_float(_mesa_float_to_half(src0))")
 
 # Trigonometric operations.
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list