Lift vertex buffer creation into the common API layer#1113
Open
EmilioLaiso wants to merge 3 commits intollvm:mainfrom
Open
Lift vertex buffer creation into the common API layer#1113EmilioLaiso wants to merge 3 commits intollvm:mainfrom
EmilioLaiso wants to merge 3 commits intollvm:mainfrom
Conversation
Add `VertexBuffers` parsing to pipeline yaml use new parsed vtx buffers in backends rebase fixups fixup vertex buffer definition in new sampletexture2d test migrate new tests to new VB yaml definition createVertexBuffer in api-agnostic device rebase fixup: `getFormatSize` -> `getFormatSizeInBytes` rename fmt const remove VertexBuffer abstraction. Rely on ParsedVertexBuffer for input layout and buffer metadata revert test VB definition changes
Comment on lines
+40
to
+44
| // Maps the buffer's memory for host access. Only valid for CpuToGpu and | ||
| // GpuToCpu buffers; returns an error for GpuOnly. Each successful map() must | ||
| // be paired with a call to unmap(). | ||
| virtual llvm::Expected<void *> map() = 0; | ||
| virtual llvm::Error unmap() = 0; |
Contributor
There was a problem hiding this comment.
I think this is a fine change for now, as the framework already maps and unmaps buffers. However, the modern APIs allow for persistently mapped resources and I think we should embrace those as well. Although I think that's better for a follow-up PR once the abstraction layer is in a more complete state.
manon-traverse
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lift vertex buffer creation into the common API layer and unifies it across the DX, Vulkan, and Metal backends.
BufferAPIgetSizeInBytes(),map(),unmap()toBuffer.BufferUsage { Storage, VertexBuffer }onBufferCreateDesc.createVertexBufferFromCPUBuffer(Device&, const CPUBuffer&)DirectX
HEAP_TYPE_DEFAULTgetsALLOW_UNORDERED_ACCESS