Traverse-Research / Traverse-Research/gpu-allocator
It's impossible to bind to a host memory which is not coherent.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 497
- Forks
- 82
- Avg merge
- 18d 17h
- Merged PRs (30d)
- 1
Description
Hi.
Maybe I'm wrong but when I look into the Allocator implementation I see the following in the Allocator::allocate method:
- If
MemoryLocation::CpuToGpuwas specified the function tries to find a memory type index for the preferred bitsvk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT | vk::MemoryPropertyFlags::HOST_CACHED. - If the previous attempt failed the function tries to find a memory type index for the required bits
vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT. - If the second attempt fails the function returns
Err(AllocationError::NoCompatibleMemoryTypeFound).
So there's no chance to allocate a host visible, non-coherent memory.
Also, in Allocator::new, there's no need to check for host_visible_not_coherent. From the Spec 11.2.1. Device Memory Properties:
There must be at least one memory type with both the VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_COHERENT_BIT bits set in its propertyFlags.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the Allocator::allocate and Allocator::new implementations, tracing the MemoryLocation::CpuToGpu memory-property selection and the host_visible_not_coherent check. Confirm the Vulkan memory-property requirements, then verify that host-visible, non-coherent memory can be selected without breaking the existing compatible-memory error path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100