Class linkage system with DX12 ?

Started by
4 comments, last by ChuckNovice 6 years, 2 months ago

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

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.

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.

 

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.

I will look into that, thank you for the precious time.

This topic is closed to new replies.

Advertisement