BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.7k stars 263 forks source link

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

Closed jmousseau closed 9 months ago

jmousseau commented 1 year 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).