nir/serialize: pack 1-component constants into 20 bits if possible
authorMarek Olšák <marek.olsak@amd.com>
Tue, 5 Nov 2019 03:25:15 +0000 (22:25 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 23 Nov 2019 05:02:10 +0000 (00:02 -0500)
commitd3346b275a476a5d3144b732610baa6b895a680a
tree5c8ea1fe90b43d4be6e56fbd0421d9e9ea694bb1
parent75f7c388637917d796fdf86c645a03c31621c1ca
nir/serialize: pack 1-component constants into 20 bits if possible

The majority of constants can be packed like this.

v2: - use enum for the packing encoding,
    - trim packed_value to 20 bits add 1 bit to last_component,
      which simplifies a later commit

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/compiler/nir/nir_serialize.c