Graphics Layers for different for Directx11 and Directx12

Started by
11 comments, last by andur 9 years, 10 months ago


To be honest I don't think you should be worrying about this right now. D3D12 is at least a year away, we don't yet know what the interface is going to be like, so trying to pre-empt an unreleased API version doesn't seem like good sense. It would be better to focus on doing a good job with D3D11 instead.

I would echo this caution, and I'll actually be the dissenting voice in this discussion and say that you shouldn't try to abstract away the differences between D3D11 and D3D12. D3D12 is supposed to be a superset of 11, except with more direct control over low level details so that you can squeeze the last few drops of performance out of your hardware. If you try to make a common abstraction between 11 & 12, then you will end up muting the benefits of 12 without really gaining anything. Assuming that D3D11 will be available anywhere that D3D12 is, then there isn't any benefit to supporting both on a common abstraction.

For pro studios, this makes sense to allow running your game on multiple platforms and supporting multiple APIs. But if you can't gain anything from the common abstraction (due to D3D11 and 12 being together everywhere) then this system doesn't make much sense. Instead, I would suggest that you write your D3D11 renderer now, and keep in mind any pain points you are encountering, then design a new renderer in about a year when D3D12 comes out that incorporates what you learned from the first time around.

Advertisement

Thanks every one . I've designed a renderer using xna ( http://www.gamedev.net/gallery/album/800-smile-engine/ ) . I decided to migrate to dx11 because I needed a lot of more modern things (atomic functions,compute shaders,tesselation) . At Least I know things that are possible now probably will be possible in dx12 too. I want to reuse my code as much as possible for future. Howecer, as mentioned we are not aware of the dx12 design . Maybe my code just makes it slower and no benefit from dx12.

But at least I need a level of abstraction because in future I probably want to support OpenGL too.

I then have many cpp files that implement then stuff in these headers, e.g. I'd have a single Device.h, and then Device_D3D11.cpp, Device_D3D9.cpp, etc...

This is what we do at work.

Maybe function pointers come handy at this situation . Instead of havina a launcher the application can in realtime assign appropriate functions that the platform supports to the pointers . And then application moves on with calling only these function pointers .


That would be a great way to make a mess of your code, and since the application would link to both Direct3D 11 and Direct3D 12, only people running Direct3D 12 could run it, making Direct3D 11 a useless parasitic twin.

If you took anything away from what Hodgman said let it be the part regarding multiple executables. This is standard in the industry for a reason.

L. Spiro

Not entirely true. I've had success in the past with Direct3D 9 and 10 in the same executable by marking the D3D dlls as being delay loadable, and then checking for which version of Direct3D the user's system was capable of running and loading that rendering path.

This topic is closed to new replies.

Advertisement