Skip to content

Can not compile ConvertUBOToPushConstant.cpp when using external SPIRV-Tools#805

Description

@uilianries

Hello! 馃憢

We are updating DiligentCore in Conan Center to API256019. The Conan recipe does not use the vendored ThirdParty/SPIRV-Tools tree, instead, it uses an installed SPIRV-Tools that only ships the public headers (include/spirv-tools/).

That layout still works for SPIRVTools.cpp (#include "spirv-tools/optimizer.hpp"). It fails on the custom pass added in #737:

Graphics/ShaderTools/src/ConvertUBOToPushConstant.cpp:30:10: fatal error: 'source/opt/pass.h' file not found

You can see my full build log: diligent-core-256019-macos-armv8-clang17-release-static.log

I understand the default build is consistent: add_subdirectory(ThirdParty/SPIRV-Tools) gives source/opt/pass.h (and ir_context.h, type_manager.h, decoration_manager.h). #362 then skips that subdirectory when SPIRV-Tools-static/SPIRV-Tools-opt already exist. ShaderTools CMake also does get_target_property(SOURCE_DIR SPIRV-Tools-opt) and adds that path for those private headers.

That works if the existing target still comes from an vendorized SPIRV-Tools source directory. It does not work for an imported target from find_package. Also, Khronos does not install source/opt/, and SOURCE_DIR is not a checkout.

It would help packagers if Diligent could keep supporting installed SPIRV-Tools as in #362, without requiring those private headers. Regards!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions