Open fknfilewalker opened 4 weeks ago
@fknfilewalker can you help to attach a better reproduction case and include any output from the slang compiler?
I forgot to say that I compile the module with the interface implementation to a .slang-module and then later include that in my main shader. But then I can no longer find the Interface type.
Yes can do that, is it possible to set type conformance via command line so I can make this example quicker?
We don't have a convenient way to set it via the command line, unfortunately.
I found out that this only happens when using #include
instead of using import
to integrate the Interface definition
I think @fknfilewalker found a solution for it. Can we close this issue?
My understanding is that when you share an interface they must be import
-ed.
If you use #include
, the including file will be preprocessed and the definition of the interface will exist in the each and every translation units.
I don't think they will be combined and resulted in a single definition at the linking time only because their names are same.
If you still think this is a bug, please give us more concrete repro steps so that we can discuss at more detail.
@jkwak-work you are absolutely right. I am fine with the module solution but of course it would be nice to also make this work with #include. There should be at least some kind of warning or info about that so people don't need to figure this out themselves.
I have an Interfaces defined in
header A
and implement it inModule B
. When I includeheader A
andModule B
in my main shader I can no longer find the Interface type withlayout->findTypeByName
, the implementation type I can find. When I excludeModule B
from the main shader, I can find the interface but of course no longer the implementation.