Skip to content

Code panics when setting up a bind group #4189

Answered by cwfitzgerald
scott-wilson asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think you need to map that buffer at creation at all. It's recieving data.

I thought that unmapping the buffer would clear the buffer before it is sent to the CPU. I assume that I could think of unmapping the buffer as "close the buffer from writing to in the GPU to be read from in the CPU"?

You've got it flipped. Mapping allows cpu access of a buffer, by saying "allow me access once the GPU is done". The unmap operation is handing the ownership back to the GPU. Mapping does not modify the contents of the buffer at all, outside of what you explicitly change on the CPU while it's mapped.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@scott-wilson
Comment options

@cwfitzgerald
Comment options

@scott-wilson
Comment options

@cwfitzgerald
Comment options

Answer selected by scott-wilson
@scott-wilson
Comment options

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