I am working on a resource manager for a DX12 framework. I have it setup with a buddy allocator system like the vulkan memory allocator by AMD. But there is one issue - map and unmap. Lets say I have an upload buffer and I make two suballocations from the upload buffer for two constant buffers. I map the upload buffer at the specific offsets, do a memcpy and unmap with the appropriate write range.
mapBuffer(triangleCBV);
memcpy(triangleCBV->address, triData);
unmapBuffer(triangleCBV, triangleCBVOffset);
mapBuffer(rectCBV);
memcpy(rectCBV->address, rectData);
unmapBuffer(rectCBV, rectCBVOffset);
The second map does nothing. I only see the triangle and the rect never seems to get the cbv data. The data is just a float4 for color.
↧