3#define_import_path bevy_pbr::occlusion_culling 5fn get_aabb_size_in_pixels(aabb: vec4<f32>, depth_pyramid: texture_2d<f32>) -> vec2<f32> { 6 let depth_pyramid_size_mip_0 = vec2<f32>(textureDimensions(depth_pyramid, 0)); 7 let aabb_width_pixels = (aabb.z - aabb.x) * depth_pyramid_size_mip_0.x; 8 let aabb_height_pixels = (aabb.w - aabb.y) * depth_pyramid_size_mip_0.y; 9 return vec2(aabb_width_pixels, aabb_height_pixels); 14 aabb_pixel_size: vec2<f32>, 15 depth_pyramid: texture_2d<f32> 17 let aabb_width_pixels = aabb_pixel_size.x; 18 let aabb_height_pixels = aabb_pixel_size.y; 20 let depth_pyramid_size_mip_0 = vec2<f32>(textureDimensions(depth_pyramid, 0)); 21 let depth_level = max(0, i32(ceil(log2(max(aabb_width_pixels, aabb_height_pixels))))); 22 let depth_pyramid_size = vec2<f32>(textureDimensions(depth_pyramid, depth_level)); 23 let aabb_top_left = vec2<u32>(aabb.xy * depth_pyramid_size); 25 let depth_quad_a = textureLoad(depth_pyramid, aabb_top_left, depth_level).x; 26 let depth_quad_b = textureLoad(depth_pyramid, aabb_top_left + vec2(1u, 0u), depth_level).x; 27 let depth_quad_c = textureLoad(depth_pyramid, aabb_top_left + vec2(0u, 1u), depth_level).x; 28 let depth_quad_d = textureLoad(depth_pyramid, aabb_top_left + vec2(1u, 1u), depth_level).x; 29 return min(min(depth_quad_a, depth_quad_b), min(depth_quad_c, depth_quad_d));