nir/format_convert: Rename nir_format_bitcast_uint_vec
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 13 Aug 2018 19:57:22 +0000 (14:57 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 29 Aug 2018 19:04:02 +0000 (14:04 -0500)
We have a name for that, it's called a uvec.  This just makes the
function name a bit shorter.  While we're here, we also add an assert
for one of the assumptions this function makes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir_format_convert.h
src/intel/blorp/blorp_blit.c

index 305273cdfdd0a099b67fcd403ef269b00f04a13c..f2eafcbf5b4b087c2ce7adceff9db5e57ca41e6e 100644 (file)
@@ -148,9 +148,10 @@ nir_format_pack_uint(nir_builder *b, nir_ssa_def *color,
 }
 
 static inline nir_ssa_def *
-nir_format_bitcast_uint_vec_unmasked(nir_builder *b, nir_ssa_def *src,
-                                     unsigned src_bits, unsigned dst_bits)
+nir_format_bitcast_uvec_unmasked(nir_builder *b, nir_ssa_def *src,
+                                 unsigned src_bits, unsigned dst_bits)
 {
+   assert(src->bit_size >= src_bits && src->bit_size >= dst_bits);
    assert(src_bits == 8 || src_bits == 16 || src_bits == 32);
    assert(dst_bits == 8 || dst_bits == 16 || dst_bits == 32);
 
index 7cc580abd06363244da3c323511ff7e4d4d515c6..60cb32641d60fe879f21a1fcff4118210c1cd25d 100644 (file)
@@ -939,7 +939,7 @@ bit_cast_color(struct nir_builder *b, nir_ssa_def *color,
          isl_format_get_num_channels(key->src_format);
       color = nir_channels(b, color, (1 << src_channels) - 1);
 
-      color = nir_format_bitcast_uint_vec_unmasked(b, color, src_bpc, dst_bpc);
+      color = nir_format_bitcast_uvec_unmasked(b, color, src_bpc, dst_bpc);
    }
 
    /* Blorp likes to assume that colors are vec4s */