加入volk 和 wma 后 编译不通过, 先保存代码

This commit is contained in:
xsl
2025-10-18 23:59:21 +08:00
parent 4237213658
commit 234e30bd50
605 changed files with 144276 additions and 15 deletions
@@ -0,0 +1,11 @@
# Include the volk target through add_subdirectory.
cmake_minimum_required(VERSION 3.5)
project(volk_test LANGUAGES C)
# Include volk as part of the build tree to make the target known.
# The two-argument version of add_subdirectory allows adding non-subdirs.
add_subdirectory(../.. volk)
add_executable(volk_test main.c)
target_link_libraries(volk_test PRIVATE volk_headers)
+53
View File
@@ -0,0 +1,53 @@
/* Set platform defines at build time for volk to pick up. */
#if defined(_WIN32)
# define VK_USE_PLATFORM_WIN32_KHR
#elif defined(__linux__) || defined(__unix__)
# define VK_USE_PLATFORM_XLIB_KHR
#elif defined(__APPLE__)
# define VK_USE_PLATFORM_MACOS_MVK
#else
# error "Platform not supported by this example."
#endif
#define VOLK_IMPLEMENTATION
#include "volk.h"
#include "stdio.h"
#include "stdlib.h"
int main()
{
VkResult r;
uint32_t version;
void* ptr;
/* This won't compile if the appropriate Vulkan platform define isn't set. */
ptr =
#if defined(_WIN32)
&vkCreateWin32SurfaceKHR;
#elif defined(__linux__) || defined(__unix__)
&vkCreateXlibSurfaceKHR;
#elif defined(__APPLE__)
&vkCreateMacOSSurfaceMVK;
#else
/* Platform not recogized for testing. */
NULL;
#endif
/* Try to initialize volk. This might not work on CI builds, but the
* above should have compiled at least. */
r = volkInitialize();
if (r != VK_SUCCESS) {
printf("volkInitialize failed!\n");
return -1;
}
version = volkGetInstanceVersion();
printf("Vulkan version %d.%d.%d initialized.\n",
VK_VERSION_MAJOR(version),
VK_VERSION_MINOR(version),
VK_VERSION_PATCH(version));
return 0;
}