This NVIDIA document regarding dos and don'ts in DirectX 12 states the following:
Use committed resources where possible to give the driver more knowledge
- This allows the driver to better manage GPU memory
- A good use case for placed resources are resource heaps that are e.g. used during streaming and do hold different sets of read-only textures over their life time
But this raises more questions than it answers:
- What additional knowledge is given to the driver if I use a committed resource? The information on the resource that I pass to both
CreatePlacedResourceis pretty much the same...
- What does it mean that the driver will better manage GPU memory?
- If I know what the allocation/deallocation patterns look like in my game, isn't it better if I manage GPU memory manually with placed resources, instead of letting the GPU decide where to place each resource, and potentially run into VRAM fragmentation in the long run? Or will the driver perform heap defragmentation?
CreateCommittedResourcecreates an implicit heap each time it is called, while
CreatePlacedResourcesimply creates the resource over the memory I choose on an existing heap, and is therefore much faster. Wouldn't it be preferable in most cases to use placed resources instead? Especially if I am interested in creating loading screens that don't miss a single frame deadline?
I am quite surprised to read from NVIDIA that committed resources are preferable to placed resources. Could anybody explain in more detail what else is happening under the hood, so committed resources are preferable to placed resources?