diff --git a/source/code/core/core/public/ice/concept/pimpl_type.hxx b/source/code/core/core/public/ice/concept/pimpl_type.hxx index 8eff740f..0d357aaa 100644 --- a/source/code/core/core/public/ice/concept/pimpl_type.hxx +++ b/source/code/core/core/public/ice/concept/pimpl_type.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include diff --git a/source/code/core/memsys/public/ice/mem_allocator_utils.hxx b/source/code/core/memsys/public/ice/mem_allocator_utils.hxx new file mode 100644 index 00000000..4c0f74ff --- /dev/null +++ b/source/code/core/memsys/public/ice/mem_allocator_utils.hxx @@ -0,0 +1,20 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + +#pragma once +#include + +namespace ice +{ + + inline auto data_copy(ice::Allocator& alloc, ice::Data data) noexcept -> ice::Memory + { + ice::Memory const result = alloc.allocate({ data.size, data.alignment }); + if (result.location != nullptr) + { + ice::memcpy(result, data); + } + return result; + } + +} // namespace ice diff --git a/source/code/core/utils/private/detail/refcounted.cxx b/source/code/core/utils/private/detail/refcounted.cxx index 80db2560..ea922799 100644 --- a/source/code/core/utils/private/detail/refcounted.cxx +++ b/source/code/core/utils/private/detail/refcounted.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include #include diff --git a/source/code/core/utils/public/ice/detail/refcounted.hxx b/source/code/core/utils/public/ice/detail/refcounted.hxx index 00100fa9..28654613 100644 --- a/source/code/core/utils/public/ice/detail/refcounted.hxx +++ b/source/code/core/utils/public/ice/detail/refcounted.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/core/utils/public/ice/ptr.hxx b/source/code/core/utils/public/ice/ptr.hxx index c61354e3..359cecf1 100644 --- a/source/code/core/utils/public/ice/ptr.hxx +++ b/source/code/core/utils/public/ice/ptr.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include diff --git a/source/code/example/android/simple/private/example_android.cxx b/source/code/example/android/simple/private/example_android.cxx index 16d30a47..cd2f6fc4 100644 --- a/source/code/example/android/simple/private/example_android.cxx +++ b/source/code/example/android/simple/private/example_android.cxx @@ -166,8 +166,9 @@ void TestGame::on_resume(ice::Engine& engine) noexcept ice::StringID traits[]{ "test"_sid, "test2"_sid, + ice::devui_trait_name(), ice::TraitID_GfxShaderStorage, - ice::devui_trait_name() + ice::TraitID_GfxImageStorage, }; engine.worlds().create_world({ .name = "world"_sid, .traits = traits }); diff --git a/source/code/example/webasm/private/example_webasm.cxx b/source/code/example/webasm/private/example_webasm.cxx index 71361ef0..e054322a 100644 --- a/source/code/example/webasm/private/example_webasm.cxx +++ b/source/code/example/webasm/private/example_webasm.cxx @@ -301,8 +301,9 @@ void TestGame::on_resume(ice::Engine& engine) noexcept ice::StringID traits[]{ "act"_sid, "test2"_sid, - ice::TraitID_GfxShaderStorage, ice::devui_trait_name(), + ice::TraitID_GfxShaderStorage, + ice::TraitID_GfxImageStorage, }; ice::StringID traits2[]{ "test"_sid, diff --git a/source/code/example/webasm/webasm.bff b/source/code/example/webasm/webasm.bff index 854180c9..ec0348f0 100644 --- a/source/code/example/webasm/webasm.bff +++ b/source/code/example/webasm/webasm.bff @@ -42,6 +42,7 @@ 'imgui_module' 'shader_tools' 'webgpu_renderer' + 'iceshard_pipelines' } ] ] diff --git a/source/code/iceshard/engine/public/ice/ecs/ecs_entity_storage_details.hxx b/source/code/iceshard/engine/public/ice/ecs/ecs_entity_storage_details.hxx index 632dfe22..aa6c2cd5 100644 --- a/source/code/iceshard/engine/public/ice/ecs/ecs_entity_storage_details.hxx +++ b/source/code/iceshard/engine/public/ice/ecs/ecs_entity_storage_details.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include diff --git a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.cxx b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.cxx index f0006d48..21553968 100644 --- a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.cxx +++ b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.cxx @@ -11,7 +11,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -36,10 +38,11 @@ namespace ice::gfx : ice::Trait{ ctx } , _loaded_images{ alloc } { - _context.bind<&Trait_GfxImageStorage::gfx_update>(ice::gfx::ShardID_RenderFrameUpdate); + _context.bind<&Trait_GfxImageStorage::gfx_update, Render>(ice::gfx::ShardID_RenderFrameUpdate); + _context.bind<&Trait_GfxImageStorage::gfx_shutdown, Render>(ice::gfx::ShardID_GfxShutdown); } - auto Trait_GfxImageStorage::on_asset_released(ice::Asset const &asset) noexcept -> ice::Task<> + auto Trait_GfxImageStorage::on_asset_released(ice::Asset const& asset) noexcept -> ice::Task<> { GfxImageEntry* entry = ice::hashmap::try_get(_loaded_images, ice::hash(asset.name())); ICE_ASSERT_CORE(entry != nullptr); @@ -59,8 +62,8 @@ namespace ice::gfx ice::AssetState const state = request->state(); ICE_ASSERT_CORE(state == AssetState::Loaded); // The image needs to be loaded. - ice::u64 const image_hash = ice::hash(request->asset_name()); - GfxImageEntry* entry = ice::hashmap::try_get(_loaded_images, image_hash); + ice::StringID const image_hash = request->asset_name(); + GfxImageEntry* entry = ice::hashmap::try_get(_loaded_images, ice::hash(image_hash)); ICE_ASSERT_CORE(entry == nullptr || entry->released); using namespace ice::render; @@ -76,6 +79,7 @@ namespace ice::gfx if (metadata_data.location == nullptr) { request->resolve({ .result = ice::AssetRequestResult::Error }); + request = assets.aquire_request(ice::render::AssetCategory_Texture2D, AssetState::Runtime); continue; } @@ -90,7 +94,7 @@ namespace ice::gfx valid_data &= ice::config::get(meta, "texture.size.y", size.y); [[maybe_unused]] - ice::Data const* d = reinterpret_cast(request->data().location); + ice::Data const texture_data = request->data(); // Creates the image object ImageInfo image_info{ @@ -100,54 +104,106 @@ namespace ice::gfx .width = (ice::u32) size.x, .height = (ice::u32) size.y, }; - Image image = device.create_image(image_info, {}); + Image image = device.create_image(image_info, texture_data); if (image == Image::Invalid) { request->resolve({ .result = AssetRequestResult::Error }); co_return; } - ice::render::Buffer buffer = device.create_buffer(BufferType::Transfer, size.x * size.y); + ice::render::Buffer transfer_buffer = device.create_buffer(BufferType::Transfer, ice::u32(texture_data.size.value)); BufferUpdateInfo const buffer_updates[]{ BufferUpdateInfo{ - .buffer = buffer, - .data = *d, + .buffer = transfer_buffer, + .data = texture_data, .offset = 0 } }; device.update_buffers(buffer_updates); - // RenderCommands& api = device.get_commands(); - // CommandBuffer const cmds = co_await params.frame_transfer; + RenderCommands& api = device.get_commands(); + CommandBuffer const cmds = co_await params.stages.frame_transfer; - // api.update_texture_v2( - // cmds, - // image, - // buffer, - // ice::vec2u{ size } - // ); + ImageBarrier barriers[4]{ }; - // co_await params.frame_end; + for (ice::u32 idx = 0; idx < 1; ++idx) + { + barriers[idx].image = image; + barriers[idx].source_layout = ImageLayout::Undefined; + barriers[idx].destination_layout = ImageLayout::TransferDstOptimal; + barriers[idx].source_access = AccessFlags::None; + barriers[idx].destination_access = AccessFlags::TransferWrite; + } + + api.pipeline_image_barrier( + cmds, + PipelineStage::TopOfPipe, + PipelineStage::Transfer, + { barriers, 1 } + ); + + api.update_texture_v2( + cmds, + image, + transfer_buffer, + ice::vec2u{ size } + ); + + for (ice::u32 idx = 0; idx < 1; ++idx) + { + barriers[idx].image = image; + barriers[idx].source_layout = ImageLayout::TransferDstOptimal; + barriers[idx].destination_layout = ImageLayout::ShaderReadOnly; + barriers[idx].source_access = AccessFlags::TransferWrite; + barriers[idx].destination_access = AccessFlags::ShaderRead; + } + + api.pipeline_image_barrier( + cmds, + PipelineStage::Transfer, + PipelineStage::FramentShader, + { barriers, 1 } + ); + + co_await params.stages.frame_end; + + device.destroy_buffer(transfer_buffer); - // device.destroy_buffer(data_buffer); + ICE_LOG(LogSeverity::Info, LogTag::Game, "TextureStorage - Loaded image: {}", request->asset_name()); - // ICE_LOG(LogSeverity::Info, LogTag::Game, "ShaderStorage - Loaded image: {}", request->asset_name()); + // Allocates a handle for it... (TODO: Rework?) + ice::Memory const result = request->allocate(ice::size_of); + *reinterpret_cast(result.location) = image; - // // Allocates a handle for it... (TODO: Rework?) - // ice::Memory const result = request->allocate(ice::size_of); - // *reinterpret_cast(result.location) = image; + // Reslove the request (will resume all awaiting tasks) + ice::Asset asset = request->resolve({ .resolver = this, .result = AssetRequestResult::Success, .memory = result }); + // send("iceshard:images-internal:loaded"_shardid, asset); - // // Save the image handle - // ice::hashmap::set(_loaded_images, image_hash, { .image = image }); + // Save the image handle + ice::hashmap::set(_loaded_images, ice::hash(image_hash), { .asset = ice::move(asset), .image = image}); // // Reslove the request (will resume all awaiting tasks) // request->resolve({ .resolver = this, .result = AssetRequestResult::Success, .memory = result }); - // // Get the next queued request - // request = update.assets.aquire_request(ice::render::AssetCategory_Texture2D, AssetState::Runtime); + // Get the next queued request + request = assets.aquire_request(ice::render::AssetCategory_Texture2D, AssetState::Runtime); + } + + co_return; + } + + auto Trait_GfxImageStorage::gfx_shutdown( + ice::render::RenderDevice& device + ) noexcept -> ice::Task<> + { + for (ice::gfx::GfxImageEntry& entry : ice::hashmap::values(_loaded_images)) + { + device.destroy_image(entry.image); + entry.asset.release(); } + ice::hashmap::clear(_loaded_images); co_return; } diff --git a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.hxx b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.hxx index 35ecac2d..294012d6 100644 --- a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.hxx +++ b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_image_storage_trait.hxx @@ -14,6 +14,7 @@ namespace ice::gfx struct GfxImageEntry { + ice::Asset asset; ice::render::Image image; bool released = false; }; @@ -35,6 +36,10 @@ namespace ice::gfx ice::AssetStorage& assets ) noexcept -> ice::Task<>; + auto gfx_shutdown( + ice::render::RenderDevice& device + ) noexcept -> ice::Task<>; + private: ice::HashMap _loaded_images; }; diff --git a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.cxx b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.cxx index d75b2d16..8f759b46 100644 --- a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.cxx +++ b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.cxx @@ -65,7 +65,7 @@ namespace ice::gfx } } - auto Trait_GfxShaderStorage::on_asset_released(ice::Asset const &asset) noexcept -> ice::Task<> + auto Trait_GfxShaderStorage::on_asset_released(ice::Asset const& asset) noexcept -> ice::Task<> { GfxShaderEntry* entry = ice::hashmap::try_get(_loaded_shaders, ice::hash(asset.name())); ICE_ASSERT_CORE(entry != nullptr); diff --git a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.hxx b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.hxx index d8582fa9..b4fe8979 100644 --- a/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.hxx +++ b/source/code/iceshard/iceshard/private/gfx/traits/iceshard_gfx_shader_storage_trait.hxx @@ -44,7 +44,10 @@ namespace ice::gfx ice::gfx::RenderFrameUpdate const& update, ice::AssetStorage& assets ) noexcept -> ice::Task<>; - auto gfx_shutdown(ice::render::RenderDevice& device) noexcept -> ice::Task<>; + + auto gfx_shutdown( + ice::render::RenderDevice& device + ) noexcept -> ice::Task<>; private: ice::HashMap _loaded_shaders; diff --git a/source/code/iceshard/iceshard/private/iceshard_world_devui.cxx b/source/code/iceshard/iceshard/private/iceshard_world_devui.cxx index aacbc56d..742aeef8 100644 --- a/source/code/iceshard/iceshard/private/iceshard_world_devui.cxx +++ b/source/code/iceshard/iceshard/private/iceshard_world_devui.cxx @@ -81,7 +81,7 @@ namespace ice { IceshardWorldContext const& ctx = _context; - static auto make_handler_list = [this](ice::String handler_type, auto const& hashmap) noexcept + auto make_handler_list = [this](ice::String handler_type, auto const& hashmap) noexcept { ImGui::TextT("{} handlers (count: {})", handler_type, ice::hashmap::count(hashmap)); if (ice::hashmap::any(hashmap)) diff --git a/source/code/modules/iceshard_pipelines/iceshard_pipelines.bff b/source/code/modules/iceshard_pipelines/iceshard_pipelines.bff index 95fedd52..88a63cb8 100644 --- a/source/code/modules/iceshard_pipelines/iceshard_pipelines.bff +++ b/source/code/modules/iceshard_pipelines/iceshard_pipelines.bff @@ -9,18 +9,10 @@ .BaseDir = '$WorkspaceCodeDir$/modules/iceshard_pipelines' - .Requires = { - 'Windows' - } - .Private = [ .Modules = { 'arctic' - 'assimp' - 'freetype' - 'msdfgen' - 'msdf_atlas_gen' 'rapidxml_ns' } .Uses = { @@ -32,5 +24,30 @@ 'engine' } ] + + .Rule_Monolythic = + [ + .Name = 'Monolythic' + .Requires = { 'Monolythic' } + .Kind = .Kind_ObjectList + ] + .Rule_Win32Plugins = + [ + .Name = 'EditorPlugins' + .Requires = { 'Windows' } + .Private = + [ + .Modules = { + 'assimp' + 'freetype' + 'msdfgen' + 'msdf_atlas_gen' + } + ] + ] + .Rules = { + .Rule_Monolythic + .Rule_Win32Plugins + } ] .Projects + .Project diff --git a/source/code/modules/iceshard_pipelines/private/asset_font.cxx b/source/code/modules/iceshard_pipelines/private/asset_font.cxx index a2cefeb2..ab7f3d05 100644 --- a/source/code/modules/iceshard_pipelines/private/asset_font.cxx +++ b/source/code/modules/iceshard_pipelines/private/asset_font.cxx @@ -10,6 +10,8 @@ #include #include +#if ISP_WINDOWS + ISC_WARNING_PUSH ISCW_DECLARATION_HIDES_CLASS_MEMBER(ISCW_OP_DISABLE) ISCW_UNREFERENCED_INTERNAL_FUNCTION_REMOVED(ISCW_OP_DISABLE) @@ -246,3 +248,5 @@ namespace ice } } // namespace ice + +#endif diff --git a/source/code/modules/iceshard_pipelines/private/asset_image.cxx b/source/code/modules/iceshard_pipelines/private/asset_image.cxx index fc7f35cf..cc1b4171 100644 --- a/source/code/modules/iceshard_pipelines/private/asset_image.cxx +++ b/source/code/modules/iceshard_pipelines/private/asset_image.cxx @@ -2,6 +2,9 @@ /// SPDX-License-Identifier: MIT #include "asset_image.hxx" +#include +#include +#include #include #define STB_IMAGE_IMPLEMENTATION @@ -25,17 +28,37 @@ namespace ice { - auto asset_image_oven( + + auto asset_image_state( void*, - ice::Allocator& alloc, - ice::ResourceTracker const&, - ice::LooseResource const& resource, - ice::Data data, - ice::Memory& memory - ) noexcept -> ice::Task + ice::AssetCategoryDefinition const&, + ice::Config const& metadata, + ice::URI const& uri + ) noexcept -> ice::AssetState + { + bool baked = false; + if (ice::config::get(metadata, "ice.shader.baked", baked) && baked) + { + return AssetState::Baked; + } + return AssetState::Raw; + } + + auto asset_image_oven( + ice::ResourceCompilerCtx& ctx, + ice::ResourceHandle const& resource_handle, + ice::ResourceTracker& resource_tracker, + ice::Span sources, + ice::Span dependencies, + ice::Allocator& result_alloc + ) noexcept -> ice::Task { using ice::render::ImageInfo; + ice::ResourceResult const res = co_await resource_tracker.load_resource(resource_handle); + ice::Data const data = res.data; + ICE_ASSERT_CORE(res.resource_status == ResourceStatus::Loaded); + stbi_uc const* image_buffer_raw = reinterpret_cast(data.location); ice::i32 width = 0; @@ -49,11 +72,12 @@ namespace ice STBI_rgb_alpha ); + ice::Memory image_mem{}; if (image_buffer != nullptr) { ice::meminfo image_meminfo = ice::meminfo_of; ice::usize const offset_data = image_meminfo += ice::meminfo_of * width * height * 4; - ice::Memory image_mem = alloc.allocate(image_meminfo); + image_mem = result_alloc.allocate(image_meminfo); ice::render::ImageInfo* texture = reinterpret_cast(image_mem.location); texture->type = ice::render::ImageType::Image2D; @@ -74,10 +98,9 @@ namespace ice ); stbi_image_free(image_buffer); - memory = image_mem; } - co_return width != 0 && height != 0; + co_return ResourceCompilerResult{ image_mem }; } auto asset_image_loader( @@ -107,17 +130,23 @@ namespace ice co_return true; } - void asset_category_image_definition(ice::AssetCategoryArchive& asset_category_archive) noexcept + void asset_category_image_definition( + ice::AssetCategoryArchive& asset_category_archive, + ice::ModuleQuery const& module_query + ) noexcept { static ice::String extensions[]{ ".jpg", ".png", ".jpeg", ".bmp" }; - static ice::AssetCategoryDefinition definition{ + static ice::ResourceCompiler const compiler{ + .fn_compile_source = asset_image_oven, + }; + + static ice::AssetCategoryDefinition const definition{ .resource_extensions = extensions, - // .fn_asset_oven = asset_image_oven, - .fn_asset_loader = asset_image_loader + .fn_asset_loader = asset_image_loader, }; - asset_category_archive.register_category(ice::render::AssetCategory_Texture2D, definition); + asset_category_archive.register_category(ice::render::AssetCategory_Texture2D, definition, &compiler); } } // namespace ice diff --git a/source/code/modules/iceshard_pipelines/private/asset_image.hxx b/source/code/modules/iceshard_pipelines/private/asset_image.hxx index bddb5b1b..caceee67 100644 --- a/source/code/modules/iceshard_pipelines/private/asset_image.hxx +++ b/source/code/modules/iceshard_pipelines/private/asset_image.hxx @@ -7,6 +7,9 @@ namespace ice { - void asset_category_image_definition(ice::AssetCategoryArchive& asset_category_archive) noexcept; + void asset_category_image_definition( + ice::AssetCategoryArchive& asset_category_archive, + ice::ModuleQuery const& module_query + ) noexcept; } // namespace iceshard diff --git a/source/code/modules/iceshard_pipelines/private/pipelines_module.cxx b/source/code/modules/iceshard_pipelines/private/pipelines_module.cxx index 6040f374..a2d89d18 100644 --- a/source/code/modules/iceshard_pipelines/private/pipelines_module.cxx +++ b/source/code/modules/iceshard_pipelines/private/pipelines_module.cxx @@ -15,13 +15,20 @@ namespace ice struct IceShardPipelinesModule : ice::Module { + static void v1_archive_api(ice::detail::asset_system::v1::AssetArchiveAPI& api) noexcept; + static bool on_load(ice::Allocator& alloc, ice::ModuleNegotiator auto const& negotiator) noexcept { ice::LogModule::init(alloc, negotiator); - return true; + return negotiator.register_api(v1_archive_api); } IS_WORKAROUND_MODULE_INITIALIZATION(IceShardPipelinesModule); }; + void IceShardPipelinesModule::v1_archive_api(ice::detail::asset_system::v1::AssetArchiveAPI& api) noexcept + { + api.fn_register_categories = ice::asset_category_image_definition; + } + } // namespace ice diff --git a/source/code/modules/imgui_module/private/imgui_gfx_stage.cxx b/source/code/modules/imgui_module/private/imgui_gfx_stage.cxx index e34faacc..acc017dd 100644 --- a/source/code/modules/imgui_module/private/imgui_gfx_stage.cxx +++ b/source/code/modules/imgui_module/private/imgui_gfx_stage.cxx @@ -38,29 +38,10 @@ namespace ice::devui using namespace ice::gfx; using namespace ice::render; - auto scheduler = stages.scheduler; - auto stage_transfer = stages.frame_transfer; - auto stage_end = stages.frame_end; + ice::TaskScheduler scheduler = stages.scheduler; RenderDevice& device = gfx.device(); - ImGuiIO& io = ImGui::GetIO(); - - ice::u8* pixels; - ice::i32 font_texture_width, font_texture_height; - io.Fonts->GetTexDataAsRGBA32(&pixels, &font_texture_width, &font_texture_height); - - // ice::u32 upload_size = font_texture_width * font_texture_height * 4 * sizeof(char); - ice::render::ImageInfo font_info; - font_info.type = ImageType::Image2D; - font_info.usage = ImageUsageFlags::Sampled | ImageUsageFlags::TransferDst; - font_info.format = ImageFormat::UNORM_RGBA; - font_info.width = font_texture_width; - font_info.height = font_texture_height; - font_info.data = pixels; - - _font_texture = device.create_image(font_info, { }); - ice::Expected r_vert = co_await ice::gfx::load_shader_program("shaders/debug/imgui-vert", _assets); ice::Expected r_frag = co_await ice::gfx::load_shader_program("shaders/debug/imgui-frag", _assets); ICE_ASSERT_CORE(r_vert && r_frag); @@ -132,14 +113,6 @@ namespace ice::devui ResourceUpdateInfo resource_update[] { - ResourceUpdateInfo - { - .sampler = _sampler - }, - ResourceUpdateInfo - { - .image = _font_texture, - }, ResourceUpdateInfo { .uniform_buffer = {.buffer = _uniform_buffer, .offset = 0, .size = 64}, @@ -148,29 +121,13 @@ namespace ice::devui ResourceSetUpdateInfo update_infos[] { - ResourceSetUpdateInfo - { - .resource_set = _resources[1], - .resource_type = ResourceType::Sampler, - .binding_index = 1, - .array_element = 0, - .resources = { resource_update + 0, 1 } - }, - ResourceSetUpdateInfo - { - .resource_set = _resources[1], - .resource_type = ResourceType::SampledImage, - .binding_index = 2, - .array_element = 0, - .resources = { resource_update + 1, 1 } - }, ResourceSetUpdateInfo { .resource_set = _resources[0], .resource_type = ResourceType::UniformBuffer, .binding_index = 3, .array_element = 0, - .resources = { resource_update + 2, 1 } + .resources = { resource_update, 1 } }, }; @@ -240,50 +197,6 @@ namespace ice::devui device.create_buffer(BufferType::Vertex, 1024 * 1024 * 64) ); -#if 1 - //auto update_texture_task = [](GfxContext& gfx_ctx, GfxFrame& gfx_frame, Image image, ImageInfo image_info) noexcept -> ice::Task<> - { - ice::u32 const image_data_size = font_info.width * font_info.height * 4; - - // Currently we start the task on the graphics thread, so we can dont race for access to the render device. - // It is planned to create an awaiter for graphics thread access so we can schedule this at any point from any thread. - ice::render::Buffer const data_buffer = device.create_buffer( - ice::render::BufferType::Transfer, - image_data_size - ); - - ice::render::BufferUpdateInfo updates[] - { - ice::render::BufferUpdateInfo - { - .buffer = data_buffer, - .data = - { - .location = font_info.data, - .size = { image_data_size }, - .alignment = ice::ualign::b_4 - } - } - }; - - device.update_buffers(updates); - - ice::render::RenderCommands& api = device.get_commands(); - ice::render::CommandBuffer const cmds = co_await stage_transfer; - - api.update_texture( - cmds, - _font_texture, - data_buffer, - { font_info.width, font_info.height } - ); - - co_await stage_end; - - device.destroy_buffer(data_buffer); - } -#endif - co_return; } @@ -306,7 +219,6 @@ namespace ice::devui ice::array::clear(_vertex_buffers); device.destroy_buffer(_uniform_buffer); - device.destroy_image(_font_texture); device.destroy_pipeline(_pipeline); device.destroy_pipeline_layout(_pipeline_layout); device.destroy_sampler(_sampler); @@ -324,7 +236,7 @@ namespace ice::devui using namespace ice::render; ImDrawData* draw_data = ImGui::GetDrawData(); - if (draw_data == nullptr) + if (draw_data == nullptr || ice::array::empty(draw_commands)) { return; } @@ -360,7 +272,7 @@ namespace ice::devui ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports ImVec2 clip_scale = draw_data->FramebufferScale; // (1,1) unless using retina display which are often (2,2) - ImTextureID last_texid = nullptr; // ImGui::GetIO().tex + ImTextureID last_texid = ImTextureID_Invalid; // ImGui::GetIO().tex ice::u32 next_resource_idx = 2; ResourceUpdateInfo resource_update[] { @@ -403,11 +315,10 @@ namespace ice::devui for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) { ImDrawCmd const* pcmd = &cmd_list->CmdBuffer[cmd_i]; - - if (pcmd->TextureId != nullptr && pcmd->TextureId != last_texid) + if (pcmd->GetTexID() != ImTextureID_Invalid && pcmd->GetTexID() != last_texid) { - last_texid = pcmd->TextureId; - resource_update[1].image = static_cast(reinterpret_cast(last_texid)); + last_texid = pcmd->GetTexID(); + resource_update[1].image = static_cast(last_texid); resource_set_update[0].resource_set = _resources[next_resource_idx]; resource_set_update[1].resource_set = _resources[next_resource_idx]; diff --git a/source/code/modules/imgui_module/private/imgui_gfx_stage.hxx b/source/code/modules/imgui_module/private/imgui_gfx_stage.hxx index 75d70e96..a7cebb71 100644 --- a/source/code/modules/imgui_module/private/imgui_gfx_stage.hxx +++ b/source/code/modules/imgui_module/private/imgui_gfx_stage.hxx @@ -62,7 +62,6 @@ namespace ice::devui ice::render::Pipeline _pipeline; ice::render::Sampler _sampler; - ice::render::Image _font_texture; ice::u16* _index_buffer_host; ice::Array _index_buffers; diff --git a/source/code/modules/imgui_module/private/imgui_system.cxx b/source/code/modules/imgui_module/private/imgui_system.cxx index d159bf78..d402b98d 100644 --- a/source/code/modules/imgui_module/private/imgui_system.cxx +++ b/source/code/modules/imgui_module/private/imgui_system.cxx @@ -171,7 +171,7 @@ namespace ice::devui ImGui::ShowDemoWindow(&show_demo); } - ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(), ImGuiDockNodeFlags_PassthruCentralNode); + ImGui::DockSpaceOverViewport(0, ImGui::GetMainViewport(), ImGuiDockNodeFlags_PassthruCentralNode); for (auto const& runtime : _widget_manager.widgets()) { diff --git a/source/code/modules/imgui_module/private/imgui_trait.cxx b/source/code/modules/imgui_module/private/imgui_trait.cxx index 7302e177..c72a96b8 100644 --- a/source/code/modules/imgui_module/private/imgui_trait.cxx +++ b/source/code/modules/imgui_module/private/imgui_trait.cxx @@ -16,24 +16,227 @@ #include #include #include +#include +#include #include #include #include #include +#include #include #include +#include #include namespace ice::devui { + namespace detail + { + + constexpr auto ice_to_imgui_key(ice::input::KeyboardKey key) noexcept -> ImGuiKey + { + switch (key) + { + using enum ice::input::KeyboardKey; + case Tab: return ImGuiKey_Tab; + case Left: return ImGuiKey_LeftArrow; + case Right: return ImGuiKey_RightArrow; + case Up: return ImGuiKey_UpArrow; + case Down: return ImGuiKey_DownArrow; + case PageUp: return ImGuiKey_PageUp; + case PageDown: return ImGuiKey_PageDown; + case Home: return ImGuiKey_Home; + case End: return ImGuiKey_End; + case Insert: return ImGuiKey_Insert; + case Delete: return ImGuiKey_Delete; + case Backspace: return ImGuiKey_Backspace; + case Space: return ImGuiKey_Space; + case Return: return ImGuiKey_Enter; + case Escape: return ImGuiKey_Escape; + case Quote: return ImGuiKey_Apostrophe; + case Comma: return ImGuiKey_Comma; + case Minus: return ImGuiKey_Minus; + case Period: return ImGuiKey_Period; + case Slash: return ImGuiKey_Slash; + case SemiColon: return ImGuiKey_Semicolon; + case Equals: return ImGuiKey_Equal; + case LeftBracket: return ImGuiKey_LeftBracket; + case BackSlash: return ImGuiKey_Backslash; + case RightBracket: return ImGuiKey_RightBracket; + case BackQuote: return ImGuiKey_GraveAccent; + case KeyCapsLock: return ImGuiKey_CapsLock; + case ScrollLock: return ImGuiKey_ScrollLock; + case NumPadNumlockClear: return ImGuiKey_NumLock; + case PrintScreen: return ImGuiKey_PrintScreen; + case Pause: return ImGuiKey_Pause; + case NumPad0: return ImGuiKey_Keypad0; + case NumPad1: return ImGuiKey_Keypad1; + case NumPad2: return ImGuiKey_Keypad2; + case NumPad3: return ImGuiKey_Keypad3; + case NumPad4: return ImGuiKey_Keypad4; + case NumPad5: return ImGuiKey_Keypad5; + case NumPad6: return ImGuiKey_Keypad6; + case NumPad7: return ImGuiKey_Keypad7; + case NumPad8: return ImGuiKey_Keypad8; + case NumPad9: return ImGuiKey_Keypad9; + //case DLK_KP_PERIOD: return ImGuiKey_KeypadDecimal; // todo? + case NumPadDivide: return ImGuiKey_KeypadDivide; + case NumPadMultiply: return ImGuiKey_KeypadMultiply; + case NumPadMinus: return ImGuiKey_KeypadSubtract; + case NumPadPlus: return ImGuiKey_KeypadAdd; + case NumPadEnter: return ImGuiKey_KeypadEnter; + //case SDLK_KP_EQUALS: return ImGuiKey_KeypadEqual; // todo? + case KeyLeftCtrl: return ImGuiKey_LeftCtrl; + case KeyLeftShift: return ImGuiKey_LeftShift; + case KeyLeftAlt: return ImGuiKey_LeftAlt; + case KeyLeftGui: return ImGuiKey_LeftSuper; + case KeyRightCtrl: return ImGuiKey_RightCtrl; + case KeyRightShift: return ImGuiKey_RightShift; + case KeyRightAlt: return ImGuiKey_RightAlt; + case KeyRightGui: return ImGuiKey_RightSuper; + //case SDLK_APPLICATION: return ImGuiKey_Menu; // todo? + case Key0: return ImGuiKey_0; + case Key1: return ImGuiKey_1; + case Key2: return ImGuiKey_2; + case Key3: return ImGuiKey_3; + case Key4: return ImGuiKey_4; + case Key5: return ImGuiKey_5; + case Key6: return ImGuiKey_6; + case Key7: return ImGuiKey_7; + case Key8: return ImGuiKey_8; + case Key9: return ImGuiKey_9; + case KeyA: return ImGuiKey_A; + case KeyB: return ImGuiKey_B; + case KeyC: return ImGuiKey_C; + case KeyD: return ImGuiKey_D; + case KeyE: return ImGuiKey_E; + case KeyF: return ImGuiKey_F; + case KeyG: return ImGuiKey_G; + case KeyH: return ImGuiKey_H; + case KeyI: return ImGuiKey_I; + case KeyJ: return ImGuiKey_J; + case KeyK: return ImGuiKey_K; + case KeyL: return ImGuiKey_L; + case KeyM: return ImGuiKey_M; + case KeyN: return ImGuiKey_N; + case KeyO: return ImGuiKey_O; + case KeyP: return ImGuiKey_P; + case KeyQ: return ImGuiKey_Q; + case KeyR: return ImGuiKey_R; + case KeyS: return ImGuiKey_S; + case KeyT: return ImGuiKey_T; + case KeyU: return ImGuiKey_U; + case KeyV: return ImGuiKey_V; + case KeyW: return ImGuiKey_W; + case KeyX: return ImGuiKey_X; + case KeyY: return ImGuiKey_Y; + case KeyZ: return ImGuiKey_Z; + case KeyF1: return ImGuiKey_F1; + case KeyF2: return ImGuiKey_F2; + case KeyF3: return ImGuiKey_F3; + case KeyF4: return ImGuiKey_F4; + case KeyF5: return ImGuiKey_F5; + case KeyF6: return ImGuiKey_F6; + case KeyF7: return ImGuiKey_F7; + case KeyF8: return ImGuiKey_F8; + case KeyF9: return ImGuiKey_F9; + case KeyF10: return ImGuiKey_F10; + case KeyF11: return ImGuiKey_F11; + case KeyF12: return ImGuiKey_F12; + //case SDLK_F13: return ImGuiKey_F13; // todo? + //case SDLK_F14: return ImGuiKey_F14; + //case SDLK_F15: return ImGuiKey_F15; + //case SDLK_F16: return ImGuiKey_F16; + //case SDLK_F17: return ImGuiKey_F17; + //case SDLK_F18: return ImGuiKey_F18; + //case SDLK_F19: return ImGuiKey_F19; + //case SDLK_F20: return ImGuiKey_F20; + //case SDLK_F21: return ImGuiKey_F21; + //case SDLK_F22: return ImGuiKey_F22; + //case SDLK_F23: return ImGuiKey_F23; + //case SDLK_F24: return ImGuiKey_F24; + //case SDLK_AC_BACK: return ImGuiKey_AppBack; // todo? + //case SDLK_AC_FORWARD: return ImGuiKey_AppForward; // todo? + default: break; + } + return ImGuiKey_None; + } + + struct ImTextureAssetDataBinding : ice::AssetDataBinding + { + ImTextureAssetDataBinding( + ice::Allocator& alloc, + ImTextureData const& texture + ) noexcept + : AssetDataBinding{ .state = AssetState::Loaded } + , _allocator{ alloc } + { + ice::Data const texture_data{ + texture.Pixels, + ice::usize(texture.GetSizeInBytes()), + ice::ualign::b_default + }; + + ice::ConfigBuilder config{ _allocator }; + ice::ConfigBuilderValue mtex = config["texture"]; + mtex["format"] = ice::i32(ice::render::ImageFormat::UNORM_RGBA); + mtex["size"]["x"] = ice::i32(texture.Width); + mtex["size"]["y"] = ice::i32(texture.Height); + _metadata = config.finalize(_allocator); + + this->content = texture_data; + this->metadata = ice::data_view(_metadata); + } + + ~ImTextureAssetDataBinding() + { + _allocator.deallocate(_metadata); + } + + ice::Allocator& _allocator; + ice::Memory _metadata; + }; + + inline auto total_command_count(ImDrawData const& draw_data) noexcept -> ice::u32 + { + ice::u32 cmd_count = 0; + for (ice::i32 i = 0; i < draw_data.CmdListsCount; i++) + { + ImDrawList const* cmd_list = draw_data.CmdLists[i]; + cmd_count += cmd_list->CmdBuffer.Size; + } + return cmd_count; + } + + inline bool is_invalid_texture(ImTextureRef const& ref) noexcept + { + return ref.GetTexID() == ImTextureID_Invalid; + } + + inline bool is_invalid_texture(ImDrawCmd const& cmd) noexcept + { + return is_invalid_texture(cmd.TexRef); + } + + inline bool is_different_texture(ImDrawCmd const& cmd, ImTextureID last_id) noexcept + { + ImTextureID const texid = cmd.TexRef.GetTexID(); + return texid != ImTextureID_Invalid && texid != last_id; + } + + static constexpr fmt::string_view TextureNameFormat = "imgui-backend-texture-{}"; + + } // namespace detail + ImGuiTrait::ImGuiTrait(ice::TraitContext& ctx, ice::Allocator& alloc, ImGuiSystem& system) noexcept : ice::Trait{ ctx } , ice::TraitDevUI{ {.category="Traits/Debug",.name="ImGUI-DevUI"} } , _allocator{ alloc, "trait:devui-imgui" } , _system{ system } + , _stats{ } , _imgui_gfx_stage{ } , _resized{ false } { @@ -55,29 +258,6 @@ namespace ice::devui io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; - io.KeyMap[ImGuiKey_Tab] = (uint32_t)ice::input::KeyboardKey::Tab; - io.KeyMap[ImGuiKey_LeftArrow] = (uint32_t)ice::input::KeyboardKey::Left; - io.KeyMap[ImGuiKey_RightArrow] = (uint32_t)ice::input::KeyboardKey::Right; - io.KeyMap[ImGuiKey_UpArrow] = (uint32_t)ice::input::KeyboardKey::Up; - io.KeyMap[ImGuiKey_DownArrow] = (uint32_t)ice::input::KeyboardKey::Down; - io.KeyMap[ImGuiKey_PageUp] = (uint32_t)ice::input::KeyboardKey::PageUp; - io.KeyMap[ImGuiKey_PageDown] = (uint32_t)ice::input::KeyboardKey::PageDown; - io.KeyMap[ImGuiKey_Home] = (uint32_t)ice::input::KeyboardKey::Home; - io.KeyMap[ImGuiKey_End] = (uint32_t)ice::input::KeyboardKey::End; - io.KeyMap[ImGuiKey_Insert] = (uint32_t)ice::input::KeyboardKey::Insert; - io.KeyMap[ImGuiKey_Delete] = (uint32_t)ice::input::KeyboardKey::Delete; - io.KeyMap[ImGuiKey_Backspace] = (uint32_t)ice::input::KeyboardKey::Backspace; - io.KeyMap[ImGuiKey_Space] = (uint32_t)ice::input::KeyboardKey::Space; - io.KeyMap[ImGuiKey_Enter] = (uint32_t)ice::input::KeyboardKey::Return; - io.KeyMap[ImGuiKey_Escape] = (uint32_t)ice::input::KeyboardKey::Escape; - io.KeyMap[ImGuiKey_KeypadEnter] = 0; - io.KeyMap[ImGuiKey_A] = (uint32_t)ice::input::KeyboardKey::KeyA; - io.KeyMap[ImGuiKey_C] = (uint32_t)ice::input::KeyboardKey::KeyC; - io.KeyMap[ImGuiKey_V] = (uint32_t)ice::input::KeyboardKey::KeyV; - io.KeyMap[ImGuiKey_X] = (uint32_t)ice::input::KeyboardKey::KeyX; - io.KeyMap[ImGuiKey_Y] = (uint32_t)ice::input::KeyboardKey::KeyY; - io.KeyMap[ImGuiKey_Z] = (uint32_t)ice::input::KeyboardKey::KeyZ; - ice::u8* pixels; ice::i32 font_texture_width, font_texture_height; io.Fonts->GetTexDataAsRGBA32(&pixels, &font_texture_width, &font_texture_height); @@ -104,6 +284,9 @@ namespace ice::devui io.AddInputCharactersUTF8(input_text); } + ice::vec2f temp_pos{}; + io.AddMouseSourceEvent(ImGuiMouseSource_Mouse); + ice::shards::inspect_each( update.frame.shards(), ice::ShardID_InputEvent, @@ -116,22 +299,23 @@ namespace ice::devui switch (input_source) { case MouseInput::ButtonLeft: - io.MouseDown[0] = input.value.button.state.pressed; + io.AddMouseButtonEvent(ImGuiMouseButton_Left, input.value.button.state.pressed); break; case MouseInput::ButtonRight: - io.MouseDown[1] = input.value.button.state.pressed; + io.AddMouseButtonEvent(ImGuiMouseButton_Right, input.value.button.state.pressed); break; case MouseInput::ButtonMiddle: - io.MouseDown[2] = input.value.button.state.pressed; + io.AddMouseButtonEvent(ImGuiMouseButton_Middle, input.value.button.state.pressed); break; case MouseInput::PositionX: - io.MousePos.x = (ice::f32)input.value.axis.value_i32; + temp_pos.x = (ice::f32)input.value.axis.value_i32; break; case MouseInput::PositionY: - io.MousePos.y = (ice::f32)input.value.axis.value_i32; + temp_pos.y = (ice::f32)input.value.axis.value_i32; + io.AddMousePosEvent(temp_pos.x, temp_pos.y); break; case MouseInput::Wheel: - io.MouseWheel = (ice::f32)input.value.axis.value_i32; + io.AddMouseWheelEvent(0.0f, (ice::f32)input.value.axis.value_i32); break; } } @@ -140,7 +324,10 @@ namespace ice::devui using namespace ice::input; ice::u32 const input_source = ice::input::input_identifier_value(input.identifier); - io.KeysDown[input_source] = input.value.button.state.pressed; + io.AddKeyEvent( + detail::ice_to_imgui_key(KeyboardKey(input_source)), + input.value.button.state.pressed + ); InputID constexpr left_ctrl_key_mod = ice::input::input_identifier(DeviceType::Keyboard, KeyboardMod::CtrlLeft, mod_identifier_base_value); InputID constexpr right_ctrl_key_mod = ice::input::input_identifier(DeviceType::Keyboard, KeyboardMod::CtrlRight, mod_identifier_base_value); @@ -148,18 +335,24 @@ namespace ice::devui InputID constexpr right_shift_key_mod = ice::input::input_identifier(DeviceType::Keyboard, KeyboardMod::ShiftRight, mod_identifier_base_value); InputID constexpr left_alt_key_mod = ice::input::input_identifier(DeviceType::Keyboard, KeyboardMod::AltLeft, mod_identifier_base_value); InputID constexpr right_alt_key_mod = ice::input::input_identifier(DeviceType::Keyboard, KeyboardMod::AltRight, mod_identifier_base_value); + InputID constexpr left_gui_key_mod = ice::input::input_identifier(DeviceType::Keyboard, KeyboardMod::GuiLeft, mod_identifier_base_value); + InputID constexpr right_gui_key_mod = ice::input::input_identifier(DeviceType::Keyboard, KeyboardMod::GuiRight, mod_identifier_base_value); if (input.identifier == left_ctrl_key_mod || input.identifier == right_ctrl_key_mod) { - io.KeyCtrl = input.value.button.state.pressed; + io.AddKeyEvent(ImGuiMod_Ctrl, input.value.button.state.pressed); } if (input.identifier == left_shift_key_mod || input.identifier == right_shift_key_mod) { - io.KeyShift = input.value.button.state.pressed; + io.AddKeyEvent(ImGuiMod_Shift, input.value.button.state.pressed); } if (input.identifier == left_alt_key_mod || input.identifier == right_alt_key_mod) { - io.KeyAlt = input.value.button.state.pressed; + io.AddKeyEvent(ImGuiMod_Alt, input.value.button.state.pressed); + } + if (input.identifier == left_gui_key_mod || input.identifier == right_gui_key_mod) + { + io.AddKeyEvent(ImGuiMod_Super, input.value.button.state.pressed); } } @@ -187,13 +380,52 @@ namespace ice::devui co_return; } - auto ImGuiTrait::gfx_shutdown(ice::gfx::GfxStateChange const& params) noexcept -> ice::Task<> + auto ImGuiTrait::gfx_shutdown( + ice::gfx::GfxStateChange const& params, + ice::gfx::GfxContext& ctx + ) noexcept -> ice::Task<> { params.registry.remove_stage("iceshard.devui"_sid); co_return; } - auto ImGuiTrait::gfx_update(ice::gfx::RenderFrameUpdate const& update) noexcept -> ice::Task<> + auto ImGuiTrait::load_texture( + ice::gfx::GfxContext& gfx, + ice::AssetStorage& assets, + ice::TaskScheduler scheduler, + ImTextureData* texture + ) noexcept -> ice::Task<> + { + IPT_ZONE_SCOPED_NAMED("ImGui - Load texture"); + + ice::HeapString<> texture_name{ _allocator }; + ice::string::push_format(texture_name, detail::TextureNameFormat, texture->UniqueID); + IPT_ZONE_TEXT_STR(texture_name); + + detail::ImTextureAssetDataBinding texture_binding{ _allocator, *texture }; + ice::Asset tex_asset = assets.bind_data( + ice::render::AssetCategory_Texture2D, + texture_name, + texture_binding + ); + + // Store the asset handle in the backend user-data pointer. + texture->BackendUserData = tex_asset._handle; + + ice::Data tex_handle = co_await ice::await_on(tex_asset[AssetState::Runtime], scheduler); + + // Get the image handle + ice::render::Image const* const tex = reinterpret_cast(tex_handle.location); + + // Update the texture object + texture->SetTexID(static_cast(*tex)); + texture->SetStatus(ImTextureStatus_OK); + } + + auto ImGuiTrait::gfx_update( + ice::gfx::RenderFrameUpdate const& update, + ice::AssetStorage& assets + ) noexcept -> ice::Task<> { IPT_ZONE_SCOPED; ImGuiIO const& io = ImGui::GetIO(); @@ -208,15 +440,20 @@ namespace ice::devui ImDrawData* draw_data = ImGui::GetDrawData(); if (draw_data != nullptr) { - ice::u32 cmd_count = 0; - for (ice::i32 i = 0; i < draw_data->CmdListsCount; i++) + if (draw_data->Textures != nullptr) { - ImDrawList const* cmd_list = draw_data->CmdLists[i]; - cmd_count += cmd_list->CmdBuffer.Size; + for (ImTextureData* texture : *draw_data->Textures) + { + if (texture->Status == ImTextureStatus_WantCreate + && texture->BackendUserData == nullptr) + { + ice::execute_task( + load_texture(update.context, assets, update.stages.scheduler, texture) + ); + } + } } - ice::array::resize(_imgui_gfx_stage->draw_commands, cmd_count); - build_internal_command_list(_imgui_gfx_stage->draw_commands); } } @@ -230,17 +467,25 @@ namespace ice::devui co_return; } - void ImGuiTrait::build_internal_command_list(ice::Span draw_cmds) noexcept + void ImGuiTrait::build_internal_command_list(ice::Array& out_draw_cmds) noexcept { IPT_ZONE_SCOPED; _stats = {}; // reset stats + ice::array::clear(_imgui_gfx_stage->draw_commands); + ImDrawData* draw_data = ImGui::GetDrawData(); if (draw_data == nullptr) { return; } + // Reserve enough space for all possible commands + ice::array::reserve( + _imgui_gfx_stage->draw_commands, + detail::total_command_count(*draw_data) + ); + using ice::render::Image; using ice::render::ResourceSet; @@ -249,28 +494,32 @@ namespace ice::devui ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports ImVec2 clip_scale = draw_data->FramebufferScale; // (1,1) unless using retina display which are often (2,2) - ImTextureID last_texid = nullptr; + ImTextureID last_texid = ImTextureID_Invalid; ice::u32 curr_resource_idx = 1; // Upload vertex/index data into a single contiguous GPU buffer ice::u32 vtx_buffer_offset = 0; ice::u32 idx_buffer_offset = 0; - ice::u32 command_idx = 0; for (int n = 0; n < draw_data->CmdListsCount; n++) { ImDrawList const* cmd_list = draw_data->CmdLists[n]; for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) { ImDrawCmd const* pcmd = &cmd_list->CmdBuffer[cmd_i]; - ImGuiGfxStage::DrawCommand& cmd = draw_cmds[command_idx]; + if (detail::is_invalid_texture(*pcmd)) + { + continue; + } - if (pcmd->TextureId != nullptr && pcmd->TextureId != last_texid) + if (detail::is_different_texture(*pcmd, last_texid)) { - last_texid = pcmd->TextureId; + last_texid = pcmd->GetTexID(); curr_resource_idx += 1; } + ice::array::push_back(out_draw_cmds, ImGuiGfxStage::DrawCommand{}); + ImGuiGfxStage::DrawCommand& cmd = ice::array::back(out_draw_cmds); cmd.resource_set_idx = curr_resource_idx; ImVec4 clip_rect; @@ -283,8 +532,6 @@ namespace ice::devui cmd.index_offset = pcmd->IdxOffset + idx_buffer_offset; cmd.vertex_offset = pcmd->VtxOffset + vtx_buffer_offset; cmd.clip_rect = clip_rect; - - command_idx += 1; } vtx_buffer_offset += cmd_list->VtxBuffer.Size; diff --git a/source/code/modules/imgui_module/private/imgui_trait.hxx b/source/code/modules/imgui_module/private/imgui_trait.hxx index 5bfbf367..42b9aed3 100644 --- a/source/code/modules/imgui_module/private/imgui_trait.hxx +++ b/source/code/modules/imgui_module/private/imgui_trait.hxx @@ -53,11 +53,24 @@ namespace ice::devui ice::AssetStorage& assets ) noexcept -> ice::Task<>; - auto gfx_shutdown(ice::gfx::GfxStateChange const& params) noexcept -> ice::Task<>; - auto gfx_update(ice::gfx::RenderFrameUpdate const& update) noexcept -> ice::Task<>; + auto gfx_shutdown( + ice::gfx::GfxStateChange const& params, + ice::gfx::GfxContext& ctx + ) noexcept -> ice::Task<>; + + auto gfx_update( + ice::gfx::RenderFrameUpdate const& update, + ice::AssetStorage& assets + ) noexcept -> ice::Task<>; private: - void build_internal_command_list(ice::Span draw_cmds) noexcept; + void build_internal_command_list(ice::Array& out_draw_cmds) noexcept; + auto load_texture( + ice::gfx::GfxContext& gfx, + ice::AssetStorage& assets, + ice::TaskScheduler scheduler, + ImTextureData* texture + ) noexcept -> ice::Task<>; private: ice::ProxyAllocator _allocator; diff --git a/source/code/modules/imgui_module/private/widgets/imgui_style_palette.cxx b/source/code/modules/imgui_module/private/widgets/imgui_style_palette.cxx index 99c0709c..b4fe5ba8 100644 --- a/source/code/modules/imgui_module/private/widgets/imgui_style_palette.cxx +++ b/source/code/modules/imgui_module/private/widgets/imgui_style_palette.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include #include #include diff --git a/source/code/modules/imgui_module/private/widgets/imgui_style_palette.hxx b/source/code/modules/imgui_module/private/widgets/imgui_style_palette.hxx index 6066b725..d42c9982 100644 --- a/source/code/modules/imgui_module/private/widgets/imgui_style_palette.hxx +++ b/source/code/modules/imgui_module/private/widgets/imgui_style_palette.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/modules/shader_tools/private/shader_tools_asl_importer.cxx b/source/code/modules/shader_tools/private/shader_tools_asl_importer.cxx index 5bb95259..503af543 100644 --- a/source/code/modules/shader_tools/private/shader_tools_asl_importer.cxx +++ b/source/code/modules/shader_tools/private/shader_tools_asl_importer.cxx @@ -163,6 +163,7 @@ namespace ice // Try to access the source ice::ResourceHandle resource; arctic::String source = _resolver.load_source(import_path, resource); + ICE_ASSERT(source.empty() == false, "Failed to load source for import path: {}", import_path); if (source.empty()) { return; @@ -174,6 +175,7 @@ namespace ice .file = parse_import_file(_allocator, *this, _script_visitors, source, import_alias), .resource = resource }; + ICE_ASSERT(import_entry.file != nullptr, "Failed to parse source of import path: {}", import_path); if (import_entry.file == nullptr) { return; diff --git a/source/code/systems/asset_system/private/asset.cxx b/source/code/systems/asset_system/private/asset.cxx index 4b02ee77..3faa0819 100644 --- a/source/code/systems/asset_system/private/asset.cxx +++ b/source/code/systems/asset_system/private/asset.cxx @@ -122,25 +122,25 @@ namespace ice return _handle->data_for_state(state).location != nullptr; } - auto Asset::preload(ice::AssetState state) noexcept -> ice::Task<> + auto Asset::resource() const noexcept -> ice::Resource const* { - co_await data(state); + return ice::asset_data_resource(_handle->_data); } - auto Asset::data(ice::AssetState state) noexcept -> ice::Task + auto Asset::preload(this ice::Asset self, ice::AssetState state) noexcept -> ice::Task<> { - co_return co_await _handle->_shelve->storage.request(*this, state); + co_await self.data(state); } - auto Asset::resource() const noexcept -> ice::Resource const* + auto Asset::data(this ice::Asset self, ice::AssetState state) noexcept -> ice::Task { - return ice::asset_data_resource(_handle->_data); + co_return co_await self._handle->_shelve->storage.request(self, state); } - auto Asset::operator[](ice::AssetState state) noexcept -> ice::Task + auto Asset::operator[](this ice::Asset self, ice::AssetState state) noexcept -> ice::Task { - ICE_ASSERT(_handle != nullptr, "Invalid Asset object!"); - co_return co_await data(state); + ICE_ASSERT(self._handle != nullptr, "Invalid Asset object!"); + co_return co_await self.data(state); } auto Asset::start_transaction( diff --git a/source/code/systems/asset_system/private/asset_data.hxx b/source/code/systems/asset_system/private/asset_data.hxx index bb865064..697db15d 100644 --- a/source/code/systems/asset_system/private/asset_data.hxx +++ b/source/code/systems/asset_system/private/asset_data.hxx @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -103,6 +104,11 @@ namespace ice ice::ResourceAssetData* resdata = static_cast(data.get()); co_return co_await ice::resource_meta(resdata->_resource_handle, out_data); } + else if (ice::has_any(data->_flags, AssetDataFlags::Allocated)) + { + out_data = { data->_readwrite, data->_size, data->_alignment }; + co_return S_Success; + } else // The data stored in this object is pure metadata { out_data = { data->_readonly, data->_size, data->_alignment }; @@ -158,13 +164,14 @@ namespace ice ice::Allocator& alloc, ice::AssetState state, ice::Allocator& data_alloc, - ice::Memory asset_memory + ice::Memory asset_memory, + ice::AssetDataFlags additional_flags = AssetDataFlags::None ) noexcept -> ice::UniquePtr { ice::AllocatedAssetData* data = alloc.create(); data->_next = nullptr; data->_alloc = ice::addressof(alloc); - data->_flags = AssetDataFlags::Allocated; + data->_flags = AssetDataFlags::Allocated | additional_flags; data->_state = state; data->_alignment = asset_memory.alignment; data->_size = asset_memory.size; @@ -208,4 +215,21 @@ namespace ice return ice::make_unique(ice::destroy_asset_data_entry, data); } + inline auto create_asset_data_entry( + ice::Allocator& alloc, + ice::AssetState state, + ice::Allocator& data_alloc, + ice::Data asset_data, + ice::Data metadata_data + ) noexcept -> ice::UniquePtr + { + ice::UniquePtr result = ice::create_asset_data_entry( + alloc, state, data_alloc, ice::data_copy(data_alloc, asset_data) + ); + result->_next = ice::create_asset_data_entry( + alloc, state, data_alloc, ice::data_copy(data_alloc, metadata_data), AssetDataFlags::Metadata + ); + return result; + } + } // namespace ice diff --git a/source/code/systems/asset_system/private/asset_entry.hxx b/source/code/systems/asset_system/private/asset_entry.hxx index 4369596d..8472211c 100644 --- a/source/code/systems/asset_system/private/asset_entry.hxx +++ b/source/code/systems/asset_system/private/asset_entry.hxx @@ -33,7 +33,7 @@ namespace ice inline AssetHandle( ice::StringID_Hash id, ice::AssetShelve* shelve, - ice::UniquePtr resource + ice::UniquePtr resource ) noexcept; inline AssetHandle(ice::AssetHandle&& other) noexcept; @@ -68,7 +68,7 @@ namespace ice inline AssetHandle::AssetHandle( ice::StringID_Hash id, ice::AssetShelve* shelve, - ice::UniquePtr resource + ice::UniquePtr resource ) noexcept : _identifier{ id } , _shelve{ shelve } @@ -102,7 +102,7 @@ namespace ice inline AssetEntryFinal( ice::HeapString<> name, ice::AssetShelve* shelve, - ice::UniquePtr resource + ice::UniquePtr resource ) noexcept; inline AssetEntryFinal(AssetEntryFinal const& other) noexcept; @@ -129,11 +129,12 @@ namespace ice inline AssetEntryFinal::AssetEntryFinal( ice::HeapString<> name, ice::AssetShelve* shelve, - ice::UniquePtr resource + ice::UniquePtr resource ) noexcept : AssetHandle{ ice::stringid(name), shelve, ice::move(resource) } , debug_name{ ice::move(name) } { + _identifier = ice::stringid(debug_name); } template diff --git a/source/code/systems/asset_system/private/asset_request_awaitable.cxx b/source/code/systems/asset_system/private/asset_request_awaitable.cxx index 72177cf8..27bf35e5 100644 --- a/source/code/systems/asset_system/private/asset_request_awaitable.cxx +++ b/source/code/systems/asset_system/private/asset_request_awaitable.cxx @@ -12,13 +12,11 @@ namespace ice { AssetRequestAwaitable::AssetRequestAwaitable( - ice::StringID_Arg asset_name, ice::AssetStateTransaction& transaction ) noexcept : _next{ nullptr } , _prev{ nullptr } , _chained{ nullptr } - , _asset_name{ asset_name } , _asset_shelve{ transaction.shelve } , _transaction{ transaction } , _result_data{ } diff --git a/source/code/systems/asset_system/private/asset_request_awaitable.hxx b/source/code/systems/asset_system/private/asset_request_awaitable.hxx index 723fcef6..64163f93 100644 --- a/source/code/systems/asset_system/private/asset_request_awaitable.hxx +++ b/source/code/systems/asset_system/private/asset_request_awaitable.hxx @@ -16,7 +16,6 @@ namespace ice { public: AssetRequestAwaitable( - ice::StringID_Arg asset_name, ice::AssetStateTransaction& transation ) noexcept; @@ -46,7 +45,6 @@ namespace ice AssetRequestAwaitable* _chained; private: - ice::StringID const _asset_name; ice::AssetShelve& _asset_shelve; ice::AssetStateTransaction& _transaction; ice::Memory _result_data; diff --git a/source/code/systems/asset_system/private/asset_shelve.cxx b/source/code/systems/asset_system/private/asset_shelve.cxx index 15a27fee..2a2efdff 100644 --- a/source/code/systems/asset_system/private/asset_shelve.cxx +++ b/source/code/systems/asset_system/private/asset_shelve.cxx @@ -4,11 +4,13 @@ #include "asset_shelve.hxx" #include "asset_entry.hxx" #include "asset_request_awaitable.hxx" -#include -#include + +#include #include +#include #include -#include +#include +#include namespace ice { @@ -59,7 +61,7 @@ namespace ice } auto AssetShelve::store( - ice::StringID_Arg name, + ice::String name, ice::ResourceHandle const& resource ) noexcept -> ice::AssetEntry* { @@ -70,7 +72,46 @@ namespace ice ice::u64 const name_hash = ice::hash(name); if constexpr (ice::AssetEntry::HoldsDebugData) { - ice::HeapString<> asset_name{ _allocator, ice::stringid_hint(name) }; + ice::HeapString<> asset_name{ _allocator, name }; + + ice::hashmap::set( + _asset_resources, + name_hash, + _allocator.create(ice::move(asset_name), this, ice::move(resource_data)) + ); + } + else + { + ice::hashmap::set( + _asset_resources, + name_hash, + _allocator.create(ice::stringid(name), this, ice::move(resource_data)) + ); + } + + ice::AssetEntry** entry = ice::hashmap::try_get(_asset_resources, name_hash); + ICE_ASSERT_CORE(entry != nullptr); + ICE_ASSERT_CORE(*entry != nullptr); + return *entry; + } + + auto AssetShelve::store( + ice::String name, + ice::AssetDataBinding const& data_binding + ) noexcept -> ice::AssetEntry* + { + ice::UniquePtr resource_data = ice::create_asset_data_entry( + _allocator, + data_binding.state, + _allocator, + data_binding.content, + data_binding.metadata + ); + + ice::u64 const name_hash = ice::hash(name); + if constexpr (ice::AssetEntry::HoldsDebugData) + { + ice::HeapString<> asset_name{ _allocator, name }; ice::hashmap::set( _asset_resources, @@ -83,7 +124,7 @@ namespace ice ice::hashmap::set( _asset_resources, name_hash, - _allocator.create(name, this, ice::move(resource_data)) + _allocator.create(ice::stringid(name), this, ice::move(resource_data)) ); } diff --git a/source/code/systems/asset_system/private/asset_shelve.hxx b/source/code/systems/asset_system/private/asset_shelve.hxx index 551291ba..81ee929d 100644 --- a/source/code/systems/asset_system/private/asset_shelve.hxx +++ b/source/code/systems/asset_system/private/asset_shelve.hxx @@ -4,6 +4,7 @@ #pragma once #include #include +#include #include #include @@ -35,10 +36,15 @@ namespace ice ) const noexcept -> ice::AssetEntry const*; auto store( - ice::StringID_Arg name, + ice::String name, ice::ResourceHandle const& resource_handle ) noexcept -> ice::AssetEntry*; + auto store( + ice::String name, + ice::AssetDataBinding const& data_binding + ) noexcept -> ice::AssetEntry*; + void append_request( ice::AssetRequestAwaitable* request, ice::AssetState state diff --git a/source/code/systems/asset_system/private/asset_storage.cxx b/source/code/systems/asset_system/private/asset_storage.cxx index 78c4193d..0ebb7900 100644 --- a/source/code/systems/asset_system/private/asset_storage.cxx +++ b/source/code/systems/asset_system/private/asset_storage.cxx @@ -8,6 +8,7 @@ #include "asset_request_awaitable.hxx" #include "asset_transaction.hxx" +#include #include namespace ice @@ -321,11 +322,7 @@ namespace ice if (resource_handle.valid()) { // Create a new asset entry if the handle exists - entry = shelve->store( - ice::stringid(name), - resource_handle - ); - + entry = shelve->store(name, resource_handle); ICE_ASSERT_CORE(entry != nullptr); //ice::u32 const prev_count = entry->_refcount.fetch_add(1, std::memory_order_relaxed); @@ -337,6 +334,62 @@ namespace ice return result; } + auto DefaultAssetStorage::bind_data( + ice::AssetCategory_Arg category, + ice::String name, + ice::AssetDataBinding const& data_binding + ) noexcept -> ice::Asset + { + Asset result{ }; + // CHECK: Always called from the same thread. + // OR TODO: Think of how to make it MT + lock-free + + // TODO: Can we have empty assets? + if (data_binding.content.location == nullptr) + { + return result; + } + + ice::AssetShelve* shelve = nullptr; + ice::AssetEntry* entry = nullptr; + if (find_shelve_and_entry(category, name, shelve, entry)) + { + result = Asset{ entry }; + + // We need to ensure the previous count was higher else the asset might be released already + ice::u32 const curr_count = entry->_refcount.load(std::memory_order_relaxed); + if (curr_count == 1) + { + // Only keep metadata data + while (entry->_data != nullptr) + { + // TODO: Add an sleep statement? + //IPT_MESSAGE_C("Asset waiting for 'Release' operation to finish.", 0xEE8866); + } + + entry->_data = ice::create_asset_data_entry( + _allocator, + data_binding.state, + _allocator, + data_binding.content, + data_binding.metadata + ); + } + } + else if (shelve != nullptr) + { + // Create a new asset entry if the handle exists + entry = shelve->store(name, data_binding); + ICE_ASSERT_CORE(entry != nullptr); + + //ice::u32 const prev_count = entry->_refcount.fetch_add(1, std::memory_order_relaxed); + //ICE_ASSERT(prev_count == 0, "Unexpected value!"); + + result = Asset{ entry }; + } + return result; + } + auto DefaultAssetStorage::preload( ice::AssetCategory_Arg category, ice::String name, @@ -402,7 +455,7 @@ namespace ice // We request a baked resource first co_await request_asset_loaded(transaction); - ice::Memory runtime_data = co_await AssetRequestAwaitable{ StringID_Invalid, transaction }; + ice::Memory runtime_data = co_await AssetRequestAwaitable{ transaction }; // ICE_ASSERT_CORE(runtime_data.location == transaction.result_data->readwrite); diff --git a/source/code/systems/asset_system/private/asset_storage.hxx b/source/code/systems/asset_system/private/asset_storage.hxx index 3e1f0e10..74020572 100644 --- a/source/code/systems/asset_system/private/asset_storage.hxx +++ b/source/code/systems/asset_system/private/asset_storage.hxx @@ -46,6 +46,12 @@ namespace ice ice::String name ) noexcept -> ice::Asset override; + auto bind_data( + ice::AssetCategory_Arg category, + ice::String name, + ice::AssetDataBinding const& data_binding + ) noexcept -> ice::Asset override; + auto preload( ice::AssetCategory_Arg category, ice::String name, diff --git a/source/code/systems/asset_system/private/asset_transaction.hxx b/source/code/systems/asset_system/private/asset_transaction.hxx index b44c9671..1a55b2fe 100644 --- a/source/code/systems/asset_system/private/asset_transaction.hxx +++ b/source/code/systems/asset_system/private/asset_transaction.hxx @@ -157,8 +157,7 @@ namespace ice ice::AssetState const state = calculate_state(min_state, meta); // Create new metadata entry and assign as next - ice::UniquePtr entry_meta = ice::create_asset_data_entry(alloc, state, dataalloc, metadata); - entry_meta->_flags |= AssetDataFlags::Metadata; + ice::UniquePtr entry_meta = ice::create_asset_data_entry(alloc, state, dataalloc, metadata, AssetDataFlags::Metadata); entry_meta->_next = ice::move(asset._data); // Set the asset data and point to the meta entry diff --git a/source/code/systems/asset_system/public/ice/asset.hxx b/source/code/systems/asset_system/public/ice/asset.hxx index c2ccbf41..fc8bd1bb 100644 --- a/source/code/systems/asset_system/public/ice/asset.hxx +++ b/source/code/systems/asset_system/public/ice/asset.hxx @@ -59,12 +59,12 @@ namespace ice auto name() const noexcept -> ice::StringID_Arg; auto metadata(ice::Data& out_metadata) const noexcept -> ice::Task; bool available(ice::AssetState state) const noexcept; - auto preload(ice::AssetState state) noexcept -> ice::Task<>; - auto data(ice::AssetState state) noexcept -> ice::Task; - auto resource() const noexcept -> ice::Resource const*; - auto operator[](ice::AssetState state) noexcept -> ice::Task; + auto preload(this ice::Asset self, ice::AssetState state) noexcept -> ice::Task<>; + auto data(this ice::Asset self, ice::AssetState state) noexcept -> ice::Task; + + auto operator[](this ice::Asset self, ice::AssetState state) noexcept -> ice::Task; public: auto start_transaction( diff --git a/source/code/systems/asset_system/public/ice/asset_storage.hxx b/source/code/systems/asset_system/public/ice/asset_storage.hxx index 26c81d97..b26d05b8 100644 --- a/source/code/systems/asset_system/public/ice/asset_storage.hxx +++ b/source/code/systems/asset_system/public/ice/asset_storage.hxx @@ -9,6 +9,13 @@ namespace ice { + struct AssetDataBinding + { + ice::Data content; + ice::Data metadata; + ice::AssetState state; + }; + struct AssetStorageCreateInfo { //! \brief Resource tracker associated with this asset storage. @@ -35,6 +42,12 @@ namespace ice ice::String name ) noexcept -> ice::Asset = 0; + virtual auto bind_data( + ice::AssetCategory_Arg category, + ice::String name, + ice::AssetDataBinding const& data_binding + ) noexcept -> ice::Asset = 0; + virtual auto preload( ice::AssetCategory_Arg category, ice::String name, diff --git a/source/code/systems/input_action_system/input_action_system.bff b/source/code/systems/input_action_system/input_action_system.bff index a4de5af6..8e965ca2 100644 --- a/source/code/systems/input_action_system/input_action_system.bff +++ b/source/code/systems/input_action_system/input_action_system.bff @@ -1,4 +1,4 @@ -/// Copyright 2021 - 2023, Dandielo +/// Copyright 2025 - 2025, Dandielo /// SPDX-License-Identifier: MIT .Project = diff --git a/source/code/systems/input_action_system/private/input_action.cxx b/source/code/systems/input_action_system/private/input_action.cxx index 6c58832d..246ec75b 100644 --- a/source/code/systems/input_action_system/private/input_action.cxx +++ b/source/code/systems/input_action_system/private/input_action.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include #include diff --git a/source/code/systems/input_action_system/private/input_action_executor.cxx b/source/code/systems/input_action_system/private/input_action_executor.cxx index 13523aea..99440b23 100644 --- a/source/code/systems/input_action_system/private/input_action_executor.cxx +++ b/source/code/systems/input_action_system/private/input_action_executor.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include #include #include diff --git a/source/code/systems/input_action_system/private/input_action_internal_types.hxx b/source/code/systems/input_action_system/private/input_action_internal_types.hxx index 24831a3b..84d28b56 100644 --- a/source/code/systems/input_action_system/private/input_action_internal_types.hxx +++ b/source/code/systems/input_action_system/private/input_action_internal_types.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/private/input_action_layer.cxx b/source/code/systems/input_action_system/private/input_action_layer.cxx index 4eaf8c85..4793db15 100644 --- a/source/code/systems/input_action_system/private/input_action_layer.cxx +++ b/source/code/systems/input_action_system/private/input_action_layer.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include "input_action_internal_types.hxx" #include "input_action_script_parser.hxx" diff --git a/source/code/systems/input_action_system/private/input_action_layer_builder.cxx b/source/code/systems/input_action_system/private/input_action_layer_builder.cxx index f7c7aa27..254f57e4 100644 --- a/source/code/systems/input_action_system/private/input_action_layer_builder.cxx +++ b/source/code/systems/input_action_system/private/input_action_layer_builder.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include "input_action_internal_types.hxx" #include #include diff --git a/source/code/systems/input_action_system/private/input_action_script.cxx b/source/code/systems/input_action_system/private/input_action_script.cxx index 0f1f93e5..a546ee68 100644 --- a/source/code/systems/input_action_system/private/input_action_script.cxx +++ b/source/code/systems/input_action_system/private/input_action_script.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include "input_action_script.hxx" #include "input_action_script_grammar.hxx" diff --git a/source/code/systems/input_action_system/private/input_action_script.hxx b/source/code/systems/input_action_system/private/input_action_script.hxx index 3df1d813..52c817b9 100644 --- a/source/code/systems/input_action_system/private/input_action_script.hxx +++ b/source/code/systems/input_action_system/private/input_action_script.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/private/input_action_script_grammar.cxx b/source/code/systems/input_action_system/private/input_action_script_grammar.cxx index 6893d95d..ffd6301d 100644 --- a/source/code/systems/input_action_system/private/input_action_script_grammar.cxx +++ b/source/code/systems/input_action_system/private/input_action_script_grammar.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include "input_action_script_grammar.hxx" namespace ice::asl::grammar diff --git a/source/code/systems/input_action_system/private/input_action_script_grammar.hxx b/source/code/systems/input_action_system/private/input_action_script_grammar.hxx index df27f699..f66d8eb1 100644 --- a/source/code/systems/input_action_system/private/input_action_script_grammar.hxx +++ b/source/code/systems/input_action_system/private/input_action_script_grammar.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include "input_action_script_syntax_data.hxx" #include "input_action_script_tokens.hxx" diff --git a/source/code/systems/input_action_system/private/input_action_script_parser.cxx b/source/code/systems/input_action_system/private/input_action_script_parser.cxx index 742b988b..5ff9e88a 100644 --- a/source/code/systems/input_action_system/private/input_action_script_parser.cxx +++ b/source/code/systems/input_action_system/private/input_action_script_parser.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include "input_action_script_grammar.hxx" #include "input_action_script_parser.hxx" diff --git a/source/code/systems/input_action_system/private/input_action_script_parser.hxx b/source/code/systems/input_action_system/private/input_action_script_parser.hxx index 629d2fff..45572e34 100644 --- a/source/code/systems/input_action_system/private/input_action_script_parser.hxx +++ b/source/code/systems/input_action_system/private/input_action_script_parser.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include "input_action_script.hxx" #include diff --git a/source/code/systems/input_action_system/private/input_action_script_syntax_data.hxx b/source/code/systems/input_action_system/private/input_action_script_syntax_data.hxx index 1f2e79bc..6862e509 100644 --- a/source/code/systems/input_action_system/private/input_action_script_syntax_data.hxx +++ b/source/code/systems/input_action_system/private/input_action_script_syntax_data.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/private/input_action_script_tokens.hxx b/source/code/systems/input_action_system/private/input_action_script_tokens.hxx index 79a008e1..dd6f6d93 100644 --- a/source/code/systems/input_action_system/private/input_action_script_tokens.hxx +++ b/source/code/systems/input_action_system/private/input_action_script_tokens.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/private/input_action_stack.cxx b/source/code/systems/input_action_system/private/input_action_stack.cxx index e374b089..dd15f768 100644 --- a/source/code/systems/input_action_system/private/input_action_stack.cxx +++ b/source/code/systems/input_action_system/private/input_action_stack.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include #include #include diff --git a/source/code/systems/input_action_system/public/ice/input_action.hxx b/source/code/systems/input_action_system/public/ice/input_action.hxx index 928e8172..f9151b10 100644 --- a/source/code/systems/input_action_system/public/ice/input_action.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/public/ice/input_action_definitions.hxx b/source/code/systems/input_action_system/public/ice/input_action_definitions.hxx index b074e3da..f047cf71 100644 --- a/source/code/systems/input_action_system/public/ice/input_action_definitions.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action_definitions.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/public/ice/input_action_executor.hxx b/source/code/systems/input_action_system/public/ice/input_action_executor.hxx index 6fd9626e..402be087 100644 --- a/source/code/systems/input_action_system/public/ice/input_action_executor.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action_executor.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include diff --git a/source/code/systems/input_action_system/public/ice/input_action_info.hxx b/source/code/systems/input_action_system/public/ice/input_action_info.hxx index 98305caa..dd4c9908 100644 --- a/source/code/systems/input_action_system/public/ice/input_action_info.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action_info.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include diff --git a/source/code/systems/input_action_system/public/ice/input_action_layer.hxx b/source/code/systems/input_action_system/public/ice/input_action_layer.hxx index 325e88b3..ff4912d0 100644 --- a/source/code/systems/input_action_system/public/ice/input_action_layer.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action_layer.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/public/ice/input_action_layer_builder.hxx b/source/code/systems/input_action_system/public/ice/input_action_layer_builder.hxx index d478e2ee..1270e4ee 100644 --- a/source/code/systems/input_action_system/public/ice/input_action_layer_builder.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action_layer_builder.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/public/ice/input_action_stack.hxx b/source/code/systems/input_action_system/public/ice/input_action_stack.hxx index 3ae16770..8dae781f 100644 --- a/source/code/systems/input_action_system/public/ice/input_action_stack.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action_stack.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/systems/input_action_system/public/ice/input_action_types.hxx b/source/code/systems/input_action_system/public/ice/input_action_types.hxx index 65b6cbda..37ad1a17 100644 --- a/source/code/systems/input_action_system/public/ice/input_action_types.hxx +++ b/source/code/systems/input_action_system/public/ice/input_action_types.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/code/test/private/game.cxx b/source/code/test/private/game.cxx index 4aafa95d..844a2231 100644 --- a/source/code/test/private/game.cxx +++ b/source/code/test/private/game.cxx @@ -300,7 +300,8 @@ void TestGame::on_resume(ice::Engine& engine) noexcept "test2"_sid, "actions"_sid, ice::devui_trait_name(), - ice::TraitID_GfxShaderStorage + ice::TraitID_GfxShaderStorage, + ice::TraitID_GfxImageStorage, }; ice::StringID traits2[]{ "test"_sid, diff --git a/source/code/test/private/input_actions.cxx b/source/code/test/private/input_actions.cxx index 13e3c3c5..60362b32 100644 --- a/source/code/test/private/input_actions.cxx +++ b/source/code/test/private/input_actions.cxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #include "input_actions.hxx" #include diff --git a/source/code/test/private/input_actions.hxx b/source/code/test/private/input_actions.hxx index 55fafe95..6bc78964 100644 --- a/source/code/test/private/input_actions.hxx +++ b/source/code/test/private/input_actions.hxx @@ -1,3 +1,6 @@ +/// Copyright 2025 - 2025, Dandielo +/// SPDX-License-Identifier: MIT + #pragma once #include #include diff --git a/source/conanfile.txt b/source/conanfile.txt index 4a8e7bbb..21fd993a 100644 --- a/source/conanfile.txt +++ b/source/conanfile.txt @@ -8,7 +8,7 @@ fastbuild-generator/0.4.2@iceshard/stable cli11/2.4.1@iceshard/stable fmt/11.2.0@iceshard/stable tracy/0.11.1@iceshard/stable -imgui/1.90.docking@iceshard/stable +imgui/1.92.4.docking@iceshard/stable hailstorm/0.4.0@iceshard/stable # chipmunk2d/7.0.3+@iceshard/stable arctic/0.2.2@iceshard/stable @@ -44,7 +44,7 @@ msdfgen/1.9.2@iceshard/stable msdf_atlas_gen/1.2.2@iceshard/stable # Editor only packages -imguizmo/1.91.3@iceshard/stable +imguizmo/1.91.5@iceshard/stable [options-Android-Arm64] diff --git a/thirdparty/LICENSES.txt b/thirdparty/LICENSES.txt index ffe75882..136c321c 100644 --- a/thirdparty/LICENSES.txt +++ b/thirdparty/LICENSES.txt @@ -82,29 +82,29 @@ -------------------- START 'catch2' -------------------- - Boost Software License - Version 1.0 - August 17th, 2003 - - Permission is hereby granted, free of charge, to any person or organization - obtaining a copy of the software and accompanying documentation covered by - this license (the "Software") to use, reproduce, display, distribute, - execute, and transmit the Software, and to prepare derivative works of the - Software, and to permit third-parties to whom the Software is furnished to - do so, all subject to the following: - - The copyright notices in the Software and this entire statement, including - the above license grant, this restriction and the following disclaimer, - must be included in all copies of the Software, in whole or in part, and - all derivative works of the Software, unless such copies or derivative - works are solely in the form of machine-executable object code generated by - a source language processor. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. + Boost Software License - Version 1.0 - August 17th, 2003 + + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. -------------------- END 'catch2' -------------------- @@ -138,206 +138,206 @@ -------------------- START 'fmt' -------------------- - Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - --- Optional exception to the license --- - - As an exception, if, as a result of your compiling your source code, portions - of this Software are embedded into a machine-executable object form of such - source code, you may redistribute such embedded portions in such object form - without including the above copyright and permission notices. + Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + --- Optional exception to the license --- + + As an exception, if, as a result of your compiling your source code, portions + of this Software are embedded into a machine-executable object form of such + source code, you may redistribute such embedded portions in such object form + without including the above copyright and permission notices. -------------------- END 'fmt' -------------------- -------------------- START 'freetype' -------------------- - The FreeType Project LICENSE - ---------------------------- - - 2006-Jan-27 - - Copyright 1996-2002, 2006 by - David Turner, Robert Wilhelm, and Werner Lemberg - - - - Introduction - ============ - - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. - - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. - - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: - - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) - - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) - - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') - - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. - - - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: - - """ - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. - """ - - Please replace with the value from the FreeType version you - actually use. - - - Legal Terms - =========== - - 0. Definitions - -------------- - - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. - - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. - - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. - - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. - - 1. No Warranty - -------------- - - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. - - 2. Redistribution - ----------------- - - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: - - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. - - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. - - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. - - 3. Advertising - -------------- - - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. - - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. - - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. - - 4. Contacts - ----------- - - There are two mailing lists related to FreeType: - - o freetype@nongnu.org - - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. - - o freetype-devel@nongnu.org - - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. - - Our home page can be found at - - https://www.freetype.org - - - --- end of FTL.TXT --- + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + + Introduction + ============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + + Legal Terms + =========== + + 0. Definitions + -------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + + 1. No Warranty + -------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + + 2. Redistribution + ----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + + 3. Advertising + -------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + + 4. Contacts + ----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + https://www.freetype.org + + + --- end of FTL.TXT --- -------------------- END 'freetype' -------------------- @@ -367,102 +367,102 @@ -------------------- START 'imgui' -------------------- - The MIT License (MIT) - - Copyright (c) 2014-2023 Omar Cornut - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + The MIT License (MIT) + + Copyright (c) 2014-2025 Omar Cornut + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. -------------------- END 'imgui' -------------------- -------------------- START 'imguizmo' -------------------- - The MIT License (MIT) - - Copyright (c) 2016 Cedric Guillemet - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + The MIT License (MIT) + + Copyright (c) 2016 Cedric Guillemet + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. -------------------- END 'imguizmo' -------------------- -------------------- START 'msdf_atlas_gen' -------------------- - MIT License - - Copyright (c) 2020 Viktor Chlumsky - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + MIT License + + Copyright (c) 2020 Viktor Chlumsky + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. -------------------- END 'msdf_atlas_gen' -------------------- -------------------- START 'msdfgen' -------------------- - MIT License - - Copyright (c) 2016 Viktor Chlumsky - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + MIT License + + Copyright (c) 2016 Viktor Chlumsky + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. -------------------- END 'msdfgen' -------------------- @@ -687,33 +687,33 @@ -------------------- START 'tracy' -------------------- - Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the - 3-clause BSD license. - - Copyright (c) 2017-2024, Bartosz Taudul - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the + 3-clause BSD license. + + Copyright (c) 2017-2024, Bartosz Taudul + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------- END 'tracy' -------------------- diff --git a/thirdparty/README.md b/thirdparty/README.md index a267108e..a3e71c9b 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -45,7 +45,7 @@ Custom package format for storing resources used by 'iceshard' game engine frame ## imgui Dear ImGui: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies - **upstream:** https://github.com/ocornut/imgui -- **version:** 1.90.docking +- **version:** 1.92.4.docking - **license:** MIT ## imguizmo