summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-01-26 09:36:58 -0800
committerJason Ekstrand <[email protected]>2015-01-26 11:25:02 -0800
commit9bd28fe3a305605168417234a163b6702bbde9d6 (patch)
treeb2a07eb30369461bd7c8eaf4af4691a87eaa3ad3 /src
parent27c6e3e4ca665c528b94937b1b0a7c10de515d89 (diff)
nir/opcodes: Simplify and fix the unpack_half_*_split_* constant expressions
Previously, these functions were explicitly writing to dst.x and dst.y. However they both return only one component so writing to dst.y is invalid. Also, since they only return one component, we don't need the explicit assignment in the expression and can simplify it use an implicit assignment. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/nir_opcodes.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
index 5fe957296eb..0fa8bf543da 100644
--- a/src/glsl/nir/nir_opcodes.py
+++ b/src/glsl/nir/nir_opcodes.py
@@ -252,12 +252,10 @@ unpack_2x16("half")
# Lowered floating point unpacking operations.
-unop_horiz("unpack_half_2x16_split_x", 1, tfloat, 1, tunsigned, """
-dst.x = unpack_half_1x16((uint16_t)(src0.x & 0xffff));
-""")
-unop_horiz("unpack_half_2x16_split_y", 1, tfloat, 1, tunsigned, """
-dst.y = unpack_half_1x16((uint16_t)(src0.x >> 16));
-""")
+unop_horiz("unpack_half_2x16_split_x", 1, tfloat, 1, tunsigned,
+ "unpack_half_1x16((uint16_t)(src0.x & 0xffff))")
+unop_horiz("unpack_half_2x16_split_y", 1, tfloat, 1, tunsigned,
+ "unpack_half_1x16((uint16_t)(src0.x >> 16))")
# Bit operations, part of ARB_gpu_shader5.