KhronosGroup/Vulkan-ExtensionLayer

shader_object_full_draw_state_struct_members.inl: error: use of undeclared identifier 'assert'

truboxl opened this issue · 5 comments

[3/13] Building CXX object layers/CMakeFiles/VkLayer_khronos_shader_object.dir/shader_object.cpp.o
FAILED: layers/CMakeFiles/VkLayer_khronos_shader_object.dir/shader_object.cpp.o
/home/builder/.termux-build/_cache/android-r25c-api-24-v2/bin/clang++ --target=aarch64-none-linux-android --gcc-toolchain=/home/builder/.termux-build/_cache/android-r25c-api-24-v2 --sysroot=/home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot -DVK_ENABLE_BETA_EXTENSIONS -DVkLayer_khronos_shader_object_EXPORTS -D_POSIX_C_SOURCE=200112 -I/home/builder/.termux-build/vulkan-extension-layer/src/layers -I/home/builder/.termux-build/vulkan-extension-layer/src/utils -I/home/builder/.termux-build/vulkan-extension-layer/src/utils/generated -fstack-protector-strong -Oz --target=aarch64-linux-android24  -I/data/data/com.termux/files/usr/include -Wpointer-arith -Wno-unused-function -Wno-sign-compare -O3 -DNDEBUG -std=c++17 -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fno-strict-aliasing -fno-builtin-memcmp -fvisibility=hidden -MD -MT layers/CMakeFiles/VkLayer_khronos_shader_object.dir/shader_object.cpp.o -MF layers/CMakeFiles/VkLayer_khronos_shader_object.dir/shader_object.cpp.o.d -o layers/CMakeFiles/VkLayer_khronos_shader_object.dir/shader_object.cpp.o -c /home/builder/.termux-build/vulkan-extension-layer/src/layers/shader_object.cpp
In file included from /home/builder/.termux-build/vulkan-extension-layer/src/layers/shader_object.cpp:888:
/home/builder/.termux-build/vulkan-extension-layer/src/layers/generated/shader_object_full_draw_state_struct_members.inl:1084:22: error: use of undeclared identifier 'assert'
default: assert(false); return 0;
^
1 error generated.
[4/13] Building CXX object layers/CMakeFiles/VkLayer_khronos_synchronization2.dir/synchronization2.cpp.o
ninja: build stopped: subcommand failed.
ERROR: failed to build.

I am not sure where went wrong when I build downstream. This is using a custom build system using Android NDK...

Android for this layer is not supported (as stated in the documentation file for the emulation layer).

Hi, sorry for the confusion. The custom build targets Khronos Vulkan Loader, similar to Linux build. So it deviates from normal Android build.

set(TARGET_NAMES VkLayer_khronos_timeline_semaphore VkLayer_khronos_synchronization2 VkLayer_khronos_shader_object)

include $(CLEAR_VARS)
LOCAL_MODULE := VkLayer_khronos_synchronization2
LOCAL_SRC_FILES += $(SRC_DIR)/layers/synchronization2.cpp
LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
$(LOCAL_PATH)/$(SRC_DIR)/utils \
$(LOCAL_PATH)/$(SRC_DIR)/utils/generated \
$(LOCAL_PATH)/$(THIRD_PARTY)/shaderc/third_party/spirv-tools/external/spirv-headers/include
LOCAL_STATIC_LIBRARIES += extlayer_utils glslang SPIRV-Tools SPIRV-Tools-opt
LOCAL_CPPFLAGS += -std=c++17 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -Wno-cast-calling-convention -fexceptions
LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden
LOCAL_LDLIBS := -llog -landroid
LOCAL_LDFLAGS += -Wl,-Bsymbolic
LOCAL_LDFLAGS += -Wl,--exclude-libs,ALL
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := VkLayer_khronos_timeline_semaphore
LOCAL_SRC_FILES += $(SRC_DIR)/layers/timeline_semaphore.c \
$(SRC_DIR)/layers/hash_table.cpp
LOCAL_C_INCLUDES += $(VULKAN_INCLUDE)
LOCAL_CPPFLAGS += -std=c++17 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -Wno-cast-calling-convention -fexceptions
LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden
LOCAL_LDLIBS := -llog -landroid
LOCAL_LDFLAGS += -Wl,-Bsymbolic
LOCAL_LDFLAGS += -Wl,--exclude-libs,ALL
include $(BUILD_SHARED_LIBRARY)

I suppose its because it is omitted in ndk-build so it never got captured? If this is expected I will disable building downstream...

LOCAL_MODULE := VkLayer_khronos_timeline_semaphore also wasn't added until May 2022.

Also, more information. The shader object layer requires underlying dynamic rendering support. This support is basically not existent in Android devices today. So the layer would always be disabled.

Closing since android isn't supported for this layer yet.