openglonmetal / MGL

OpenGL 4.6 on Metal
Apache License 2.0
781 stars 30 forks source link

Unable to run test_mgl_glfw #12

Closed cadenkriese closed 2 years ago

cadenkriese commented 2 years ago

Hi, I'm not able to run the mgl test on my machine, M1 Max macOS 12.2

I get this error from Xcode which I don't really know how to debug,

Xcode Error ``` Details Could not launch “test_mgl_glfw” Domain: IDEDebugSessionErrorDomain Code: 3 Failure Reason: LLDB provided no error string. User Info: { DVTErrorCreationDateKey = "2022-02-06 07:55:44 +0000"; DVTRadarComponentKey = 855031; IDERunOperationFailingWorker = DBGLLDBLauncher; RawUnderlyingErrorMessage = "LLDB provided no error string."; } -- Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : { "device_model" = "MacBookPro18,2"; "device_osBuild" = "12.2 (21D49)"; "device_platform" = "com.apple.platform.macosx"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 16; "operation_errorCode" = 3; "operation_errorDomain" = IDEDebugSessionErrorDomain; "operation_errorWorker" = DBGLLDBLauncher; "operation_name" = IDERunOperationWorkerGroup; "param_consoleMode" = 0; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.macosx"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.tool"; "param_runnable_swiftVersion" = "5.5.2"; "param_runnable_type" = 2; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "macosx12.1"; "sdk_osVersion" = "12.1"; "sdk_variant" = macos; } -- System Information macOS Version 12.2 (Build 21D49) Xcode 13.2.1 (19586) (Build 13C100) Timestamp: 2022-02-06T00:55:44-07:00 ```

Actually, I saw this has been brought up in #9

When trying to build through the makefile I get a missing KHR header presumably from some dependency misconfiguration on my end but I've been fiddling with this for a while and can't quite figure it out.

Makefile Error ``` ❯ make -j test c++ -std=c++14 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -I/opt/homebrew/Cellar/glfw/3.3.6/include -c test_mgl_glfw/main.cpp -o build/test_mgl_glfw/main.o cc -std=gnu17 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/src/buffers.c -o build/MGL/src/buffers.o cc -std=gnu17 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/src/compute.c -o build/MGL/src/compute.o cc -std=gnu17 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/src/draw_buffers.c -o build/MGL/src/draw_buffers.o cc -std=gnu17 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/src/error.c -o build/MGL/src/error.o cc -std=gnu17 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/src/fence.c -o build/MGL/src/fence.o In file included from MGL/src/compute.c:21: In file included from MGL/include/glm_context.h:28: In file included from MGL/include/glm_dispatch.h:13: MGL/include/glcorearb.h:65:10: fatal error: 'KHR/khrplatform.h' file not found #include ^~~~~~~~~~~~~~~~~~~ In file included from MGL/src/buffers.c:26: In file included from MGL/include/glm_context.h:28: In file included from MGL/include/glm_dispatch.h:13: MGL/include/glcorearb.h:65:10: fatal error: 'KHR/khrplatform.h' file not found #include ^~~~~~~~~~~~~~~~~~~ test_mgl_glfw/main.cpp:32:10: fatal error: 'GL/glcorearb.h' file not found #include ^~~~~~~~~~~~~~~~ 1 error generated. cc -std=gnu17 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/src/framebuffers.c -o build/MGL/src/framebuffers.o make: *** [build/MGL/src/compute.o] Error 1 make: *** Waiting for unfinished jobs.... cc -std=gnu17 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -Iexternal/SPIRV-Cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/src/get.c -o build/MGL/src/get.o 1 error generated. In file included from MGL/src/draw_buffers.c:25: In file included from MGL/include/glm_context.h:28: In file included from MGL/include/glm_dispatch.h:13: MGL/include/glcorearb.h:65:10: fatal error: 'KHR/khrplatform.h' file not found #include ^~~~~~~~~~~~~~~~~~~ make: *** [build/MGL/src/buffers.o] Error 1 In file included from MGL/src/error.c:25: In file included from MGL/include/error.h:25: In file included from MGL/include/glm_context.h:28: In file included from MGL/include/glm_dispatch.h:13: MGL/include/glcorearb.h:65:10: fatal error: 'KHR/khrplatform.h' file not found #include ^~~~~~~~~~~~~~~~~~~ In file included from MGL/src/fence.c:23: In file included from MGL/include/glm_context.h:28: In file included from MGL/include/glm_dispatch.h:13: MGL/include/glcorearb.h:65:10: fatal error: 'KHR/khrplatform.h' file not found #include ^~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [build/MGL/src/draw_buffers.o] Error 1 1 error generated. 1 error generated. make: *** [build/MGL/src/error.o] Error 1 make: *** [build/MGL/src/fence.o] Error 1 In file included from MGL/src/get.c:21: In file included from MGL/include/glm_context.h:28: In file included from MGL/include/glm_dispatch.h:13: MGL/include/glcorearb.h:65:10: fatal error: 'KHR/khrplatform.h' file not found #include ^~~~~~~~~~~~~~~~~~~ In file included from MGL/src/framebuffers.c:24: In file included from MGL/include/glm_context.h:28: In file included from MGL/include/glm_dispatch.h:13: MGL/include/glcorearb.h:65:10: fatal error: 'KHR/khrplatform.h' file not found #include ^~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [build/MGL/src/framebuffers.o] Error 1 1 error generated. make: *** [build/MGL/src/get.o] Error 1 1 error generated. make: *** [build/test_mgl_glfw/main.o] Error 1 ```
darkaegisagain commented 2 years ago

The KHR headers should be under /usr/include/KHR, if not you can find them in the externals directory.

Xcode may require the command line utilities to run lldb, and you will need to change the signing on the build from Xcode to your own developer id

cadenkriese commented 2 years ago

I had already changed the developer id / team for all the targets in xcode and installed commandline tools.

I grabbed the KHR headers from https://www.khronos.org/registry/EGL/, and now I get

New Error ``` ❯ make -j test c++ -std=c++14 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -I/usr/local/include/spirv_cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -I/opt/homebrew/Cellar/glfw/3.3.6/include -c test_mgl_glfw/main.cpp -o build/test_mgl_glfw/main.o c++ -std=c++14 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -I/usr/local/include/spirv_cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/SPIRV/SPIRV-Cross/spirv_cpp.cpp -o build/MGL/SPIRV/SPIRV-Cross/spirv_cpp.o c++ -std=c++14 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -I/usr/local/include/spirv_cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/SPIRV/SPIRV-Cross/spirv_glsl.cpp -o build/MGL/SPIRV/SPIRV-Cross/spirv_glsl.o c++ -std=c++14 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -I/usr/local/include/spirv_cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/SPIRV/SPIRV-Cross/spirv_hlsl.cpp -o build/MGL/SPIRV/SPIRV-Cross/spirv_hlsl.o c++ -std=c++14 -MMD -gfull -Og -arch arm64 -I/usr/local/include/spirv/1.2 -I/usr/local/include/spirv_cross -I/opt/homebrew/opt/glslang/include/glslang/Include -I/opt/homebrew/include -I/opt/homebrew/Cellar/spirv-tools/2022.1/include -I/opt/homebrew/Cellar/glm/0.9.9.8/include -IMGL/include -IMGL/SPIRV/SPIRV-Cross -DENABLE_OPT=0 -DSPIRV_CROSS_C_API_MSL=1 -DSPIRV_CROSS_C_API_GLSL=1 -DSPIRV_CROSS_C_API_CPP=1 -DSPIRV_CROSS_C_API_REFLECT=1 -c MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp -o build/MGL/SPIRV/SPIRV-Cross/spirv_msl.o test_mgl_glfw/main.cpp:32:10: fatal error: 'GL/glcorearb.h' file not found #include ^~~~~~~~~~~~~~~~ 1 error generated. make: *** [build/test_mgl_glfw/main.o] Error 1 make: *** Waiting for unfinished jobs.... MGL/SPIRV/SPIRV-Cross/spirv_cpp.cpp:345:9: error: too few arguments to function call, single argument 'iteration_count' was not specified reset(); ~~~~~ ^ /usr/local/include/spirv_cross/spirv_glsl.hpp:345:7: note: 'reset' declared here void reset(uint32_t iteration_count); ^ MGL/SPIRV/SPIRV-Cross/spirv_glsl.cpp:299:20: error: out-of-line definition of 'reset' does not match any declaration in 'spirv_cross::CompilerGLSL' void CompilerGLSL::reset() ^~~~~ MGL/SPIRV/SPIRV-Cross/spirv_glsl.cpp:669:9: error: too few arguments to function call, single argument 'iteration_count' was not specified reset(); ~~~~~ ^ /usr/local/include/spirv_cross/spirv_glsl.hpp:345:7: note: 'reset' declared here void reset(uint32_t iteration_count); ^ MGL/SPIRV/SPIRV-Cross/spirv_glsl.cpp:4525:78: error: no member named 'buffer_offset_array_is_value_type' in 'spirv_cross::CompilerGLSL::BackendVariations' (uses_buffer_offset && !backend.buffer_offset_array_is_value_type)); ~~~~~~~ ^ MGL/SPIRV/SPIRV-Cross/spirv_glsl.cpp:4914:22: error: out-of-line definition of 'constant_expression' does not match any declaration in 'spirv_cross::CompilerGLSL' string CompilerGLSL::constant_expression(const SPIRConstant &c) ^~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_glsl.cpp:6913:18: error: no member named 'buffer_offset_array_is_value_type' in 'spirv_cross::CompilerGLSL::BackendVariations' return !backend.buffer_offset_array_is_value_type && backed_type.basetype == SPIRType::Struct && ~~~~~~~ ^ MGL/SPIRV/SPIRV-Cross/spirv_hlsl.cpp:5791:9: error: too few arguments to function call, single argument 'iteration_count' was not specified reset(); ~~~~~ ^ /usr/local/include/spirv_cross/spirv_glsl.hpp:345:7: note: 'reset' declared here void reset(uint32_t iteration_count); ^ 1 error generated. make: *** [build/MGL/SPIRV/SPIRV-Cross/spirv_cpp.o] Error 1 MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:1364:10: error: no member named 'buffer_offset_array_is_value_type' in 'spirv_cross::CompilerGLSL::BackendVariations' backend.buffer_offset_array_is_value_type = false; ~~~~~~~ ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:1452:9: error: too few arguments to function call, single argument 'iteration_count' was not specified reset(); ~~~~~ ^ /usr/local/include/spirv_cross/spirv_glsl.hpp:345:7: note: 'reset' declared here void reset(uint32_t iteration_count); ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7766:68: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') emit_atomic_func_op(result_type, id, "atomic_exchange_explicit", mem_sem, mem_sem, false, ptr, val); ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7779:81: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') emit_atomic_func_op(result_type, id, "atomic_compare_exchange_weak_explicit", mem_sem_pass, mem_sem_fail, true, ^~~~~~~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7793:64: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') emit_atomic_func_op(result_type, id, "atomic_load_explicit", mem_sem, mem_sem, false, ptr, 0); ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7804:65: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') emit_atomic_func_op(result_type, id, "atomic_store_explicit", mem_sem, mem_sem, false, ptr, val); ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7824:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMIO(add); ^~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7821:23: note: expanded from macro 'MSL_AFMIO' #define MSL_AFMIO(op) MSL_AFMO_IMPL(op, 1, true) ^~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7828:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMIO(sub); ^~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7821:23: note: expanded from macro 'MSL_AFMIO' #define MSL_AFMIO(op) MSL_AFMO_IMPL(op, 1, true) ^~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7832:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMO(add); ^~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7820:22: note: expanded from macro 'MSL_AFMO' #define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7836:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMO(sub); ^~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7820:22: note: expanded from macro 'MSL_AFMO' #define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7841:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMO(min); ^~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7820:22: note: expanded from macro 'MSL_AFMO' #define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7846:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMO(max); ^~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7820:22: note: expanded from macro 'MSL_AFMO' #define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7850:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMO(and); ^~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7820:22: note: expanded from macro 'MSL_AFMO' #define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7854:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMO(or); ^~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7820:22: note: expanded from macro 'MSL_AFMO' #define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7858:3: error: cannot initialize a parameter of type 'spv::Op' with an lvalue of type 'uint32_t' (aka 'unsigned int') MSL_AFMO(xor); ^~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7820:22: note: expanded from macro 'MSL_AFMO' #define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5], false) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:7816:73: note: expanded from macro 'MSL_AFMO_IMPL' emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \ ^~~~~~~ /usr/local/include/spirv_cross/spirv_msl.hpp:924:93: note: passing argument to parameter 'opcode' here void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode, ^ MGL/SPIRV/SPIRV-Cross/spirv_msl.cpp:8802:19: error: out-of-line definition of 'emit_atomic_func_op' does not match any declaration in 'spirv_cross::CompilerMSL' void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, uint32_t mem_order_1, ^~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [build/MGL/SPIRV/SPIRV-Cross/spirv_hlsl.o] Error 1 5 errors generated. make: *** [build/MGL/SPIRV/SPIRV-Cross/spirv_glsl.o] Error 1 16 errors generated. make: *** [build/MGL/SPIRV/SPIRV-Cross/spirv_msl.o] Error 1 ```

also worth noting that I needed to replace the bundled glfw with the 3.3-stable branch from their repo in order to build it.

darkaegisagain commented 2 years ago

I use the shell scripts in external, clone/build/install on my local machine that seems to work fine for me.

Normally I wipe the entire MGL directory after a check-in and rebuild from scratch to make sure it builds correctly.

I will delete the /usr/include/GL and other directories and do a clean wipe and clone MGL again tonight to make sure it still builds correctly.