mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Perf] (DirectGLES): upload the union dirty box instead of scatter rects when staging through the unpack ring (each PBO-sourced glTexSubImage is a GPU copy job on Mali; ~100 sprite rects per tick cost +6ms/frame of GPU time)
This commit is contained in:
@@ -4002,6 +4002,15 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
dirtyRectCount = textureMipmapObject->GetStorageDirtyRects(
|
||||
uploadTarget, level, dirtyRects,
|
||||
MG_State::GLState::MipmapStorage::kMaxDirtyRects);
|
||||
// The scatter refinement pays only on the client-pointer path,
|
||||
// where fewer bytes mean less driver-side copying. Through the
|
||||
// unpack ring every glTexSubImage is a GPU copy job (Mali), so
|
||||
// ~100 sprite rects become ~100 jobs whose fixed cost dwarfs
|
||||
// the union box's extra bytes - measured +6 ms/frame of GPU
|
||||
// time in MC's animated-atlas ticks. One box, one job.
|
||||
if (BufferImpl::UnpackRingAvailable()) {
|
||||
dirtyRectCount = 0;
|
||||
}
|
||||
}
|
||||
const auto rectShadowPtr = [&](const MG_State::GLState::MipmapDirtyRegion& rect) {
|
||||
return static_cast<const Uint8*>(uploadData) +
|
||||
|
||||
Reference in New Issue
Block a user