Skip to main content

grid_2d

Function grid_2d 

Source
pub fn grid_2d(
    total_cubes: u32,
    limits: &GpuLimits,
) -> Result<(u32, u32), CubeclUtilsErrors>
Expand description

Split a flat cube count into a 2D grid within the device’s x/y limits.

Convenience wrapper over grid_2d_limited using the smaller of the device’s x and y cube-count limits, so the result is valid on either axis.

§Params

§Returns

(x, y) with x * y >= total_cubes, or GridTooLarge.