CPU Memory Buffer #208
-
How would one go about creating a full-CPU-memory-based buffer, such as a vertex buffer that resides entirely in CPU ram? Is this type of thing possible in Diligent Engine? My D3D9 based engine used these system memory buffers for mesh conversions, and to perform offline operations on them. Its pretty handy, because you can use existing mesh classes during offline operations, while having full read/write access to the data. I've searched around, but could not find information about targeting specific memory pools for buffers. I think this would relate to D3D12_MEMORY_POOL_L0 vs D3D12_MEMORY_POOL_L1? But I haven't found an equivalent setting in Diligent. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You will need to implement it yourself. CPU memory is just a CPU memory. When you are done with it, you can copy the data to a GPU (USAGE_DEFAULT) memory buffer. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I looked at the D3D12 impl of buffer creation and figured that was the case, so I went ahead and wrote a custom buffer class that diverges logic when necessary. I think I was using D3DX9 tools with the buffers in the past, so this wasn't really an option back then. My engine is over 1800 source files and I'm still converting code to Diligent, so no idea yet what trouble I may run into because of the change. Thanks for help! |
Beta Was this translation helpful? Give feedback.
You will need to implement it yourself. CPU memory is just a CPU memory. When you are done with it, you can copy the data to a GPU (USAGE_DEFAULT) memory buffer.