Fixes up some warnings

This commit is contained in:
2024-06-24 07:41:58 -04:00
parent f9bd899037
commit 6bf8737857
13 changed files with 33 additions and 21 deletions

View File

@@ -24,9 +24,10 @@
namespace fgl::engine
{
std::uint64_t getNextID()
//TODO: We should be trying to re-use IDs that are released from textures so we can prevent this number from getting extremely large.
std::uint32_t getNextID()
{
static std::uint64_t id { 0 };
static std::uint32_t id { 0 };
return id++;
}
@@ -106,8 +107,8 @@ namespace fgl::engine
{}
Texture::Texture( const std::vector< std::byte >& data, const vk::Extent2D extent, const vk::Format format ) :
m_extent( extent ),
m_texture_id( getNextID() )
m_texture_id( getNextID() ),
m_extent( extent )
{
ZoneScoped;
@@ -272,7 +273,11 @@ namespace fgl::engine
return m_imgui_set;
}
Texture::Texture( Image& image, Sampler sampler ) : m_image_view( image.getView() ), m_texture_id( getNextID() )
Texture::Texture( Image& image, Sampler sampler ) :
m_texture_id( getNextID() ),
m_image_view( image.getView() ),
//TODO: Figure out how to get extents from images.
m_extent()
{
m_image_view->getSampler() = std::move( sampler );
setReady();