git: f7abaa498134 - main - graphics/vulkan-headers: update to 1.2.202

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sat, 11 Dec 2021 00:10:11 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f7abaa498134e5bccf45f6ab67525d803b00aaac

commit f7abaa498134e5bccf45f6ab67525d803b00aaac
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-12-07 09:36:34 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-12-11 00:09:54 +0000

    graphics/vulkan-headers: update to 1.2.202
    
    Force rebuild vulkan-loader to make sure vulkaninfo shows the new version.
    
    Changes:        https://github.com/KhronosGroup/Vulkan-Headers/compare/v1.2.201...v1.2.202
    Reported by:    Repology
---
 .../warzone2100/files/patch-vulkan-headers-1.2.202 | 30 ++++++++++++++++++++++
 graphics/vulkan-headers/Makefile                   |  2 +-
 graphics/vulkan-headers/distinfo                   |  6 ++---
 .../files/patch-include_vulkan_vulkan.hpp          | 30 ++++++++++++++++++++++
 graphics/vulkan-loader/Makefile                    |  1 +
 5 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/games/warzone2100/files/patch-vulkan-headers-1.2.202 b/games/warzone2100/files/patch-vulkan-headers-1.2.202
new file mode 100644
index 000000000000..94c67b83349f
--- /dev/null
+++ b/games/warzone2100/files/patch-vulkan-headers-1.2.202
@@ -0,0 +1,30 @@
+In file included from warzone2100-4.0.1/lib/ivis_opengl/gfx_api_vk.cpp:42:
+lib/ivis_opengl/gfx_api_vk.h:123:9: error: redefinition of 'hash<vk::DescriptorBufferInfo>'
+        struct hash<vk::DescriptorBufferInfo>
+               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/usr/local/include/vulkan/vulkan_structs.hpp:20333:13: note: previous definition is here
+struct std::hash<VULKAN_HPP_NAMESPACE::DescriptorBufferInfo>
+            ^
+
+--- lib/ivis_opengl/gfx_api_vk.h.orig	2021-04-18 18:28:41 UTC
++++ lib/ivis_opengl/gfx_api_vk.h
+@@ -118,19 +118,6 @@ inline void hash_combine(std::size_t& seed, const T& v
+ #endif
+ 	hash_combine(seed, rest...);
+ }
+-namespace std {
+-	template <>
+-	struct hash<vk::DescriptorBufferInfo>
+-	{
+-		std::size_t operator()(const vk::DescriptorBufferInfo& k) const
+-		{
+-			std::size_t h = 0;
+-			hash_combine(h, static_cast<VkBuffer>(k.buffer), k.offset, k.range);
+-			return h;
+-		}
+-	};
+-}
+-
+ struct BlockBufferAllocator
+ {
+ 	BlockBufferAllocator(VmaAllocator allocator, uint32_t minimumBlockSize, const vk::BufferUsageFlags& usageFlags, const VmaAllocationCreateInfo& allocInfo, bool autoMap = false);
diff --git a/graphics/vulkan-headers/Makefile b/graphics/vulkan-headers/Makefile
index c6ae99fc9317..5d89bac9c1ec 100644
--- a/graphics/vulkan-headers/Makefile
+++ b/graphics/vulkan-headers/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	vulkan-headers
 DISTVERSIONPREFIX=	v
-DISTVERSION=	1.2.201
+DISTVERSION=	1.2.202
 CATEGORIES=	graphics
 
 MAINTAINER=	jbeich@FreeBSD.org
diff --git a/graphics/vulkan-headers/distinfo b/graphics/vulkan-headers/distinfo
index ff042db4220b..db7b80b2344d 100644
--- a/graphics/vulkan-headers/distinfo
+++ b/graphics/vulkan-headers/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1638326636
-SHA256 (KhronosGroup-Vulkan-Headers-v1.2.201_GH0.tar.gz) = 6b7f9c809acff4f0877e2e7722e02a08f2e17e06c6e2e8c84081631d15490009
-SIZE (KhronosGroup-Vulkan-Headers-v1.2.201_GH0.tar.gz) = 1318121
+TIMESTAMP = 1638869794
+SHA256 (KhronosGroup-Vulkan-Headers-v1.2.202_GH0.tar.gz) = df8748ba3073be032f78c97994798c3c2b52b1812e506cc58855faf10f031226
+SIZE (KhronosGroup-Vulkan-Headers-v1.2.202_GH0.tar.gz) = 1361825
diff --git a/graphics/vulkan-headers/files/patch-include_vulkan_vulkan.hpp b/graphics/vulkan-headers/files/patch-include_vulkan_vulkan.hpp
new file mode 100644
index 000000000000..edb4a98c9d2e
--- /dev/null
+++ b/graphics/vulkan-headers/files/patch-include_vulkan_vulkan.hpp
@@ -0,0 +1,30 @@
+https://github.com/KhronosGroup/Vulkan-Hpp/issues/1161
+
+--- include/vulkan/vulkan.hpp.orig	2021-12-07 09:36:34 UTC
++++ include/vulkan/vulkan.hpp
+@@ -234,9 +234,23 @@ static_assert( VK_HEADER_VERSION == 202, "Wrong VK_HEA
+ #  define VULKAN_HPP_NAMESPACE vk
+ #endif
+ 
++template <typename T, typename = typename std::is_enum<T>::type>
++struct safe_underlying_type
++{
++  using type = T;
++};
++
++template <typename T>
++struct safe_underlying_type<T, std::true_type>
++{
++  using type = typename std::underlying_type<T>::type;
++};
++
+ #if !defined( VULKAN_HPP_HASH_COMBINE )
+-#  define VULKAN_HPP_HASH_COMBINE( valueType, seed, value ) \
+-    seed ^= std::hash<std::remove_const<valueType>::type>{}( value ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 )
++#  define VULKAN_HPP_HASH_COMBINE( valueType, seed, value )                              \
++    seed ^= std::hash<std::remove_const<safe_underlying_type<valueType>::type>::type>{}( \
++              static_cast<safe_underlying_type<valueType>::type>( value ) ) +            \
++            0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 )
+ #endif
+ 
+ #define VULKAN_HPP_STRINGIFY2( text ) #text
diff --git a/graphics/vulkan-loader/Makefile b/graphics/vulkan-loader/Makefile
index 5c256e8edb0a..eb4c681cc81a 100644
--- a/graphics/vulkan-loader/Makefile
+++ b/graphics/vulkan-loader/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	vulkan-loader
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.2.201
+PORTREVISION=	1
 CATEGORIES=	graphics devel
 
 MAINTAINER=	jbeich@FreeBSD.org