Hash :
8bae2565
Author :
Date :
2025-08-22T14:38:23
Vulkan: Improve VertexArrayVk::syncState VertexArrayVk::syncState often time shows up the biggest single API in simpleperf. For example, in tower_of_fantasy it is 7.9% of all CPU time in libANGLE. This function also uses macros which made it hard to debug. This CL removes the usage of macros which makes code much easier to handle. The other real problem is that we are repeatedly calling syncDirtyAttrib() function for disabled attributes. This CL breaks the dirty bits into bindingDirtyBits and bufferDataDiryBits and attribDirtyBits. Only attribDirtyBits will end up doing the actual state sync. All other dirty bits will just turn them into attribDirtyBits. Also disabled attributes will be looped separately. This simplification makes it impossible to have duplicate state syncs since we only call sync*Attrib at the end of function. By splitting syncDirtyAttrib into syncDirtyEnabledAttrib/syncDirtyDIsabledAttrib/syncNeedsConversionAttrib, we also moved the if check from syncDirtyAttrib (which is called within for loop) to syncState. With this CL, simpleperf shows this function has reduced from 7.9% to 5.9%. Bug: b/439073246 Change-Id: I99b5ff0b34a5992e31541d2e9cd81ff5c9dda716 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6876527 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
This folder contains shared back-end-specific implementation files. The classes
and types in renderer are not specified by GLES. They instead are common to
all the various ANGLE implementations.
See renderer_utils.h for various cross back-end utilties.
The ANGLE format class, angle::Format, works as a union
between GLES and all the various back-end formats. It can represent any type
of format in ANGLE. e.g. Formats in Vulkan that don’t exist in GLES, or DXGI
formats that don’t exist in GLES, or Windows/Android surface configs that
don’t exist anywhere else.
The glInternalFormat member of angle::Format represents the “closest” GL
format for an ANGLE format. For formats that don’t exist in GLES this will
not be exactly what the format represents.
The back-ends also define their own format tables. See the Vulkan Format table docs and the [D3D11 format table docs][D23D11FormatDocs].
DXGI formats are used in both the GL and D3D11 back-end. Therefore the generated info table lives in this common shared location.
The DXGI info table is generated by gen_dxgi_format_table.py
and sources data from dxgi_format_data.json. The
main purpose of the table is to convert from a DXGI format to an ANGLE
format, where the ANGLE format should have all the necessary information.