commit | daa23f9096fb87013df181d3b06b18e9a5c0a03f | [log] [tgz] |
---|---|---|
author | Yiwei Zhang <zzyiwei@google.com> | Fri Jun 09 02:59:22 2023 +0000 |
committer | SkCQ <skcq-be@skia-corp.google.com.iam.gserviceaccount.com> | Fri Jun 09 13:53:21 2023 +0000 |
tree | 890b2b17689a2bb9564d61d7e9394b6be4ea92ad | |
parent | e5d557c6ee669eadeae928c085f8a8dbd4f57312 [diff] |
Update VkHardwareBufferTest to also fallback for ahb mem type Aligns with https://skia-review.googlesource.com/c/skia/+/709099 Bug: b/286465032 Test: UnitTest_VulkanHardwareBuffer_CPU_Vulkan Change-Id: I2cd076b3e436ea3f9aa6d4956b7e9cc0cd3ab014 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/709756 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Auto-Submit: Yiwei Zhang <zzyiwei@google.com> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/tests/VkHardwareBufferTest.cpp b/tests/VkHardwareBufferTest.cpp index 59cd1cc..a2eefed 100644 --- a/tests/VkHardwareBufferTest.cpp +++ b/tests/VkHardwareBufferTest.cpp
@@ -752,6 +752,13 @@ } } } + + // Fallback to align with GrAHardwareBufferUtils + if (!foundHeap && hwbProps.memoryTypeBits) { + typeIndex = ffs(hwbProps.memoryTypeBits) - 1; + foundHeap = true; + } + if (!foundHeap) { ERRORF(reporter, "Failed to find valid heap for imported memory"); return false;