Skip to content

Commit 3bfd7af

Browse files
committed
🐛 fix windows build
1 parent ff444c7 commit 3bfd7af

25 files changed

Lines changed: 167 additions & 72 deletions

File tree

.github/workflows/windows.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020

2121
- name: Download ISPC (Windows)
2222
run: |
23-
Invoke-WebRequest -Uri "https://github.com/ispc/ispc/releases/download/v1.18.0/ispc-v1.18.0-windows.zip" -OutFile "ispc.zip"
23+
Invoke-WebRequest -Uri "https://github.com/ispc/ispc/releases/download/v1.27.0/ispc-v1.27.0-windows.zip" -OutFile "ispc.zip"
2424
7z x ispc.zip
25-
"ispc-v1.18.0-windows/bin" >> $env:GITHUB_PATH
25+
"ispc-v1.27.0-windows/bin" >> $env:GITHUB_PATH
2626
2727
- name: Setup Vulkan SDK
2828
uses: humbletim/setup-vulkan-sdk@v1.2.0

examples/editor/editor.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using namespace std::literals;
1313

1414
namespace hitagi {
1515
auto get_resource_label(Resource* res) {
16-
return fmt::format("{}##{}", res->GetName(), res->GetGuid().str());
16+
return fmt::format("{}##{}", res->GetName(), res->GetUUID());
1717
}
1818

1919
Editor::Editor(Engine& engine)
@@ -29,7 +29,7 @@ void Editor::Tick() {
2929
if (m_CurrScene) m_CurrScene->Update();
3030

3131
m_Engine.GuiManager().DrawGui([this]() {
32-
ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(), ImGuiDockNodeFlags_PassthruCentralNode);
32+
ImGui::DockSpaceOverViewport(0, ImGui::GetMainViewport(), ImGuiDockNodeFlags_PassthruCentralNode);
3333
MenuBar();
3434
FileImporter();
3535
SceneGraphViewer();
@@ -135,7 +135,6 @@ void Editor::SceneGraphViewer() {
135135
ImGuiTableFlags_Resizable |
136136
ImGuiTableFlags_RowBg;
137137
constexpr ImGuiTreeNodeFlags base_node_flags =
138-
ImGuiTreeNodeFlags_NoTreePushOnOpen |
139138
ImGuiTreeNodeFlags_SpanFullWidth;
140139

141140
if (ImGui::BeginTable("Scene Graph", 1, table_flags)) {
@@ -170,25 +169,27 @@ void Editor::SceneGraphViewer() {
170169
name_id = name;
171170
}
172171

173-
bool node_open = ImGui::TreeNodeEx(name_id.c_str(), node_flags, "%s", name.c_str()); // TODO print entity name
174-
if (ImGui::IsItemClicked(ImGuiMouseButton_Left) && !ImGui::IsItemToggledOpen())
175-
m_SelectedEntity = entity;
176-
177-
if (node_open && !(node_flags & ImGuiTreeNodeFlags_Leaf)) {
172+
if (ImGui::TreeNodeEx(name_id.c_str(), node_flags, "%s", name.c_str())) {
178173
// print children
179-
for (const auto child : entity.Get<asset::RelationShip>().GetChildren()) {
180-
print_node(child);
174+
if (!(node_flags & ImGuiTreeNodeFlags_Leaf)) {
175+
for (const auto child : entity.Get<asset::RelationShip>().GetChildren()) {
176+
print_node(child);
177+
}
181178
}
182179
ImGui::TreePop();
183180
}
181+
182+
if (ImGui::IsItemClicked(ImGuiMouseButton_Left) && !ImGui::IsItemToggledOpen()) {
183+
m_SelectedEntity = entity;
184+
}
184185
};
185186

186187
if (scene) print_node(scene->GetRootEntity());
187188

188-
// Add empty row
189-
for (int i = 0; i < std::max(0, 10 - num_row); i++) {
190-
ImGui::TableNextRow(0, ImGui::GetTextLineHeight());
191-
}
189+
// // Add empty row
190+
// for (int i = 0; i < std::max(0, 10 - num_row); i++) {
191+
// ImGui::TableNextRow(0, ImGui::GetTextLineHeight());
192+
// }
192193

193194
ImGui::EndTable();
194195
}
@@ -298,7 +299,7 @@ void Editor::SceneNodeModifier() {
298299
ImGui::Text("No Texture");
299300
}
300301
},
301-
[](math::mat4f& data) {},
302+
[](math::mat4f& _) {},
302303
},
303304
parameter.value);
304305
};

examples/editor/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <tracy/Tracy.hpp>
66

77
auto main(int argc, char** argv) -> int {
8-
#ifdef _DEBUG
8+
#ifdef HITAGI_DEBUG
99
spdlog::set_level(spdlog::level::debug);
1010
#endif
1111

hitagi/asset/include/hitagi/asset/resource.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#pragma once
2-
#include <crossguid/guid.hpp>
2+
#include <hitagi/utils/uuid.hpp>
33

44
#include <string>
55
#include <string_view>
66

77
namespace hitagi::asset {
88
class Resource {
99
public:
10-
enum struct Type {
10+
enum struct Type : std::uint8_t {
1111
Scene,
1212
SceneNode,
1313
Vertex,
@@ -21,7 +21,7 @@ class Resource {
2121
Skeleton,
2222
};
2323

24-
Resource(Type type, std::string_view name = "") : m_Type(type), m_Name(name), m_Guid(xg::Guid()) {}
24+
Resource(Type type, std::string_view name = "") : m_Type(type), m_Name(name), m_UUID(utils::UUID::Create()) {}
2525

2626
Resource(const Resource&);
2727
Resource& operator=(const Resource&);
@@ -31,14 +31,14 @@ class Resource {
3131

3232
inline auto GetType() const noexcept { return m_Type; }
3333
inline auto GetName() const noexcept -> std::string_view { return m_Name; }
34-
inline const auto& GetGuid() const noexcept { return m_Guid; }
34+
inline const auto& GetUUID() const noexcept { return m_UUID; }
3535
auto GetUniqueName() const noexcept -> std::pmr::string;
3636

3737
inline void SetName(std::string_view name) noexcept { m_Name = name; }
3838

3939
protected:
4040
Type m_Type;
4141
std::pmr::string m_Name;
42-
xg::Guid m_Guid;
42+
utils::UUID m_UUID;
4343
};
4444
} // namespace hitagi::asset

hitagi/asset/src/resource.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include <hitagi/asset/resource.hpp>
2-
2+
#include <hitagi/utils/uuid.hpp>
33
#include <fmt/format.h>
44

55
namespace hitagi::asset {
66
Resource::Resource(const Resource& other)
7-
: m_Type(other.m_Type), m_Name(other.m_Name), m_Guid(xg::newGuid()) {
7+
: m_Type(other.m_Type), m_Name(other.m_Name), m_UUID(utils::UUID::Create()) {
88
}
99

1010
Resource& Resource::operator=(const Resource& rhs) {
@@ -16,7 +16,7 @@ Resource& Resource::operator=(const Resource& rhs) {
1616
}
1717

1818
auto Resource::GetUniqueName() const noexcept -> std::pmr::string {
19-
return std::pmr::string{fmt::format("{}-{}", GetName(), GetGuid().str())};
19+
return std::pmr::string{fmt::format("{}-{}", GetName(), GetUUID())};
2020
}
2121

2222
} // namespace hitagi::asset

hitagi/asset/xmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
add_requires("crossguid", "libpng", "assimp", "libjpeg-turbo", "fx-gltf")
1+
-- TODO assimp 5.4.0 can not build with clang-cl now
2+
add_requires("libpng", "assimp 5.3.1", "libjpeg-turbo", "fx-gltf")
23

34
target("asset")
45
set_kind("static")
@@ -9,7 +10,6 @@ target("asset")
910
)
1011
add_includedirs("include", {public = true})
1112
add_deps("core", "math", "gfx", "ecs", "utils")
12-
add_packages("crossguid", {public = true})
1313

1414
target("parser")
1515
set_kind("static")

hitagi/core/xmake.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ target("core")
4141
"thread_manager"
4242
)
4343
add_deps("utils", {public = true})
44-
add_includedirs("include", {public = true})
45-
add_packages("crossguid", {public = true})
44+
add_includedirs("include", {public = true})

hitagi/ecs/include/hitagi/ecs/schedule.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ Schedule& Schedule::Request(std::string_view name, Func&& task, DynamicComponent
181181
std::bitset<traits::args_size> dynamic_component_flags;
182182
[&]<std::size_t... I>(std::index_sequence<I...>) {
183183
static_assert((!(utils::remove_const_pointer_same<detail::decay_parameter_t<typename traits::template arg_t<I - 1>>, std::byte*> &&
184-
Component<detail::decay_parameter_t<typename traits::template arg_t<I>>>)&&...),
184+
Component<detail::decay_parameter_t<typename traits::template arg_t<I>>>) &&
185+
...),
185186
"dynamic parameter pointers must be after component types");
186187
((dynamic_component_flags[I - 1] = utils::remove_const_pointer_same<detail::decay_parameter_t<typename traits::template arg_t<I - 1>>, std::byte*>), ...);
187188
}(utils::make_index_sequence_from_to<1, traits::args_size>{});

hitagi/gfx/src/dx12/dx12_utils.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,8 @@ inline Format get_format(D3D_REGISTER_COMPONENT_TYPE type, BYTE mask) {
11211121
return Format::R32_SINT;
11221122
case D3D_REGISTER_COMPONENT_FLOAT32:
11231123
return Format::R32_FLOAT;
1124+
default:
1125+
return Format::UNKNOWN;
11241126
}
11251127
}
11261128
case 2: {
@@ -1133,6 +1135,8 @@ inline Format get_format(D3D_REGISTER_COMPONENT_TYPE type, BYTE mask) {
11331135
return Format::R32G32_SINT;
11341136
case D3D_REGISTER_COMPONENT_FLOAT32:
11351137
return Format::R32G32_FLOAT;
1138+
default:
1139+
return Format::UNKNOWN;
11361140
}
11371141
}
11381142
case 3: {
@@ -1145,6 +1149,8 @@ inline Format get_format(D3D_REGISTER_COMPONENT_TYPE type, BYTE mask) {
11451149
return Format::R32G32B32_SINT;
11461150
case D3D_REGISTER_COMPONENT_FLOAT32:
11471151
return Format::R32G32B32_FLOAT;
1152+
default:
1153+
return Format::UNKNOWN;
11481154
}
11491155
}
11501156
case 4: {
@@ -1157,6 +1163,8 @@ inline Format get_format(D3D_REGISTER_COMPONENT_TYPE type, BYTE mask) {
11571163
return Format::R32G32B32A32_SINT;
11581164
case D3D_REGISTER_COMPONENT_FLOAT32:
11591165
return Format::R32G32B32A32_FLOAT;
1166+
default:
1167+
return Format::UNKNOWN;
11601168
}
11611169
}
11621170
default:

hitagi/gfx/src/shader_compiler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ inline constexpr auto from_dxc_reflection_attribute(const D3D12_SIGNATURE_PARAME
126126
format = Format::R32G32B32A32_FLOAT;
127127
}
128128
} break;
129+
default: {
130+
format = Format::UNKNOWN;
131+
}
129132
}
130133
return VertexAttribute{
131134
.semantic = std::pmr::string(fmt::format("{}{}", desc.SemanticName, desc.SemanticIndex)),

0 commit comments

Comments
 (0)