adding entry point to soft driver, adding C test
This commit is contained in:
24
test/c/main.c
git.filemode.normal_file
24
test/c/main.c
git.filemode.normal_file
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define VK_NO_PROTOTYPES
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifndef LIBVK
|
||||
#define LIBVK "vulkan"
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("openning ./zig-out/lib/lib" LIBVK ".so\n");
|
||||
void* lib = dlopen("./zig-out/lib/lib" LIBVK ".so", RTLD_NOW | RTLD_LOCAL);
|
||||
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dlsym(lib, "vk_icdGetInstanceProcAddr");
|
||||
|
||||
printf("test %p\n", vkGetInstanceProcAddr(NULL, "vkCreateInstance"));
|
||||
|
||||
dlclose(lib);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user