Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spvc_msl_resource_binding_2 and other stuff is deprecated from SPIRV-Cross in spirv_cross_c.h file #97

Open
ThobiasKnudsen opened this issue Jan 27, 2025 · 1 comment

Comments

@ThobiasKnudsen
Copy link

/home/o/Personal/Code/CPI/build/_deps/sdl3_shadercross-src/src/SDL_shadercross.c:1239:9: error: unknown type name ‘spvc_msl_resource_binding_2’; did you mean ‘spvc_msl_resource_binding’?
1239 | spvc_msl_resource_binding_2 bufferBindings[32];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| spvc_msl_resource_binding
/home/o/Personal/Code/CPI/build/_deps/sdl3_shadercross-src/src/SDL_shadercross.c:1242:9: error: unknown type name ‘spvc_msl_resource_binding_2’; did you mean ‘spvc_msl_resource_binding’?
1242 | spvc_msl_resource_binding_2 textureBindings[32];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| spvc_msl_resource_binding

CMakeLists.txt:
cmake_minimum_required(VERSION 3.14)
project(CPI LANGUAGES C)

include(FetchContent)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

====================================================================

SDL3

====================================================================

FetchContent_Declare(
SDL3
GIT_REPOSITORY https://github.com/libsdl-org/SDL
GIT_TAG release-3.2.0
)
FetchContent_MakeAvailable(SDL3)
list(APPEND CMAKE_PREFIX_PATH "${sdl3_BINARY_DIR}")

====================================================================

SPIRV-Cross

====================================================================

FetchContent_Declare(
SPIRV-Cross
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Cross
GIT_TAG main
)
FetchContent_MakeAvailable(SPIRV-Cross)

====================================================================

SPIRV-Headers

====================================================================

FetchContent_Declare(
SPIRV-Headers
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Headers
GIT_TAG main
)
FetchContent_MakeAvailable(SPIRV-Headers)

====================================================================

SPIRV-Tools

====================================================================

FetchContent_Declare(
SPIRV-Tools
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Tools
GIT_TAG main
)
FetchContent_MakeAvailable(SPIRV-Tools)

====================================================================

DirectXShaderCompiler

====================================================================

if(WIN32 OR WIN64)
FetchContent_Declare(
DirectXShaderCompiler
GIT_REPOSITORY https://github.com/microsoft/DirectXShaderCompiler
GIT_TAG main
)
FetchContent_MakeAvailable(DirectXShaderCompiler)
else()
set(SDLSHADERCROSS_DXC OFF CACHE BOOL "Disable HLSL compilation via DXC" FORCE)
endif()

====================================================================

SDL3_shadercross

Dependencies: SPIRV-Cross and DirectXShaderCompiler

====================================================================

set(SDLSHADERCROSS_VENDORED OFF CACHE BOOL "Builds dependecies locally" FORCE)
find_package(spirv_cross_c REQUIRED)
FetchContent_Declare(
SDL3_shadercross
GIT_REPOSITORY https://github.com/libsdl-org/SDL_shadercross.git
GIT_TAG main
)
FetchContent_MakeAvailable(SDL3_shadercross)

====================================================================

glslang

====================================================================

FetchContent_Declare(
glslang
GIT_REPOSITORY https://github.com/KhronosGroup/glslang
GIT_TAG main
)
FetchContent_MakeAvailable(glslang)

====================================================================

shaderc

Dependencies: SPIRV-Headers, SPIRV-Tools and glslang

====================================================================

set(SHADERC_SKIP_INSTALL ON CACHE BOOL "Skip install" FORCE)
set(SHADERC_SKIP_TESTS ON CACHE BOOL "Disable tests" FORCE)
set(SHADERC_SKIP_EXAMPLES ON CACHE BOOL "Disable examples" FORCE)
set(SHADERC_SKIP_COPYRIGHT_CHECK ON CACHE BOOL "Skip copyright" FORCE)
set(SHADERC_ENABLE_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SHADERC_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
FetchContent_Declare(
shaderc
GIT_REPOSITORY https://github.com/google/shaderc
GIT_TAG main
)
FetchContent_MakeAvailable(shaderc)

====================================================================

executable

====================================================================

add_executable(
main
src/main.c
)

====================================================================

link libraries

====================================================================

target_link_libraries(main PRIVATE
shaderc_combined
SDL3::SDL3
SDL3_shadercross::SDL3_shadercross
)

@thatcosmonaut
Copy link
Collaborator

spvc_msl_resource_binding_2 is definitely there: https://github.com/KhronosGroup/SPIRV-Cross/blob/1a7b7ef6de02cf6767e42b10ddad217c45e90d47/spirv_cross_c.h#L396

Not sure what is going on with your build system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants