[graphite] Refactor UniformManager::calculateOffset
- Removed fCurUBOOffset. This variable mainly mirrored (and always
equaled) fOffset.
- UniformOffsetCalculator::calculateOffset computed offset twice and two
separate ways: once calling `sksltype_to_size` and once calling
Writer::WriteUniform with a null pointer. These two routines compute
the exact same value and the latter has support for arrays in Metal,
std140, std430 layout. Removed `sksltype_to_size`. Also removed size
calculation (which was used to independently update fCurUBOOffset))
from `get_ubo_aligned_offset`. Now it only computes the aligned start
offset.
- Renamed `calculateOffset` to `advanceOffset` to better reflect its
state mutating nature.
- `UniformManager::write` now calls `advanceOffset` instead of
duplicating the logic that mutates fOffset.
Bug: skia:13860
Change-Id: Iaff81dd629da55e5dc071d09690d32c6ebd2ce82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/596764
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
4 files changed