0
\$\begingroup\$

I found this question which talks around the question I'm interested in. In particular I focused on the line where the guys says that GraphicsDevice object is literally a representation of the underlying graphics card.

Now, can I assume that XNA automatically uses the memory directly from the underlying graphics card (to perform the most expensive calculations like updates and drawing)?

If so, is everything (like thread management) already optimized or there are way to configure the device depending my various cases? If not, do I have to tell the GraphicsDevice object whether to use or not the GPU memory rather than the CPU?

\$\endgroup\$
1
\$\begingroup\$

All this stuff happens at DirectX level (or driver level). You don't have to worry about it. The engine will handle textures for you (like determining how much can be kept in video memory at any given time).

However, there's still room for optimizations or slowdowns based on bad strategies. For example, switching the active texture can be a costly operation. If you keep doing this over and over again (rather than using sprite batches for example), you can indeed slow down rendering.

Also keep in mind that you'll always have to go the way through system memory. There's no way for you to directly alter anything stored on the graphics card.

If you've got like 512 MB VRAM and you're using textures which got a total of 1 GB data, then data is copied as needed, i.e. you'll have the full 1 GB in RAM, but only a subset (whatever is used right now) as a copy in VRAM.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.