Hi,
I've been able to load textures for a while now in my engine, but am wondering about best practices and recommendations. Because of some of the changes with D3D12, we're responsible for making sure the data is properly staged, uploaded, and synced before being used. Additionally, we're responsible for making sure any temporary (staging) resources don't get destroyed before they're done being used.
It seems that the MiniEngine sample code does an execute command list and GPU sync on every texture load (see DDSTextureLoader and CommandContext). What I've been doing up to this point is essentially sending a command list to texture load calls during scene initialization and then before the initialization routine ends, calling execute command list on the entire thing and syncing that. I've been sending along a std::vector<ComPtr<ID3D12Resource>>& for the texture loader to put temporary resources in to make sure they don't get deleted before the sync occurs. This is nice in that I only have to bother with one command list execute and one GPU sync during initialization, but the load texture method signature gets a little ugly sending in the temporary resource vector.
Should I keep up my current approach, or should I be submitting command lists for execution and syncing more often like MiniEngine is doing? Or is there perhaps a middle ground between the two approaches I should be thinking on instead?
Thanks.