Cleanup on usage of static vs. dynamic loading (#462)

This commit is contained in:
Andreas Süßenbach 2019-12-23 08:45:40 +01:00 committed by Markus Tavenrath
parent 18febd6237
commit 021c7499a0
53 changed files with 69 additions and 72 deletions

View File

@ -1173,7 +1173,10 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic(std::string & str)
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library. // This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
{ {
init(static_cast<VkInstance>(instance), ::vkGetInstanceProcAddr, static_cast<VkDevice>(device), device ? ::vkGetDeviceProcAddr : nullptr); static vk::DynamicLoader dl;
PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
PFN_vkGetDeviceProcAddr getDeviceProcAddr = dl.getProcAddress<PFN_vkGetDeviceProcAddr>("vkGetDeviceProcAddr");
init(static_cast<VkInstance>(instance), getInstanceProcAddr, static_cast<VkDevice>(device), device ? getDeviceProcAddr : nullptr);
} }
#endif // !defined(VK_NO_PROTOTYPES) #endif // !defined(VK_NO_PROTOTYPES)

View File

@ -26,8 +26,6 @@ set(SOURCES
source_group(headers FILES ${HEADERS}) source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES}) source_group(sources FILES ${SOURCES})
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
add_executable(01_InitInstance add_executable(01_InitInstance
${HEADERS} ${HEADERS}
${SOURCES} ${SOURCES}

View File

@ -34,4 +34,4 @@ add_executable(02_EnumerateDevices
) )
set_target_properties(02_EnumerateDevices PROPERTIES FOLDER "Samples") set_target_properties(02_EnumerateDevices PROPERTIES FOLDER "Samples")
target_link_libraries(02_EnumerateDevices "${Vulkan_LIBRARIES}") target_compile_definitions(02_EnumerateDevices PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(03_InitDevice
) )
set_target_properties(03_InitDevice PROPERTIES FOLDER "Samples") set_target_properties(03_InitDevice PROPERTIES FOLDER "Samples")
target_link_libraries(03_InitDevice "${Vulkan_LIBRARIES}") target_compile_definitions(03_InitDevice PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(04_InitCommandBuffer
) )
set_target_properties(04_InitCommandBuffer PROPERTIES FOLDER "Samples") set_target_properties(04_InitCommandBuffer PROPERTIES FOLDER "Samples")
target_link_libraries(04_InitCommandBuffer "${Vulkan_LIBRARIES}") target_compile_definitions(04_InitCommandBuffer PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(05_InitSwapchain
) )
set_target_properties(05_InitSwapchain PROPERTIES FOLDER "Samples") set_target_properties(05_InitSwapchain PROPERTIES FOLDER "Samples")
target_link_libraries(05_InitSwapchain "${Vulkan_LIBRARIES}") target_compile_definitions(05_InitSwapchain PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(06_InitDepthBuffer
) )
set_target_properties(06_InitDepthBuffer PROPERTIES FOLDER "Samples") set_target_properties(06_InitDepthBuffer PROPERTIES FOLDER "Samples")
target_link_libraries(06_InitDepthBuffer "${Vulkan_LIBRARIES}") target_compile_definitions(06_InitDepthBuffer PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(07_InitUniformBuffer
) )
set_target_properties(07_InitUniformBuffer PROPERTIES FOLDER "Samples") set_target_properties(07_InitUniformBuffer PROPERTIES FOLDER "Samples")
target_link_libraries(07_InitUniformBuffer "${Vulkan_LIBRARIES}") target_compile_definitions(07_InitUniformBuffer PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(08_InitPipelineLayout
) )
set_target_properties(08_InitPipelineLayout PROPERTIES FOLDER "Samples") set_target_properties(08_InitPipelineLayout PROPERTIES FOLDER "Samples")
target_link_libraries(08_InitPipelineLayout "${Vulkan_LIBRARIES}") target_compile_definitions(08_InitPipelineLayout PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -36,4 +36,4 @@ add_executable(09_InitDescriptorSet
) )
set_target_properties(09_InitDescriptorSet PROPERTIES FOLDER "Samples") set_target_properties(09_InitDescriptorSet PROPERTIES FOLDER "Samples")
target_link_libraries(09_InitDescriptorSet "${Vulkan_LIBRARIES}") target_compile_definitions(09_InitDescriptorSet PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(10_InitRenderPass
) )
set_target_properties(10_InitRenderPass PROPERTIES FOLDER "Samples") set_target_properties(10_InitRenderPass PROPERTIES FOLDER "Samples")
target_link_libraries(10_InitRenderPass "${Vulkan_LIBRARIES}") target_compile_definitions(10_InitRenderPass PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -37,6 +37,6 @@ add_executable(11_InitShaders
) )
set_target_properties(11_InitShaders PROPERTIES FOLDER "Samples") set_target_properties(11_InitShaders PROPERTIES FOLDER "Samples")
target_compile_definitions(11_InitShaders PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(11_InitShaders PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(11_InitShaders PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(11_InitShaders PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}" target_link_libraries(11_InitShaders PUBLIC glslang SPIRV)
)

View File

@ -34,4 +34,4 @@ add_executable(12_InitFrameBuffers
) )
set_target_properties(12_InitFrameBuffers PROPERTIES FOLDER "Samples") set_target_properties(12_InitFrameBuffers PROPERTIES FOLDER "Samples")
target_link_libraries(12_InitFrameBuffers PUBLIC "${Vulkan_LIBRARIES}") target_compile_definitions(12_InitFrameBuffers PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -35,4 +35,4 @@ add_executable(13_InitVertexBuffer
) )
set_target_properties(13_InitVertexBuffer PROPERTIES FOLDER "Samples") set_target_properties(13_InitVertexBuffer PROPERTIES FOLDER "Samples")
target_link_libraries(13_InitVertexBuffer PUBLIC "${Vulkan_LIBRARIES}") target_compile_definitions(13_InitVertexBuffer PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -40,6 +40,6 @@ add_executable(14_InitPipeline
) )
set_target_properties(14_InitPipeline PROPERTIES FOLDER "Samples") set_target_properties(14_InitPipeline PROPERTIES FOLDER "Samples")
target_compile_definitions(14_InitPipeline PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(14_InitPipeline PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(14_InitPipeline PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(14_InitPipeline PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}" target_link_libraries(14_InitPipeline PUBLIC glslang SPIRV)
)

View File

@ -40,6 +40,6 @@ add_executable(15_DrawCube
) )
set_target_properties(15_DrawCube PROPERTIES FOLDER "Samples") set_target_properties(15_DrawCube PROPERTIES FOLDER "Samples")
target_compile_definitions(15_DrawCube PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(15_DrawCube PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(15_DrawCube PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(15_DrawCube PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}" target_link_libraries(15_DrawCube PUBLIC glslang SPIRV)
)

View File

@ -34,4 +34,4 @@ add_executable(16_Vulkan_1_1
) )
set_target_properties(16_Vulkan_1_1 PROPERTIES FOLDER "Samples") set_target_properties(16_Vulkan_1_1 PROPERTIES FOLDER "Samples")
target_link_libraries(16_Vulkan_1_1 PUBLIC "${Vulkan_LIBRARIES}") target_compile_definitions(16_Vulkan_1_1 PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -26,8 +26,6 @@ else()
message(FATAL_ERROR, "unhandled platform !") message(FATAL_ERROR, "unhandled platform !")
endif() endif()
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*) FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*)
if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP) if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP)

View File

@ -34,4 +34,4 @@ add_executable(CopyBlitImage
) )
set_target_properties(CopyBlitImage PROPERTIES FOLDER "Samples") set_target_properties(CopyBlitImage PROPERTIES FOLDER "Samples")
target_link_libraries(CopyBlitImage PUBLIC "${Vulkan_LIBRARIES}") target_compile_definitions(CopyBlitImage PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -26,8 +26,6 @@ set(SOURCES
source_group(headers FILES ${HEADERS}) source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES}) source_group(sources FILES ${SOURCES})
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
add_executable(CreateDebugUtilsMessenger add_executable(CreateDebugUtilsMessenger
${HEADERS} ${HEADERS}
${SOURCES} ${SOURCES}

View File

@ -40,5 +40,6 @@ add_executable(DrawTexturedCube
) )
set_target_properties(DrawTexturedCube PROPERTIES FOLDER "Samples") set_target_properties(DrawTexturedCube PROPERTIES FOLDER "Samples")
target_compile_definitions(DrawTexturedCube PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(DrawTexturedCube PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(DrawTexturedCube PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(DrawTexturedCube PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(DrawTexturedCube PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(DynamicUniform
) )
set_target_properties(DynamicUniform PROPERTIES FOLDER "Samples") set_target_properties(DynamicUniform PROPERTIES FOLDER "Samples")
target_compile_definitions(DynamicUniform PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(DynamicUniform PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(DynamicUniform PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(DynamicUniform PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(DynamicUniform PUBLIC glslang SPIRV)

View File

@ -26,8 +26,6 @@ set(SOURCES
source_group(headers FILES ${HEADERS}) source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES}) source_group(sources FILES ${SOURCES})
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
add_executable(EnableValidationWithCallback add_executable(EnableValidationWithCallback
${HEADERS} ${HEADERS}
${SOURCES} ${SOURCES}

View File

@ -34,4 +34,4 @@ add_executable(EnumerateDevicesAdvanced
) )
set_target_properties(EnumerateDevicesAdvanced PROPERTIES FOLDER "Samples") set_target_properties(EnumerateDevicesAdvanced PROPERTIES FOLDER "Samples")
target_link_libraries(EnumerateDevicesAdvanced "${Vulkan_LIBRARIES}") target_compile_definitions(EnumerateDevicesAdvanced PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -34,4 +34,4 @@ add_executable(Events
) )
set_target_properties(Events PROPERTIES FOLDER "Samples") set_target_properties(Events PROPERTIES FOLDER "Samples")
target_link_libraries(Events PUBLIC "${Vulkan_LIBRARIES}") target_compile_definitions(Events PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)

View File

@ -40,5 +40,6 @@ add_executable(ImmutableSampler
) )
set_target_properties(ImmutableSampler PROPERTIES FOLDER "Samples") set_target_properties(ImmutableSampler PROPERTIES FOLDER "Samples")
target_compile_definitions(ImmutableSampler PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(ImmutableSampler PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(ImmutableSampler PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(ImmutableSampler PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(ImmutableSampler PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(InitTexture
) )
set_target_properties(InitTexture PROPERTIES FOLDER "Samples") set_target_properties(InitTexture PROPERTIES FOLDER "Samples")
target_compile_definitions(InitTexture PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(InitTexture PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(InitTexture PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(InitTexture PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(InitTexture PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(InputAttachment
) )
set_target_properties(InputAttachment PROPERTIES FOLDER "Samples") set_target_properties(InputAttachment PROPERTIES FOLDER "Samples")
target_compile_definitions(InputAttachment PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(InputAttachment PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(InputAttachment PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(InputAttachment PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(InputAttachment PUBLIC glslang SPIRV)

View File

@ -26,8 +26,6 @@ set(SOURCES
source_group(headers FILES ${HEADERS}) source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES}) source_group(sources FILES ${SOURCES})
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
add_executable(InstanceExtensionProperties add_executable(InstanceExtensionProperties
${HEADERS} ${HEADERS}
${SOURCES} ${SOURCES}

View File

@ -26,8 +26,6 @@ set(SOURCES
source_group(headers FILES ${HEADERS}) source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES}) source_group(sources FILES ${SOURCES})
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
add_executable(InstanceLayerExtensionProperties add_executable(InstanceLayerExtensionProperties
${HEADERS} ${HEADERS}
${SOURCES} ${SOURCES}

View File

@ -26,8 +26,6 @@ set(SOURCES
source_group(headers FILES ${HEADERS}) source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES}) source_group(sources FILES ${SOURCES})
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
add_executable(InstanceLayerProperties add_executable(InstanceLayerProperties
${HEADERS} ${HEADERS}
${SOURCES} ${SOURCES}

View File

@ -26,8 +26,6 @@ set(SOURCES
source_group(headers FILES ${HEADERS}) source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES}) source_group(sources FILES ${SOURCES})
add_definitions(-DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
add_executable(InstanceVersion add_executable(InstanceVersion
${HEADERS} ${HEADERS}
${SOURCES} ${SOURCES}

View File

@ -40,5 +40,6 @@ add_executable(MultipleSets
) )
set_target_properties(MultipleSets PROPERTIES FOLDER "Samples") set_target_properties(MultipleSets PROPERTIES FOLDER "Samples")
target_compile_definitions(MultipleSets PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(MultipleSets PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(MultipleSets PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(MultipleSets PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(MultipleSets PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(OcclusionQuery
) )
set_target_properties(OcclusionQuery PROPERTIES FOLDER "Samples") set_target_properties(OcclusionQuery PROPERTIES FOLDER "Samples")
target_compile_definitions(OcclusionQuery PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(OcclusionQuery PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(OcclusionQuery PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(OcclusionQuery PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(OcclusionQuery PUBLIC glslang SPIRV)

View File

@ -34,5 +34,4 @@ add_executable(PhysicalDeviceExtensions
) )
set_target_properties(PhysicalDeviceExtensions PROPERTIES FOLDER "Samples") set_target_properties(PhysicalDeviceExtensions PROPERTIES FOLDER "Samples")
target_link_libraries(PhysicalDeviceExtensions PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(PhysicalDeviceExtensions PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -34,5 +34,4 @@ add_executable(PhysicalDeviceFeatures
) )
set_target_properties(PhysicalDeviceFeatures PROPERTIES FOLDER "Samples") set_target_properties(PhysicalDeviceFeatures PROPERTIES FOLDER "Samples")
target_link_libraries(PhysicalDeviceFeatures PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(PhysicalDeviceFeatures PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -34,5 +34,4 @@ add_executable(PhysicalDeviceGroups
) )
set_target_properties(PhysicalDeviceGroups PROPERTIES FOLDER "Samples") set_target_properties(PhysicalDeviceGroups PROPERTIES FOLDER "Samples")
target_link_libraries(PhysicalDeviceGroups PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(PhysicalDeviceGroups PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -34,5 +34,4 @@ add_executable(PhysicalDeviceMemoryProperties
) )
set_target_properties(PhysicalDeviceMemoryProperties PROPERTIES FOLDER "Samples") set_target_properties(PhysicalDeviceMemoryProperties PROPERTIES FOLDER "Samples")
target_link_libraries(PhysicalDeviceMemoryProperties PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(PhysicalDeviceMemoryProperties PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -34,5 +34,4 @@ add_executable(PhysicalDeviceProperties
) )
set_target_properties(PhysicalDeviceProperties PROPERTIES FOLDER "Samples") set_target_properties(PhysicalDeviceProperties PROPERTIES FOLDER "Samples")
target_link_libraries(PhysicalDeviceProperties PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(PhysicalDeviceProperties PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -34,5 +34,4 @@ add_executable(PhysicalDeviceQueueFamilyProperties
) )
set_target_properties(PhysicalDeviceQueueFamilyProperties PROPERTIES FOLDER "Samples") set_target_properties(PhysicalDeviceQueueFamilyProperties PROPERTIES FOLDER "Samples")
target_link_libraries(PhysicalDeviceQueueFamilyProperties PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(PhysicalDeviceQueueFamilyProperties PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -40,5 +40,6 @@ add_executable(PipelineCache
) )
set_target_properties(PipelineCache PROPERTIES FOLDER "Samples") set_target_properties(PipelineCache PROPERTIES FOLDER "Samples")
target_compile_definitions(PipelineCache PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(PipelineCache PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(PipelineCache PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(PipelineCache PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(PipelineCache PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(PipelineDerivative
) )
set_target_properties(PipelineDerivative PROPERTIES FOLDER "Samples") set_target_properties(PipelineDerivative PROPERTIES FOLDER "Samples")
target_compile_definitions(PipelineDerivative PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(PipelineDerivative PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(PipelineDerivative PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(PipelineDerivative PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(PipelineDerivative PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(PushConstants
) )
set_target_properties(PushConstants PROPERTIES FOLDER "Samples") set_target_properties(PushConstants PROPERTIES FOLDER "Samples")
target_compile_definitions(PushConstants PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(PushConstants PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(PushConstants PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(PushConstants PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(PushConstants PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(PushDescriptors
) )
set_target_properties(PushDescriptors PROPERTIES FOLDER "Samples") set_target_properties(PushDescriptors PROPERTIES FOLDER "Samples")
target_compile_definitions(PushDescriptors PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(PushDescriptors PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(PushDescriptors PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(PushDescriptors PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(PushDescriptors PUBLIC glslang SPIRV)

View File

@ -39,6 +39,7 @@ add_executable(RayTracing
) )
set_target_properties(RayTracing PROPERTIES FOLDER "Samples") set_target_properties(RayTracing PROPERTIES FOLDER "Samples")
target_compile_definitions(RayTracing PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(RayTracing PUBLIC target_include_directories(RayTracing PUBLIC
${CMAKE_SOURCE_DIR}/glslang ${CMAKE_SOURCE_DIR}/glslang
${CMAKE_SOURCE_DIR}/glfw/include ${CMAKE_SOURCE_DIR}/glfw/include
@ -51,5 +52,4 @@ target_include_directories(RayTracing PUBLIC
target_link_libraries(RayTracing PUBLIC glslang SPIRV target_link_libraries(RayTracing PUBLIC glslang SPIRV
legacy_stdio_definitions.lib legacy_stdio_definitions.lib
${CMAKE_SOURCE_DIR}/builds/VS2017_64/glfw/src/Debug/glfw3.lib ${CMAKE_SOURCE_DIR}/builds/VS2017_64/glfw/src/Debug/glfw3.lib
"${Vulkan_LIBRARIES}"
) )

View File

@ -1063,7 +1063,7 @@ int main(int /*argc*/, char** /*argv*/)
// Cleanup // Cleanup
device->waitIdle(); device->waitIdle();
swapChainData.swapChain.reset(); // need to reset swapChain before destroying the surface ! swapChainData.swapChain.reset(); // need to reset swapChain before destroying the surface !
vkDestroySurfaceKHR(*instance, surface, nullptr); VULKAN_HPP_DEFAULT_DISPATCHER.vkDestroySurfaceKHR(*instance, surface, nullptr);
glfwDestroyWindow(window); glfwDestroyWindow(window);
glfwTerminate(); glfwTerminate();
} }

View File

@ -40,5 +40,6 @@ add_executable(SecondaryCommandBuffer
) )
set_target_properties(SecondaryCommandBuffer PROPERTIES FOLDER "Samples") set_target_properties(SecondaryCommandBuffer PROPERTIES FOLDER "Samples")
target_compile_definitions(SecondaryCommandBuffer PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(SecondaryCommandBuffer PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(SecondaryCommandBuffer PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(SecondaryCommandBuffer PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(SecondaryCommandBuffer PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(SeparateImageSampler
) )
set_target_properties(SeparateImageSampler PROPERTIES FOLDER "Samples") set_target_properties(SeparateImageSampler PROPERTIES FOLDER "Samples")
target_compile_definitions(SeparateImageSampler PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(SeparateImageSampler PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(SeparateImageSampler PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(SeparateImageSampler PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(SeparateImageSampler PUBLIC glslang SPIRV)

View File

@ -34,5 +34,4 @@ add_executable(SurfaceCapabilities
) )
set_target_properties(SurfaceCapabilities PROPERTIES FOLDER "Samples") set_target_properties(SurfaceCapabilities PROPERTIES FOLDER "Samples")
target_link_libraries(SurfaceCapabilities PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(SurfaceCapabilities PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -34,5 +34,4 @@ add_executable(SurfaceFormats
) )
set_target_properties(SurfaceFormats PROPERTIES FOLDER "Samples") set_target_properties(SurfaceFormats PROPERTIES FOLDER "Samples")
target_link_libraries(SurfaceFormats PUBLIC "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib" target_compile_definitions(SurfaceFormats PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
)

View File

@ -40,5 +40,6 @@ add_executable(Template
) )
set_target_properties(Template PROPERTIES FOLDER "Samples") set_target_properties(Template PROPERTIES FOLDER "Samples")
target_compile_definitions(Template PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(Template PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(Template PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(Template PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(Template PUBLIC glslang SPIRV)

View File

@ -40,5 +40,6 @@ add_executable(TexelBuffer
) )
set_target_properties(TexelBuffer PROPERTIES FOLDER "Samples") set_target_properties(TexelBuffer PROPERTIES FOLDER "Samples")
target_compile_definitions(TexelBuffer PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
target_include_directories(TexelBuffer PUBLIC ${CMAKE_SOURCE_DIR}/glslang) target_include_directories(TexelBuffer PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(TexelBuffer PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}") target_link_libraries(TexelBuffer PUBLIC glslang SPIRV)

View File

@ -66779,7 +66779,10 @@ namespace VULKAN_HPP_NAMESPACE
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library. // This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
{ {
init(static_cast<VkInstance>(instance), ::vkGetInstanceProcAddr, static_cast<VkDevice>(device), device ? ::vkGetDeviceProcAddr : nullptr); static vk::DynamicLoader dl;
PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
PFN_vkGetDeviceProcAddr getDeviceProcAddr = dl.getProcAddress<PFN_vkGetDeviceProcAddr>("vkGetDeviceProcAddr");
init(static_cast<VkInstance>(instance), getInstanceProcAddr, static_cast<VkDevice>(device), device ? getDeviceProcAddr : nullptr);
} }
#endif // !defined(VK_NO_PROTOTYPES) #endif // !defined(VK_NO_PROTOTYPES)