godot/modules
Arseny Kapoulkine 260287b3a1 Rewrite index optimization code for maximum efficiency
While all the previous fixes to optimizeVertexCache invocation fixed the
vertex transform efficiency, the import code still was missing two
crucial recommendations from meshoptimizer documentation:

- All meshes should be optimized for vertex cache (this reorders
  vertices for maximum fetch efficiency)
- When LODs are used with a shared vertex buffer, the vertex order
  should be generated by doing a vertex fetch optimization on the
  concatenated index buffer from coarse to fine LODs; this maximizes
  fetch efficiency for coarse LODs

The last point is especially crucial for Mali GPUs; unlike other GPUs
where vertex order affects fetch efficiency but not shading, these GPUs
have various shading quirks (depending on the GPU generation) that
really require consecutive index ranges for each LOD, which requires the
second optimization mentioned above. However all of these also help
desktop GPUs and other mobile GPUs as well.

Because this optimization is "global" in the sense that it affects all
LODs and all vertex arrays in concert, I've taken this opportunity to
isolate all optimization code in this function and pull it out of
generate_lods and create_shadow_mesh; this doesn't change the vertex
cache efficiency, but makes the code cleaner. Consequently,
optimize_indices should be called after other functions like
create_shadow_mesh / generate_lods.

This required exposing meshopt_optimizeVertexFetchRemap; as a drive-by,
meshopt_simplifySloppy was never used so it's not exposed anymore - this
will simplify future meshopt upgrades if they end up changing the
function's interface.
2024-11-04 06:58:06 -08:00
..
astcenc SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
basis_universal Don't include core/io/image.h in core/os/os.h 2024-10-18 19:04:19 +03:00
bcdec Fix decompressing textures with dimensions that are not multiples of 4 2024-10-06 11:13:39 +02:00
betsy Merge pull request #98247 from TCROC/fix-headless-graphics-driver-and-shader-crash 2024-10-24 13:22:53 -05:00
bmp SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
camera Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
csg Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
cvtt Replace squish with bcdec for BC decompression 2024-09-26 14:42:54 +02:00
dds DDS: Add support for loading layered textures 2024-10-29 20:55:22 +01:00
enet Add method for getting packet flags from ENetPacketPeer 2024-10-02 14:34:06 +02:00
etcpak SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
fbx SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
freetype SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
gdscript Merge pull request #47502 from KoBeWi/add_0 2024-10-31 20:14:39 -05:00
glslang SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
gltf Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
godot_physics_2d Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
godot_physics_3d Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
gridmap Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
hdr SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
interactive_music Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
jpg SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
jsonrpc SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
ktx SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
lightmapper_rd Merge pull request #97483 from akien-mga/clang-format-19.1.0 2024-09-26 12:46:04 +02:00
mbedtls Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
meshoptimizer Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
minimp3 SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
mobile_vr Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
mono Merge pull request #47502 from KoBeWi/add_0 2024-10-31 20:14:39 -05:00
msdfgen SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
multiplayer Merge pull request #98039 from aaronfranke/button-icon 2024-10-29 19:25:59 -05:00
navigation Merge pull request #98039 from aaronfranke/button-icon 2024-10-29 19:25:59 -05:00
noise Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
ogg SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
openxr Merge pull request #98039 from aaronfranke/button-icon 2024-10-29 19:25:59 -05:00
raycast Fix Occlusion Culling not working for an orthogonal camera. 2024-10-26 20:07:34 +02:00
regex SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
svg optimize ImageLoaderSVG::create_image_from_utf8_buffer 2024-10-19 14:09:34 +09:00
text_server_adv Update ICU to 76.1 2024-10-24 22:47:59 +03:00
text_server_fb Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
tga Don't include core/io/image.h in core/os/os.h 2024-10-18 19:04:19 +03:00
theora Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
tinyexr Don't include core/io/image.h in core/os/os.h 2024-10-18 19:04:19 +03:00
upnp SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
vhacd SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
vorbis Vorbis: Remove redundant bounds check 2024-09-27 21:04:46 +05:30
webp SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
webrtc Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
websocket Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
webxr Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
xatlas_unwrap SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
zip SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
register_module_types.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
SCsub SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00