Skip to content

gpu: Fix off-by-one error in gsk_vulkan_mipmap_levels

Janne Grunau requested to merge jannau/gtk:gsk-vulkan-mip-levels into main

The dimensions for the next mipmap level are calculated by a truncating division by two. Subtracting one from the dimensions results in omitting one mipmap level for power of two dimensions. Also makes the special handling for 1x1 images from commit 9fe9ea34 ("vulkan: Handle generating mipmaps for 1x1 images") unnecessary.

Noticed by the vulkan validation layers for 2x2 images which are created with .mipLevels = 1 but use .baseMipLevel = 1 in gsk_gpu_render_pass_end_op_vk_command().

Merge request reports

Loading