From 2379892c02ec8d5696e9f06f05465cfb40185801 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 22 Mar 2022 14:00:36 +0800 Subject: [PATCH] Unify stl (#10427) * replace std::deque and std::queue * replace std::unordered_set * replace std::queue, std::deque and std::unordered_set --- native/CMakeLists.txt | 4 + native/cocos/audio/AudioEngine.cpp | 5 +- native/cocos/base/CoreStd.h | 3 - native/cocos/base/Scheduler.h | 4 +- native/cocos/base/ThreadPool.h | 7 +- .../job-system-dummy/DummyJobGraph.h | 6 +- .../job-system-taskflow/TFJobGraph.h | 3 +- .../job-system/job-system-tbb/TBBJobGraph.h | 3 +- native/cocos/base/memory/StlAlloc.h | 32 ------ native/cocos/base/std/container/deque.h | 39 +++++++ native/cocos/base/std/container/queue.h | 39 +++++++ native/cocos/base/std/container/set.h | 20 ++++ .../cocos/base/std/container/unordered_set.h | 22 ++++ native/cocos/base/std/container/vector.h | 4 +- native/cocos/base/threading/ThreadPool.h | 1 - native/cocos/core/assets/Font.cpp | 2 +- native/cocos/core/assets/Font.h | 14 +-- native/cocos/editor-support/MeshBuffer.h | 2 +- native/cocos/network/Downloader-curl.cpp | 102 +++++++++--------- native/cocos/network/DownloaderImpl-apple.mm | 5 +- native/cocos/network/HttpClient-apple.mm | 1 - native/cocos/network/HttpClient-java.cpp | 3 +- native/cocos/network/HttpClient.cpp | 1 - .../cocos/network/WebSocket-libwebsockets.cpp | 2 +- .../cocos/renderer/frame-graph/FrameGraph.cpp | 4 +- native/cocos/renderer/gfx-agent/DeviceAgent.h | 3 +- .../renderer/gfx-gles2/GLES2CommandBuffer.h | 3 +- .../renderer/gfx-gles3/GLES3CommandBuffer.h | 3 +- .../cocos/renderer/gfx-metal/MTLGPUObjects.h | 6 +- .../renderer/gfx-metal/MTLPipelineState.mm | 5 +- .../renderer/gfx-vulkan/VKCommandBuffer.h | 3 +- .../cocos/renderer/gfx-vulkan/VKCommands.cpp | 4 +- .../cocos/renderer/gfx-vulkan/VKGPUObjects.h | 15 +-- native/cocos/renderer/gfx-wgpu/WGPUBuffer.h | 1 + .../renderer/gfx-wgpu/WGPUCommandBuffer.cpp | 3 +- .../renderer/gfx-wgpu/WGPUCommandBuffer.h | 2 +- native/cocos/renderer/gfx-wgpu/WGPUDef.h | 1 + .../renderer/gfx-wgpu/WGPUDescriptorSet.h | 1 + native/cocos/renderer/gfx-wgpu/WGPUDevice.h | 1 + native/cocos/renderer/gfx-wgpu/WGPUObject.h | 3 +- .../renderer/gfx-wgpu/WGPUPipelineLayout.cpp | 3 +- .../renderer/gfx-wgpu/WGPUPipelineLayout.h | 4 +- .../renderer/gfx-wgpu/WGPUPipelineState.cpp | 3 +- .../renderer/gfx-wgpu/WGPUPipelineState.h | 4 +- .../cocos/renderer/gfx-wgpu/WGPUQueryPool.h | 1 + .../renderer/pipeline/RenderBatchedQueue.h | 3 +- native/cocos/renderer/pipeline/RenderFlow.cpp | 1 + .../renderer/pipeline/RenderInstancedQueue.h | 3 +- 48 files changed, 252 insertions(+), 152 deletions(-) create mode 100644 native/cocos/base/std/container/deque.h create mode 100644 native/cocos/base/std/container/queue.h create mode 100644 native/cocos/base/std/container/set.h create mode 100644 native/cocos/base/std/container/unordered_set.h diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 6d0cd64cb6..f28c84b8e2 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -328,7 +328,11 @@ cocos_source_files( cocos/base/ThreadPool.h cocos/base/TypeDef.h cocos/base/Variant.h + cocos/base/std/container/deque.h + cocos/base/std/container/queue.h + cocos/base/std/container/set.h cocos/base/std/container/vector.h + cocos/base/std/container/unordered_set.h ) ############ application diff --git a/native/cocos/audio/AudioEngine.cpp b/native/cocos/audio/AudioEngine.cpp index 8f41bad067..7a1f6cba3c 100644 --- a/native/cocos/audio/AudioEngine.cpp +++ b/native/cocos/audio/AudioEngine.cpp @@ -28,10 +28,9 @@ #include "base/Log.h" #include "base/Utils.h" #include "platform/FileUtils.h" - +#include "base/std/container/queue.h" #include #include -#include #include #if CC_PLATFORM == CC_PLATFORM_ANDROID @@ -136,7 +135,7 @@ private: } ccstd::vector _workers; - std::queue> _taskQueue; + ccstd::queue> _taskQueue; std::mutex _queueMutex; std::condition_variable _taskCondition; diff --git a/native/cocos/base/CoreStd.h b/native/cocos/base/CoreStd.h index ad0a704bb8..b365ed3fed 100644 --- a/native/cocos/base/CoreStd.h +++ b/native/cocos/base/CoreStd.h @@ -42,14 +42,11 @@ #include #include #include -#include #include #include #include #include #include -#include -#include #include #include #include diff --git a/native/cocos/base/Scheduler.h b/native/cocos/base/Scheduler.h index b3641d0634..4176cf61ec 100644 --- a/native/cocos/base/Scheduler.h +++ b/native/cocos/base/Scheduler.h @@ -31,10 +31,10 @@ #include #include -#include #include #include "base/RefCounted.h" +#include "base/std/container/set.h" #include "base/std/container/vector.h" namespace cc { @@ -250,7 +250,7 @@ public: priority is higher than minPriority will be paused. @since v2.0.0 */ - std::set pauseAllTargetsWithMinPriority(int minPriority); + ccstd::set pauseAllTargetsWithMinPriority(int minPriority); /** Calls a function on the cocos2d thread. Useful when you need to call a cocos2d function from another thread. This function is thread safe. diff --git a/native/cocos/base/ThreadPool.h b/native/cocos/base/ThreadPool.h index f3e72c34fa..37bb1c2c0f 100644 --- a/native/cocos/base/ThreadPool.h +++ b/native/cocos/base/ThreadPool.h @@ -26,16 +26,15 @@ #pragma once -#include "base/Utils.h" - #include #include #include #include #include #include -#include #include +#include "base/std/container/queue.h" +#include "base/Utils.h" namespace cc { @@ -181,7 +180,7 @@ private: } private: - std::queue q; + ccstd::queue q; std::mutex mutex; }; diff --git a/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.h b/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.h index fd51a3aeea..8f298866c3 100644 --- a/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.h +++ b/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.h @@ -25,8 +25,8 @@ #pragma once -#include #include "base/std/container/vector.h" +#include "base/std/container/unordered_set.h" #include "cocos/base/Macros.h" #include "cocos/base/TypeDef.h" @@ -100,8 +100,8 @@ private: void reset(); DummyGraphNodeTaskItf * _callback{nullptr}; - std::unordered_set _successors{}; - std::unordered_set _predecessors{}; + ccstd::unordered_set _successors{}; + ccstd::unordered_set _predecessors{}; DummyGraphNode * _next{nullptr}; int _generation{0}; friend class DummyGraph; diff --git a/native/cocos/base/job-system/job-system-taskflow/TFJobGraph.h b/native/cocos/base/job-system/job-system-taskflow/TFJobGraph.h index 35b64b85c7..7e1c423fff 100644 --- a/native/cocos/base/job-system/job-system-taskflow/TFJobGraph.h +++ b/native/cocos/base/job-system/job-system-taskflow/TFJobGraph.h @@ -26,6 +26,7 @@ #pragma once #include "TFJobSystem.h" +#include "base/std/container/deque.h" #include "taskflow/taskflow.hpp" namespace cc { @@ -57,7 +58,7 @@ private: tf::Executor *_executor = nullptr; tf::Taskflow _flow; - deque _tasks; // existing tasks cannot be invalidated + ccstd::deque _tasks; // existing tasks cannot be invalidated std::future _future; bool _pending = false; diff --git a/native/cocos/base/job-system/job-system-tbb/TBBJobGraph.h b/native/cocos/base/job-system/job-system-tbb/TBBJobGraph.h index 7f39555e72..3b0858c48f 100644 --- a/native/cocos/base/job-system/job-system-tbb/TBBJobGraph.h +++ b/native/cocos/base/job-system/job-system-tbb/TBBJobGraph.h @@ -27,6 +27,7 @@ #include #include "base/std/container/vector.h" +#include "base/std/container/deque.h" namespace cc { @@ -64,7 +65,7 @@ private: tbb::flow::graph _graph; using TBBJobNode = tbb::flow::continue_node; - deque _nodes; // existing nodes cannot be invalidated + ccstd::deque _nodes; // existing nodes cannot be invalidated struct TBBParallelJob { uint predecessor = 0u; diff --git a/native/cocos/base/memory/StlAlloc.h b/native/cocos/base/memory/StlAlloc.h index 774a77ba77..e46a60f8f5 100644 --- a/native/cocos/base/memory/StlAlloc.h +++ b/native/cocos/base/memory/StlAlloc.h @@ -26,44 +26,12 @@ THE SOFTWARE. #pragma once -#include -#include #include -#include -#include #include #include -#include namespace cc { -//template -//using vector = std::vector; - -template -using list = std::list; - -template -using queue = std::queue; - -template ::type, typename P = std::less> -using priority_queue = std::priority_queue; - -template -using deque = std::deque; - -template > -using set = std::set; - -template > -using multiset = std::multiset; - -template , typename P = std::equal_to> -using unordered_set = std::unordered_set; - -template , typename P = std::equal_to> -using unordered_multiset = std::unordered_multiset; - template > using map = std::map; diff --git a/native/cocos/base/std/container/deque.h b/native/cocos/base/std/container/deque.h new file mode 100644 index 0000000000..0ea2256a4f --- /dev/null +++ b/native/cocos/base/std/container/deque.h @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2022 Xiamen Yaji Software Co., Ltd. + + http://www.cocos.com + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated engine source code (the "Software"), a limited, + worldwide, royalty-free, non-assignable, revocable and non-exclusive license + to use Cocos Creator solely to develop games on your target platforms. You shall + not use Cocos Creator software for developing other software or tools that's + used for developing games. You are not granted to publish, distribute, + sublicense, and/or sell copies of Cocos Creator. + + The software or tools in this License Agreement are licensed, not sold. + Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you. + + 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. + ****************************************************************************/ + +#pragma once + +#include +#include "boost/container/pmr/polymorphic_allocator.hpp" + +namespace ccstd { +template +using deque = std::deque; + +namespace pmr { +template +using deque = std::deque>; +} +} // namespace ccstd diff --git a/native/cocos/base/std/container/queue.h b/native/cocos/base/std/container/queue.h new file mode 100644 index 0000000000..66e46ccb84 --- /dev/null +++ b/native/cocos/base/std/container/queue.h @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2022 Xiamen Yaji Software Co., Ltd. + + http://www.cocos.com + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated engine source code (the "Software"), a limited, + worldwide, royalty-free, non-assignable, revocable and non-exclusive license + to use Cocos Creator solely to develop games on your target platforms. You shall + not use Cocos Creator software for developing other software or tools that's + used for developing games. You are not granted to publish, distribute, + sublicense, and/or sell copies of Cocos Creator. + + The software or tools in this License Agreement are licensed, not sold. + Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you. + + 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. + ****************************************************************************/ + +#pragma once + +#include +#include "boost/container/pmr/polymorphic_allocator.hpp" + +namespace ccstd { +template +using queue = std::queue; + +namespace pmr { +template +using queue = std::queue>; +} +} // namespace ccstd diff --git a/native/cocos/base/std/container/set.h b/native/cocos/base/std/container/set.h new file mode 100644 index 0000000000..615b69a83d --- /dev/null +++ b/native/cocos/base/std/container/set.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include "boost/container/pmr/polymorphic_allocator.hpp" + +namespace ccstd { +template < +class Key, +class Compare = std::less +> +using set = std::set; + +namespace pmr { +template < +class Key, +class Compare = std::less +> +using set = std::set>; +} +} // namespace ccstd diff --git a/native/cocos/base/std/container/unordered_set.h b/native/cocos/base/std/container/unordered_set.h new file mode 100644 index 0000000000..f414b3295b --- /dev/null +++ b/native/cocos/base/std/container/unordered_set.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include "boost/container/pmr/polymorphic_allocator.hpp" + +namespace ccstd { +template < +class Key, +class Hash = std::hash, +class KeyEqual = std::equal_to +> +using unordered_set = std::unordered_set; + +namespace pmr { +template < +class Key, +class Hash = std::hash, +class KeyEqual = std::equal_to +> +using unordered_set = std::unordered_set>; +} +} // namespace ccstd diff --git a/native/cocos/base/std/container/vector.h b/native/cocos/base/std/container/vector.h index aa84e952fa..6ad980ac12 100644 --- a/native/cocos/base/std/container/vector.h +++ b/native/cocos/base/std/container/vector.h @@ -29,11 +29,11 @@ #include "boost/container/pmr/polymorphic_allocator.hpp" namespace ccstd { -template +template using vector = std::vector; namespace pmr { -template +template using vector = std::vector>; } } // namespace ccstd diff --git a/native/cocos/base/threading/ThreadPool.h b/native/cocos/base/threading/ThreadPool.h index bae735ee79..926878f066 100644 --- a/native/cocos/base/threading/ThreadPool.h +++ b/native/cocos/base/threading/ThreadPool.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "Event.h" #include "concurrentqueue/concurrentqueue.h" diff --git a/native/cocos/core/assets/Font.cpp b/native/cocos/core/assets/Font.cpp index b4b4660ea5..11a8f8fc47 100644 --- a/native/cocos/core/assets/Font.cpp +++ b/native/cocos/core/assets/Font.cpp @@ -62,7 +62,7 @@ FontFaceInfo::FontFaceInfo(uint32_t size, uint32_t width, uint32_t height) } } -FontFaceInfo::FontFaceInfo(uint32_t size, uint32_t width, uint32_t height, std::vector chars) +FontFaceInfo::FontFaceInfo(uint32_t size, uint32_t width, uint32_t height, ccstd::vector chars) : fontSize(size), textureWidth(width), textureHeight(height), preLoadedCharacters(std::move(chars)) { CCASSERT(math::IsPowerOfTwo(width) && math::IsPowerOfTwo(height), "Font texture size must be power of 2."); } diff --git a/native/cocos/core/assets/Font.h b/native/cocos/core/assets/Font.h index 6bd87c1626..bc56d75c84 100644 --- a/native/cocos/core/assets/Font.h +++ b/native/cocos/core/assets/Font.h @@ -25,7 +25,7 @@ #pragma once #include -#include +#include "base/std/container/vector.h" #include "core/assets/Asset.h" namespace cc { @@ -80,13 +80,13 @@ struct KerningHash { struct FontFaceInfo { explicit FontFaceInfo(uint32_t size); FontFaceInfo(uint32_t size, uint32_t width, uint32_t height); - FontFaceInfo(uint32_t size, uint32_t width, uint32_t height, std::vector chars); + FontFaceInfo(uint32_t size, uint32_t width, uint32_t height, ccstd::vector chars); // only used in freetype, for bitmap font, fontSize is determined by file. uint32_t fontSize{1U}; uint32_t textureWidth{DEFAULT_FREETYPE_TEXTURE_SIZE}; uint32_t textureHeight{DEFAULT_FREETYPE_TEXTURE_SIZE}; - std::vector preLoadedCharacters; + ccstd::vector preLoadedCharacters; //~ }; @@ -108,7 +108,7 @@ public: inline Font * getFont() const { return _font; } inline uint32_t getFontSize() const { return _fontSize; } inline uint32_t getLineHeight() const { return _lineHeight; } - inline const std::vector &getTextures() const { return _textures; } + inline const ccstd::vector &getTextures() const { return _textures; } inline gfx::Texture * getTexture(uint32_t page) const { return _textures[page]; } inline uint32_t getTextureWidth() const { return _textureWidth; } inline uint32_t getTextureHeight() const { return _textureHeight; } @@ -121,7 +121,7 @@ protected: uint32_t _lineHeight{0U}; std::unordered_map _glyphs; std::unordered_map _kernings; - std::vector _textures; + ccstd::vector _textures; uint32_t _textureWidth{0U}; uint32_t _textureHeight{0U}; }; @@ -142,7 +142,7 @@ public: inline FontType getType() const { return _type; } inline const std::string & getPath() const { return _path; } - inline const std::vector &getData() const { return _data; } + inline const ccstd::vector &getData() const { return _data; } inline FontFace * getFace(uint32_t fontSize) { return _faces[fontSize]; } void releaseFaces(); @@ -151,7 +151,7 @@ protected: FontType _type{FontType::INVALID}; std::string _path; - std::vector _data; + ccstd::vector _data; std::unordered_map _faces; }; diff --git a/native/cocos/editor-support/MeshBuffer.h b/native/cocos/editor-support/MeshBuffer.h index d585517197..24baebba31 100644 --- a/native/cocos/editor-support/MeshBuffer.h +++ b/native/cocos/editor-support/MeshBuffer.h @@ -25,7 +25,7 @@ #pragma once -#include +#include "base/std/container/vector.h" #include "IOBuffer.h" #include "IOTypedArray.h" diff --git a/native/cocos/network/Downloader-curl.cpp b/native/cocos/network/Downloader-curl.cpp index 7701a95b77..5aaa803538 100644 --- a/native/cocos/network/Downloader-curl.cpp +++ b/native/cocos/network/Downloader-curl.cpp @@ -28,12 +28,13 @@ #include #include -#include -#include #include #include "application/ApplicationManager.h" #include "base/Scheduler.h" +#include "base/std/container/set.h" +#include "base/std/container/deque.h" +#include "base/std/container/vector.h" #include "platform/FileUtils.h" #include "network/Downloader.h" @@ -49,7 +50,6 @@ namespace cc { namespace network { -using namespace std; //////////////////////////////////////////////////////////////////////////////// // Implementation DownloadTaskCURL @@ -59,7 +59,7 @@ class DownloadTaskCURL : public IDownloadTask { // if more than one task write to one file, cause file broken // so use a set to check this situation - static set _sStoragePathSet; + static ccstd::set _sStoragePathSet; public: int serialId; @@ -84,7 +84,7 @@ public: DLLOG("Destruct DownloadTaskCURL %p", this); } - bool init(const string &filename, const string &tempSuffix) { + bool init(const std::string &filename, const std::string &tempSuffix) { if (0 == filename.length()) { // data task _buf.reserve(CURL_MAX_WRITE_SIZE); @@ -109,9 +109,9 @@ public: // open temp file handle for write bool ret = false; do { - string dir; + std::string dir; size_t found = _tempFileName.find_last_of("/\\"); - if (found == string::npos) { + if (found == std::string::npos) { _errCode = DownloadTask::ERROR_INVALID_PARAMS; _errCodeInternal = 0; _errDescription = "Can't find dirname in storagePath."; @@ -146,19 +146,19 @@ public: } void initProc() { - lock_guard lock(_mutex); + std::lock_guard lock(_mutex); _initInternal(); } void setErrorProc(int code, int codeInternal, const char *desc) { - lock_guard lock(_mutex); + std::lock_guard lock(_mutex); _errCode = code; _errCodeInternal = codeInternal; _errDescription = desc; } size_t writeDataProc(unsigned char *buffer, size_t size, size_t count) { - lock_guard lock(_mutex); + std::lock_guard lock(_mutex); size_t ret = 0; if (_fp) { ret = fwrite(buffer, size, count, _fp); @@ -182,14 +182,14 @@ private: friend class DownloaderCURL; // for lock object instance - mutex _mutex; + std::mutex _mutex; // header info bool _acceptRanges; bool _headerAchieved; int64_t _totalBytesExpected; - string _header; // temp buffer for receive header string, only used in thread proc + std::string _header; // temp buffer for receive header string, only used in thread proc // progress int64_t _bytesReceived; @@ -198,12 +198,12 @@ private: // error int _errCode; int _errCodeInternal; - string _errDescription; + std::string _errDescription; // for saving data - string _fileName; - string _tempFileName; - vector _buf; + std::string _fileName; + std::string _tempFileName; + ccstd::vector _buf; FILE * _fp; void _initInternal() { @@ -219,14 +219,14 @@ private: } }; int DownloadTaskCURL::_sSerialId; -set DownloadTaskCURL::_sStoragePathSet; +ccstd::set DownloadTaskCURL::_sStoragePathSet; -typedef pair, DownloadTaskCURL *> TaskWrapper; +typedef std::pair, DownloadTaskCURL *> TaskWrapper; //////////////////////////////////////////////////////////////////////////////// // Implementation DownloaderCURL::Impl // This class shared by DownloaderCURL and work thread. -class DownloaderCURL::Impl : public enable_shared_from_this { +class DownloaderCURL::Impl : public std::enable_shared_from_this { public: DownloaderHints hints; @@ -242,42 +242,42 @@ public: void addTask(std::shared_ptr task, DownloadTaskCURL *coTask) { if (DownloadTask::ERROR_NO_ERROR == coTask->_errCode) { - lock_guard lock(_requestMutex); + std::lock_guard lock(_requestMutex); _requestQueue.push_back(make_pair(task, coTask)); } else { - lock_guard lock(_finishedMutex); + std::lock_guard lock(_finishedMutex); _finishedQueue.push_back(make_pair(task, coTask)); } } void run() { - lock_guard lock(_threadMutex); + std::lock_guard lock(_threadMutex); if (false == _thread.joinable()) { - thread newThread(&DownloaderCURL::Impl::_threadProc, this); + std::thread newThread(&DownloaderCURL::Impl::_threadProc, this); _thread.swap(newThread); } } void stop() { - lock_guard lock(_threadMutex); + std::lock_guard lock(_threadMutex); if (_thread.joinable()) { _thread.detach(); } } bool stoped() { - lock_guard lock(_threadMutex); + std::lock_guard lock(_threadMutex); return false == _thread.joinable() ? true : false; } - void getProcessTasks(vector &outList) { - lock_guard lock(_processMutex); + void getProcessTasks(ccstd::vector &outList) { + std::lock_guard lock(_processMutex); outList.reserve(_processSet.size()); outList.insert(outList.end(), _processSet.begin(), _processSet.end()); } - void getFinishedTasks(vector &outList) { - lock_guard lock(_finishedMutex); + void getFinishedTasks(ccstd::vector &outList) { + std::lock_guard lock(_finishedMutex); outList.reserve(_finishedQueue.size()); outList.insert(outList.end(), _finishedQueue.begin(), _finishedQueue.end()); _finishedQueue.clear(); @@ -383,7 +383,7 @@ private: break; } - bool acceptRanges = (string::npos != coTask._header.find("Accept-Ranges")) ? true : false; + bool acceptRanges = (std::string::npos != coTask._header.find("Accept-Ranges")) ? true : false; // get current file size int64_t fileSize = 0; @@ -392,7 +392,7 @@ private: } // set header info to coTask - lock_guard lock(coTask._mutex); + std::lock_guard lock(coTask._mutex); coTask._totalBytesExpected = (int64_t)contentLen; coTask._acceptRanges = acceptRanges; if (acceptRanges && fileSize > 0) { @@ -411,7 +411,7 @@ private: DLLOG("++++DownloaderCURL::Impl::_threadProc begin %p", this); // the holder prevent DownloaderCURL::Impl class instance be destruct in main thread auto holder = this->shared_from_this(); - auto thisThreadId = this_thread::get_id(); + auto thisThreadId = std::this_thread::get_id(); uint32_t countOfMaxProcessingTasks = this->hints.countOfMaxProcessingTasks; // init curl content CURLM * curlmHandle = curl_multi_init(); @@ -423,7 +423,7 @@ private: do { // check the thread should exit or not { - lock_guard lock(_threadMutex); + std::lock_guard lock(_threadMutex); // if the Impl stoped, this->_thread.reset will be called, thus _thread.get_id() not equal with thisThreadId if (thisThreadId != this->_thread.get_id()) { break; @@ -456,7 +456,7 @@ private: // do wait action if (maxfd == -1) { - this_thread::sleep_for(chrono::milliseconds(CC_CURL_POLL_TIMEOUT_MS)); + std::this_thread::sleep_for(std::chrono::milliseconds(CC_CURL_POLL_TIMEOUT_MS)); rc = 0; } else { struct timeval timeout; @@ -543,7 +543,7 @@ private: // remove from _processSet { - lock_guard lock(_processMutex); + std::lock_guard lock(_processMutex); if (_processSet.end() != _processSet.find(wrapper)) { _processSet.erase(wrapper); } @@ -551,7 +551,7 @@ private: // add to finishedQueue { - lock_guard lock(_finishedMutex); + std::lock_guard lock(_finishedMutex); _finishedQueue.push_back(wrapper); } } @@ -564,7 +564,7 @@ private: // get task wrapper from request queue TaskWrapper wrapper; { - lock_guard lock(_requestMutex); + std::lock_guard lock(_requestMutex); if (_requestQueue.size()) { wrapper = _requestQueue.front(); _requestQueue.pop_front(); @@ -583,7 +583,7 @@ private: if (nullptr == curlHandle) { wrapper.second->setErrorProc(DownloadTask::ERROR_IMPL_INTERNAL, 0, "Alloc curl handle failed."); - lock_guard lock(_finishedMutex); + std::lock_guard lock(_finishedMutex); _finishedQueue.push_back(wrapper); continue; } @@ -595,14 +595,14 @@ private: mcode = curl_multi_add_handle(curlmHandle, curlHandle); if (CURLM_OK != mcode) { wrapper.second->setErrorProc(DownloadTask::ERROR_IMPL_INTERNAL, mcode, curl_multi_strerror(mcode)); - lock_guard lock(_finishedMutex); + std::lock_guard lock(_finishedMutex); _finishedQueue.push_back(wrapper); continue; } DLLOG(" _threadProc task create curl handle:%p", curlHandle); coTaskMap[curlHandle] = wrapper; - lock_guard lock(_processMutex); + std::lock_guard lock(_processMutex); _processSet.insert(wrapper); } } while (coTaskMap.size()); @@ -612,15 +612,15 @@ private: DLLOG("----DownloaderCURL::Impl::_threadProc end"); } - thread _thread; - deque _requestQueue; - set _processSet; - deque _finishedQueue; + std::thread _thread; + ccstd::deque _requestQueue; + ccstd::set _processSet; + ccstd::deque _finishedQueue; - mutex _threadMutex; - mutex _requestMutex; - mutex _processMutex; - mutex _finishedMutex; + std::mutex _threadMutex; + std::mutex _requestMutex; + std::mutex _processMutex; + std::mutex _finishedMutex; }; //////////////////////////////////////////////////////////////////////////////// @@ -649,7 +649,7 @@ DownloaderCURL::DownloaderCURL(const DownloaderHints &hints) _schedulerKey = key; if (auto sche = _scheduler.lock()) { - sche->schedule(bind(&DownloaderCURL::_onSchedule, this, placeholders::_1), + sche->schedule(std::bind(&DownloaderCURL::_onSchedule, this, std::placeholders::_1), this, 0.1f, true, @@ -688,7 +688,7 @@ void DownloaderCURL::abort(const std::unique_ptr &task) { } void DownloaderCURL::_onSchedule(float) { - vector tasks; + ccstd::vector tasks; // update processing tasks _impl->getProcessTasks(tasks); @@ -696,7 +696,7 @@ void DownloaderCURL::_onSchedule(float) { const DownloadTask &task = *wrapper.first; DownloadTaskCURL & coTask = *wrapper.second; - lock_guard lock(coTask._mutex); + std::lock_guard lock(coTask._mutex); if (coTask._bytesReceived) { _currTask = &coTask; onTaskProgress(task, diff --git a/native/cocos/network/DownloaderImpl-apple.mm b/native/cocos/network/DownloaderImpl-apple.mm index 2db701349c..6eb21dae78 100644 --- a/native/cocos/network/DownloaderImpl-apple.mm +++ b/native/cocos/network/DownloaderImpl-apple.mm @@ -25,9 +25,8 @@ ****************************************************************************/ #include "network/DownloaderImpl-apple.h" -#include #import - +#include "base/std/container/queue.h" #include "network/Downloader.h" #include "base/UTF8.h" @@ -53,7 +52,7 @@ @interface DownloaderAppleImpl : NSObject { const cc::network::DownloaderApple *_outer; cc::network::DownloaderHints _hints; - std::queue _taskQueue; + ccstd::queue _taskQueue; } @property (nonatomic, strong) NSURLSession *downloadSession; @property (nonatomic, strong) NSMutableDictionary *taskDict; // ocTask: DownloadTaskWrapper diff --git a/native/cocos/network/HttpClient-apple.mm b/native/cocos/network/HttpClient-apple.mm index 3f1373c46b..59b5cdf33f 100644 --- a/native/cocos/network/HttpClient-apple.mm +++ b/native/cocos/network/HttpClient-apple.mm @@ -28,7 +28,6 @@ #include "network/HttpClient.h" -#include #include #import "network/HttpAsynConnection-apple.h" diff --git a/native/cocos/network/HttpClient-java.cpp b/native/cocos/network/HttpClient-java.cpp index d18eea0ea8..b94a6e8855 100644 --- a/native/cocos/network/HttpClient-java.cpp +++ b/native/cocos/network/HttpClient-java.cpp @@ -30,12 +30,11 @@ #include #include -#include #include #include "application/ApplicationManager.h" #include "platform/FileUtils.h" #include "platform/java/jni/JniHelper.h" - +#include "base/std/container/queue.h" #include "base/Log.h" #include "base/UTF8.h" diff --git a/native/cocos/network/HttpClient.cpp b/native/cocos/network/HttpClient.cpp index 77dc0df8ba..9629cee416 100644 --- a/native/cocos/network/HttpClient.cpp +++ b/native/cocos/network/HttpClient.cpp @@ -29,7 +29,6 @@ #include "network/HttpClient.h" #include #include -#include #include "application/ApplicationManager.h" #include "base/Log.h" #include "base/memory/Memory.h" diff --git a/native/cocos/network/WebSocket-libwebsockets.cpp b/native/cocos/network/WebSocket-libwebsockets.cpp index 65099d5080..b08d1c81d7 100644 --- a/native/cocos/network/WebSocket-libwebsockets.cpp +++ b/native/cocos/network/WebSocket-libwebsockets.cpp @@ -50,11 +50,11 @@ #include #include // for std::shared_ptr #include -#include #include #include #include "application/ApplicationManager.h" #include "base/Scheduler.h" +#include "base/std/container/queue.h" #include "network/Uri.h" #include "network/WebSocket.h" diff --git a/native/cocos/renderer/frame-graph/FrameGraph.cpp b/native/cocos/renderer/frame-graph/FrameGraph.cpp index 54a81170df..c7bbc0c372 100644 --- a/native/cocos/renderer/frame-graph/FrameGraph.cpp +++ b/native/cocos/renderer/frame-graph/FrameGraph.cpp @@ -27,10 +27,10 @@ #include #include -#include #include "PassNodeBuilder.h" #include "Resource.h" #include "base/StringUtil.h" +#include "base/std/container/set.h" #include "frame-graph/ResourceEntry.h" namespace cc { @@ -377,7 +377,7 @@ void FrameGraph::computeStoreActionAndMemoryless() { lastPassSubpassEnable = passNode->_subpass && !passNode->_subpassEnd; } - static std::set renderTargets; + static ccstd::set renderTargets; renderTargets.clear(); for (const auto &passNode : _passNodes) { diff --git a/native/cocos/renderer/gfx-agent/DeviceAgent.h b/native/cocos/renderer/gfx-agent/DeviceAgent.h index a0ff8b63be..be5f03a72e 100644 --- a/native/cocos/renderer/gfx-agent/DeviceAgent.h +++ b/native/cocos/renderer/gfx-agent/DeviceAgent.h @@ -26,6 +26,7 @@ #pragma once #include "base/Agent.h" +#include "base/std/container/unordered_set.h" #include "base/threading/Semaphore.h" #include "gfx-base/GFXDevice.h" @@ -117,7 +118,7 @@ protected: uint32_t _currentIndex = 0U; Semaphore _frameBoundarySemaphore{MAX_CPU_FRAME_AHEAD}; - unordered_set _cmdBuffRefs; + ccstd::unordered_set _cmdBuffRefs; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h index 0715bcdd5e..31238a7e08 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h @@ -26,6 +26,7 @@ #pragma once #include "GLES2Std.h" +#include "base/std/container/queue.h" #include "gfx-base/GFXCommandBuffer.h" namespace cc { @@ -79,7 +80,7 @@ protected: GLES2GPUCommandAllocator *_cmdAllocator = nullptr; GLES2CmdPackage * _curCmdPackage = nullptr; - queue _pendingPackages, _freePackages; + ccstd::queue _pendingPackages, _freePackages; uint32_t _curSubpassIdx = 0U; GLES2GPUPipelineState * _curGPUPipelineState = nullptr; diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h index 1143ad884b..9e492f2c9f 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h @@ -26,6 +26,7 @@ #pragma once #include "GLES3Std.h" +#include "base/std/container/queue.h" #include "gfx-base/GFXCommandBuffer.h" namespace cc { @@ -82,7 +83,7 @@ protected: GLES3GPUCommandAllocator *_cmdAllocator = nullptr; GLES3CmdPackage * _curCmdPackage = nullptr; - queue _pendingPackages, _freePackages; + ccstd::queue _pendingPackages, _freePackages; uint32_t _curSubpassIdx = 0U; GLES3GPUPipelineState * _curGPUPipelineState = nullptr; diff --git a/native/cocos/renderer/gfx-metal/MTLGPUObjects.h b/native/cocos/renderer/gfx-metal/MTLGPUObjects.h index cc21ab2a93..204b32e883 100644 --- a/native/cocos/renderer/gfx-metal/MTLGPUObjects.h +++ b/native/cocos/renderer/gfx-metal/MTLGPUObjects.h @@ -25,8 +25,6 @@ #pragma once -#import - #import #import #import @@ -36,6 +34,8 @@ #import "MTLConfig.h" #import "MTLDevice.h" #import "MTLUtils.h" +#include "base/std/container/queue.h" + namespace cc { namespace gfx { class CCMTLBuffer; @@ -326,7 +326,7 @@ public: protected: //avoid cross-reference with CCMTLDevice std::function _getFrameIndex; - std::queue _releaseQueue[MAX_FRAMES_IN_FLIGHT]; + ccstd::queue _releaseQueue[MAX_FRAMES_IN_FLIGHT]; }; struct CCMTLGPUSwapChainObject { diff --git a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm index 4a73c30208..727cc2316c 100644 --- a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm +++ b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ +#import "base/std/container/set.h" #import "MTLStd.h" - #import "MTLDevice.h" #import "MTLGPUObjects.h" #import "MTLPipelineLayout.h" @@ -35,7 +35,6 @@ #import "MTLTexture.h" #import "MTLUtils.h" - #import #import #import @@ -274,7 +273,7 @@ void CCMTLPipelineState::setMTLFunctionsAndFormats(MTLRenderPipelineDescriptor * bindingIndices.reserve(outputNum); bindingOffsets.reserve(outputNum); MTLPixelFormat mtlPixelFormat; - std::set inputs; + ccstd::set inputs; uint32_t depthStencilTexIndex = INVALID_BINDING; if (!subpasses.empty()) { for (size_t passIndex = 0; passIndex < subpasses.size(); ++passIndex) { diff --git a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h index 48f5d9fffe..6d960e1355 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h +++ b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h @@ -25,6 +25,7 @@ #pragma once +#include "base/std/container/queue.h" #include "gfx-base/GFXCommandBuffer.h" #include "VKGPUObjects.h" @@ -96,7 +97,7 @@ protected: ccstd::vector _imageMemoryBarriers; ccstd::vector _vkCommandBuffers; - queue _pendingQueue; + ccstd::queue _pendingQueue; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp index 97b200af4e..d8685e46e7 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include - +#include "base/std/container/unordered_set.h" #include "VKStd.h" #include "VKCommands.h" @@ -341,7 +341,7 @@ private: return !memcmp(&lhs.srcSubpass, &rhs.srcSubpass, size); } }; - unordered_set _hashes; + ccstd::unordered_set _hashes; }; void cmdFuncCCVKCreateRenderPass(CCVKDevice *device, CCVKGPURenderPass *gpuRenderPass) { diff --git a/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h b/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h index 013ebc430c..21ac88dbf3 100644 --- a/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h +++ b/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h @@ -27,6 +27,7 @@ #include "VKStd.h" #include "VKUtils.h" +#include "base/std/container/unordered_set.h" #define TBB_USE_EXCEPTIONS 0 // no-rtti for now #include "tbb/concurrent_unordered_map.h" @@ -239,7 +240,7 @@ struct CCVKGPUCommandBuffer { VkCommandBufferLevel level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; uint32_t queueFamilyIndex = 0U; bool began = false; - mutable unordered_set recordedBuffers; + mutable ccstd::unordered_set recordedBuffers; }; struct CCVKGPUQueue { @@ -381,7 +382,7 @@ public: CCVKGPUGeneralBarrier defaultColorBarrier; CCVKGPUGeneralBarrier defaultDepthStencilBarrier; - unordered_set swapchains; + ccstd::unordered_set swapchains; CCVKGPUCommandBufferPool *getCommandBufferPool(); CCVKGPUDescriptorSetPool *getDescriptorSetPool(uint32_t layoutID); @@ -603,7 +604,7 @@ private: struct DescriptorSetPool { VkDescriptorPool vkPool = VK_NULL_HANDLE; - unordered_set activeSets; + ccstd::unordered_set activeSets; ccstd::vector freeSets; }; ccstd::vector _pools; @@ -865,7 +866,7 @@ private: } } - using DescriptorSetList = unordered_set; + using DescriptorSetList = ccstd::unordered_set; CCVKGPUDevice * _device = nullptr; ccstd::vector _setsToBeUpdated; @@ -1043,7 +1044,7 @@ private: template struct DescriptorInfo { - unordered_set sets; + ccstd::unordered_set sets; CachedArray descriptors; }; @@ -1298,8 +1299,8 @@ public: inline void cancel(CCVKGPUTexture *gpuTexture) { _texturesToBeChecked.erase(gpuTexture); } private: - unordered_set _buffersToBeChecked; - unordered_set _texturesToBeChecked; + ccstd::unordered_set _buffersToBeChecked; + ccstd::unordered_set _texturesToBeChecked; CCVKGPUDevice * _device = nullptr; }; diff --git a/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h b/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h index 9f0e1afc1e..fbbc912132 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h @@ -27,6 +27,7 @@ #include #include #include "gfx-base/GFXBuffer.h" +#include "base/std/container/vector.h" namespace cc { namespace gfx { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp index 55f4f92b4d..ecba7b625a 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp @@ -26,6 +26,7 @@ #include "WGPUCommandBuffer.h" #include #include +#include "base/std/container/vector.h" #include "WGPUBuffer.h" #include "WGPUDescriptorSet.h" #include "WGPUDescriptorSetLayout.h" @@ -269,7 +270,7 @@ void CCWGPUCommandBuffer::bindStates() { return; } - std::set setInUse; + ccstd::set setInUse; for (const auto &descriptorSet : _gpuCommandBufferObj->stateCache.descriptorSets) { setInUse.insert(descriptorSet.index); } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h index 7e5085e012..e9e481ff81 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h @@ -26,9 +26,9 @@ #pragma once #include #include -#include #include #include "gfx-base/GFXCommandBuffer.h" +#include "base/std/container/vector.h" namespace cc { namespace gfx { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDef.h b/native/cocos/renderer/gfx-wgpu/WGPUDef.h index a408d770e6..db86bc2614 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDef.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDef.h @@ -1,6 +1,7 @@ #pragma once #include #include "../gfx-base/GFXDef-common.h" +#include "base/std/container/vector.h" namespace cc { namespace gfx { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h index 439a25dd63..2c2e42a9b1 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h @@ -27,6 +27,7 @@ #include #include +#include "base/std/container/vector.h" #include "gfx-base/GFXDescriptorSet.h" namespace cc { namespace gfx { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDevice.h b/native/cocos/renderer/gfx-wgpu/WGPUDevice.h index 192ac4207d..6e5d2ae52d 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDevice.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDevice.h @@ -32,6 +32,7 @@ #include #include #include "WGPUDef.h" +#include "base/std/container/vector.h" #include "gfx-base/GFXDevice.h" #define EMSArraysToU8Vec(v, i) (emscripten::convertJSArrayToNumberVector(v[i])) diff --git a/native/cocos/renderer/gfx-wgpu/WGPUObject.h b/native/cocos/renderer/gfx-wgpu/WGPUObject.h index b9b56b77e8..e7e42e94bb 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUObject.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUObject.h @@ -28,6 +28,7 @@ #include #include "WGPUDef.h" #include "base/Utils.h" +#include "base/std/container/vector.h" #include "gfx-base/GFXDef.h" class WGPURenderPassDescriptor; @@ -156,7 +157,7 @@ struct CCWGPUBindGroupLayoutObject { struct CCWGPUBindGroupObject { WGPUBindGroup bindgroup = wgpuDefaultHandle; ccstd::vector bindGroupEntries; - std::set bindingSet; + ccstd::set bindingSet; }; struct CCWGPUPipelineLayoutObject { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp index 02a482bcdf..53887624a4 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp @@ -25,6 +25,7 @@ #include "WGPUPipelineLayout.h" #include +#include "base/std/container/vector.h" #include "WGPUDescriptorSetLayout.h" #include "WGPUDevice.h" #include "WGPUObject.h" @@ -41,7 +42,7 @@ void CCWGPUPipelineLayout::doInit(const PipelineLayoutInfo &info) { _gpuPipelineLayoutObj = CC_NEW(CCWGPUPipelineLayoutObject); } -void CCWGPUPipelineLayout::prepare(const std::set &setInUse) { +void CCWGPUPipelineLayout::prepare(const ccstd::set &setInUse) { ccstd::vector layouts; // _bgLayouts.clear(); for (size_t i = 0; i < _setLayouts.size(); i++) { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h index 73f91d3253..5cd33872bf 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h @@ -25,7 +25,7 @@ #pragma once #include -#include +#include "base/std/container/set.h" #include "gfx-base/GFXPipelineLayout.h" namespace cc { @@ -41,7 +41,7 @@ public: inline CCWGPUPipelineLayoutObject *gpuPipelineLayoutObject() { return _gpuPipelineLayoutObj; } //bindgroup not ready yet so delay creation - void prepare(const std::set &setInUse); + void prepare(const ccstd::set &setInUse); // const ccstd::vector & layouts()const{return _bgLayouts;} diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp index 20e2ce9831..07eec96df3 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp @@ -26,6 +26,7 @@ #include "WGPUPipelineState.h" #include #include +#include "base/std/container/vector.h" #include "WGPUDescriptorSetLayout.h" #include "WGPUDevice.h" #include "WGPUObject.h" @@ -53,7 +54,7 @@ void CCWGPUPipelineState::check(RenderPass *renderPass) { } } -void CCWGPUPipelineState::prepare(const std::set &setInUse) { +void CCWGPUPipelineState::prepare(const ccstd::set &setInUse) { auto *pipelineLayout = static_cast(_pipelineLayout); const DepthStencilAttachment &dsAttachment = _renderPass->getDepthStencilAttachment(); diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h index 8fb1ccae45..87903dfa66 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.h @@ -25,7 +25,7 @@ #pragma once #include -#include +#include "base/std/container/set.h" #include "gfx-base/GFXPipelineState.h" namespace cc { @@ -42,7 +42,7 @@ public: void check(RenderPass *renderPass); - void prepare(const std::set &setInUse); + void prepare(const ccstd::set &setInUse); void *ppl() const { return _ppl; } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h b/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h index 6c02b08ff8..b54767b212 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h @@ -26,6 +26,7 @@ #pragma once #include "gfx-base/GFXQueryPool.h" +#include "base/std/container/vector.h" namespace cc { namespace gfx { diff --git a/native/cocos/renderer/pipeline/RenderBatchedQueue.h b/native/cocos/renderer/pipeline/RenderBatchedQueue.h index bbfc9e3569..4d26d2d63f 100644 --- a/native/cocos/renderer/pipeline/RenderBatchedQueue.h +++ b/native/cocos/renderer/pipeline/RenderBatchedQueue.h @@ -25,6 +25,7 @@ #pragma once +#include "base/std/container/unordered_set.h" #include "gfx-base/GFXDef.h" namespace cc { @@ -44,7 +45,7 @@ public: bool empty() { return _queues.empty(); } private: - unordered_set _queues; + ccstd::unordered_set _queues; }; } // namespace pipeline diff --git a/native/cocos/renderer/pipeline/RenderFlow.cpp b/native/cocos/renderer/pipeline/RenderFlow.cpp index df0c60dd6f..17bc8aa930 100644 --- a/native/cocos/renderer/pipeline/RenderFlow.cpp +++ b/native/cocos/renderer/pipeline/RenderFlow.cpp @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ +#include #include "RenderFlow.h" #include "RenderStage.h" diff --git a/native/cocos/renderer/pipeline/RenderInstancedQueue.h b/native/cocos/renderer/pipeline/RenderInstancedQueue.h index 67990d1645..1d58948cc6 100644 --- a/native/cocos/renderer/pipeline/RenderInstancedQueue.h +++ b/native/cocos/renderer/pipeline/RenderInstancedQueue.h @@ -25,6 +25,7 @@ #pragma once +#include "base/std/container/unordered_set.h" #include "base/CoreStd.h" namespace cc { @@ -51,7 +52,7 @@ public: bool empty() { return _queues.empty(); } private: - unordered_set _queues; + ccstd::unordered_set _queues; }; } // namespace pipeline