On Thu, Oct 28, 2021 at 12:16:58AM +0200, Christian Weisgerber wrote:
[...]
> graphics/vulkan-validation-layers

from the log:
/usr/obj/ports/vulkan-validation-layers-1.2.189.1/Vulkan-ValidationLayers-sdk-1.2.189.1/layers/subresource_adapter.h:67:5:
 error: definition of implicit copy assignment operator for 'Subresource' is 
deprecated because it has a user-declared copy constructor 
[-Werror,-Wdeprecated-copy]
    Subresource(const Subresource& from) = default;
    ^
/usr/obj/ports/vulkan-validation-layers-1.2.189.1/Vulkan-ValidationLayers-sdk-1.2.189.1/layers/subresource_adapter.h:305:42:
 note: in implicit copy assignment operator for 
'subresource_adapter::Subresource' first required here
        *static_cast<Subresource*>(this) = encoder_->Decode(index);
                                         ^
1 error generated.

It looks to me like the explicit declaration of the copy constructor is
unnecessary. I built vulkan-validation-layers with clang 11.1 without
problems. Tested vkcube, vkquake, and FNA with /gldevice:Vulkan
(Cryptark) and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and
everything looks and runs as expected.

The diff for this is below.

Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/vulkan-validation-layers/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile    16 Oct 2021 14:50:41 -0000      1.9
+++ Makefile    28 Oct 2021 01:08:54 -0000
@@ -7,6 +7,7 @@ PKGNAME =       vulkan-validation-layers-${V}
 GH_TAGNAME =   sdk-${V}
 GH_ACCOUNT =   KhronosGroup
 GH_PROJECT =   Vulkan-ValidationLayers
+REVISION =     0
 
 CATEGORIES =   devel graphics
 
Index: patches/patch-layers_subresource_adapter_h
===================================================================
RCS file: patches/patch-layers_subresource_adapter_h
diff -N patches/patch-layers_subresource_adapter_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-layers_subresource_adapter_h  28 Oct 2021 01:08:54 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+remove unneeded user-declared copy constructor to fix build with
+clang13
+
+Index: layers/subresource_adapter.h
+--- layers/subresource_adapter.h.orig
++++ layers/subresource_adapter.h
+@@ -64,7 +64,6 @@ struct Subresource : public VkImageSubresource {
+     uint32_t aspect_index;
+     Subresource() : VkImageSubresource({0, 0, 0}), aspect_index(0) {}
+ 
+-    Subresource(const Subresource& from) = default;
+     Subresource(const RangeEncoder& encoder, const VkImageSubresource& 
subres);
+     Subresource(VkImageAspectFlags aspect_mask_, uint32_t mip_level_, 
uint32_t array_layer_, uint32_t aspect_index_)
+         : VkImageSubresource({aspect_mask_, mip_level_, array_layer_}), 
aspect_index(aspect_index_) {}

Reply via email to