Jump to content
  • Advertisement
ChuckNovice

Class linkage system with DX12 ?

Recommended Posts

Hello,

I am fairly experienced with DX11 and recently gave myself the challenge to keep myself up to date with graphic APIs so I am learning DX12 in parallel.

 

After compiling one of my old DX11 shader that was using interface / classes as a hack to fake function pointers I got a nice message in the ouput saying that DX12 doesn't support interfaces in shaders.

Am I right to assume that all this class linkage system was pure candy from the DX11 drivers and that it was using multiple root signatures behind the scene to achieve this? I want to be sure before I switch everything around and start handling all that stuff manually.

 

This is the interfaces / classes that I am talking about : https://msdn.microsoft.com/en-us/library/windows/desktop/ff471421(v=vs.85).aspx

 

Thanks for your time

Edited by ChuckNovice

Share this post


Link to post
Share on other sites
Advertisement

It was pure candy to quote you :)

 

Meanwhile, to improve longer than ever shader compile time in large projects. Microsoft introduces libraries in shader model 6.1. That are kind of the same idea, you compile libraries of shader code that can use forward declaration of functions and can later link multiple libraries together to produce your shaders.

Share this post


Link to post
Share on other sites
18 minutes ago, galop1n said:

It was pure candy to quote you :)

 

Meanwhile, to improve longer than ever shader compile time in large projects. Microsoft introduces libraries in shader model 6.1. That are kind of the same idea, you compile libraries of shader code that can use forward declaration of functions and can later link multiple libraries together to produce your shaders.

Hello galop1n,

 

Thank you for the answer I will definitely keep those new 6.1 feature in mind. Is there a link that reference what you are talking about? I don't find much about shader model 6.1 other than all those Wave...() functions that were added.

 

Also am I right to think that such library system would work this way?

- Shader can contain a big library of function and be compiled without an entry point

- The bytecode of that function library can later be linked to other shaders to avoid re-compiling the library everytime from #include directives.

 

Share this post


Link to post
Share on other sites

There is not much of a documentation, you can start looking here (https://blogs.msdn.microsoft.com/marcelolr/2017/06/21/two-weeks-of-directx-shader-compiler-2016-06-20/). I am sure i saw something more detailed in the past, but i can't find it. Or maybe it was just my imagination or my own code :)

 

Basically, you compile with lib_6_x instead of regular shader target without entry point, obviously. You get a bunch of precompiled function ( some can be entry points for later linkage ). Then with the linking interface, you provide a set of libraries and the entry point to finalize the shader.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!