diff --git a/doc/changelog.dox b/doc/changelog.dox index a348e3b6c..451c3524f 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -193,6 +193,11 @@ See also: - @ref magnum-imageconverter "magnum-imageconverter" has a new `--in-place` option for converting images in-place +@subsubsection changelog-latest-changes-vk Vk library + +- @ref Vk::hasVkSamplerAddressMode() and @ref Vk::vkSamplerAddressMode() now + recognizes @ref SamplerWrapping::MirrorClampToEdge + @subsection changelog-latest-buildsystem Build system - Fixed compilation of the @ref GL library on macOS with ANGLE --- new code diff --git a/src/Magnum/Sampler.h b/src/Magnum/Sampler.h index f89ff38c8..7fe849e2d 100644 --- a/src/Magnum/Sampler.h +++ b/src/Magnum/Sampler.h @@ -169,8 +169,8 @@ enum class SamplerWrapping: UnsignedInt { * Mirror the texture once in negative coordinates and clamp to * edge after that. * - * Corresponds to @ref GL::SamplerWrapping::MirrorClampToEdge. Not - * available on Vulkan. + * Corresponds to @ref GL::SamplerWrapping::MirrorClampToEdge. / + * @val_vk_keyword{SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE,SamplerAddressMode}. */ MirrorClampToEdge }; diff --git a/src/Magnum/Vk/Enums.cpp b/src/Magnum/Vk/Enums.cpp index 6a45dfe0e..f99455899 100644 --- a/src/Magnum/Vk/Enums.cpp +++ b/src/Magnum/Vk/Enums.cpp @@ -102,7 +102,7 @@ constexpr VkSamplerAddressMode SamplerAddressModeMapping[]{ VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, - VkSamplerAddressMode(~UnsignedInt{}), + VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, }; } diff --git a/src/Magnum/Vk/Enums.h b/src/Magnum/Vk/Enums.h index 626b03f1c..cb5d0ade5 100644 --- a/src/Magnum/Vk/Enums.h +++ b/src/Magnum/Vk/Enums.h @@ -209,10 +209,8 @@ MAGNUM_VK_EXPORT VkSamplerMipmapMode vkSamplerMipmapMode(Magnum::SamplerMipmap m /** @brief Check availability of a generic sampler wrapping mode -Some Vulkan targets don't support all generic sampler wrapping modes (for -example the @ref SamplerWrapping::MirrorClampToEdge). Returns @cpp false @ce if -current target can't support such format, @cpp true @ce otherwise. The -@p wrapping value is expected to be valid. +Returns @cpp false @ce if Vulkan doesn't support such wrapping, @cpp true @ce +otherwise. The @p wrapping value is expected to be valid. @note Support of some formats depends on presence of a particular Vulkan extension. Such check is outside of the scope of this function and you are diff --git a/src/Magnum/Vk/Test/EnumsTest.cpp b/src/Magnum/Vk/Test/EnumsTest.cpp index 5a57522c3..b0c95ae87 100644 --- a/src/Magnum/Vk/Test/EnumsTest.cpp +++ b/src/Magnum/Vk/Test/EnumsTest.cpp @@ -624,14 +624,16 @@ void EnumsTest::mapVkSamplerAddressModeUnsupported() { CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); #endif + #if 1 + CORRADE_SKIP("All sampler address modes are supported."); + #else CORRADE_VERIFY(!hasVkSamplerAddressMode(Magnum::SamplerWrapping::MirrorClampToEdge)); std::ostringstream out; - { - Error redirectError{&out}; - vkSamplerAddressMode(Magnum::SamplerWrapping::MirrorClampToEdge); - } + Error redirectError{&out}; + vkSamplerAddressMode(Magnum::SamplerWrapping::MirrorClampToEdge); CORRADE_COMPARE(out.str(), "Vk::vkSamplerAddressMode(): unsupported wrapping SamplerWrapping::MirrorClampToEdge\n"); + #endif } void EnumsTest::mapVkSamplerAddressModeInvalid() {