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\$
1
  • \$\begingroup\$ what do you mean "of Windows"? \$\endgroup\$ Commented Jan 3, 2011 at 9:25

2 Answers 2

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\$
2
  • 4
    \$\begingroup\$ correct, and if I remember correctly you can still get direct access to the GPU by writing shaders \$\endgroup\$
    – CodeSmile
    Commented Oct 17, 2010 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\$ Commented Oct 19, 2010 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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .