diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-01-10 15:16:05 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-11 19:17:30 +0000 |
commit | deb7998834245983ae89b776256d47c2eeb39192 (patch) | |
tree | 4fb9c628a1e1df115e8e98a962f36ae7fbbc42b6 /src/gpu/vk | |
parent | ba00d226c3ce65ba36907671fc00b9dc03ec43c7 (diff) |
Fix buffer size assertion in Vulkan
Bug: skia:
Change-Id: I2b878ec288b6dac891fc3724678a528d2db08b09
Reviewed-on: https://skia-review.googlesource.com/93362
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/vk')
-rw-r--r-- | src/gpu/vk/GrVkBuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/vk/GrVkBuffer.cpp b/src/gpu/vk/GrVkBuffer.cpp index a93a16e3cc..5aa3fb0c15 100644 --- a/src/gpu/vk/GrVkBuffer.cpp +++ b/src/gpu/vk/GrVkBuffer.cpp @@ -193,7 +193,9 @@ void GrVkBuffer::internalUnmap(GrVkGpu* gpu, size_t size) { VK_CALL(gpu, UnmapMemory(gpu->device(), this->alloc().fMemory)); fMapPtr = nullptr; } else { - if (size <= 65536) { + // vkCmdUpdateBuffer requires size < 64k and 4-byte alignment. + // https://bugs.chromium.org/p/skia/issues/detail?id=7488 + if (size <= 65536 && 0 == (size & 0x3)) { gpu->updateBuffer(this, fMapPtr, this->offset(), size); } else { GrVkTransferBuffer* transferBuffer = |