When using Direct3D, how much math is being done on the CPU?

Posted by zirgen on Stack Overflow See other posts from Stack Overflow or by zirgen
Published on 2010-05-20T23:01:17Z Indexed on 2010/05/20 23:40 UTC
Read the original article Hit count: 180

Filed under:
|
|

Context: I'm just starting out. I'm not even touching the Direct3D 11 API, and instead looking at understanding the pipeline, etc.

From looking at documentation and information floating around the web, it seems like some calculations are being handled by the application. That, is, instead of simply presenting matrices to multiply to the GPU, the calculations are being done by a math library that operates on the CPU. I don't have any particular resources to point to, although I guess I can point to the XNA Math Library or the samples shipped in the February DX SDK. When you see code like mViewProj = mView * mProj;, that projection is being calculated on the CPU. Or am I wrong?

If you were writing a program, where you can have 10 cubes on the screen, where you can move or rotate cubes, as well as viewpoint, what calculations would you do on the CPU? I think I would store the geometry for the a single cube, and then transform matrices representing the actual instances. And then it seems I would use the XNA math library, or another of my choosing, to transform each cube in model space. Then get the coordinates in world space. Then push the information to the GPU.

That's quite a bit of calculation on the CPU. Am I wrong?

  • Am I reaching conclusions based on too little information and understanding?
  • What terms should I Google for, if the answer is STFW?
  • Or if I am right, why aren't these calculations being pushed to the GPU as well?

© Stack Overflow or respective owner

Related posts about direct3d

Related posts about graphics