Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question
    
what do you mean "of Windows"? –  Prof. Falken Jan 3 '11 at 9:25
add comment

2 Answers

up vote 8 down vote accepted

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).

share|improve this answer
    
Thanks (15 chars) –  Martijn Courteaux Oct 17 '10 at 17:52
4  
correct, and if I remember correctly you can still get direct access to the GPU by writing shaders –  LearnCocos2D Oct 17 '10 at 18:21
2  
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. –  Mike Strobel Oct 19 '10 at 14:28
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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