Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrain crash on Linux #764

Closed
portaloffreedom opened this issue Oct 16, 2023 · 7 comments
Closed

Terrain crash on Linux #764

portaloffreedom opened this issue Oct 16, 2023 · 7 comments
Assignees
Labels
blocked Blocked for external reason

Comments

@portaloffreedom
Copy link
Collaborator

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}
@brakhane
Copy link
Contributor

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.

@portaloffreedom portaloffreedom changed the title Terrain crash on Linux (release) Terrain crash on Linux Oct 16, 2023
@portaloffreedom
Copy link
Collaborator Author

Intel Xe Mesa driver seems to not support sparse buffers

@turanszkij turanszkij added the blocked Blocked for external reason label Nov 11, 2023
@portaloffreedom
Copy link
Collaborator Author

brakhane added a commit to brakhane/WickedEngine that referenced this issue Nov 21, 2023
This doesn't fix turanszkij#764, but should make it clearer what is going
on when the terrain system is used without sparse buffer support.
@brakhane
Copy link
Contributor

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

@turanszkij turanszkij reopened this Nov 22, 2023
@turanszkij
Copy link
Owner

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

@brakhane
Copy link
Contributor

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.

@turanszkij
Copy link
Owner

Thanks, I'll close it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked for external reason
Projects
None yet
Development

No branches or pull requests

3 participants