Skip to content

UpdateBuffer() #214

Answered by TheMostDiligent
RobertMtx asked this question in Q&A
Oct 13, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Could anyone help me understand why that's necessary, and is there any way to avoid the allocation and additional copy?

It is because GPU-local memory is generally not directly accessible by GPU. You have to use temporary memory that CPU can write to and GPU can read from.

is there any way to avoid the allocation and additional copy?

Use dynamic buffers. They allow writing to GPU-readable memory directly.

I try to avoid doing allocations per frame in my app.

Allocation for Update buffer is very fast. The performance bottleneck there is state transition required to perform the copy operation.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RobertMtx
Comment options

@TheMostDiligent
Comment options

Answer selected by RobertMtx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants