Hi Ben,
I used the changes in the above link and it compiled successfully. I'm trying to use the compiled .so file with my Vulkan application.
If I'm understanding this correctly, all I have to do is replace the libvulkan.so.1 file provided in the Vulkan SDK with the file that was built to use SwiftShader, right? I'm using the following command to build my application on a Linux system:
g++ ... -L/path/to/swiftshader/build/Linux -lvulkan ...
Then, the above command cannot seem to find libvulkan.so unless I explicity link the .so file as path/to/swiftshader/build/Linux/libvulkan.so.1
. Even when that does work, it seems to have undefined references as follows:
g++ -std=c++17 -I/home/nipun/SwiftShader/include/vulkan -coverage -g -o ShadedCubeApp main.cpp app.cpp /home/nipun/SwiftShader/build/Linux/libvulkan.so.1 `pkg-config --static --libs glfw3` -lpthread -coverage
/tmp/cc5Htusp.o: In function `ShadedCubeApp::createSwapchain()':
/home/nipun/vulkanSampleApp/app.cpp:384: undefined reference to `vkCreateSwapchainKHR'
/home/nipun/vulkanSampleApp/app.cpp:386: undefined reference to `vkGetSwapchainImagesKHR'
/home/nipun/vulkanSampleApp/app.cpp:388: undefined reference to `vkGetSwapchainImagesKHR'
/tmp/cc5Htusp.o: In function `ShadedCubeApp::cleanupSwapchain()':
/home/nipun/vulkanSampleApp/app.cpp:943: undefined reference to `vkDestroySwapchainKHR'
/tmp/cc5Htusp.o: In function `ShadedCubeApp::drawFrame()':
/home/nipun/vulkanSampleApp/app.cpp:985: undefined reference to `vkAcquireNextImageKHR'
/home/nipun/vulkanSampleApp/app.cpp:1028: undefined reference to `vkQueuePresentKHR'