Commit 6233955b286ea115b7d8e38075ec4fa7094bab9c

Yuxin Hu 2025-10-13T17:58:29

Optimize SetUniform for isFloat16 case Before this change, we use a temporary std::vector<GLshort> to store the transformed GLshort uniform data. This incurs heap memory allocation and deallocation every time we call SetUniform(). This change removes the temporary std::vector<GLshort>, and use the stack memory to store the transformed GLshort uniform data. To make code easier to read, placing the UpdateBufferWithLayout() function for the special GLshort case inside the SetUniform() itself, and remove the UpdateBufferWithLayout implementation for GLshort type. On Pixel 9, the driver_overhead_2 trace wall_time changes from 9.4 ms to 8.7 ms after this change. Bug: angleproject:405795981 Change-Id: I7508e4a3e3c4615129ef540b0b4d6b3feea0e705 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7038417 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>