From bc0ba361cd417556538f85e3b14a9ea1827d4f44 Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:29:15 +0200 Subject: [PATCH] [magnum] fix build of vk feature (#39806) --- ports/magnum/006-fix-build.patch | 70 ++++++++++++++++++++++++++++++++ ports/magnum/portfile.cmake | 1 + ports/magnum/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/m-/magnum.json | 5 +++ 5 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 ports/magnum/006-fix-build.patch diff --git a/ports/magnum/006-fix-build.patch b/ports/magnum/006-fix-build.patch new file mode 100644 index 0000000000..002b013f02 --- /dev/null +++ b/ports/magnum/006-fix-build.patch @@ -0,0 +1,70 @@ +diff --git a/src/Magnum/Vk/Enums.cpp b/src/Magnum/Vk/Enums.cpp +index ad8b6d063..b7dffb74f 100644 +--- a/src/Magnum/Vk/Enums.cpp ++++ b/src/Magnum/Vk/Enums.cpp +@@ -36,17 +36,17 @@ namespace Magnum { namespace Vk { + + namespace { + +-constexpr VkPrimitiveTopology PrimitiveTopologyMapping[]{ ++constexpr UnsignedInt PrimitiveTopologyMapping[]{ + VK_PRIMITIVE_TOPOLOGY_POINT_LIST, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST, +- VkPrimitiveTopology(~UnsignedInt{}), ++ ~UnsignedInt{}, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN, +- VkPrimitiveTopology(~UnsignedInt{}), /* Instances */ +- VkPrimitiveTopology(~UnsignedInt{}), /* Faces */ +- VkPrimitiveTopology(~UnsignedInt{}) /* Edges */ ++ ~UnsignedInt{}, /* Instances */ ++ ~UnsignedInt{}, /* Faces */ ++ ~UnsignedInt{} /* Edges */ + }; + + constexpr VkIndexType IndexTypeMapping[]{ +@@ -94,12 +94,12 @@ constexpr VkSamplerMipmapMode SamplerMipmapModeMapping[]{ + VK_SAMPLER_MIPMAP_MODE_LINEAR + }; + +-constexpr VkSamplerAddressMode SamplerAddressModeMapping[]{ ++constexpr UnsignedInt SamplerAddressModeMapping[]{ + VK_SAMPLER_ADDRESS_MODE_REPEAT, + VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, +- VkSamplerAddressMode(~UnsignedInt{}), ++ ~UnsignedInt{}, + }; + + } +@@ -119,10 +119,10 @@ VkPrimitiveTopology vkPrimitiveTopology(const Magnum::MeshPrimitive primitive) { + + CORRADE_ASSERT(UnsignedInt(primitive) - 1 < Containers::arraySize(PrimitiveTopologyMapping), + "Vk::vkPrimitiveTopology(): invalid primitive" << primitive, {}); +- const VkPrimitiveTopology out = PrimitiveTopologyMapping[UnsignedInt(primitive) - 1]; +- CORRADE_ASSERT(out != VkPrimitiveTopology(~UnsignedInt{}), ++ const UnsignedInt out = PrimitiveTopologyMapping[UnsignedInt(primitive) - 1]; ++ CORRADE_ASSERT(out != ~UnsignedInt{}, + "Vk::vkPrimitiveTopology(): unsupported primitive" << primitive, {}); +- return out; ++ return VkPrimitiveTopology(out); + } + + bool hasVkIndexType(const Magnum::MeshIndexType type) { +@@ -224,10 +224,10 @@ bool hasVkSamplerAddressMode(const Magnum::SamplerWrapping wrapping) { + VkSamplerAddressMode vkSamplerAddressMode(const Magnum::SamplerWrapping wrapping) { + CORRADE_ASSERT(UnsignedInt(wrapping) < Containers::arraySize(SamplerAddressModeMapping), + "Vk::vkSamplerAddressMode(): invalid wrapping" << wrapping, {}); +- const VkSamplerAddressMode out = SamplerAddressModeMapping[UnsignedInt(wrapping)]; +- CORRADE_ASSERT(out != VkSamplerAddressMode(~UnsignedInt{}), ++ const UnsignedInt out = SamplerAddressModeMapping[UnsignedInt(wrapping)]; ++ CORRADE_ASSERT(out != ~UnsignedInt{}, + "Vk::vkSamplerAddressMode(): unsupported wrapping" << wrapping, {}); +- return out; ++ return VkSamplerAddressMode(out); + } + + }} diff --git a/ports/magnum/portfile.cmake b/ports/magnum/portfile.cmake index e34f9f2560..6a7079fb46 100644 --- a/ports/magnum/portfile.cmake +++ b/ports/magnum/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( 003-fix-FindGLFW.patch 004-fix-FindOpenAL.patch 005-fix-find-sdl2.patch + 006-fix-build.patch # From https://github.com/mosra/magnum/issues/642#issuecomment-2217261862 ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) diff --git a/ports/magnum/vcpkg.json b/ports/magnum/vcpkg.json index c941bd4e9c..a6490bca7b 100644 --- a/ports/magnum/vcpkg.json +++ b/ports/magnum/vcpkg.json @@ -1,7 +1,7 @@ { "name": "magnum", "version-string": "2020.06", - "port-version": 18, + "port-version": 19, "description": "C++11/C++14 graphics middleware for games and data visualization", "homepage": "https://magnum.graphics/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 8181afa760..8748b40969 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5594,7 +5594,7 @@ }, "magnum": { "baseline": "2020.06", - "port-version": 18 + "port-version": 19 }, "magnum-extras": { "baseline": "2020.06", diff --git a/versions/m-/magnum.json b/versions/m-/magnum.json index 59e6baca10..b3d1552447 100644 --- a/versions/m-/magnum.json +++ b/versions/m-/magnum.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d8cf9aa78a3ffe42bb01a1ce95564717d2ebd6c8", + "version-string": "2020.06", + "port-version": 19 + }, { "git-tree": "87613165fa337f84fae12a9a2ed1e1ee93ec8fb9", "version-string": "2020.06",