Commit 473f3731 by Alexis Hetu Committed by Alexis Hétu

Fixed Vulkan unittests for Visual Studio

A few things: - The library wasn't located in the provided path - The function pointers weren't using the convention call - The libraries built from Visual Studio weren't taken into account (probably only those generated from the CMake generated project were loadable) Change-Id: I7f9cc9aee920747b4bab77286ba811b33982cece Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33128Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 82feec7e
...@@ -56,9 +56,19 @@ bool Driver::loadSwiftShader() ...@@ -56,9 +56,19 @@ bool Driver::loadSwiftShader()
EXPECT_NE((HMODULE)NULL, libvulkan); EXPECT_NE((HMODULE)NULL, libvulkan);
return true; return true;
#elif defined(NDEBUG) #elif defined(NDEBUG)
return load("./build/Release/libvk_swiftshader.dll"); #if defined(_WIN64)
return load("./build/Release_Win64/vk_swiftshader.dll") ||
#else
return load("./build/Release_Win32/vk_swiftshader.dll") ||
#endif
load("./build/Release/libvk_swiftshader.dll");
#else #else
return load("./build/Debug/libvk_swiftshader.dll"); #if defined(_WIN64)
return load("./build/Debug_Win64/vk_swiftshader.dll") ||
#else
return load("./build/Debug_Win32/vk_swiftshader.dll") ||
#endif
load("./build/Debug/libvk_swiftshader.dll");
#endif #endif
#elif OS_MAC #elif OS_MAC
#if defined(STANDALONE) #if defined(STANDALONE)
......
...@@ -48,12 +48,12 @@ public: ...@@ -48,12 +48,12 @@ public:
VKAPI_ATTR PFN_vkVoidFunction(VKAPI_CALL* vk_icdGetInstanceProcAddr)(VkInstance instance, const char* pName); VKAPI_ATTR PFN_vkVoidFunction(VKAPI_CALL* vk_icdGetInstanceProcAddr)(VkInstance instance, const char* pName);
// Global vulkan function pointers. // Global vulkan function pointers.
#define VK_GLOBAL(N, R, ...) R (*N)(__VA_ARGS__) #define VK_GLOBAL(N, R, ...) VKAPI_ATTR R (VKAPI_CALL *N)(__VA_ARGS__)
#include "VkGlobalFuncs.hpp" #include "VkGlobalFuncs.hpp"
#undef VK_GLOBAL #undef VK_GLOBAL
// Per-instance vulkan function pointers. // Per-instance vulkan function pointers.
#define VK_INSTANCE(N, R, ...) R (*N)(__VA_ARGS__) #define VK_INSTANCE(N, R, ...) VKAPI_ATTR R (VKAPI_CALL *N)(__VA_ARGS__)
#include "VkInstanceFuncs.hpp" #include "VkInstanceFuncs.hpp"
#undef VK_INSTANCE #undef VK_INSTANCE
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=$(SolutionDir)out\$(Configuration)_$(Platform)</LocalDebuggerEnvironment> <LocalDebuggerEnvironment>PATH=$(SolutionDir)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>--gtest_break_on_failure --gtest_filter=*</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>--gtest_break_on_failure --gtest_filter=*</LocalDebuggerCommandArguments>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=$(SolutionDir)out\$(Configuration)_$(Platform)</LocalDebuggerEnvironment> <LocalDebuggerEnvironment>PATH=$(SolutionDir)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment