LibGL+LibSoftGPU: Use more expressive is_power_of_two

This commit is contained in:
Jelle Raaijmakers 2022-01-30 16:11:36 +01:00 committed by Linus Groh
commit 7004b20656
Notes: sideshowbarker 2024-07-17 18:23:28 +09:00
2 changed files with 5 additions and 10 deletions

View file

@ -19,14 +19,9 @@ Image::Image(unsigned width, unsigned height, unsigned depth, unsigned max_level
VERIFY(max_levels > 0);
VERIFY(layers > 0);
if ((width & (width - 1)) == 0)
m_width_is_power_of_two = true;
if ((height & (height - 1)) == 0)
m_height_is_power_of_two = true;
if ((depth & (depth - 1)) == 0)
m_depth_is_power_of_two = true;
m_width_is_power_of_two = is_power_of_two(width);
m_height_is_power_of_two = is_power_of_two(height);
m_depth_is_power_of_two = is_power_of_two(depth);
unsigned level;
for (level = 0; level < max_levels; ++level) {