Commit 365d89a
[ET-VK] Fix VMA assertion caused by bool return type truncation
The `test_host_cached_available` function in Allocator.cpp was introduced in
D95836687 with a `bool` return type, but its return statements return
`VmaAllocationCreateFlags` values (`VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT`
= 0x1000 and `VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT` = 0x800).
The `bool` return type truncates both to `1`, which equals
`VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT` — not a host access flag.
This caused VMA to assert when allocating host-mapped staging buffers because
the allocation had `MAPPED_BIT` + `AUTO_PREFER_HOST` but no host access flag.
Fix the return type from `bool` to `VmaAllocationCreateFlags` so the correct
flag values are preserved.
Differential Revision: [D96151798](https://our.internmc.facebook.com/intern/diff/D96151798/)
ghstack-source-id: 350606504
Pull Request resolved: #181051 parent 9789b0e commit 365d89a
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments