Question

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!

Was it helpful?

Solution

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top