Shark_Bladder
Shark_Bladder

Reputation: 67

What is the major difference between dx11 and dx12 in development?

I learned dx12 first, so I don't know how dx11 works.

I heard that dx11 is easier overall, but where is it? For example, where you use Constant Buffer?

Upvotes: 1

Views: 1315

Answers (1)

Varrak
Varrak

Reputation: 768

The major difference is that with DX12, you need to be very explicit in how you talk to the GPU (via the API). DX11 is a level higher (conceptually), meaning a lot of the heavy lifting is done under the hood (in the driver). You still need to put all the various bits together when using the API (shaders, various states, etc) but you don't really need to think about how all of these things fit together beyond just specifying the thing you need, and setting it.

The explicitness of DX12 involves a lot more work on your part; you need to write a lot more code, track a lot more state (and think about how that all fits together ahead of time), and generally just think through things a lot more carefully. The driver is a relatively thin layer, and most of the heavy lifting is up to the application developer.

With D3D11, the API is much simpler, much less explicit, and so requires much less lift on your part. A ton of work is done (opaquely to you) in the driver. Most modern drivers will spin up a bunch of threads to pull things together into something meaningful for the device, and hide a lot of that overhead.

With DX11, the drivers are heavily optimized, so the performance is pretty darned good. But it still ends up being a lot more work (even if much of it happens "behind the scenes") than a well-written DX12 application where the developer explicitly knows all the parts in the puzzle.

Upvotes: 3

Related Questions