Fixes up some warnings
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "engine/primitives/TransformComponent.hpp"
|
||||
|
||||
@@ -69,7 +70,7 @@ namespace fgl::engine
|
||||
|
||||
class ModelComponent final : public GameObjectComponent< 1 >
|
||||
{
|
||||
std::shared_ptr<Model> m_model;
|
||||
std::shared_ptr< Model > m_model;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tracy/Tracy.hpp>
|
||||
#include <vulkan/vulkan.hpp>
|
||||
#include <vulkan/vulkan_raii.hpp>
|
||||
|
||||
|
||||
@@ -70,8 +70,10 @@ namespace fgl::engine::filesystem
|
||||
auto size { ImGui::GetWindowSize() };
|
||||
size.x -= 12; // Remove scrollbar pixels
|
||||
|
||||
const float extra { std::fmod( size.x, desired_size + ( padding * 2 ) ) };
|
||||
const auto cols { ( size.x - extra ) / static_cast< float >( desired_size + ( padding * 2 ) ) };
|
||||
const float extra { std::fmod( size.x, static_cast< float >( desired_size + ( padding * 2 ) ) ) };
|
||||
const auto cols {
|
||||
static_cast< int >( ( size.x - extra ) / static_cast< float >( desired_size + ( padding * 2 ) ) )
|
||||
};
|
||||
|
||||
if ( cols == 0 )
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
#include <coroutine>
|
||||
#include <filesystem>
|
||||
#include <queue>
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <imgui.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include "engine/descriptors/DescriptorPool.hpp"
|
||||
#include "engine/filesystem/FileBrowser.hpp"
|
||||
#include "engine/model/Model.hpp"
|
||||
@@ -181,6 +179,8 @@ namespace fgl::engine::gui
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
/*
|
||||
ImGui DockBuilder is still very much not ready for use.
|
||||
void prepareDock()
|
||||
{
|
||||
// Docks seem utterly broken.
|
||||
@@ -219,6 +219,7 @@ namespace fgl::engine::gui
|
||||
|
||||
ImGui::DockBuilderFinish( primary_id );
|
||||
}
|
||||
*/
|
||||
|
||||
void drawMainGUI( FrameInfo& info )
|
||||
{
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace fgl::engine
|
||||
ImageView::ImageView( std::shared_ptr< ImageHandle >& img ) :
|
||||
m_resource( img ),
|
||||
m_descriptor_info(),
|
||||
m_sampler(),
|
||||
m_image_view( createImageView( img ) )
|
||||
m_image_view( createImageView( img ) ),
|
||||
m_sampler()
|
||||
{
|
||||
m_descriptor_info.imageLayout = img->m_final_layout;
|
||||
m_descriptor_info.imageView = m_image_view;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "generator.hpp"
|
||||
|
||||
#include <glm/geometric.hpp>
|
||||
#include <tracy/Tracy.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <random>
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace fgl::engine
|
||||
ShaderHandle::ShaderHandle( const std::filesystem::path path, const vk::PipelineShaderStageCreateInfo info ) :
|
||||
shader_data( loadData( path ) ),
|
||||
module_create_info( createModuleInfo() ),
|
||||
shader_module( Device::getInstance()->createShaderModule( module_create_info ) ),
|
||||
stage_info( info )
|
||||
stage_info( info ),
|
||||
shader_module( Device::getInstance()->createShaderModule( module_create_info ) )
|
||||
{
|
||||
stage_info.module = shader_module;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <unordered_set>
|
||||
#include <iostream>
|
||||
|
||||
#include "engine/logging/logging.hpp"
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace fgl::engine
|
||||
g_buffer_position.setClear( vk::ClearColorValue( std::array< float, 4 > { { 0.0f, 0.0f, 0.0f, 0.0f } } ) );
|
||||
g_buffer_normal.setClear( vk::ClearColorValue( std::array< float, 4 > { { 0.0f, 0.0f, 0.0f, 0.0f } } ) );
|
||||
g_buffer_albedo.setClear( vk::ClearColorValue( std::array< float, 4 > { { 0.0f, 0.0f, 0.0f, 0.0f } } ) );
|
||||
g_buffer_composite.setClear( vk::ClearColorValue( std::array< float, 4 > { 0.0f, 0.0f, 0.0f, 0.0f } ) );
|
||||
g_buffer_composite.setClear( vk::ClearColorValue( std::array< float, 4 > { { 0.0f, 0.0f, 0.0f, 0.0f } } ) );
|
||||
|
||||
g_buffer_position_img = std::make_unique< Texture >( g_buffer_position.m_attachment_resources.m_images[ 0 ]
|
||||
->setName( "GBufferPosition" ) );
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -33,13 +33,13 @@ namespace fgl::engine
|
||||
friend class AssetStore;
|
||||
|
||||
//TODO: Implement reusing texture ids
|
||||
TextureID m_texture_id { std::numeric_limits< TextureID >::infinity() };
|
||||
TextureID m_texture_id;
|
||||
|
||||
std::shared_ptr< ImageView > m_image_view {};
|
||||
|
||||
std::unique_ptr< BufferSuballocation > m_staging { nullptr };
|
||||
|
||||
vk::Extent2D m_extent { 0, 0 };
|
||||
vk::Extent2D m_extent;
|
||||
|
||||
vk::DescriptorSet m_imgui_set { VK_NULL_HANDLE };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user