0

I've been reading up on Direct3D11 a lot (including right here on stack overflow!) and in all my research I haven't been able to conclusively answer this question:

When a Resource object (i.e. a Buffer or a Texture object) is created, for example with pDevice->CreateBuffer(), where is it stored? On system RAM or on the GPU's Video-RAM? Or am I entirely misunderstanding the fundamental nature of what a Resource object is?

Obviously whatever data you populate the resource with (such as vertex and index arrays) is stored wherever you - the programmer - placed it, but once you map that data to the Resource where is it copied? (I'm assuming that, since Resources have to be mapped and unmapped for read/write protection the mapped data is in fact copied, perhaps to VRAM). Moreover, where is the Resource object itself instantiated?

Thanks in advance for any and all help!

  • The fact that you don't know and can't find out is rather core about DirectX. Which allows it to do things like use the software renderer instead of a GPU and deal with, say, a video card that doesn't have enough memory. You don't *want* to know the answer to this question. Abstracting the implementation details away is core to any good api. – Hans Passant Sep 27 '13 at 20:36
  • That's an excellent point, I'll definitely keep that in mind when working with DirectX, or any other API for that matter. Thanks! The question was as much a purely scholarly one as a practical one, of course :) – Aaron Gordon Sep 28 '13 at 01:38

1 Answers1

1

During resource creation, your Create* call goes through D3D run time, UMD (user mode graphics driver) & KMD (kernel mode). The KMD takes care of page table management (it could talk to the OS in the case of shared virtual memory, but lets ignore that). If your resource doesn't use SVM, then it is blitted to the graphics memory.

The graphics memory for processor graphics (such as Intel Iris) is your system RAM. So, its really just a copy from the applications virtual address space to the KMD.

For discrete graphics cards, the data resides on the video RAM of your card. The GPU can work only with data it the video RAM. (I'm not sure how shared virtual memory works for discrete graphics)

Raja
  • 2,846
  • 5
  • 19
  • 28
  • That makes perfect sense, and is what I sort of suspected - but your clear explanation helps a ton. Thank you so much for your help! – Aaron Gordon Sep 28 '13 at 01:44
  • Not a problem. Have a look at http://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/ – Raja Sep 28 '13 at 07:15