1
\$\begingroup\$

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 and CreatePlacedResource 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, while CreatePlacedResource 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?

\$\endgroup\$
  • \$\begingroup\$ The general answer is that the more flexibility you provide the driver, the better it can choose the right kind of memory based on the specific device. CreatePlacedResources is more proscriptive than CreateCommittedResource 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
  • 1
    \$\begingroup\$ @ChuckWalbourn: Thanks for the insight. I thought the entire point of Direct3D 12 was to leave less decisions to the driver so you can optimize for your use case, so I'm surprised that they would prefer to defer those decisions to the driver. \$\endgroup\$ – Panda Pajama Dec 7 '18 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.