From cc4cffe9896a5f2886ce6ab58cc1c79f137e093f Mon Sep 17 00:00:00 2001 From: Anish Bhobe Date: Tue, 13 May 2025 12:46:58 +0200 Subject: [PATCH] Fix: Usage of `format_to` in `fmt`. Should not be using versions. `v11::format_to` -> `fmt::format_to`. --- aster/include/aster/core/global.h | 2 +- aster/src/aster/core/global.cpp | 8 +++---- flake.lock | 12 +++++----- flake.nix | 5 ++-- shell.nix | 38 ------------------------------- 5 files changed, 14 insertions(+), 51 deletions(-) delete mode 100644 shell.nix diff --git a/aster/include/aster/core/global.h b/aster/include/aster/core/global.h index 2e95fd4..21f1a54 100644 --- a/aster/include/aster/core/global.h +++ b/aster/include/aster/core/global.h @@ -247,7 +247,7 @@ struct fmt::formatter> : nested_fo // ReSharper disable once CppInconsistentNaming format(const eastl::fixed_string &str, format_context &ctx) const { - return write_padded(ctx, [this, str](auto out) { return v11::format_to(out, "{}", nested(str.c_str())); }); + return write_padded(ctx, [this, str](auto out) { return fmt::format_to(out, "{}", nested(str.c_str())); }); } }; diff --git a/aster/src/aster/core/global.cpp b/aster/src/aster/core/global.cpp index b93c0bd..68e0ea3 100644 --- a/aster/src/aster/core/global.cpp +++ b/aster/src/aster/core/global.cpp @@ -56,18 +56,18 @@ struct fmt::formatter // return format_to(ctx.out(), "({}, {})", foo.a, foo.b); // --== KEY LINE ==-- if (mem.m_Gigabytes > 0) { - return v11::format_to(ctx.out(), "{}.{} GB", mem.m_Gigabytes, static_cast(mem.m_Megabytes / 1024.0)); + return fmt::format_to(ctx.out(), "{}.{} GB", mem.m_Gigabytes, static_cast(mem.m_Megabytes / 1024.0)); } if (mem.m_Megabytes > 0) { - return v11::format_to(ctx.out(), "{}.{} MB", mem.m_Megabytes, static_cast(mem.m_Kilobytes / 1024.0)); + return fmt::format_to(ctx.out(), "{}.{} MB", mem.m_Megabytes, static_cast(mem.m_Kilobytes / 1024.0)); } if (mem.m_Kilobytes > 0) { - return v11::format_to(ctx.out(), "{}.{} KB", mem.m_Kilobytes, static_cast(mem.m_Bytes / 1024.0)); + return fmt::format_to(ctx.out(), "{}.{} KB", mem.m_Kilobytes, static_cast(mem.m_Bytes / 1024.0)); } - return v11::format_to(ctx.out(), "{} Bytes", mem.m_Bytes); + return fmt::format_to(ctx.out(), "{} Bytes", mem.m_Bytes); } }; diff --git a/flake.lock b/flake.lock index d1752e5..50da184 100644 --- a/flake.lock +++ b/flake.lock @@ -20,16 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738734093, - "narHash": "sha256-UEYOKfXXKU49fR7dGB05As0s2pGbLK4xDo48Qtdm7xs=", - "owner": "NixOS", + "lastModified": 1742976680, + "narHash": "sha256-Lcyi6YyR0PgN5rOrmM6mM/1MJIYhGi6rrq0+eiqvUb4=", + "owner": "kidrigger", "repo": "nixpkgs", - "rev": "5b2753b0356d1c951d7a3ef1d086ba5a71fff43c", + "rev": "51cf54bdbd9c1a0a2f833cced82451df0d9c25bd", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", + "owner": "kidrigger", + "ref": "imgui-docking", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 6300e07..3ed29fc 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:kidrigger/nixpkgs/imgui-docking"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = {self, nixpkgs, flake-utils }: @@ -26,7 +26,7 @@ ccls clang-tools lldb - (imgui.override {IMGUI_BUILD_VULKAN_BINDING = true; IMGUI_BUILD_GLFW_BINDING=true; }) + (imgui.override {IMGUI_BUILD_VULKAN_BINDING = true; IMGUI_BUILD_GLFW_BINDING=true; IMGUI_EXPERIMENTAL_DOCKING = true; }) ]; buildInputs = [ @@ -50,6 +50,7 @@ directx-shader-compiler glslang shaderc + shader-slang ]; }; } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 725e3e2..0000000 --- a/shell.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ pkgs ? import {} }: - -let eabase = pkgs.callPackage ./vendored-nix/eabase {}; in -let eastl = pkgs.callPackage ./vendored-nix/eastl { inherit eabase; }; in -let tinygltf = pkgs.callPackage ./vendored-nix/tinygltf {}; in -let debugbreak = pkgs.callPackage ./vendored-nix/scottt-debugbreak {}; in - -pkgs.clangStdenv.mkDerivation { - name = "aster-env"; - - nativeBuildInputs = with pkgs; [ - cmake - ninja - (imgui.override {IMGUI_BUILD_VULKAN_BINDING = true; IMGUI_BUILD_GLFW_BINDING=true; }) - ]; - - buildInputs = with pkgs; [ - glm - glfw3 - eastl - fmt - eabase - eastl - entt - tinygltf - debugbreak - stb - - # vulkan - vulkan-headers - vulkan-loader - vulkan-validation-layers - vulkan-memory-allocator - directx-shader-compiler - glslang - shaderc - ]; -}