godot/scene/resources
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
..
2d Compile certain CanvasItem._edit_*() functions with DEBUG_ENABLED 2024-11-02 15:43:18 -03:00
3d Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
animated_texture.cpp AnimatedTexture: Fix crash when loaded from a thread 2024-06-19 09:54:01 +02:00
animated_texture.h AnimatedTexture: Fix crash when loaded from a thread 2024-06-19 09:54:01 +02:00
animation_library.cpp Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
animation_library.h Optimise Object's get_argument_options 2024-02-29 18:00:54 +01:00
animation.compat.inc Fix seeking Animation immediate after playback for Discrete track 2024-06-08 22:09:37 +09:00
animation.cpp Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
animation.h Add markers to animation 2024-09-29 17:27:36 +09:00
atlas_texture.cpp Fix empty region in AtlasTexture 2024-07-18 15:31:59 +02:00
atlas_texture.h Fix empty region in AtlasTexture 2024-07-18 15:31:59 +02:00
audio_stream_polyphonic.compat.inc Add samples playback support 2024-06-18 11:06:31 -04:00
audio_stream_polyphonic.cpp Fix leak when using audio samples instead of streams 2024-09-04 12:56:03 -04:00
audio_stream_polyphonic.h Fix polyphonic audio streams with id > 1 cannot be stopped or changed (MSVC mis-optimization) 2024-07-22 14:08:02 +02:00
audio_stream_wav.cpp Merge pull request #96768 from DeeJayLSP/wav-end 2024-09-12 09:25:31 +02:00
audio_stream_wav.h AudioStream(Playback)WAV: Use LocalVectors instead of pointers 2024-09-08 02:32:59 -03:00
bit_map.cpp Avoid expensive sqrt operation in hot loop of BitMap.grow_mask 2024-09-12 11:04:57 -03:00
bit_map.h
bone_map.cpp Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
bone_map.h Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
camera_attributes.cpp Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
camera_attributes.h Style: Apply new clang-format changes 2024-09-20 08:09:48 -05:00
camera_texture.cpp Add linux camera support 2024-09-25 12:08:06 +02:00
camera_texture.h Add linux camera support 2024-09-25 12:08:06 +02:00
canvas_item_material.cpp Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile. 2024-10-02 15:11:58 -03:00
canvas_item_material.h Let materials' shaders update happen on loader threads 2024-05-06 19:40:00 +02:00
compositor.cpp Implement hooks into renderer 2024-02-18 21:54:21 +11:00
compositor.h Implement hooks into renderer 2024-02-18 21:54:21 +11:00
compressed_texture.cpp Add check in CompressedTextureLayered::get_layer_data to prevent crash 2024-02-16 22:41:05 +08:00
compressed_texture.h Add 'override' mark to ResourceFormat class 2024-03-25 04:06:34 +08:00
curve_texture.cpp Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
curve_texture.h
curve.cpp Support “clear points” function in Path3D editor 2024-03-27 12:40:30 +08:00
curve.h Support “clear points” function in Path3D editor 2024-03-27 12:40:30 +08:00
environment.cpp Implement glow/bloom on compatibility renderer 2024-02-19 13:29:43 +11:00
environment.h Add optional depth fog 2024-02-17 22:39:34 -03:00
external_texture.cpp ExternalTexture: Avoid error when destroyed without having been used 2024-10-23 10:04:38 +02:00
external_texture.h ExternalTexture: Avoid error when destroyed without having been used 2024-10-23 10:04:38 +02:00
font.compat.inc [TextServer / Font] Add support for customizable baseline offset. 2024-01-28 13:26:49 +02:00
font.cpp Merge pull request #93602 from aaronp64/inspector_latency 2024-08-22 00:10:26 +02:00
font.h [Font] Add check for cyclic base font dependencies. 2024-08-03 00:00:11 +03:00
gradient_texture.cpp Fix pink GradientTexture2D 2024-09-26 09:50:55 -03:00
gradient_texture.h Fix pink GradientTexture2D 2024-09-26 09:50:55 -03:00
gradient.cpp
gradient.h
image_texture.cpp
image_texture.h
immediate_mesh.cpp Fix immediate mesh modifications that don't call set_mesh 2024-10-03 18:08:49 -06:00
immediate_mesh.h
label_settings.cpp
label_settings.h
material.cpp Fix implementation of property_can_revert() in various classes 2024-10-04 23:02:04 +02:00
material.h Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile. 2024-10-02 15:11:58 -03:00
mesh_data_tool.compat.inc
mesh_data_tool.cpp
mesh_data_tool.h
mesh_texture.cpp
mesh_texture.h
mesh.cpp Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
mesh.h GDExtension: Mark virtual function as is_required in extension_api.json 2024-09-11 16:48:14 -05:00
multimesh.cpp Fixed Timestep Interpolation: MultiMesh 2024-08-18 17:14:59 +02:00
multimesh.h Fixed Timestep Interpolation: MultiMesh 2024-08-18 17:14:59 +02:00
navigation_mesh.cpp NavigationPolygon: Implement get/set_polygon fast paths. 2024-08-17 00:31:58 +02:00
navigation_mesh.h Extract navigation-related defaults to separate header 2024-08-27 20:12:10 +02:00
packed_scene.cpp Added a more detailed error message when instatiating a scene with missing export properties. 2024-09-16 16:08:55 +02:00
packed_scene.h Implement typed dictionaries 2024-09-04 10:27:26 -05:00
particle_process_material.cpp Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile. 2024-10-02 15:11:58 -03:00
particle_process_material.h Add cone angle control to particle emission ring shape 2024-09-02 14:35:51 +02:00
physics_material.cpp
physics_material.h
placeholder_textures.cpp Support immediately update ui after resizing placeholder* texture 2024-02-02 14:56:05 +08:00
placeholder_textures.h
portable_compressed_texture.cpp Mark underscored properties as internal 2024-07-30 18:50:00 +02:00
portable_compressed_texture.h Fix lossless formats in PortableCompressedTexture2D (fix data format storing) 2024-01-06 22:56:25 +05:00
resource_format_text.cpp Fix lost of gdextension on editor startup. 2024-10-20 18:39:31 -04:00
resource_format_text.h Fix SCU global namespace conflict in resource_format_text.cpp 2024-09-03 07:30:56 +01:00
SCsub SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
shader_include.cpp
shader_include.h Add 'override' mark to ResourceFormat class 2024-03-25 04:06:34 +08:00
shader.compat.inc Allow setting a cubemap as default parameter to shader 2024-08-27 09:43:05 +03:00
shader.cpp Merge pull request #97205 from tetrapod00/inspect-native-shader-code 2024-10-21 16:39:13 -05:00
shader.h Merge pull request #97205 from tetrapod00/inspect-native-shader-code 2024-10-21 16:39:13 -05:00
skeleton_profile.cpp Match the coding style for concatenating String 2024-06-09 18:35:23 +09:00
skeleton_profile.h [Animation] Expose SkeletonProfile.set/is_required 2024-03-30 20:57:55 +01:00
sky.cpp Make ShaderMaterial always the last option in inspector resource dropdowns 2024-02-05 21:49:17 +01:00
sky.h
sprite_frames.cpp Add duplicate animation 2024-09-01 17:00:47 +02:00
sprite_frames.h Add duplicate animation 2024-09-01 17:00:47 +02:00
style_box_flat.cpp Increase range hint for StyleBoxFlat border_width, corner_radius and expand_margin 2024-10-24 01:21:40 +02:00
style_box_flat.h
style_box_line.cpp
style_box_line.h
style_box_texture.cpp
style_box_texture.h
style_box.cpp GDExtension: Mark virtual function as is_required in extension_api.json 2024-09-11 16:48:14 -05:00
style_box.h GDExtension: Mark virtual function as is_required in extension_api.json 2024-09-11 16:48:14 -05:00
surface_tool.cpp Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
surface_tool.h Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
syntax_highlighter.cpp Fix editing of some properties in CodeHighlighter 2024-09-24 17:56:13 +02:00
syntax_highlighter.h Make native shader source visualizer can highlight uint suffix 2024-05-07 14:18:48 +08:00
text_file.cpp
text_file.h
text_line.cpp
text_line.h
text_paragraph.cpp Account for dropcap when calculating paragraph size, fix duplicate last char when using dropcap with autowrap off. 2024-08-29 09:37:23 +03:00
text_paragraph.h Set clang-format RemoveSemicolon rule to true 2024-10-25 13:49:43 -04:00
texture_rd.cpp Enforce calling RenderingDevice code from rendering thread in TextureRD classes 2024-01-29 14:47:50 -08:00
texture_rd.h Enforce calling RenderingDevice code from rendering thread in TextureRD classes 2024-01-29 14:47:50 -08:00
texture.cpp GDExtension: Mark virtual function as is_required in extension_api.json 2024-09-11 16:48:14 -05:00
texture.h GDExtension: Mark virtual function as is_required in extension_api.json 2024-09-11 16:48:14 -05:00
theme.cpp Improve Editor Inspector/Theme item lookup performance 2024-08-20 13:39:40 -04:00
theme.h Improve Editor Inspector/Theme item lookup performance 2024-08-20 13:39:40 -04:00
video_stream.cpp GDExtension: Mark virtual function as is_required in extension_api.json 2024-09-11 16:48:14 -05:00
video_stream.h GDExtension: Mark virtual function as is_required in extension_api.json 2024-09-11 16:48:14 -05:00
visual_shader_nodes.compat.inc Allow setting a cubemap as default parameter to shader 2024-08-27 09:43:05 +03:00
visual_shader_nodes.cpp Visual Shader: Add vector operations to Remap node 2024-09-22 11:25:36 -07:00
visual_shader_nodes.h Visual Shader: Add vector operations to Remap node 2024-09-22 11:25:36 -07:00
visual_shader_particle_nodes.cpp Reduce and prevent unnecessary random-access to List 2024-05-04 16:08:55 +02:00
visual_shader_particle_nodes.h Fix some missing categories in visual shader nodes 2024-03-05 19:39:23 +01:00
visual_shader_sdf_nodes.cpp
visual_shader_sdf_nodes.h Fix some missing categories in visual shader nodes 2024-03-05 19:39:23 +01:00
visual_shader.cpp Add alpha channel display to vec4 previews of visual shader nodes 2024-10-18 20:00:10 +03:00
visual_shader.h Allow setting a cubemap as default parameter to shader 2024-08-27 09:43:05 +03:00
world_2d.cpp Reorganize some code to have 2D things grouped together 2024-04-13 02:56:50 -07:00
world_2d.h Remove self includes in some files 2024-02-27 17:10:54 +01:00