Some starting cleanup
This commit is contained in:
@@ -15,9 +15,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
PreSetup()
|
||||
|
||||
|
||||
PostSetup()
|
||||
|
||||
#file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/data)
|
||||
|
||||
#Enable cmake_modules
|
||||
@@ -26,8 +23,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
|
||||
message("-- CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
|
||||
|
||||
PlatformPreSetup()
|
||||
CompilerPreSetup()
|
||||
message("-- FGL_FLAGS: ${FGL_FLAGS}")
|
||||
|
||||
add_subdirectory(dependencies/vma)
|
||||
@@ -40,4 +35,4 @@ include(dependencies/shaderc)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
CompilerPostSetup()
|
||||
PostSetup()
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "engine/flags.hpp"
|
||||
#include "engine/math/Average.hpp"
|
||||
#include "engine/math/literals/size.hpp"
|
||||
#include "engine/rendering/pipelines/v2/Pipeline.hpp"
|
||||
|
||||
namespace fgl::engine
|
||||
{
|
||||
@@ -48,7 +47,6 @@ namespace fgl::engine
|
||||
|
||||
memory::TransferManager::createInstance( device, 128_MiB );
|
||||
|
||||
|
||||
m_matrix_info_pool.setDebugName( "Matrix info pool" );
|
||||
m_draw_parameter_pool.setDebugName( "Draw parameter pool" );
|
||||
|
||||
@@ -59,7 +57,7 @@ namespace fgl::engine
|
||||
|
||||
initMaterialDataVec( m_material_data_pool );
|
||||
|
||||
constexpr auto offset { 8.0f };
|
||||
constexpr float offset { 8.0f };
|
||||
constexpr std::size_t grid_size { 6 };
|
||||
constexpr float factor_offset { 1.0f / static_cast< float >( grid_size ) };
|
||||
|
||||
@@ -87,13 +85,16 @@ namespace fgl::engine
|
||||
for ( auto& prim : prims )
|
||||
{
|
||||
auto& pbr { prim.m_material->properties.pbr };
|
||||
pbr.roughness_factor = x * factor_offset;
|
||||
pbr.metallic_factor = y * factor_offset;
|
||||
pbr.roughness_factor = static_cast< float >( x ) * factor_offset;
|
||||
pbr.metallic_factor = static_cast< float >( y ) * factor_offset;
|
||||
prim.m_material->update();
|
||||
}
|
||||
}
|
||||
|
||||
obj.getTransform().translation = WorldCoordinate( 10.0 + x * offset, 10.0 + y * offset, 0.0f );
|
||||
obj.getTransform().translation = WorldCoordinate(
|
||||
-10.0f + ( static_cast< float >( x ) * offset ),
|
||||
-10.0f + ( static_cast< float >( y ) * offset ),
|
||||
0.0f );
|
||||
|
||||
m_game_objects_root.addGameObject( std::move( obj ) );
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace fgl::engine
|
||||
std::vector< FrameHookFunc > post_frame_hooks {};
|
||||
|
||||
//! Called before the context is destroyed
|
||||
std::vector< std::function< void() > > destruction_hooks;
|
||||
std::vector< std::function< void() > > destruction_hooks {};
|
||||
|
||||
// Memory pool for shader uniforms.
|
||||
memory::Buffer m_ubo_buffer_pool;
|
||||
|
||||
@@ -182,10 +182,10 @@ namespace fgl::engine
|
||||
|
||||
assert( view );
|
||||
|
||||
VkImageView vk_view { **view };
|
||||
const VkImageView vk_view { **view };
|
||||
assert( vk_view );
|
||||
|
||||
VkSampler vk_sampler { *( view->getSampler() ) };
|
||||
const VkSampler vk_sampler { *( view->getSampler() ) };
|
||||
|
||||
m_imgui_set = ImGui_ImplVulkan_AddTexture( vk_sampler, vk_view, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL );
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ namespace fgl::engine::descriptors
|
||||
DescriptorSetLayout( set_idx, std::vector< std::reference_wrapper< const Descriptor > > { descriptors... } )
|
||||
{}
|
||||
|
||||
std::size_t count() const { return bindings.size(); }
|
||||
[[nodiscard]] std::size_t count() const { return bindings.size(); }
|
||||
|
||||
std::unique_ptr< DescriptorSet > create();
|
||||
vk::raii::DescriptorSetLayout createLayout() const;
|
||||
[[nodiscard]] vk::raii::DescriptorSetLayout createLayout() const;
|
||||
vk::raii::DescriptorSetLayout& layout();
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
|
||||
AddFGLLibrary(FGLLoader STATIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
AddFGLChildLibrary(FGLLoader STATIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
#target_include_directories(FGLLoader PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
Reference in New Issue
Block a user