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
CreateCommittedResource
andCreatePlacedResource
is 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?
CreateCommittedResource
creates an implicit heap each time it is called, whileCreatePlacedResource
simply 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?
CreatePlacedResources
is more proscriptive thanCreateCommittedResource
for technologies like nVidia TurboCache as well as dealing with video memory overcommittment. What actually happens is up to the driver writer here, which is basically what nVIDIA would prefer as noted in their article. In the end it's general advice, so you need to test on a variety of cards to see what actually works. \$\endgroup\$ – Chuck Walbourn Dec 4 '18 at 18:17