Monday, October 11, 2010

Thoughts on D3D11

About a month ago I drew my first triangle with D3D11. My initial reaction to the API was kind of puzzling, and to understand it, you need to know a little about the history of D3D.

In the beginning it was a mess, and all the horror stories about it were definitely true. But as time went on it was evolved, and by the time of D3D8 - when the requirement to use DirectDraw interfaces in conjunction with it was removed - it was a very clean and elegant API. D3D9 built on that, making some very minor changes and adding HLSL.

So on to D3D10 and 11. I'm not sure if it's correct to say that "D3D11 is to D3D10 as D3D9 was to D3D8", but the similarities are there and it works for me. In both 10 and 11 the interface is through generic buffer objects. You pass them arrays of structs (sometimes nested 2 or 3 levels deep) specifying content types, usages, properties, binary data, etc, and they do their thing. All the simple, direct (pun intended) elements of the API are gone.

This seems kind of familiar so I had to do a slight double-take on it, but I'm quite convinced by now - it's just like our old friends the dreaded Execute Buffers all over again!

Who knows - maybe this is now a rational and sensible design paradigm for a modern 3D API on modern hardware, but it's hard to avoid the feeling that whatever else it may be, it's one hell of a huge step backwards.

I haven't yet worked up the courage to look at textures, so that's where things currently stand with those plans. It's still something I'd like to do, as there are advantages to using D3D11, and if they outweigh the disadvantages (and potential World Of Pain And Suffering inflicted by it's design) then it remains viable. Time will tell.

0 comments: