beaumanvienna / vulkan

A Vulkan Render Engine
GNU General Public License v3.0
64 stars 7 forks source link

changing the storage of loaded pixels in VKcubeMap.cpp #33

Closed GDBobby closed 1 year ago

GDBobby commented 1 year ago

thanks for the reference, here are the changes I made while implementing cube maps into my project.

Notes: ~I combined image loading and memory mapping ~m_LocalBuffers[] can be removed from VKcubemap.h, as it's not used in the cpp file anymore ~^ pixels replaces the array, it doesn't need to be casted when you memcpy but I left that in, by the chance I am unaware of something going on behind the scenes.

With these changes, I would recommend removing the Init() function and adding the remaining functionality to Create()

beaumanvienna commented 1 year ago

We can go ahead with this PR. Can you remove m_LocalBuffer in the header as well? Also, can you merge the changes into master, no need for a new branch.

The functions Init() and Create() are separate to allow for different ways of obtaining image data. E.g. for textures, the engine can load image data from a resource system rather than files on disk. Take a look at VKtexture.h and you'll see.

I fixed the Ubuntu PPA and added premake5 for Jammy. I also cloned your repo and tested patch-1. It looked Okay.

Thank you for contributing to my engine. Much appreciated! I would be happy to receive more PRs from you in the future. If you are interested to do more work, we can discuss it on Discord.