First steps with Direct3D12

Background & Motivation

The last few months I was pretty busy with my master’s thesis, which was a OpenGL 4.5 based project. Now that I’m on free foot again, it is time to try something new. I have some experience in D3D11 but its been a while.

Since there are already a lot of useful resources, I won’t write a full “First Triangle” tutorial but rather link to others. This post just sums up my first steps & insights. Maybe its useful for someone else too.

Preparation & Prerequisites:

  • Windows 10
  • Visual Studio 2015
    • There is a free Community Edition
  • Windows 10 SDK (not included in Visual Studio!)
  • A driver that supports DX12
    • Nvidia: Fermi or newer
    • AMD: GCN 1.0 or newer
    • Intel: Haswell or newer
    • if you have a Fermi+IvyBridge “Optimus” combination like my laptop, you are out of luck. Looks like there is no way to get it running >.<

What’s New, Overview

Scrapped from here and some other places where I found things that were especially interesting to me.

  • The new lowlevel API itself.
    • There is no Map/Lock-Discard and SubResource anymore! It is like using D3D11’s NO_OVERWRITE or OpenGL4.5 persistent mapping all the time. That means you need to pipeline updates yourself.
    • No reference counting for actual memory, only for interfaces.
    • There is only one large state object that contains everything: The Pipeline State Object (PSO)
    • Command Lists that are submited to the GPU instead of (one or more) immediate or deferred contexts
    • “Bundles” allow to record certain commands a bit like Display Lists in old OpenGL
    • …………..
  • It is finally possible to perform asynchronous readbacks
  • A few new hardware features, exposed as well in DX11.3
  • There is an open source header with C++ helper structs. Its called d3dx12.h but has not much in common with the good old D3DX from the DX9 days. You can find such functionallity in github repos like DirectXTex

Pitfalls

Porting to Direct3D12 might be hard and does not guarantee that your application will run faster. Aras gave recently a talk about the issues you might encounter (siggraph15). Accordingly, its like porting from loose constants to constant buffers – you need a lot more “global” information about your rendering process.

External Resources

Here are some useful links to get started:

I have an overview diagram of D3D12 in the making and will publish it as soon as I have a bit more experience. Stay tuned! Posted Image

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s