How can I migrate between versions?
Asked Answered
C

1

1

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.

Crepuscule answered 25/8, 2013 at 16:46 Comment(3)
Why would you want to migrate? DirectX 11 adds some new functionality. Functionality that you obviously do not need. The quality of your program does not increase by just switching DirectX versions.Opuscule
i think diffrent versions are about technology. better lightening, better rendering and...... no?:dCrepuscule
No. Lighting and rendering are up to the programmer.Opuscule
V
6

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

Virulent answered 26/8, 2013 at 2:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.