PacktPublishing / Vulkan-Cookbook

Code repository for Vulkan Cookbook by Packt
MIT License
816 stars 109 forks source link

vkDestroyer private constructor matter #5

Closed Sebultura closed 6 years ago

Sebultura commented 7 years ago

I'm stuck at compilation with this error: (Visual Studio 13 Community + Windows 10): VulkanCookbook\Library\Source Files\09 Command Recording and Drawing/19 Increasing the performance through increasing the number of separately rendered frames.h(44): error C2248: 'VulkanCookbook::VkDestroyer<VkSemaphore>::VkDestroyer' : cannot access private member declared in class 'VulkanCookbook::VkDestroyer<VkSemaphore>' For some reason, it seems that in the FrameResources struct, the vkDestroyer members require the VkDestroyer( VkDestroyer<OBJ> const & ); constructor.

Ekzuzy commented 7 years ago

I created the code on Windows 7 and Visual Studio 2015. But as I had some problems with compilation on Linux, I changed it a bit so it compiles both on Windows and Linux. So far I didn't have other issues but I didn't test it on other versions of Visual Studio. But I will try to look at it.

29.07.2017 10:24 AM "Sebultura" notifications@github.com napisał(a):

I'm stuck at compilation with this error: (Visual Studio 13 Community + Windows 10): VulkanCookbook\Library\Source Files\09 Command Recording and Drawing/19 Increasing the performance through increasing the number of separately rendered frames.h(44): error C2248: 'VulkanCookbook::VkDestroyer::VkDestroyer' : cannot access private member declared in class 'VulkanCookbook::VkDestroyer' For some reason, it seems that in the FrameResources struct, the vkDestroyer members require the VkDestroyer( VkDestroyer const & ); constructor. Anyway, I remark that the syntax coloration is a bit messed up on that line (tied to some C++11 issue on my setup I guess ?)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PacktPublishing/Vulkan-Cookbook/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ6PZ6-EC8EGoKEPz5jMvk3IC13LkmLWks5sSuwmgaJpZM4OnS9K .

Ekzuzy commented 6 years ago

Sorry it took so long but there indeed is a problem with compilation on Visual Studio 2013 Community. If You didn't already change Your IDE to a newer version, I'm working on a fix and I'm almost done. I had to add a constructor to the FrameResources structure that accepts references to VkDestroyer<> objects.

Sebultura commented 6 years ago

Hey thanks for the news, but don't be afraid, I'm on stand by about Vulkan: right now I'm working on the OpenGL side, while I'm on a more advanced Direct3D point ;) I haven't switched to another version of Visual Studio, so once you'll have something to test, I'll be able to give you some feedback for sure!

Ekzuzy commented 6 years ago

Hi again!

Could You check if the problem still persists? I've added a move constructor to the FrameResources struct and it helped with compilation problems in Visual Studio 2013. I've also heavily refactor VkDestroyer<> class. This shouldn't have a negative impact and I checked it on Visual Studio 2013 and 2015 on two different computers and three different graphics hardware (Nvidia and Intel) but I'd like to be sure everything works fine for others too. ;-)

Sebultura commented 6 years ago

Hey Ekzuzy: I confirm that there's 0 warnings and 0 errors now! Great job !

Ekzuzy commented 6 years ago

Great!! Thanks! :-)