aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkPipelineState.cpp
diff options
context:
space:
mode:
authorGravatar dskiba <dskiba@chromium.org>2016-11-29 06:50:35 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-11-29 06:50:35 -0800
commite4cd00699167cefde9abedbd49ede64f82d552c7 (patch)
tree4921bc19c367263ce66532675cb846ee3bc383ee /src/gpu/vk/GrVkPipelineState.cpp
parentc51c18fd783737391e26541cbb5a72af2396ef7b (diff)
Make GrMemoryPool play nice with bucketing allocators.
Some memory allocators have very coarse size buckets, so for example on Android (jemalloc) an attempt to allocate 32 KiB + 1 byte will end up allocating 40 KiB, wasting 8 KiB. GrMemoryPool ctor takes two arguments that specify prealloc / block sizes, and then inflates them to accommodate some bookkeeping structures. Since most places create GrMemoryPools with pow2 numbers (which have buckets in most allocators) the inflation causes allocator to select next size bucket, wasting memory. This CL makes GrMemoryPool to stop inflating sizes it was created with, and allocate specified amounts exactly. Part of allocated memory is then used for bookkeeping structures. Additionally, GrObjectMemoryPool template is provided, which takes prealloc / block object counts (instead of sizes) and guarantees that specified number of objects will fit in prealloc / block spaces. BUG=651872 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2525773002 Review-Url: https://codereview.chromium.org/2525773002
Diffstat (limited to 'src/gpu/vk/GrVkPipelineState.cpp')
0 files changed, 0 insertions, 0 deletions