Use 4-byte LightmapSlabIndex for batching instead of 16-byte AssetId<Image> #18326
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Less data accessed and compared gives better batching performance.
Objective
Solution
LightmapSlabIndex(aNonMaxU32which is 4 bytes) instead of the lightmapAssetId<Image>(an enum where the largest variant is a 16-byte UUID) to discern the ability to batch.Testing
Tested main (yellow) vs this PR (red) on an M4 Max using the

many_cubesexample withWGPU_SETTINGS_PRIO=webgl2to avoid GPU-preprocessing, and modifying the materials inmany_cubesto haveAlphaMode::Blendso that they would rely on the less efficient sorted render phase batching.A 44.75us or 7.5% reduction in median execution time of the batch and prepare sorted render phase system for the
Transparent3dphase (handling 160k cubes).Migration Guide
RenderLightmap::new()no longer takes anAssetId<Image>argument for the asset id of the lightmap image.