5
\$\begingroup\$

I'm a bit confused. The question is: when I'm developing a XNA game for Xbox (or Windows), is it possible to use DirectX (to make use of the GPU)? Or is everything getting calculated by the CPU?

A quick Google search didn't gave any results of combining those two...

\$\endgroup\$
  • \$\begingroup\$ what do you mean "of Windows"? \$\endgroup\$ – Prof. Falken Jan 3 '11 at 9:25
8
\$\begingroup\$

As far as i know, it's no different from PC + XNA: draw calls you make (anything using Spritebatch, any of the DrawIndexedPrimitives, rendering models, etc.) are done via the GPU (since XNA is a layer on DirectX). Anything else goes on the CPU(s).

\$\endgroup\$
  • 4
    \$\begingroup\$ correct, and if I remember correctly you can still get direct access to the GPU by writing shaders \$\endgroup\$ – LearnCocos2D Oct 17 '10 at 18:21
  • 2
    \$\begingroup\$ I can confirm that GamingHorror is correct. XNA has out-of-the-box support for shaders written in HLSL, which could be used to perform various operations directly on the GPU. \$\endgroup\$ – Mike Strobel Oct 19 '10 at 14:28
5
\$\begingroup\$

XNA uses Direct3D 9, so you can do pretty much the same things you can do with D3D9 in XNA, without having to deal with some of the lower level plumbing. And, as said, you can use HLSL with XNA to compute stuff on the GPU.

As a rule, most (if not all) of the graphics rendering/computing is done on the GPU, and the rest is done on the CPU.

\$\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.