mirror of
https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
synced 2025-05-14 08:48:39 +00:00
parent
881049b977
commit
d7418625d9
4 changed files with 29 additions and 10 deletions
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -49,6 +49,9 @@ jobs:
|
|||
|
||||
android:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
abi: [ armeabi-v7a, arm64-v8a ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
|
@ -59,14 +62,13 @@ jobs:
|
|||
run: |
|
||||
cmake -S . -B build/ --toolchain $ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
|
||||
-D ANDROID_PLATFORM=26 \
|
||||
-D CMAKE_ANDROID_ARCH_ABI=x86_64 \
|
||||
-D CMAKE_ANDROID_ARCH_ABI=${{matrix.abi}} \
|
||||
-D CMAKE_ANDROID_STL_TYPE=c++_static \
|
||||
-D CMAKE_ANDROID_RTTI=YES \
|
||||
-D CMAKE_ANDROID_EXCEPTIONS=YES \
|
||||
-D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=NO \
|
||||
-D VUL_WERROR=ON \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D UPDATE_DEPS=ON \
|
||||
-D BUILD_TESTS=ON \
|
||||
-G "Ninja"
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
|
|
|
@ -37,4 +37,8 @@ target_link_libraries(vul_tests PRIVATE
|
|||
Vulkan::CompilerConfiguration
|
||||
)
|
||||
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
return()
|
||||
endif()
|
||||
|
||||
gtest_discover_tests(vul_tests DISCOVERY_TIMEOUT 100)
|
||||
|
|
|
@ -90,6 +90,8 @@ TEST(struct_helper, struct_defaults_correct) {
|
|||
ASSERT_EQ(s.t4.sType, VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO);
|
||||
}
|
||||
|
||||
#if VK_USE_64_BIT_PTR_DEFINES == 1
|
||||
|
||||
TEST(struct_helper, get_object_type) {
|
||||
ASSERT_EQ(vku::GetObjectType<VkInstance>(), VK_OBJECT_TYPE_INSTANCE);
|
||||
ASSERT_EQ(vku::GetObjectType<VkPerformanceConfigurationINTEL>(), VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL);
|
||||
|
@ -97,3 +99,5 @@ TEST(struct_helper, get_object_type) {
|
|||
ASSERT_EQ(vku::GetObjectType<VkAccelerationStructureKHR>(), VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR);
|
||||
ASSERT_EQ(vku::GetObjectType<VkAccelerationStructureNV>(), VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV);
|
||||
}
|
||||
|
||||
#endif // VK_USE_64_BIT_PTR_DEFINES == 1
|
||||
|
|
|
@ -10,20 +10,29 @@
|
|||
#include <vulkan/utility/vk_dispatch_table.h>
|
||||
|
||||
// Only exists so that local_vkGetDeviceProcAddr can return a 'real' function pointer
|
||||
inline void empty_func() {}
|
||||
inline VKAPI_ATTR void empty_func() {}
|
||||
|
||||
inline PFN_vkVoidFunction local_vkGetInstanceProcAddr(VkInstance instance, const char *pName) {
|
||||
if (instance == VK_NULL_HANDLE) return NULL;
|
||||
inline VKAPI_ATTR PFN_vkVoidFunction local_vkGetInstanceProcAddr(VkInstance instance, const char *pName) {
|
||||
if (instance == VK_NULL_HANDLE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp(pName, "vkGetInstanceProcAddr")) return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetInstanceProcAddr);
|
||||
if (strcmp(pName, "vkGetInstanceProcAddr")) {
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetInstanceProcAddr);
|
||||
}
|
||||
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&empty_func);
|
||||
}
|
||||
|
||||
inline PFN_vkVoidFunction local_vkGetDeviceProcAddr(VkDevice device, const char *pName) {
|
||||
if (device == VK_NULL_HANDLE) return NULL;
|
||||
inline VKAPI_ATTR PFN_vkVoidFunction local_vkGetDeviceProcAddr(VkDevice device, const char *pName) {
|
||||
if (device == VK_NULL_HANDLE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp(pName, "vkGetDeviceProcAddr")) {
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetDeviceProcAddr);
|
||||
}
|
||||
|
||||
if (strcmp(pName, "vkGetDeviceProcAddr")) return reinterpret_cast<PFN_vkVoidFunction>(&local_vkGetDeviceProcAddr);
|
||||
return reinterpret_cast<PFN_vkVoidFunction>(&empty_func);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue