diff options
Diffstat (limited to 'src/compiler/nir/nir_builder.h')
-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 826e549019a..74ecde798d5 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -986,6 +986,18 @@ nir_i2b(nir_builder *build, nir_ssa_def *i) } static inline nir_ssa_def * +nir_b2f(nir_builder *build, nir_ssa_def *b, uint32_t bit_size) +{ + switch (bit_size) { + case 64: return nir_b2f64(build, b); + case 32: return nir_b2f32(build, b); + case 16: return nir_b2f16(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) { |