Hash :
c60e247e
Author :
Date :
2024-06-04T17:40:26
Make LinkedUniform.getElementComponents() fully inline-able Before this CL, getElementComponents() calls into GetUniformTypeInfoFromIndex() which cannot be inlined as it uses kInfoTable from uniform_type_info_autogen.cpp. That table is fairly large however, so this CL adds the elementComponents part of that structure to an inlinle GetUniformElementComponents() function. This allows to fully inline LinkedUniform.getElementComponents() which significantly simplifies clampUniformCount() assembly code, to the point where this leads to a (small but) measurable performance improvement in driver_overhead_2 trace despite getElementComponents _never actually getting called_ (because count is always == 1 and clampUniformCount returns early). This appears to be caused by a side effect of the function call, where clang generates prologue and epilogue instructions that are still executed on the fast path when the function is not getting called (even if ANGLE_LIKELY is added or code rearranged). Bug: b/335295728 Change-Id: If8f2068b098576246ab90ffbacd5a520cc843f49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5597885 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>