Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

DX12: Map/Unmap a suballocation

$
0
0
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.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>