diff options
author | Iago Toral Quiroga <[email protected]> | 2018-12-14 08:54:36 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-01-02 07:54:05 +0100 |
commit | 5fc9ad1cb0f205b3fcf988338bc28a86e2b572b6 (patch) | |
tree | f9aabd79983db16dd2d218db7df5581c819fa029 /src/compiler | |
parent | 70be9afccb23aa636272b782f7b72b0a23d3d9d4 (diff) |
compiler/nir: add a nir_b2f() helper
Reviewed-by: Jason Ekstrand <[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 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) { |