From: Rob Clark <robcl...@freedesktop.org> I need something like this in a couple places. And didn't see anything like it anywhere.
Signed-off-by: Rob Clark <robcl...@freedesktop.org> --- src/glsl/nir/nir.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 98b0ec3..3a96d56 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -506,6 +506,15 @@ typedef struct { bool is_ssa; } nir_dest; +static inline unsigned +nir_dest_num_components(nir_dest *dest) +{ + if (dest->is_ssa) + return dest->ssa.num_components; + else + return dest->reg.reg->num_components; +} + static inline nir_src nir_src_for_ssa(nir_ssa_def *def) { -- 2.3.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev