KhronosGroup / SPIRV-Tools

Apache License 2.0
1.09k stars 559 forks source link

Export header files needed to define own optimizer passes outside of SPIRV-Tools #5832

Closed ivirtex closed 1 month ago

ivirtex commented 1 month ago

I think it's not possible without modifying the source code, so it would be nice to be able to define and implement our own passes using public API.

s-perron commented 1 month ago

This is something we have considered in the past. We decided against it in the past because this would force us to expose the interface to a large number of classes that were not stable. We did not even make if officially exposed to the fuzzer.

We are making the same decision now. Even though spirv-opt does not change as much anymore, we still do not want to limit what can be done by having a public interface that has to be backwards compatible.

You can probably get around that by being clever with the cmake file in your own project. Unfortunately, I don't have an example project that does this to help you out.