bevy/crates
Lain-dono 24e5e10cd4 Use 3 bits of PipelineKey to store MSAA sample count (#5826)
Sample count always power of two. Thus, it is enough to store `log2(sample_count)`.
This can be implemented using [u32::trailing_zeros](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.trailing_zeros). Then we can restore sample count with the `1 << stored`.
You get 3 bits instead of 6 and up to 128x MSAA. This is more than is supported by any common hardware.

Full table of possible variations:

```
    original MSAA sample count      stored    loaded
* 00000000000000000000000000000000 -> 000 -> 00000001  1
  00000000000000000000000000000001 -> 000 -> 00000001  1
  00000000000000000000000000000010 -> 001 -> 00000010  2
  00000000000000000000000000000100 -> 010 -> 00000100  4
  00000000000000000000000000001000 -> 011 -> 00001000  8
  00000000000000000000000000010000 -> 100 -> 00010000  16
  00000000000000000000000000100000 -> 101 -> 00100000  32
  00000000000000000000000001000000 -> 110 -> 01000000  64
  00000000000000000000000010000000 -> 111 -> 10000000  128
* 00000000000000000000000100000000 -> 000 -> 00000001  256
* 00000000000000000000001000000000 -> 001 -> 00000010  512
* 00000000000000000000010000000000 -> 010 -> 00000100  1024
* 00000000000000000000100000000000 -> 011 -> 00001000  2048
* 00000000000000000001000000000000 -> 100 -> 00010000  4096
* 00000000000000000010000000000000 -> 101 -> 00100000  8192
* 00000000000000000100000000000000 -> 110 -> 01000000  16384
* 00000000000000001000000000000000 -> 111 -> 10000000  32768
* 00000000000000010000000000000000 -> 000 -> 00000001  65536
* 00000000000000100000000000000000 -> 001 -> 00000010  131072
* 00000000000001000000000000000000 -> 010 -> 00000100  262144
* 00000000000010000000000000000000 -> 011 -> 00001000  524288
* 00000000000100000000000000000000 -> 100 -> 00010000  1048576
* 00000000001000000000000000000000 -> 101 -> 00100000  2097152
* 00000000010000000000000000000000 -> 110 -> 01000000  4194304
* 00000000100000000000000000000000 -> 111 -> 10000000  8388608
* 00000001000000000000000000000000 -> 000 -> 00000001  16777216
* 00000010000000000000000000000000 -> 001 -> 00000010  33554432
* 00000100000000000000000000000000 -> 010 -> 00000100  67108864
* 00001000000000000000000000000000 -> 011 -> 00001000  134217728
* 00010000000000000000000000000000 -> 100 -> 00010000  268435456
* 00100000000000000000000000000000 -> 101 -> 00100000  536870912
* 01000000000000000000000000000000 -> 110 -> 01000000  1073741824
* 10000000000000000000000000000000 -> 111 -> 10000000  2147483648
```
2022-08-30 03:00:39 +00:00
..
bevy_animation Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_app Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_asset Add note on ordering to AssetServerSettings docs. (#5706) 2022-08-30 02:40:18 +00:00
bevy_audio Remove Sync requirement in Decodable::Decoder (#5819) 2022-08-29 23:02:12 +00:00
bevy_core Add missing type registrations for bevy_math types (#5758) 2022-08-23 21:19:29 +00:00
bevy_core_pipeline register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_derive Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_diagnostic Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_dylib Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_dynamic_plugin Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_ecs Warning message for missing events (#5730) 2022-08-30 02:23:04 +00:00
bevy_ecs_compile_fail_tests Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_encase_derive Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_gilrs Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_gltf Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_hierarchy Remove duplicate asserts in test (#5648) 2022-08-15 23:03:42 +00:00
bevy_input register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_internal Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_log Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_macro_utils Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_math Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_mikktspace Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_pbr Use 3 bits of PipelineKey to store MSAA sample count (#5826) 2022-08-30 03:00:39 +00:00
bevy_ptr Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_reflect bevy_reflect: Remove unnecessary Clone bounds (#5783) 2022-08-24 21:21:11 +00:00
bevy_render register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_scene Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_sprite Use 3 bits of PipelineKey to store MSAA sample count (#5826) 2022-08-30 03:00:39 +00:00
bevy_tasks Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_text register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_time register missing reflect types (#5747) 2022-08-23 17:41:39 +00:00
bevy_transform Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_ui Add UI scaling (#5814) 2022-08-29 23:35:53 +00:00
bevy_utils Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_window Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_winit Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00