[magnum] fix build of vk feature (#39806)

This commit is contained in:
autoantwort 2024-07-13 16:29:15 +02:00 committed by GitHub
parent 5cca0d81a6
commit bc0ba361cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 78 additions and 2 deletions

View File

@ -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);
}
}}

View File

@ -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)

View File

@ -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,

View File

@ -5594,7 +5594,7 @@
},
"magnum": {
"baseline": "2020.06",
"port-version": 18
"port-version": 19
},
"magnum-extras": {
"baseline": "2020.06",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d8cf9aa78a3ffe42bb01a1ce95564717d2ebd6c8",
"version-string": "2020.06",
"port-version": 19
},
{
"git-tree": "87613165fa337f84fae12a9a2ed1e1ee93ec8fb9",
"version-string": "2020.06",