From 8bc73161345f72dbbfca9b52f0db8d7880da7f5d Mon Sep 17 00:00:00 2001 From: Lveyou <1339484752@qq.com> Date: Mon, 27 Apr 2026 01:51:11 +0800 Subject: [PATCH] 1 --- dl/CMakeLists.txt | 6 ------ dl/math/dl_algorithm.h | 2 +- dl/memory/dl_crypto.cpp | 2 +- dl/render/dl_light.cpp | 2 +- dl/vk/dl_vk.h | 7 ++++++- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dl/CMakeLists.txt b/dl/CMakeLists.txt index 95939581..97beda89 100644 --- a/dl/CMakeLists.txt +++ b/dl/CMakeLists.txt @@ -66,12 +66,6 @@ endif() include_directories(${CMAKE_SOURCE_DIR}/dl) # linux 无法识别上面的头文件目录 -# 防止windows不识别头文件修改 -target_include_directories(${PROJECT_NAME} - PRIVATE - ${CMAKE_SOURCE_DIR}/dl -) - if (CMAKE_SYSTEM_NAME MATCHES "Windows") #set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 23) endif() diff --git a/dl/math/dl_algorithm.h b/dl/math/dl_algorithm.h index c859aed7..77b78532 100644 --- a/dl/math/dl_algorithm.h +++ b/dl/math/dl_algorithm.h @@ -404,7 +404,7 @@ void split_no_empty(const T& container, V delimiter, std::vector& ret) else { //分隔符位置 - auto iter_find = find(iter_begin, container.end(), delimiter); + auto iter_find = std::find(iter_begin, container.end(), delimiter); if (iter_find == container.end()) {//分隔符 未找到(说明字符串读完了,最后没有分隔符的情况) diff --git a/dl/memory/dl_crypto.cpp b/dl/memory/dl_crypto.cpp index 1721a046..190354af 100644 --- a/dl/memory/dl_crypto.cpp +++ b/dl/memory/dl_crypto.cpp @@ -295,7 +295,7 @@ dl::Buffer DecryptAes256(BufferView buf, const Aes256Key& key) { return {}; } - std::array HashSha256(BufferView buf) + std::array HashSha256(BufferView buf) { return {}; } diff --git a/dl/render/dl_light.cpp b/dl/render/dl_light.cpp index ad085e15..7cba337f 100644 --- a/dl/render/dl_light.cpp +++ b/dl/render/dl_light.cpp @@ -18,7 +18,7 @@ void LightDir::RenderDebug(const Position3& pos) Color col = createColor(_s, 1.0f); // 绘制向量 - Position3 v = Math::Normalize(std::as_const(_d)); + Position3 v = Math::Normalize(dl::as_const(_d)); Position3 p1 = pos + v * 1.0f; g_gfx->SetColor(col); diff --git a/dl/vk/dl_vk.h b/dl/vk/dl_vk.h index 2451108e..7bf4539e 100644 --- a/dl/vk/dl_vk.h +++ b/dl/vk/dl_vk.h @@ -103,7 +103,7 @@ constexpr size_t NUM_MAX_FRAME_IN_FLIGHT = 2; // 最大图元数 constexpr size_t NUM_MAX_PRIMITIVE = 1024; // 最大材质数(ubMaterial) -constexpr size_t NUM_MAX_MATERIAL = 50; +constexpr size_t NUM_MAX_MATERIAL = 256; // 最大骨骼实例(ubBone) constexpr size_t NUM_MAX_BONE = 128; // 单个实例最大骨骼数(ubBone[96])与shader一致 @@ -633,6 +633,11 @@ public: return i; } size_t id = _allMaterial.size(); + if (id >= NUM_MAX_MATERIAL) + { + log_warn("材质数超过上限!"); + return 0; + } void* data; vkMapMemory(_device, _ubMaterialMemory[id], 0, sizeof(m), 0, &data); memcpy(data, &m, sizeof(m));