Terrain crash on Linux
Adding the terrain from the editor enters a crash. Cause is Division by zero. Crash is happening here: https://github.com/turanszkij/WickedEngine/blob/master/WickedEngine/wiTerrain.cpp#L1210-L1211
region.width = atlas.maps[map_type].texture.desc.width / atlas.maps[map_type].texture.sparse_properties->tile_width;
region.height = atlas.maps[map_type].texture.desc.height / atlas.maps[map_type].texture.sparse_properties->tile_height;
The debugger shows the sparse_properties to be zero:
(gdb) print sparse_properties
$1 = (const wi::graphics::SparseTextureProperties *) 0x5555572f85c8
(gdb) print *sparse_properties
$2 = {tile_width = 0, tile_height = 0, tile_depth = 0, total_tile_count = 16384, packed_mip_start = 0, packed_mip_count = 0, packed_mip_tile_offset = 0, packed_mip_tile_count = 0}
That happens when the GPU does not support sparse buffers. The engine treats it as an optional feature, but the terrain system assumes it does exist.
Intel Xe Mesa driver seems to not support sparse buffers
This should be fixed once Mesa 24 is out. https://www.gamingonlinux.com/2023/11/intel-vulkan-drivers-on-linux-should-run-more-games-with-mesa-24-0/
@turanszkij Can we keep this open? Seems like github doesn't understand what "doesn't solve" means.
Yeah, I didn't mean to close it, just happened automatically.
With the recent drivers, terrain now works for me on Intel Xe. Granted, it's almost measured in SPF and not FPS, but it doesn't crash anymore.
Thanks, I'll close it then.