BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.72k stars 267 forks source link

Use `packed_ull` for values larger than four bytes #334

Closed jmousseau closed 10 months ago

jmousseau commented 2 years ago

The packed_uint uint32_t() operator will truncate values exceeding four bytes. In practice, this is probably never a concern for the current packed_uint<8> use cases (all KTX2), so this work could be considered a compiler warning fix.

I first attempted to add a uint64_t() operator to packed_uint, but that caused a bunch of ambiguous operator compiler errors. There's probably a way to implement this change by updating packed_uint and doing some fancy templating, but my attempts to do so were unsuccessful (and complex).