How can I migrate between versions?

513 views Asked by At

What are changes from directx 10 to 11? Ive written some code in directx 10 and I want to change it to directx 11. Is this just about quality and I can do it just by changing headrs and dll files or functions and way of coding have been changed? ing.

1

There are 1 answers

0
Ivan Aksamentov - Drop On BEST ANSWER

First, I need to say, that nothing will change if you just change your D3D10DoSomething() functions to D3D11DoSomething(). They will do same things. No passive gain. You must use new features explicitly to make your app better. Those features that D3D10 don't have: such as hardware tessellation, compute shader, many many other stuff. To code.

So, the main question is "do you really need this features"? Or, maybe, "will you need these features later"? Does your coding mates laughing when see your ancient D3D10 code?

If answer is yes:

DirectX 10 to 11 porting is very simple. It is just a joke compared to DirectX 9 to 10 porting.

Here is short and non-exhaustive list of things to do when porting D3D10 to D3D11:

  • backup your sources
  • get text find-replace tool (such as in Visual studio, or grep), find "D3D10" and replace to "D3D11"
  • replace #include <d3d10*> to #include <d3d11*>
  • replace d3d10*.lib to d3d11*.lib in linker options

Device and Context creation:

  • In D3D11 device interface splitted to device and context, so device now responsible for creation functionality (most methods are Create*()) and context responsible for state changing functionality (most methods are Set*()/Get*()).
  • Where you create device with one of the D3D10CreateDevice*functions (now they've become D3D11CreateDevice*), add additional ID3D11DeviceContext parameter and also add parameters related to D3D_FEATURE_LEVEL. (more about feature levels here)
  • Change device->ChangeState() calls to deviceContext->ChangeState()

Other stuff:

  • Some of functions accepts additional argument(s). Most times you just can pass 0 for the time until you don't need this functionality. If you get compiler errors related with number of arguments or "unable to convert parameter.." just find this function in DirectX 11 reference and see if you must add additional zero argument =)

Shaders:

  • Vertex, Geometry, Pixel shaders mostly unchanged, so you can safely use old ones.
  • If you using Effect10 framework, things can be more complicated, but still porting will take one hour of time or so. Refer to Microsoft site or Google when you have questions.

And here are additional tips from Microsoft : link, link.

Well, mostly done! Welcome to D3D11 world =)