codeonwort / Cyseal

Cross-API engine which will support DX12 and Vulkan renderer
1 stars 0 forks source link

Initial texture support #1

Closed codeonwort closed 2 years ago

codeonwort commented 2 years ago

Descriptor copy mechanism

Finally coming to understand how resource binding works in DirectX 12.

This PR implements basic descriptor copy mechanism. There are various CBVs, SRVs, and UAVs all in different heaps, but we can set only two heaps (one for CBV/SRV/UAV, another for sampler) at the same time. It's nearly impossible to manage all that descriptors in one global heap, so we leave them in different heaps. For each frame, prepare a volatile heap and copy the descriptors needed for the current frame to it.

TODO: Refactor heap ownership and memory management of commited resources

I just managed to gather descriptors I need into the volatile heap, but the source heaps still exist in random places, and ownership is ambiguous.

Also I'm utilizing commited resources badly. Need to manage VRAM for buffers and textures.