WickedEngine icon indicating copy to clipboard operation
WickedEngine copied to clipboard

Terrain crash on Linux

Open portaloffreedom opened this issue 2 years ago • 5 comments

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}

portaloffreedom avatar Oct 16 '23 20:10 portaloffreedom

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.

brakhane avatar Oct 16 '23 21:10 brakhane

Intel Xe Mesa driver seems to not support sparse buffers

portaloffreedom avatar Oct 19 '23 20:10 portaloffreedom

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/

portaloffreedom avatar Nov 21 '23 12:11 portaloffreedom

@turanszkij Can we keep this open? Seems like github doesn't understand what "doesn't solve" means.

brakhane avatar Nov 22 '23 12:11 brakhane

Yeah, I didn't mean to close it, just happened automatically.

turanszkij avatar Nov 22 '23 12:11 turanszkij

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.

brakhane avatar May 25 '24 12:05 brakhane

Thanks, I'll close it then.

turanszkij avatar May 25 '24 13:05 turanszkij