[vlc-commits] [Git][videolan/vlc][master] 7 commits: vulkan: platform_win32: rename plateform_ops into ops

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sun Mar 6 13:57:46 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
e5cc8e46 by Alexandre Janniaux at 2022-03-06T12:08:06+00:00
vulkan: platform_win32: rename plateform_ops into ops

Regression from ...

- - - - -
e5dad05c by Alexandre Janniaux at 2022-03-06T12:08:06+00:00
vulkan: platform_win32: reorder to avoid forward declaration

In addition, the signature wasn't matching with the function itself.

- - - - -
1472e92d by Alexandre Janniaux at 2022-03-06T12:08:06+00:00
vulkan: platform_win32: fix create_surface function

- - - - -
241ae201 by Alexandre Janniaux at 2022-03-06T12:08:06+00:00
vulkan: platform_xcb: rename platform_ops into ops

platform_ops doesn't exist.

- - - - -
fe157235 by Alexandre Janniaux at 2022-03-06T12:08:06+00:00
contrib: add vulkan-headers 1.1.127 rules

- - - - -
e95c00f2 by Alexandre Janniaux at 2022-03-06T12:08:06+00:00
contrib: add vulkan-loader 1.1.127 rules

Add contrib for building vulkan module for Windows with patches from the
msys2 project. We don't take a more recent version for now because it
depends upon IDXGI*6 objects that are not available in the toolchain nor
the contribs yet.

- - - - -
c9cf7a09 by Alexandre Janniaux at 2022-03-06T12:08:06+00:00
contrib: libplacebo: depend on vulkan-loader

This enable libplacebo vulkan support, which is used by the libplacebo
video output.

- - - - -


9 changed files:

- contrib/src/libplacebo/rules.mak
- + contrib/src/vulkan-headers/SHA512SUMS
- + contrib/src/vulkan-headers/rules.mak
- + contrib/src/vulkan-loader/001-build-fix.patch
- + contrib/src/vulkan-loader/002-proper-def-files-for-32bit.patch
- + contrib/src/vulkan-loader/003-generate-pkgconfig-files.patch
- + contrib/src/vulkan-loader/SHA512SUMS
- + contrib/src/vulkan-loader/rules.mak
- modules/video_output/vulkan/platform_win32.c


Changes:

=====================================
contrib/src/libplacebo/rules.mak
=====================================
@@ -17,6 +17,15 @@ ifdef HAVE_WIN32
 DEPS_libplacebo += pthreads $(DEPS_pthreads)
 endif
 
+# We don't want vulkan on darwin for now
+ifndef HAVE_DARWIN_OS
+# This should be enabled on Linux too, but it currently fails picking xcb on
+# cross-compilation setup. Test the raspbian build for instance of this issue.
+ifndef HAVE_LINUX
+DEPS_libplacebo += vulkan-loader $(DEPS_vulkan-loader) vulkan-headers $(DEPS_vulkan-headers)
+endif
+endif
+
 PLACEBOCONF := -Dglslang=enabled \
 	-Dshaderc=disabled
 


=====================================
contrib/src/vulkan-headers/SHA512SUMS
=====================================
@@ -0,0 +1 @@
+7472ec31fe74bc3a98303f668eb0c88bf4e4a93b1e3bcf4df2b20fe731cc2efd754d8b64e6507d8ee470841ee575c3092b2b20c4325a44e2e5cd830b7c7dc8ab  Vulkan-Headers-1.1.127.tar.gz


=====================================
contrib/src/vulkan-headers/rules.mak
=====================================
@@ -0,0 +1,18 @@
+VULKAN_HEADERS_VERSION := 1.1.127
+VULKAN_HEADERS_URL := https://github.com/KhronosGroup/Vulkan-Headers/archive/v$(VULKAN_HEADERS_VERSION).tar.gz
+
+DEPS_vulkan-headers =
+
+$(TARBALLS)/Vulkan-Headers-$(VULKAN_HEADERS_VERSION).tar.gz:
+	$(call download_pkg,$(VULKAN_HEADERS_URL),vulkan-headers)
+
+.sum-vulkan-headers: Vulkan-Headers-$(VULKAN_HEADERS_VERSION).tar.gz
+
+vulkan-headers: Vulkan-Headers-$(VULKAN_HEADERS_VERSION).tar.gz .sum-vulkan-headers
+	$(UNPACK)
+	$(MOVE)
+
+.vulkan-headers: vulkan-headers toolchain.cmake
+	cd $< && $(HOSTVARS) $(CMAKE)
+	+$(CMAKEBUILD) $< --target install
+	touch $@


=====================================
contrib/src/vulkan-loader/001-build-fix.patch
=====================================
@@ -0,0 +1,43 @@
+--- a/loader/CMakeLists.txt	2018-05-16 14:05:33.046991100 +0300
++++ b/loader/CMakeLists.txt	2018-05-16 14:07:39.464013100 +0300
+@@ -86,7 +86,7 @@
+ set(ASM_FAILURE_MSG "${ASM_FAILURE_MSG} extensions will suffer from a corrupted stack.")
+ if(WIN32)
+     enable_language(ASM_MASM)
+-    if(CMAKE_ASM_MASM_COMPILER_WORKS)
++    if (MSVC AND CMAKE_ASM_MASM_COMPILER_WORKS)
+         if(NOT CMAKE_CL_64)
+             set(CMAKE_ASM_MASM_FLAGS ${CMAKE_ASM_MASM_FLAGS} /safeseh)
+         endif()
+--- a/loader/loader.c	2018-05-16 14:03:52.750814700 +0300
++++ b/loader/loader.c	2018-05-16 14:04:08.631642600 +0300
+@@ -672,6 +672,10 @@
+ //
+ // *reg_data contains a string list of filenames as pointer.
+ // When done using the returned string list, the caller should free the pointer.
++#ifdef __MINGW32__
++#define CM_GETIDLIST_FILTER_PRESENT            0x00000100
++#define CM_GETIDLIST_FILTER_CLASS              0x00000200
++#endif
+ VkResult loaderGetDeviceRegistryFiles(const struct loader_instance *inst, char **reg_data, PDWORD reg_data_size,
+                                       LPCSTR value_name) {
+     static const wchar_t *softwareComponentGUID = L"{5c4c3332-344d-483c-8739-259e934c9cc8}";
+--- a/loader/loader.rc
++++ b/loader/loader.rc
+@@ -43,8 +43,6 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////
+ 
+-#include "winres.h"
+-
+ #define VER_FILE_VERSION            VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_BUILDNO
+ 
+ #define STRINGIZE2(s) #s
+@@ -77,7 +75,6 @@
+ #endif
+ 
+  FILEOS 0x00000L
+- FILETYPE VFT_DLL
+  FILESUBTYPE 0x0L
+ BEGIN
+     BLOCK "StringFileInfo"


=====================================
contrib/src/vulkan-loader/002-proper-def-files-for-32bit.patch
=====================================
@@ -0,0 +1,401 @@
+diff -Naur Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/CMakeLists.txt Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/CMakeLists.txt
+--- Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/CMakeLists.txt	2017-04-05 00:36:39.000000000 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/CMakeLists.txt	2017-06-29 08:34:52.393725000 +0300
+@@ -153,6 +153,16 @@
+     endif()
+ endif()
+ 
++if (WIN32)
++  if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
++    set(DEFFILE_SUFFIX "")
++    set(WINBITS Win64)
++  else()
++    set(DEFFILE_SUFFIX "-x86")
++    set(WINBITS Win32)
++  endif()
++endif()
++
+ if(MSVC)
+     # /WX: Treat warnings as errors
+     # /GR-: Disable RTTI
+diff -Naur Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/loader/CMakeLists.txt Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/loader/CMakeLists.txt
+--- Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/loader/CMakeLists.txt	2017-06-29 08:19:36.448133100 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/loader/CMakeLists.txt	2017-06-29 08:42:41.322355600 +0300
+@@ -137,6 +137,7 @@
+ set_target_properties(loader_gen_files PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
+ 
+ if(WIN32)
++    if(MSVC)
+     # Use static MSVCRT libraries
+     foreach(configuration
+             in
+@@ -156,6 +157,7 @@
+                            "${${configuration}}")
+         endif()
+     endforeach()
++    endif()
+ 
+     if(ENABLE_WIN10_ONECORE)
+         # Note: When linking your app or driver to OneCore.lib, be sure to remove any links to non-umbrella libs (such as
+@@ -190,24 +192,32 @@
+                     $<TARGET_OBJECTS:loader-opt>
+                     $<TARGET_OBJECTS:loader-norm>
+                     $<TARGET_OBJECTS:loader-unknown-chain>
+-                    ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-1.def
++                    ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-1${DEFFILE_SUFFIX}.def
+                     ${CMAKE_CURRENT_SOURCE_DIR}/loader.rc)
++        if(MSVC)
+         set_target_properties(vulkan
+                               PROPERTIES LINK_FLAGS_DEBUG
+                                          "/ignore:4098"
+                                          OUTPUT_NAME
+                                          vulkan-1)
++        else()
++        set_target_properties(vulkan
++                              PROPERTIES
++                              LIBRARY_OUTPUT_NAME vulkan
++                              RUNTIME_OUTPUT_NAME vulkan-1
++                              ARCHIVE_OUTPUT_NAME vulkan)
++        endif()
+         target_link_libraries(vulkan Vulkan::Headers)
+     else()
+         add_library(vulkan
+                     STATIC
+                     $<TARGET_OBJECTS:loader-opt>
+                     $<TARGET_OBJECTS:loader-norm>
+                     $<TARGET_OBJECTS:loader-unknown-chain>)
+         set_target_properties(vulkan PROPERTIES OUTPUT_NAME VKstatic.1)
+     endif()
+ 
+-    if(ENABLE_WIN10_ONECORE)
++    if(ENABLE_WIN10_ONECORE AND MSVC)
+         target_link_libraries(vulkan OneCoreUAP.lib LIBCMT.LIB LIBCMTD.LIB LIBVCRUNTIME.LIB LIBUCRT.LIB)
+         set_target_properties(vulkan PROPERTIES LINK_FLAGS "/NODEFAULTLIB")
+     else()
+--- Vulkan-LoaderAndValidationLayers-sdk-1.1.73.0/loader/vulkan-1.def.orig	2018-05-16 11:55:36.673944400 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.1.73.0/loader/vulkan-1.def	2018-05-16 11:55:41.307152500 +0300
+@@ -21,7 +21,7 @@
+ ;
+ ;;;;  End Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ 
+-LIBRARY vulkan-1.dll
++LIBRARY libvulkan-1.dll
+ EXPORTS
+    vkCreateInstance
+    vkDestroyInstance
+diff -Naur Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/loader/vulkan-1-x86.def Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/loader/vulkan-1-x86.def
+--- Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/loader/vulkan-1-x86.def	1970-01-01 03:00:00.000000000 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/loader/vulkan-1-x86.def	2017-04-05 00:36:39.000000000 +0300
+@@ -0,0 +1,221 @@
++
++;;;; Begin Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++;
++; Copyright (c) 2015-2017 The Khronos Group Inc.
++; Copyright (c) 2015-2017 Valve Corporation
++; Copyright (c) 2015-2017 LunarG, Inc.
++;
++; Licensed under the Apache License, Version 2.0 (the "License");
++; you may not use this file except in compliance with the License.
++; You may obtain a copy of the License at
++;
++;     http://www.apache.org/licenses/LICENSE-2.0
++;
++; Unless required by applicable law or agreed to in writing, software
++; distributed under the License is distributed on an "AS IS" BASIS,
++; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++; See the License for the specific language governing permissions and
++; limitations under the License.
++;
++;  Author: Courtney Goeltzenleuchter <courtney at LunarG.com>
++;
++;;;;  End Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++
++LIBRARY libvulkan-1.dll
++EXPORTS
++   vkCreateInstance at 12
++   vkDestroyInstance at 8
++   vkEnumeratePhysicalDevices at 12
++   vkGetPhysicalDeviceFeatures at 8
++   vkGetPhysicalDeviceFormatProperties at 12
++   vkGetPhysicalDeviceImageFormatProperties at 28
++   vkGetPhysicalDeviceProperties at 8
++   vkGetPhysicalDeviceQueueFamilyProperties at 12
++   vkGetPhysicalDeviceMemoryProperties at 8
++   vkGetInstanceProcAddr at 8
++   vkGetDeviceProcAddr at 8
++   vkCreateDevice at 16
++   vkDestroyDevice at 8
++   vkEnumerateInstanceExtensionProperties at 12
++   vkEnumerateDeviceExtensionProperties at 16
++   vkEnumerateInstanceLayerProperties at 8
++   vkEnumerateDeviceLayerProperties at 12
++   vkGetDeviceQueue at 16
++   vkQueueSubmit at 20
++   vkQueueWaitIdle at 4
++   vkDeviceWaitIdle at 4
++   vkAllocateMemory at 16
++   vkFreeMemory at 16
++   vkMapMemory at 36
++   vkUnmapMemory at 12
++   vkFlushMappedMemoryRanges at 12
++   vkInvalidateMappedMemoryRanges at 12
++   vkGetDeviceMemoryCommitment at 16
++   vkBindBufferMemory at 28
++   vkBindImageMemory at 28
++   vkGetBufferMemoryRequirements at 16
++   vkGetImageMemoryRequirements at 16
++   vkGetImageSparseMemoryRequirements at 20
++   vkGetPhysicalDeviceSparseImageFormatProperties at 32
++   vkQueueBindSparse at 20
++   vkCreateFence at 16
++   vkDestroyFence at 16
++   vkResetFences at 12
++   vkGetFenceStatus at 12
++   vkWaitForFences at 24
++   vkCreateSemaphore at 16
++   vkDestroySemaphore at 16
++   vkCreateEvent at 16
++   vkDestroyEvent at 16
++   vkGetEventStatus at 12
++   vkSetEvent at 12
++   vkResetEvent at 12
++   vkCreateQueryPool at 16
++   vkDestroyQueryPool at 16
++   vkGetQueryPoolResults at 40
++   vkCreateBuffer at 16
++   vkDestroyBuffer at 16
++   vkCreateBufferView at 16
++   vkDestroyBufferView at 16
++   vkCreateImage at 16
++   vkDestroyImage at 16
++   vkGetImageSubresourceLayout at 20
++   vkCreateImageView at 16
++   vkDestroyImageView at 16
++   vkCreateShaderModule at 16
++   vkDestroyShaderModule at 16
++   vkCreatePipelineCache at 16
++   vkDestroyPipelineCache at 16
++   vkGetPipelineCacheData at 20
++   vkMergePipelineCaches at 20
++   vkCreateGraphicsPipelines at 28
++   vkCreateComputePipelines at 28
++   vkDestroyPipeline at 16
++   vkCreatePipelineLayout at 16
++   vkDestroyPipelineLayout at 16
++   vkCreateSampler at 16
++   vkDestroySampler at 16
++   vkCreateDescriptorSetLayout at 16
++   vkDestroyDescriptorSetLayout at 16
++   vkCreateDescriptorPool at 16
++   vkDestroyDescriptorPool at 16
++   vkResetDescriptorPool at 16
++   vkAllocateDescriptorSets at 12
++   vkFreeDescriptorSets at 20
++   vkUpdateDescriptorSets at 20
++   vkCreateFramebuffer at 16
++   vkDestroyFramebuffer at 16
++   vkCreateRenderPass at 16
++   vkDestroyRenderPass at 16
++   vkGetRenderAreaGranularity at 16
++   vkCreateCommandPool at 16
++   vkDestroyCommandPool at 16
++   vkResetCommandPool at 16
++   vkAllocateCommandBuffers at 12
++   vkFreeCommandBuffers at 20
++   vkBeginCommandBuffer at 8
++   vkEndCommandBuffer at 4
++   vkResetCommandBuffer at 8
++   vkCmdBindPipeline at 16
++   vkCmdSetViewport at 16
++   vkCmdSetScissor at 16
++   vkCmdSetLineWidth at 8
++   vkCmdSetDepthBias at 16
++   vkCmdSetBlendConstants at 8
++   vkCmdSetDepthBounds at 12
++   vkCmdSetStencilCompareMask at 12
++   vkCmdSetStencilWriteMask at 12
++   vkCmdSetStencilReference at 12
++   vkCmdBindDescriptorSets at 36
++   vkCmdBindIndexBuffer at 24
++   vkCmdBindVertexBuffers at 20
++   vkCmdDraw at 20
++   vkCmdDrawIndexed at 24
++   vkCmdDrawIndirect at 28
++   vkCmdDrawIndexedIndirect at 28
++   vkCmdDispatch at 16
++   vkCmdDispatchIndirect at 20
++   vkCmdCopyBuffer at 28
++   vkCmdCopyImage at 36
++   vkCmdBlitImage at 40
++   vkCmdCopyBufferToImage at 32
++   vkCmdCopyImageToBuffer at 32
++   vkCmdUpdateBuffer at 32
++   vkCmdFillBuffer at 32
++   vkCmdClearColorImage at 28
++   vkCmdClearDepthStencilImage at 28
++   vkCmdClearAttachments at 20
++   vkCmdResolveImage at 36
++   vkCmdSetEvent at 16
++   vkCmdResetEvent at 16
++   vkCmdWaitEvents at 44
++   vkCmdPipelineBarrier at 40
++   vkCmdBeginQuery at 20
++   vkCmdEndQuery at 16
++   vkCmdResetQueryPool at 20
++   vkCmdWriteTimestamp at 20
++   vkCmdCopyQueryPoolResults at 48
++   vkCmdPushConstants at 28
++   vkCmdBeginRenderPass at 12
++   vkCmdNextSubpass at 8
++   vkCmdEndRenderPass at 4
++   vkCmdExecuteCommands at 12
++   vkDestroySurfaceKHR at 16
++   vkGetPhysicalDeviceSurfaceSupportKHR at 20
++   vkGetPhysicalDeviceSurfaceCapabilitiesKHR at 16
++   vkGetPhysicalDeviceSurfaceFormatsKHR at 20
++   vkGetPhysicalDeviceSurfacePresentModesKHR at 20
++   vkCreateSwapchainKHR at 16
++   vkDestroySwapchainKHR at 16
++   vkGetSwapchainImagesKHR at 20
++   vkAcquireNextImageKHR at 40
++   vkQueuePresentKHR at 8
++   vkGetPhysicalDeviceDisplayPropertiesKHR at 12
++   vkGetPhysicalDeviceDisplayPlanePropertiesKHR at 12
++   vkGetDisplayPlaneSupportedDisplaysKHR at 16
++   vkGetDisplayModePropertiesKHR at 20
++   vkCreateDisplayModeKHR at 24
++   vkGetDisplayPlaneCapabilitiesKHR at 20
++   vkCreateDisplayPlaneSurfaceKHR at 16
++   vkCreateSharedSwapchainsKHR at 20
++   vkCreateWin32SurfaceKHR at 16
++   vkGetPhysicalDeviceWin32PresentationSupportKHR at 8
++
++   vkEnumerateInstanceVersion at 4
++   vkEnumeratePhysicalDeviceGroups at 12
++   vkGetPhysicalDeviceFeatures2 at 8
++   vkGetPhysicalDeviceProperties2 at 8
++   vkGetPhysicalDeviceFormatProperties2 at 12
++   vkGetPhysicalDeviceQueueFamilyProperties2 at 12
++   vkGetPhysicalDeviceMemoryProperties2 at 8
++   vkGetPhysicalDeviceSparseImageFormatProperties2 at 16
++   vkGetPhysicalDeviceExternalBufferProperties at 12
++   vkGetPhysicalDeviceExternalSemaphoreProperties at 12
++   vkGetPhysicalDeviceExternalFenceProperties at 12
++   vkBindBufferMemory2 at 12
++   vkBindImageMemory2 at 12
++   vkGetDeviceGroupPeerMemoryFeatures at 20
++   vkCmdSetDeviceMask at 8
++   vkCmdDispatchBase at 28
++   vkGetImageMemoryRequirements2 at 12
++   vkGetBufferMemoryRequirements2 at 12
++   vkTrimCommandPool at 16
++   vkGetDeviceQueue2 at 12
++   vkCreateSamplerYcbcrConversion at 16
++   vkDestroySamplerYcbcrConversion at 16
++   vkGetDescriptorSetLayoutSupport at 12
++   vkGetDeviceGroupPresentCapabilitiesKHR at 8
++   vkGetDeviceGroupSurfacePresentModesKHR at 16
++   vkGetPhysicalDevicePresentRectanglesKHR at 20
++   vkAcquireNextImage2KHR at 12
++   vkCreateDescriptorUpdateTemplate at 16
++   vkDestroyDescriptorUpdateTemplate at 16
++   vkUpdateDescriptorSetWithTemplate at 24
++
++   vkGetPhysicalDeviceDisplayProperties2KHR at 12
++   vkGetPhysicalDeviceDisplayPlaneProperties2KHR at 12
++   vkGetDisplayModeProperties2KHR at 20
++   vkGetDisplayPlaneCapabilities2KHR at 12
++
++   vkGetImageSparseMemoryRequirements2 at 16
++   vkGetPhysicalDeviceImageFormatProperties2 at 12
+diff -Naur Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/tests/layers/CMakeLists.txt Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/tests/layers/CMakeLists.txt
+--- Vulkan-LoaderAndValidationLayers-sdk-1.1.73.0-orig/tests/layers/CMakeLists.txt	2017-04-05 00:36:39.000000000 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.1.73.0/tests/layers/CMakeLists.txt	2017-06-29 08:39:07.115088000 +0300
+@@ -19,12 +19,12 @@
+ 
+ if(WIN32)
+     macro(AddVkLayer target)
+-        file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/VkLayer_${target}.def DEF_FILE)
++        file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/VkLayer_${target}${DEFFILE_SUFFIX}.def DEF_FILE)
+         add_custom_target(copy-${target}-def-file ALL
+-                          COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEF_FILE} VkLayer_${target}.def
++                          COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEF_FILE} VkLayer_${target}${DEFFILE_SUFFIX}.def
+                           VERBATIM)
+         set_target_properties(copy-${target}-def-file PROPERTIES FOLDER ${LOADER_HELPER_FOLDER})
+-        add_library(VkLayer_${target} SHARED ${ARGN} VkLayer_${target}.def)
++        add_library(VkLayer_${target} SHARED ${ARGN} VkLayer_${target}${DEFFILE_SUFFIX}.def)
+         target_compile_options(VkLayer_${target} PUBLIC ${MSVC_LOADER_COMPILE_OPTIONS})
+         add_dependencies(VkLayer_${target} generate_helper_files)
+     endmacro()
+diff -Naur Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/tests/layers/VkLayer_test-x86.def Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/tests/layers/VkLayer_test-x86.def
+--- Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/tests/layers/VkLayer_test-x86.def	1970-01-01 03:00:00.000000000 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/tests/layers/VkLayer_test-x86.def	2017-04-05 00:36:39.000000000 +0300
+@@ -0,0 +1,32 @@
++; THIS FILE IS GENERATED.  DO NOT EDIT.
++
++;;;; Begin Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++; Vulkan
++;
++; Copyright (c) 2015-2016 The Khronos Group Inc.
++; Copyright (c) 2015-2016 Valve Corporation
++; Copyright (c) 2015-2016 LunarG, Inc.
++;
++; Licensed under the Apache License, Version 2.0 (the "License");
++; you may not use this file except in compliance with the License.
++; You may obtain a copy of the License at
++;
++;     http://www.apache.org/licenses/LICENSE-2.0
++;
++; Unless required by applicable law or agreed to in writing, software
++; distributed under the License is distributed on an "AS IS" BASIS,
++; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++; See the License for the specific language governing permissions and
++; limitations under the License.
++;
++;  Author: Courtney Goeltzenleuchter <courtney at LunarG.com>
++;;;;  End Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++
++; The following is required on Windows, for exporting symbols from the DLL
++
++LIBRARY VkLayer_test
++EXPORTS
++vkGetInstanceProcAddr at 8
++vkGetDeviceProcAddr at 8
++vkEnumerateInstanceLayerProperties at 8
++vkEnumerateInstanceExtensionProperties at 12
+diff -Naur Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/tests/layers/VkLayer_wrap_objects-x86.def Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/tests/layers/VkLayer_wrap_objects-x86.def
+--- Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/tests/layers/VkLayer_wrap_objects-x86.def	1970-01-01 03:00:00.000000000 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/tests/layers/VkLayer_wrap_objects-x86.def	2017-04-05 00:36:39.000000000 +0300
+@@ -0,0 +1,32 @@
++; THIS FILE IS GENERATED.  DO NOT EDIT.
++
++;;;; Begin Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++; Vulkan
++;
++; Copyright (c) 2015-2016 The Khronos Group Inc.
++; Copyright (c) 2015-2016 Valve Corporation
++; Copyright (c) 2015-2016 LunarG, Inc.
++;
++; Licensed under the Apache License, Version 2.0 (the "License");
++; you may not use this file except in compliance with the License.
++; You may obtain a copy of the License at
++;
++;     http://www.apache.org/licenses/LICENSE-2.0
++;
++; Unless required by applicable law or agreed to in writing, software
++; distributed under the License is distributed on an "AS IS" BASIS,
++; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++; See the License for the specific language governing permissions and
++; limitations under the License.
++;
++;  Author: Courtney Goeltzenleuchter <courtney at LunarG.com>
++;;;;  End Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++
++; The following is required on Windows, for exporting symbols from the DLL
++
++LIBRARY VkLayer_wrap_objects
++EXPORTS
++vkGetInstanceProcAddr at 8
++vkGetDeviceProcAddr at 8
++vkEnumerateInstanceLayerProperties at 8
++vkEnumerateInstanceExtensionProperties at 12


=====================================
contrib/src/vulkan-loader/003-generate-pkgconfig-files.patch
=====================================
@@ -0,0 +1,18 @@
+diff -Naur Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/loader/CMakeLists.txt Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/loader/CMakeLists.txt
+--- Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0-orig/loader/CMakeLists.txt	2017-06-29 08:19:36.448133100 +0300
++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.46.0/loader/CMakeLists.txt	2017-06-29 08:42:41.322355600 +0300
+@@ -286,6 +286,7 @@
+     if(INSTALL_LVL_FILES)
+         install(TARGETS ${API_LOWERCASE} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+     endif()
++endif()
+ 
+     if(NOT APPLE)
+         # Generate pkg-config file.
+@@ -302,6 +302,5 @@
+             endif()
+         endif()
+     endif()
+-endif()
+ 
+ 


=====================================
contrib/src/vulkan-loader/SHA512SUMS
=====================================
@@ -0,0 +1 @@
+59afc74b83050bd21186dc7a58f7d39350796ddd4cfdf9975dcf7c5d525f1e318acd204dc2a796b6286d24c2b928c3ccaa76563ce2bfedcbcfeaf68e70a88116  Vulkan-Loader-1.1.127.tar.gz


=====================================
contrib/src/vulkan-loader/rules.mak
=====================================
@@ -0,0 +1,64 @@
+VULKAN_LOADER_VERSION := 1.1.127
+VULKAN_LOADER_URL := https://github.com/KhronosGroup/Vulkan-Loader/archive/v$(VULKAN_LOADER_VERSION).tar.gz
+
+DEPS_vulkan-loader = vulkan-headers $(DEPS_vulkan-headers)
+
+# On WIN32 platform, we don't know where to find the loader
+# so always build it for the Vulkan module.
+ifdef HAVE_WIN32_DESKTOP
+PKGS += vulkan-loader
+endif
+
+ifeq ($(call need_pkg,"vulkan"),)
+PKGS_FOUND += vulkan-loader
+endif
+
+# On Android, vulkan-loader is available on the system itself.
+ifdef HAVE_ANDROID
+PKGS_FOUND += vulkan-loader
+endif
+
+ifdef HAVE_LINUX
+DEPS_vulkan-loader += xcb $(DEPS_xcb)
+endif
+
+VULKAN_LOADER_CONF := \
+	-DENABLE_STATIC_LOADER=ON \
+	-DBUILD_SHARED_LIBS=OFF \
+	-DBUILD_TESTS=OFF \
+	-DBUILD_LOADER=ON \
+	-DCMAKE_ASM_COMPILER="$(AS)"
+
+$(TARBALLS)/Vulkan-Loader-$(VULKAN_LOADER_VERSION).tar.gz:
+	$(call download_pkg,$(VULKAN_LOADER_URL),vulkan-loader)
+
+.sum-vulkan-loader: Vulkan-Loader-$(VULKAN_LOADER_VERSION).tar.gz
+
+vulkan-loader: Vulkan-Loader-$(VULKAN_LOADER_VERSION).tar.gz .sum-vulkan-loader
+	$(UNPACK)
+# Patches are from msys2 package system
+# https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-vulkan-loader
+	$(APPLY) $(SRC)/vulkan-loader/001-build-fix.patch
+	$(APPLY) $(SRC)/vulkan-loader/002-proper-def-files-for-32bit.patch
+	$(APPLY) $(SRC)/vulkan-loader/003-generate-pkgconfig-files.patch
+	$(MOVE)
+
+# Needed for the loader's cmake script to find the registry files
+VULKAN_LOADER_ENV_CONF = \
+	VULKAN_HEADERS_INSTALL_DIR="$(PREFIX)"
+
+.vulkan-loader: vulkan-loader toolchain.cmake
+	cd $< && rm -rf ./build && mkdir -p build
+	cd $</build && $(VULKAN_LOADER_ENV_CONF) $(HOSTVARS) \
+		$(CMAKE) $(VULKAN_LOADER_CONF) ..
+	cd $</build && $(CMAKEBUILD) .
+
+ifdef HAVE_WIN32
+# CMake will generate a .pc file with -lvulkan even if the static library
+# generated is libVKstatic.1.a. It also forget to link with libcfgmgr32.
+	cd $< && sed -i.orig -e "s,-lvulkan,-lVKstatic.1 -lcfgmgr32," build/loader/vulkan.pc
+endif
+
+	$(call pkg_static,"build/loader/vulkan.pc")
+	cd $</build && $(MAKE) install
+	touch $@


=====================================
modules/video_output/vulkan/platform_win32.c
=====================================
@@ -28,30 +28,12 @@
 #include <vlc_plugin.h>
 #include "platform.h"
 
-static void ClosePlatform(vlc_vk_platform_t *vk);
-static int CreateSurface(vlc_vk_platform_t *vk);
-static const struct vlc_vk_platform_operations platform_ops =
-{
-    .close = ClosePlatform,
-    .create_surface = CreateSurface,
-};
-
-static int InitPlatform(vlc_vk_platform_t *vk)
-{
-    if (vk->window->type != VOUT_WINDOW_TYPE_HWND)
-        return VLC_EGENERIC;
-
-    vk->platform_ext = VK_KHR_WIN32_SURFACE_EXTENSION_NAME;
-    vk->platform_ops = &platform_ops;
-    return VLC_SUCCESS;
-}
-
 static void ClosePlatform(vlc_vk_platform_t *vk)
 {
     VLC_UNUSED(vk);
 }
 
-static int CreateSurface(vlc_vk_platform_t *vk, VkInstance vkinst)
+static int CreateSurface(vlc_vk_platform_t *vk, VkInstance vkinst, VkSurfaceKHR *surface_out)
 {
     // Get current win32 HINSTANCE
     HINSTANCE hInst = GetModuleHandle(NULL);
@@ -62,7 +44,7 @@ static int CreateSurface(vlc_vk_platform_t *vk, VkInstance vkinst)
          .hwnd = (HWND) vk->window->handle.hwnd,
     };
 
-    VkResult res = vkCreateWin32SurfaceKHR(vkinst, &winfo, NULL, &vk->surface);
+    VkResult res = vkCreateWin32SurfaceKHR(vkinst, &winfo, NULL, surface_out);
     if (res != VK_SUCCESS) {
         msg_Err(vk, "Failed creating Win32 surface");
         return VLC_EGENERIC;
@@ -71,6 +53,22 @@ static int CreateSurface(vlc_vk_platform_t *vk, VkInstance vkinst)
     return VLC_SUCCESS;
 }
 
+static const struct vlc_vk_platform_operations platform_ops =
+{
+    .close = ClosePlatform,
+    .create_surface = CreateSurface,
+};
+
+static int InitPlatform(vlc_vk_platform_t *vk)
+{
+    if (vk->window->type != VOUT_WINDOW_TYPE_HWND)
+        return VLC_EGENERIC;
+
+    vk->platform_ext = VK_KHR_WIN32_SURFACE_EXTENSION_NAME;
+    vk->ops = &platform_ops;
+    return VLC_SUCCESS;
+}
+
 vlc_module_begin()
     set_shortname("Vulkan Win32")
     set_description(N_("Win32 platform support for Vulkan"))



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ab7be29617a4d7449f2a3e73337f9adba614c6eb...c9cf7a0909bb5137481c5e08e837a204104816b5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ab7be29617a4d7449f2a3e73337f9adba614c6eb...c9cf7a0909bb5137481c5e08e837a204104816b5
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list