diff options
author | Connor Abbott <[email protected]> | 2019-08-02 14:56:20 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-08-06 18:03:10 -0400 |
commit | e7fd90e8ef6dc9cf12108f53409fb71f0133cb01 (patch) | |
tree | 98ae4e3d9e0bfe19ff1be271248ecef1bfb4c272 /src/compiler | |
parent | f84c9ad17abfcfa66e9c0f0f23fdb387b29335e1 (diff) |
nir/builder: Add nir_b2i
Same as nir_b2f but for integers.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_builder.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 2fed76106eb..0f300aef155 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -1167,6 +1167,18 @@ nir_b2f(nir_builder *build, nir_ssa_def *b, uint32_t bit_size) } static inline nir_ssa_def * +nir_b2i(nir_builder *build, nir_ssa_def *b, uint32_t bit_size) +{ + switch (bit_size) { + case 64: return nir_b2i64(build, b); + case 32: return nir_b2i32(build, b); + case 16: return nir_b2i16(build, b); + case 8: return nir_b2i8(build, b); + default: + unreachable("Invalid bit-size"); + }; +} +static inline nir_ssa_def * nir_load_barycentric(nir_builder *build, nir_intrinsic_op op, unsigned interp_mode) { |