diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 34a107f3d9..6d0cd64cb6 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -328,6 +328,7 @@ cocos_source_files( cocos/base/ThreadPool.h cocos/base/TypeDef.h cocos/base/Variant.h + cocos/base/std/container/vector.h ) ############ application diff --git a/native/cocos/3d/assets/Mesh.cpp b/native/cocos/3d/assets/Mesh.cpp index df538d27fc..905d36c695 100644 --- a/native/cocos/3d/assets/Mesh.cpp +++ b/native/cocos/3d/assets/Mesh.cpp @@ -278,7 +278,7 @@ void Mesh::initialize() { gfx::Device * gfxDevice = gfx::Device::getInstance(); auto vertexBuffers = createVertexBuffers(gfxDevice, buffer.buffer()); gfx::BufferList indexBuffers; - std::vector> subMeshes; + ccstd::vector> subMeshes; for (size_t i = 0; i < _struct.primitives.size(); i++) { auto &prim = _struct.primitives[i]; @@ -381,7 +381,7 @@ Mesh::BoneSpaceBounds Mesh::getBoneSpaceBounds(Skeleton *skeleton) { } Vec3 v32; BoneSpaceBounds & bounds = _boneSpaceBounds[skeleton->getHash()]; - std::vector valid; + ccstd::vector valid; const auto & bindposes = skeleton->getBindposes(); valid.reserve(bindposes.size()); for (size_t i = 0; i < bindposes.size(); i++) { @@ -528,7 +528,7 @@ bool Mesh::merge(Mesh *mesh, const Mat4 *worldMatrix /* = nullptr */, bool valid bool hasAttr = false; - std::vector vertexBundles; + ccstd::vector vertexBundles; vertexBundles.resize(_struct.vertexBundles.size()); for (size_t i = 0; i < _struct.vertexBundles.size(); ++i) { @@ -604,7 +604,7 @@ bool Mesh::merge(Mesh *mesh, const Mat4 *worldMatrix /* = nullptr */, bool valid uint32_t idxStride = 2; uint32_t vertBatchCount = 0; - std::vector primitives; + ccstd::vector primitives; primitives.resize(_struct.primitives.size()); for (size_t i = 0; i < _struct.primitives.size(); ++i) { @@ -937,7 +937,7 @@ void Mesh::updateSubMesh(index_t primitiveIndex, const IDynamicGeometry &geometr return; } - std::vector buffers; + ccstd::vector buffers; if (!geometry.positions.empty()) { buffers.push_back(&geometry.positions); } diff --git a/native/cocos/3d/assets/Mesh.h b/native/cocos/3d/assets/Mesh.h index e2f12b7620..3fbe69eeea 100644 --- a/native/cocos/3d/assets/Mesh.h +++ b/native/cocos/3d/assets/Mesh.h @@ -25,7 +25,6 @@ #pragma once -#include #include "3d/assets/MorphRendering.h" #include "3d/assets/Types.h" #include "cocos/base/Optional.h" @@ -83,7 +82,7 @@ public: * @en The vertex bundle references used by the sub mesh. * @zh 此子网格引用的顶点块,索引至网格的顶点块数组。 */ - std::vector vertexBundelIndices; + ccstd::vector vertexBundelIndices; /** * @en The primitive mode of the sub mesh @@ -136,7 +135,7 @@ public: * @en dynamic submesh bounds * @zh 动态子模型包围盒。 */ - std::vector bounds; + ccstd::vector bounds; }; /** @@ -148,13 +147,13 @@ public: * @en All vertex bundles of the mesh * @zh 此网格所有的顶点块。 */ - std::vector vertexBundles; + ccstd::vector vertexBundles; /** * @en All sub meshes * @zh 此网格的所有子网格。 */ - std::vector primitives; + ccstd::vector primitives; /** * @en The minimum position of all vertices in the mesh @@ -173,7 +172,7 @@ public: * @zh 此网格使用的关节索引映射关系列表,数组长度应为子模型中实际使用到的所有关节, * 每个元素都对应一个原骨骼资源里的索引,按子模型 VB 内的实际索引排列。 */ - cc::optional>> jointMaps; + cc::optional>> jointMaps; /** * @en The morph information of the mesh @@ -272,13 +271,13 @@ public: */ void setHash(uint64_t hash) { _hash = hash; } - using JointBufferIndicesType = std::vector; + using JointBufferIndicesType = ccstd::vector; /** * The index of the joint buffer of all sub meshes in the joint map buffers */ const JointBufferIndicesType &getJointBufferIndices(); - using RenderingSubMeshList = std::vector>; + using RenderingSubMeshList = ccstd::vector>; /** * @en The sub meshes for rendering. Mesh could be split into different sub meshes for rendering. * @zh 此网格创建的渲染网格。 @@ -325,7 +324,7 @@ public: */ void reset(ICreateInfo &&info); - using BoneSpaceBounds = std::vector>; + using BoneSpaceBounds = ccstd::vector>; /** * @en Get [[AABB]] bounds in the skeleton's bone space * @zh 获取骨骼变换空间内下的 [[AABB]] 包围盒 diff --git a/native/cocos/3d/assets/Morph.h b/native/cocos/3d/assets/Morph.h index b46a65bd14..165d848960 100644 --- a/native/cocos/3d/assets/Morph.h +++ b/native/cocos/3d/assets/Morph.h @@ -72,7 +72,7 @@ public: */ virtual void adaptPipelineState(index_t subMeshIndex, gfx::DescriptorSet *descriptorSet) = 0; - virtual std::vector requiredPatches(index_t subMeshIndex) = 0; + virtual ccstd::vector requiredPatches(index_t subMeshIndex) = 0; /** * Destroy the rendering instance. diff --git a/native/cocos/3d/assets/MorphRendering.cpp b/native/cocos/3d/assets/MorphRendering.cpp index 16948b4a5e..e8a5c62606 100644 --- a/native/cocos/3d/assets/MorphRendering.cpp +++ b/native/cocos/3d/assets/MorphRendering.cpp @@ -50,12 +50,12 @@ public: * Set weights of each morph target. * @param weights The weights. */ - virtual void setWeights(const std::vector &weights) = 0; + virtual void setWeights(const ccstd::vector &weights) = 0; /** * Asks the define overrides needed to do the rendering. */ - virtual std::vector requiredPatches() = 0; + virtual ccstd::vector requiredPatches() = 0; /** * Adapts the pipelineState to apply the rendering. @@ -168,7 +168,7 @@ struct CpuMorphAttributeTarget { Float32Array displacements; }; -using CpuMorphAttributeTargetList = std::vector; +using CpuMorphAttributeTargetList = ccstd::vector; struct CpuMorphAttribute { std::string name; @@ -297,7 +297,7 @@ public: return _remoteBuffer; } - void setWeights(const std::vector &weights) { + void setWeights(const ccstd::vector &weights) { CC_ASSERT(weights.size() == _targetCount); for (size_t iWeight = 0; iWeight < weights.size(); ++iWeight) { _localBuffer->setFloat32(static_cast(pipeline::UBOMorph::OFFSET_OF_WEIGHTS + 4 * iWeight), weights[iWeight]); @@ -329,10 +329,10 @@ public: explicit CpuComputing(Mesh *mesh, uint32_t subMeshIndex, const Morph *morph, gfx::Device *gfxDevice); SubMeshMorphRenderingInstance * createInstance() override; - const std::vector &getData() const; + const ccstd::vector &getData() const; private: - std::vector _attributes; + ccstd::vector _attributes; gfx::Device * _gfxDevice{nullptr}; }; @@ -348,7 +348,7 @@ private: const SubMeshMorph * _subMeshMorph{nullptr}; uint32_t _textureWidth{0}; uint32_t _textureHeight{0}; - std::vector _attributes; + ccstd::vector _attributes; uint32_t _verticesCount{0}; friend class GpuComputingRenderingInstance; @@ -369,7 +369,7 @@ public: } } - void setWeights(const std::vector &weights) override { + void setWeights(const ccstd::vector &weights) override { for (size_t iAttribute = 0; iAttribute < _attributes.size(); ++iAttribute) { const auto & myAttribute = _attributes[iAttribute]; Float32Array &valueView = myAttribute.morphTexture->getValueView(); @@ -398,7 +398,7 @@ public: } } - std::vector requiredPatches() override { + ccstd::vector requiredPatches() override { return { {"CC_MORPH_TARGET_USE_TEXTURE", true}, {"CC_MORPH_PRECOMPUTED", true}, @@ -436,7 +436,7 @@ public: } private: - std::vector _attributes; + ccstd::vector _attributes; IntrusivePtr _owner; IntrusivePtr _morphUniforms; }; @@ -452,12 +452,12 @@ public: _attributes = &_owner->_attributes; } - void setWeights(const std::vector &weights) override { + void setWeights(const ccstd::vector &weights) override { _morphUniforms->setWeights(weights); _morphUniforms->commit(); } - std::vector requiredPatches() override { + ccstd::vector requiredPatches() override { return { {"CC_MORPH_TARGET_USE_TEXTURE", true}, }; @@ -490,7 +490,7 @@ public: } private: - std::vector *_attributes{nullptr}; + ccstd::vector *_attributes{nullptr}; IntrusivePtr _owner; IntrusivePtr _morphUniforms; }; @@ -528,7 +528,7 @@ SubMeshMorphRenderingInstance *CpuComputing::createInstance() { _gfxDevice); } -const std::vector &CpuComputing::getData() const { +const ccstd::vector &CpuComputing::getData() const { return _attributes; } @@ -626,7 +626,7 @@ public: } } - std::vector requiredPatches(index_t subMeshIndex) override { + ccstd::vector requiredPatches(index_t subMeshIndex) override { CC_ASSERT(_owner->_mesh->getStruct().morph.has_value()); const auto &subMeshMorphOpt = _owner->_mesh->getStruct().morph.value().subMeshMorphs[subMeshIndex]; auto * subMeshRenderingInstance = _subMeshInstances[subMeshIndex].get(); @@ -635,7 +635,7 @@ public: } const auto &subMeshMorph = subMeshMorphOpt.value(); - std::vector patches{ + ccstd::vector patches{ {"CC_USE_MORPH", true}, {"CC_MORPH_TARGET_COUNT", static_cast(subMeshMorph.targets.size())}}; @@ -681,7 +681,7 @@ public: private: IntrusivePtr _owner; - std::vector> _subMeshInstances; + ccstd::vector> _subMeshInstances; }; StdMorphRendering::StdMorphRendering(Mesh *mesh, gfx::Device *gfxDevice) { diff --git a/native/cocos/3d/assets/MorphRendering.h b/native/cocos/3d/assets/MorphRendering.h index 4644e3e63a..9c4c55c49c 100644 --- a/native/cocos/3d/assets/MorphRendering.h +++ b/native/cocos/3d/assets/MorphRendering.h @@ -45,7 +45,7 @@ public: private: Mesh * _mesh{nullptr}; - std::vector> _subMeshRenderings; + ccstd::vector> _subMeshRenderings; CC_DISALLOW_COPY_MOVE_ASSIGN(StdMorphRendering); diff --git a/native/cocos/3d/assets/Skeleton.cpp b/native/cocos/3d/assets/Skeleton.cpp index ba5772c069..41312aefb0 100644 --- a/native/cocos/3d/assets/Skeleton.cpp +++ b/native/cocos/3d/assets/Skeleton.cpp @@ -32,9 +32,9 @@ namespace cc { -const std::vector &Skeleton::getInverseBindposes() { +const ccstd::vector &Skeleton::getInverseBindposes() { if (!_invBindposes.has_value()) { - _invBindposes = std::vector{}; + _invBindposes = ccstd::vector{}; for (const auto &bindpose : _bindposes) { _invBindposes.value().emplace_back(bindpose.getInversed()); } diff --git a/native/cocos/3d/assets/Skeleton.h b/native/cocos/3d/assets/Skeleton.h index a168520de7..c88a1fb2aa 100644 --- a/native/cocos/3d/assets/Skeleton.h +++ b/native/cocos/3d/assets/Skeleton.h @@ -42,11 +42,11 @@ public: * @en The path of all bones, the length always equals the length of [[bindposes]] * @zh 所有关节的路径。该数组的长度始终与 [[bindposes]] 的长度相同。 */ - inline const std::vector &getJoints() const { + inline const ccstd::vector &getJoints() const { return _joints; } - inline void setJoints(const std::vector &value) { + inline void setJoints(const ccstd::vector &value) { _joints = value; } @@ -54,11 +54,11 @@ public: * @en The bind poses matrix of all bones, the length always equals the length of [[joints]] * @zh 所有关节的绑定姿势矩阵。该数组的长度始终与 [[joints]] 的长度相同。 */ - const std::vector &getBindposes() const { + const ccstd::vector &getBindposes() const { return _bindposes; } - void setBindposes(const std::vector &value) { + void setBindposes(const ccstd::vector &value) { _bindposes = value; } @@ -66,7 +66,7 @@ public: * @en Gets the inverse bind poses matrix * @zh 获取反向绑定姿势矩阵 */ - const std::vector &getInverseBindposes(); + const ccstd::vector &getInverseBindposes(); /** * @en Gets the hash of the skeleton asset @@ -83,9 +83,9 @@ public: bool validate() const override; private: - std::vector _joints; - std::vector _bindposes; - cc::optional> _invBindposes; + ccstd::vector _joints; + ccstd::vector _bindposes; + cc::optional> _invBindposes; uint64_t _hash{0}; }; diff --git a/native/cocos/3d/assets/Types.h b/native/cocos/3d/assets/Types.h index 84dfd0e6dc..a6d73d0ac6 100644 --- a/native/cocos/3d/assets/Types.h +++ b/native/cocos/3d/assets/Types.h @@ -27,7 +27,6 @@ #include #include -#include #include "cocos/base/Optional.h" #include "core/TypedArray.h" namespace cc { @@ -39,7 +38,7 @@ struct IMeshBufferView { uint32_t stride{0}; }; -using MeshWeightsType = std::vector; +using MeshWeightsType = ccstd::vector; /** * @en Array views for index buffer @@ -70,19 +69,19 @@ struct MorphTarget { /** * Displacement of each target attribute. */ - std::vector displacements; + ccstd::vector displacements; }; struct SubMeshMorph { /** * Attributes to morph. */ - std::vector attributes; + ccstd::vector attributes; /** * Targets. */ - std::vector targets; + ccstd::vector targets; /** * Initial weights of each target. @@ -94,7 +93,7 @@ struct Morph { /** * Morph data of each sub-mesh. */ - std::vector> subMeshMorphs; + ccstd::vector> subMeshMorphs; /** * Common initial weights of each sub-mesh. @@ -105,7 +104,7 @@ struct Morph { * Name of each target of each sub-mesh morph. * This field is only meaningful if every sub-mesh has the same number of targets. */ - cc::optional> targetNames; + cc::optional> targetNames; }; } // namespace cc diff --git a/native/cocos/3d/misc/Buffer.h b/native/cocos/3d/misc/Buffer.h index 66493cfb0c..cdfaf96265 100644 --- a/native/cocos/3d/misc/Buffer.h +++ b/native/cocos/3d/misc/Buffer.h @@ -34,7 +34,7 @@ namespace cc { // default params behaviors just like on an plain, compact Float32Array template void writeBuffer(DataView & target, - const std::vector &data, + const ccstd::vector &data, const gfx::Format & format = gfx::Format::R32F, uint32_t offset = 0, uint32_t stride = 0) { diff --git a/native/cocos/3d/misc/BufferBlob.h b/native/cocos/3d/misc/BufferBlob.h index be923a6a38..fb3521ab90 100644 --- a/native/cocos/3d/misc/BufferBlob.h +++ b/native/cocos/3d/misc/BufferBlob.h @@ -24,8 +24,8 @@ ****************************************************************************/ #pragma once -#include #include "cocos/base/Variant.h" +#include "cocos/base/std/container/vector.h" #include "core/ArrayBuffer.h" namespace cc { @@ -41,7 +41,7 @@ public: ArrayBuffer::Ptr getCombined(); private: - std::vector> _arrayBufferOrPaddings; + ccstd::vector> _arrayBufferOrPaddings; uint32_t _length{0}; }; diff --git a/native/cocos/3d/misc/CreateMesh.cpp b/native/cocos/3d/misc/CreateMesh.cpp index eda2d982dc..c0ef16cc50 100644 --- a/native/cocos/3d/misc/CreateMesh.cpp +++ b/native/cocos/3d/misc/CreateMesh.cpp @@ -33,15 +33,15 @@ Mesh::ICreateInfo MeshUtils::createMeshInfo(const IGeometry &geometry, const ICr uint32_t stride = 0; struct Channel { uint32_t offset{0}; - std::vector data; // float? + ccstd::vector data; // float? gfx::Attribute attribute; }; - std::vector channels; + ccstd::vector channels; uint32_t vertCount = 0; const gfx::Attribute *attr = nullptr; - std::vector positions(geometry.positions); + ccstd::vector positions(geometry.positions); if (!positions.empty()) { attr = nullptr; @@ -190,7 +190,7 @@ Mesh::ICreateInfo MeshUtils::createMeshInfo(const IGeometry &geometry, const ICr uint32_t idxCount = 0; const uint32_t idxStride = 2; if (geometry.indices.has_value()) { - const std::vector &indices = geometry.indices.value(); + const ccstd::vector &indices = geometry.indices.value(); idxCount = static_cast(indices.size()); indexBuffer = new ArrayBuffer(idxStride * idxCount); DataView indexBufferView(indexBuffer); @@ -303,8 +303,8 @@ Mesh::ICreateInfo MeshUtils::createDynamicMeshInfo(const IDynamicGeometry &geome } } - std::vector vertexBundles; - std::vector primitives; + ccstd::vector vertexBundles; + ccstd::vector primitives; uint32_t dataSize = 0U; for (auto i = 0U; i < options.maxSubMeshes; i++) { diff --git a/native/cocos/3d/models/BakedSkinningModel.cpp b/native/cocos/3d/models/BakedSkinningModel.cpp index c3c2bc9056..d1f1468732 100644 --- a/native/cocos/3d/models/BakedSkinningModel.cpp +++ b/native/cocos/3d/models/BakedSkinningModel.cpp @@ -39,7 +39,7 @@ const cc::gfx::SamplerInfo JOINT_TEXTURE_SAMPLER_INFO{ cc::gfx::Address::CLAMP, }; -std::vector myPatches{ +ccstd::vector myPatches{ {"CC_USE_SKINNING", true}, {"CC_USE_BAKED_ANIMATION", true}}; @@ -155,7 +155,7 @@ void BakedSkinningModel::applyJointTexture(const cc::optional &BakedSkinningModel::getMacroPatches(index_t subModelIndex) { +ccstd::vector &BakedSkinningModel::getMacroPatches(index_t subModelIndex) { auto &patches = Super::getMacroPatches(subModelIndex); patches.reserve(patches.size() + myPatches.size()); patches.insert(std::end(patches), std::begin(myPatches), std::end(myPatches)); @@ -176,7 +176,7 @@ void BakedSkinningModel::updateLocalDescriptors(index_t subModelIndex, gfx::Desc } } -void BakedSkinningModel::updateInstancedAttributes(const std::vector &attributes, scene::Pass *pass) { +void BakedSkinningModel::updateInstancedAttributes(const ccstd::vector &attributes, scene::Pass *pass) { Super::updateInstancedAttributes(attributes, pass); _instAnimInfoIdx = getInstancedAttributeIndex(INST_JOINT_ANIM_INFO); updateInstancedJointTextureInfo(); @@ -201,7 +201,7 @@ void BakedSkinningModel::syncAnimInfoForJS(gfx::Buffer *buffer, const Float32Arr _jointMedium.animInfo.dirtyForJSB = &dirty[0]; } -void BakedSkinningModel::syncDataForJS(const std::vector> &boundsInfo, +void BakedSkinningModel::syncDataForJS(const ccstd::vector> &boundsInfo, const cc::optional & modelBound, float jointTextureInfo0, float jointTextureInfo1, diff --git a/native/cocos/3d/models/BakedSkinningModel.h b/native/cocos/3d/models/BakedSkinningModel.h index 5f3601c90b..0484c0307e 100644 --- a/native/cocos/3d/models/BakedSkinningModel.h +++ b/native/cocos/3d/models/BakedSkinningModel.h @@ -45,7 +45,7 @@ struct BakedJointInfo { Float32Array jointTextureInfo; cc::optional texture; IAnimInfo animInfo; - std::vector> boundsInfo; + ccstd::vector> boundsInfo; }; class BakedSkinningModel final : public MorphModel { @@ -56,11 +56,11 @@ public: void destroy() override; - std::vector &getMacroPatches(index_t subModelIndex) override; + ccstd::vector &getMacroPatches(index_t subModelIndex) override; void updateLocalDescriptors(index_t subModelIndex, gfx::DescriptorSet *descriptorSet) override; void updateTransform(uint32_t stamp) override; void updateUBOs(uint32_t stamp) override; - void updateInstancedAttributes(const std::vector &attributes, scene::Pass *pass) override; + void updateInstancedAttributes(const ccstd::vector &attributes, scene::Pass *pass) override; void updateInstancedJointTextureInfo(); // void uploadAnimation(AnimationClip *anim); // TODO(xwx): AnimationClip not define @@ -75,7 +75,7 @@ public: } void syncAnimInfoForJS(gfx::Buffer *buffer, const Float32Array &data, Uint8Array &dirty); - void syncDataForJS(const std::vector> &boundsInfo, + void syncDataForJS(const ccstd::vector> &boundsInfo, const cc::optional & modelBound, float jointTextureInfo0, float jointTextureInfo1, diff --git a/native/cocos/3d/models/MorphModel.cpp b/native/cocos/3d/models/MorphModel.cpp index 8ca14908a9..b3670638af 100644 --- a/native/cocos/3d/models/MorphModel.cpp +++ b/native/cocos/3d/models/MorphModel.cpp @@ -27,7 +27,7 @@ namespace cc { -std::vector &MorphModel::getMacroPatches(index_t subModelIndex) { +ccstd::vector &MorphModel::getMacroPatches(index_t subModelIndex) { if (_morphRenderingInstance) { _macroPatches = _morphRenderingInstance->requiredPatches(subModelIndex); return _macroPatches; diff --git a/native/cocos/3d/models/MorphModel.h b/native/cocos/3d/models/MorphModel.h index 400844b2e9..e4a59e7750 100644 --- a/native/cocos/3d/models/MorphModel.h +++ b/native/cocos/3d/models/MorphModel.h @@ -25,7 +25,6 @@ #pragma once #include -#include #include "3d/assets/Morph.h" #include "scene/Define.h" #include "scene/Model.h" @@ -40,7 +39,7 @@ public: ~MorphModel() override = default; CC_DISALLOW_COPY_MOVE_ASSIGN(MorphModel); - std::vector &getMacroPatches(index_t subModelIndex) override; + ccstd::vector &getMacroPatches(index_t subModelIndex) override; void initSubModel(index_t idx, RenderingSubMesh *subMeshData, Material *mat) override; void destroy() override; void setSubModelMaterial(index_t idx, Material *mat) override; diff --git a/native/cocos/3d/models/SkinningModel.cpp b/native/cocos/3d/models/SkinningModel.cpp index 14d8e3934e..36624a9377 100644 --- a/native/cocos/3d/models/SkinningModel.cpp +++ b/native/cocos/3d/models/SkinningModel.cpp @@ -36,7 +36,7 @@ #include "scene/RenderScene.h" namespace { -void getRelevantBuffers(std::vector &outIndices, std::vector &outBuffers, const std::vector> &jointMaps, int32_t targetJoint) { +void getRelevantBuffers(ccstd::vector &outIndices, ccstd::vector &outBuffers, const ccstd::vector> &jointMaps, int32_t targetJoint) { for (int32_t i = 0; i < jointMaps.size(); i++) { index_t index = CC_INVALID_INDEX; for (int32_t j = 0; j < jointMaps[i].size(); j++) { @@ -52,7 +52,7 @@ void getRelevantBuffers(std::vector &outIndices, std::vector & } } -std::vector myPatches{{"CC_USE_SKINNING", true}}; +ccstd::vector myPatches{{"CC_USE_SKINNING", true}}; } // namespace namespace cc { @@ -98,8 +98,8 @@ void SkinningModel::bindSkeleton(Skeleton *skeleton, Node *skinningRoot, Mesh *m auto * transform = cc::getTransform(target, skinningRoot); const Mat4 & bindPose = skeleton->getBindposes()[index]; - std::vector indices; - std::vector buffers; + ccstd::vector indices; + ccstd::vector buffers; if (!jointMaps.has_value()) { indices.emplace_back(index); buffers.emplace_back(0); @@ -171,7 +171,7 @@ void SkinningModel::initSubModel(index_t idx, RenderingSubMesh *subMeshData, Mat iaInfo.vertexBuffers = original; } -std::vector &SkinningModel::getMacroPatches(index_t subModelIndex) { +ccstd::vector &SkinningModel::getMacroPatches(index_t subModelIndex) { auto &patches = Super::getMacroPatches(subModelIndex); patches.reserve(myPatches.size() + patches.size()); patches.insert(std::begin(patches), std::begin(myPatches), std::end(myPatches)); @@ -193,7 +193,7 @@ void SkinningModel::updateLocalDescriptors(index_t submodelIdx, gfx::DescriptorS } } -void SkinningModel::updateInstancedAttributes(const std::vector &attributes, scene::Pass *pass) { +void SkinningModel::updateInstancedAttributes(const ccstd::vector &attributes, scene::Pass *pass) { if (pass->getBatchingScheme() != scene::BatchingSchemes::NONE) { // TODO(holycanvas): #9203 better to print the complete path instead of only the current node debug::warnID(3936, getNode()->getName()); diff --git a/native/cocos/3d/models/SkinningModel.h b/native/cocos/3d/models/SkinningModel.h index e398cfb25c..903061ef9e 100644 --- a/native/cocos/3d/models/SkinningModel.h +++ b/native/cocos/3d/models/SkinningModel.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "3d/models/MorphModel.h" #include "core/animation/SkeletalAnimationUtils.h" #include "math/Mat4.h" @@ -44,8 +43,8 @@ struct JointInfo { Node * target{nullptr}; Mat4 bindpose; IJointTransform * transform{nullptr}; - std::vector buffers; - std::vector indices; + ccstd::vector buffers; + ccstd::vector indices; }; class SkinningModel final : public MorphModel { @@ -60,8 +59,8 @@ public: void destroy() override; void initSubModel(index_t idx, RenderingSubMesh *subMeshData, Material *mat) override; - std::vector &getMacroPatches(index_t subModelIndex) override; - void updateInstancedAttributes(const std::vector &attributes, scene::Pass *pass) override; + ccstd::vector &getMacroPatches(index_t subModelIndex) override; + void updateInstancedAttributes(const ccstd::vector &attributes, scene::Pass *pass) override; void bindSkeleton(Skeleton *skeleton, Node *skinningRoot, Mesh *mesh); @@ -69,10 +68,10 @@ private: static void uploadJointData(uint32_t base, const Mat4 &mat, float *dst); void ensureEnoughBuffers(index_t count); - std::vector _bufferIndices; - std::vector> _buffers; - std::vector _joints; - std::vector *> _dataArray; + ccstd::vector _bufferIndices; + ccstd::vector> _buffers; + ccstd::vector _joints; + ccstd::vector *> _dataArray; CC_DISALLOW_COPY_MOVE_ASSIGN(SkinningModel); }; diff --git a/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.cpp b/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.cpp index 350e01327c..f6cda54bfc 100644 --- a/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.cpp +++ b/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.cpp @@ -157,7 +157,7 @@ void JointTexturePool::clear() { _textureBuffers.clear(); } -void JointTexturePool::registerCustomTextureLayouts(const std::vector &layouts) { +void JointTexturePool::registerCustomTextureLayouts(const ccstd::vector &layouts) { for (const auto &layout : layouts) { auto chunkIdx = static_cast(_customPool->createChunk(layout.textureLength)); for (const auto &content : layout.contents) { @@ -177,8 +177,8 @@ cc::optional JointTexturePool::getDefaultPoseTexture(Skel texture = _textureBuffers[hash]; } - const std::vector &joints = skeleton->getJoints(); - const std::vector & bindPoses = skeleton->getBindposes(); + const ccstd::vector &joints = skeleton->getJoints(); + const ccstd::vector & bindPoses = skeleton->getBindposes(); Float32Array textureBuffer; bool buildTexture = false; auto jointCount = static_cast(joints.size()); @@ -231,7 +231,7 @@ cc::optional JointTexturePool::getDefaultPoseTexture(Skel } } - std::vector bounds; + ccstd::vector bounds; texture.value()->bounds[static_cast(mesh->getHash())] = bounds; geometry::AABB::fromPoints(v3Min, v3Max, &bounds[0]); if (buildTexture) { @@ -253,8 +253,8 @@ cc::optional JointTexturePool::getDefaultPoseTexture(Skel // return texture; // } // } -// const std::vector &joints = skeleton->getJoints(); -// const std::vector & bindPoses = skeleton->getBindposes(); +// const ccstd::vector &joints = skeleton->getJoints(); +// const ccstd::vector & bindPoses = skeleton->getBindposes(); // // const clipData = SkelAnimDataHub.getOrExtract(clip); // // const { frames } = clipData; // Float32Array textureBuffer; @@ -286,7 +286,7 @@ cc::optional JointTexturePool::getDefaultPoseTexture(Skel // texture->refCount++; // } // auto boneSpaceBounds = mesh->getBoneSpaceBounds(skeleton); -// std::vector bounds; +// ccstd::vector bounds; // texture->bounds[mesh->getHash()] = bounds; // // for (uint32_t f = 0; f < frames; ++f) { // TODO(xwx): frames not define diff --git a/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.h b/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.h index 2d8a72d28c..0ed8aa023f 100644 --- a/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.h +++ b/native/cocos/3d/skeletal-animation/SkeletalAnimationUtils.h @@ -43,17 +43,17 @@ class Mesh; // _chunkIdxMap[key] = skeleton ^ clips[i] struct IChunkContent { uint64_t skeleton{0}; - std::vector clips; + ccstd::vector clips; }; struct ICustomJointTextureLayout { uint32_t textureLength{0}; - std::vector contents; + ccstd::vector contents; }; struct IInternalJointAnimInfo { cc::optional downstream; // downstream default pose, if present - cc::optional> curveData; // the nearest animation curve, if present + cc::optional> curveData; // the nearest animation curve, if present index_t bindposeIdx{0}; // index of the actual bindpose to use cc::optional bindposeCorrection; // correction factor from the original bindpose }; @@ -66,8 +66,8 @@ public: uint64_t skeletonHash{0}; bool readyToBeDeleted{false}; ITextureBufferHandle handle; - std::unordered_map> bounds; - cc::optional> animInfos; + std::unordered_map> bounds; + cc::optional> animInfos; static IJointTextureHandle *createJoinTextureHandle() { return new IJointTextureHandle(); @@ -87,7 +87,7 @@ public: void clear(); - void registerCustomTextureLayouts(const std::vector &layouts); + void registerCustomTextureLayouts(const ccstd::vector &layouts); /** * @en diff --git a/native/cocos/application/ApplicationManager.h b/native/cocos/application/ApplicationManager.h index e2505c8210..e6af6447e2 100644 --- a/native/cocos/application/ApplicationManager.h +++ b/native/cocos/application/ApplicationManager.h @@ -26,8 +26,7 @@ #pragma once #include -#include - +#include "base/std/container/vector.h" #include "application/BaseApplication.h" namespace cc { @@ -65,7 +64,7 @@ public: private: std::weak_ptr _currentApp; - std::vector _apps; + ccstd::vector _apps; }; } // namespace cc diff --git a/native/cocos/audio/AudioEngine.cpp b/native/cocos/audio/AudioEngine.cpp index 66af0e3d30..e18513e98d 100644 --- a/native/cocos/audio/AudioEngine.cpp +++ b/native/cocos/audio/AudioEngine.cpp @@ -71,7 +71,7 @@ AudioEngineImpl * AudioEngine::sAudioE float AudioEngine::sVolumeFactor = 1.0F; uint32_t AudioEngine::sOnPauseListenerID = 0; uint32_t AudioEngine::sOnResumeListenerID = 0; -std::vector AudioEngine::sBreakAudioID; +ccstd::vector AudioEngine::sBreakAudioID; AudioEngine::AudioEngineThreadPool *AudioEngine::sThreadPool = nullptr; bool AudioEngine::sIsEnabled = true; @@ -135,7 +135,7 @@ private: } } - std::vector _workers; + ccstd::vector _workers; std::queue> _taskQueue; std::mutex _queueMutex; diff --git a/native/cocos/audio/android/AudioDecoder.cpp b/native/cocos/audio/android/AudioDecoder.cpp index 7aae3ef26b..0d5b9a63d7 100644 --- a/native/cocos/audio/android/AudioDecoder.cpp +++ b/native/cocos/audio/android/AudioDecoder.cpp @@ -66,7 +66,7 @@ long AudioDecoder::fileTell(void *datasource) { AudioDecoder::AudioDecoder() : _fileCurrPos(0), _sampleRate(-1) { - auto pcmBuffer = std::make_shared>(); + auto pcmBuffer = std::make_shared>(); pcmBuffer->reserve(4096); _result.pcmBuffer = pcmBuffer; } @@ -150,7 +150,7 @@ bool AudioDecoder::resample() { ALOGV("resample() %zu output frames", outputFrames); - std::vector Ovalues; + ccstd::vector Ovalues; if (Ovalues.empty()) { Ovalues.push_back(static_cast(outputFrames)); @@ -211,7 +211,7 @@ bool AudioDecoder::resample() { _result.numFrames = static_cast(outputFrames); _result.sampleRate = outFrameRate; - auto buffer = std::make_shared>(); + auto buffer = std::make_shared>(); buffer->reserve(_result.numFrames * _result.bitsPerSample / 8); buffer->insert(buffer->end(), (char *)convert, (char *)convert + outputFrames * channels * sizeof(int16_t)); @@ -232,7 +232,7 @@ bool AudioDecoder::interleave() { } else if (_result.numChannels == 1) { // If it's a mono audio, try to compose a fake stereo buffer size_t newBufferSize = _result.pcmBuffer->size() * 2; - auto newBuffer = std::make_shared>(); + auto newBuffer = std::make_shared>(); newBuffer->reserve(newBufferSize); size_t totalFrameSizeInBytes = (size_t)(_result.numFrames * _result.bitsPerSample / 8); diff --git a/native/cocos/audio/android/AudioEngine-inl.cpp b/native/cocos/audio/android/AudioEngine-inl.cpp index 40165c9ead..84ffb878b7 100644 --- a/native/cocos/audio/android/AudioEngine-inl.cpp +++ b/native/cocos/audio/android/AudioEngine-inl.cpp @@ -306,7 +306,7 @@ void AudioEngineImpl::stopAll() { // Create a temporary vector for storing all players since // p->stop() will trigger _audioPlayers.erase, // and it will cause a crash as it's already in for loop - std::vector players; + ccstd::vector players; players.reserve(_audioPlayers.size()); for (const auto &e : _audioPlayers) { diff --git a/native/cocos/audio/android/AudioMixerController.cpp b/native/cocos/audio/android/AudioMixerController.cpp index 9ed9dd217e..ecbf0e81c7 100644 --- a/native/cocos/audio/android/AudioMixerController.cpp +++ b/native/cocos/audio/android/AudioMixerController.cpp @@ -77,14 +77,14 @@ bool AudioMixerController::addTrack(Track *track) { } template -static void removeItemFromVector(std::vector &v, T item) { +static void removeItemFromVector(ccstd::vector &v, T item) { auto iter = std::find(v.begin(), v.end(), item); if (iter != v.end()) { v.erase(iter); } } -void AudioMixerController::initTrack(Track *track, std::vector &tracksToRemove) { +void AudioMixerController::initTrack(Track *track, ccstd::vector &tracksToRemove) { if (track->isInitialized()) return; @@ -142,7 +142,7 @@ void AudioMixerController::mixOneFrame() { auto mixStart = clockNow(); - std::vector tracksToRemove; + ccstd::vector tracksToRemove; tracksToRemove.reserve(_activeTracks.size()); // FOR TESTING BEGIN diff --git a/native/cocos/audio/android/AudioMixerController.h b/native/cocos/audio/android/AudioMixerController.h index 23a4320ad5..898ec34163 100644 --- a/native/cocos/audio/android/AudioMixerController.h +++ b/native/cocos/audio/android/AudioMixerController.h @@ -25,13 +25,12 @@ THE SOFTWARE. #pragma once -#include "audio/android/utils/Errors.h" - #include #include #include #include -#include +#include "audio/android/utils/Errors.h" +#include "base/std/container/vector.h" namespace cc { @@ -64,7 +63,7 @@ public: private: void destroy(); - void initTrack(Track *track, std::vector &tracksToRemove); + void initTrack(Track *track, ccstd::vector &tracksToRemove); private: int _bufferSizeInFrames; @@ -74,7 +73,7 @@ private: AudioMixer *_mixer; std::mutex _activeTracksMutex; - std::vector _activeTracks; + ccstd::vector _activeTracks; OutputBuffer _mixingBuffer; diff --git a/native/cocos/audio/android/AudioPlayerProvider.cpp b/native/cocos/audio/android/AudioPlayerProvider.cpp index 23469c2083..82c775fa78 100644 --- a/native/cocos/audio/android/AudioPlayerProvider.cpp +++ b/native/cocos/audio/android/AudioPlayerProvider.cpp @@ -257,7 +257,7 @@ void AudioPlayerProvider::preloadEffect(const AudioFileInfo &info, const Preload PreloadCallbackParam param; param.callback = cb; param.isPreloadInPlay2d = isPreloadInPlay2d; - std::vector callbacks; + ccstd::vector callbacks; callbacks.push_back(std::move(param)); _preloadCallbackMap.insert(std::make_pair(audioFilePath, std::move(callbacks))); } diff --git a/native/cocos/audio/android/AudioPlayerProvider.h b/native/cocos/audio/android/AudioPlayerProvider.h index 088a648e0c..f0909637a7 100644 --- a/native/cocos/audio/android/AudioPlayerProvider.h +++ b/native/cocos/audio/android/AudioPlayerProvider.h @@ -107,7 +107,7 @@ private: bool isPreloadInPlay2d; }; - std::unordered_map> _preloadCallbackMap; + std::unordered_map> _preloadCallbackMap; std::mutex _preloadCallbackMutex; std::mutex _preloadWaitMutex; diff --git a/native/cocos/audio/android/PcmAudioService.cpp b/native/cocos/audio/android/PcmAudioService.cpp index 0d5609afa1..8749615651 100644 --- a/native/cocos/audio/android/PcmAudioService.cpp +++ b/native/cocos/audio/android/PcmAudioService.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. namespace cc { -static std::vector __silenceData; +static ccstd::vector __silenceData; #define AUDIO_PLAYER_BUFFER_COUNT (2) diff --git a/native/cocos/audio/android/PcmData.h b/native/cocos/audio/android/PcmData.h index f5d701bbbd..aa37b66a15 100644 --- a/native/cocos/audio/android/PcmData.h +++ b/native/cocos/audio/android/PcmData.h @@ -27,13 +27,13 @@ THE SOFTWARE. #include #include -#include #include +#include "base/std/container/vector.h" namespace cc { struct PcmData { - std::shared_ptr> pcmBuffer; + std::shared_ptr> pcmBuffer; int numChannels; int sampleRate; int bitsPerSample; diff --git a/native/cocos/audio/android/UrlAudioPlayer.cpp b/native/cocos/audio/android/UrlAudioPlayer.cpp index 181b0af1a1..2b892b5dd2 100644 --- a/native/cocos/audio/android/UrlAudioPlayer.cpp +++ b/native/cocos/audio/android/UrlAudioPlayer.cpp @@ -27,6 +27,7 @@ THE SOFTWARE. #include "audio/android/UrlAudioPlayer.h" #include "audio/android/ICallerThreadUtils.h" +#include "base/std/container/vector.h" #include #include // for std::find @@ -34,7 +35,7 @@ THE SOFTWARE. namespace { std::mutex __playerContainerMutex; -std::vector __playerContainer; +ccstd::vector __playerContainer; std::once_flag __onceFlag; } // namespace diff --git a/native/cocos/audio/android/UrlAudioPlayer.h b/native/cocos/audio/android/UrlAudioPlayer.h index e7ba0fb088..e5a4427fb7 100644 --- a/native/cocos/audio/android/UrlAudioPlayer.h +++ b/native/cocos/audio/android/UrlAudioPlayer.h @@ -29,7 +29,6 @@ THE SOFTWARE. #include "audio/android/OpenSLHelper.h" #include "audio/android/AssetFd.h" #include -#include #include #include diff --git a/native/cocos/audio/apple/AudioCache.h b/native/cocos/audio/apple/AudioCache.h index ea4617a7f7..6d1cab9256 100644 --- a/native/cocos/audio/apple/AudioCache.h +++ b/native/cocos/audio/apple/AudioCache.h @@ -30,10 +30,10 @@ #include #include -#include #include "audio/apple/AudioMacros.h" #include "base/Macros.h" +#include "base/std/container/vector.h" namespace cc { class AudioEngineImpl; @@ -84,10 +84,10 @@ protected: uint32_t _queBufferFrames; std::mutex _playCallbackMutex; - std::vector> _playCallbacks; + ccstd::vector> _playCallbacks; // loadCallbacks doesn't need mutex since it's invoked only in Cocos thread. - std::vector> _loadCallbacks; + ccstd::vector> _loadCallbacks; std::mutex _readDataTaskMutex; diff --git a/native/cocos/audio/apple/AudioCache.mm b/native/cocos/audio/apple/AudioCache.mm index d2fca79502..d61ad94aeb 100644 --- a/native/cocos/audio/apple/AudioCache.mm +++ b/native/cocos/audio/apple/AudioCache.mm @@ -161,7 +161,7 @@ void AudioCache::readDataTask(unsigned int selfId) { BREAK_IF_ERR_LOG(!decoder.seek(totalFrames), "AudioDecoder::seek(%u) error", totalFrames); char *tmpBuf = (char *)malloc(framesToReadOnce * bytesPerFrame); - std::vector adjustFrameBuf; + ccstd::vector adjustFrameBuf; adjustFrameBuf.reserve(framesToReadOnce * bytesPerFrame); // Adjust total frames by setting position to the end of frames and try to read more data. diff --git a/native/cocos/audio/include/AudioEngine.h b/native/cocos/audio/include/AudioEngine.h index c806f0f53c..d88e85bf33 100644 --- a/native/cocos/audio/include/AudioEngine.h +++ b/native/cocos/audio/include/AudioEngine.h @@ -28,7 +28,7 @@ #include "audio/include/Export.h" #include "base/Macros.h" - +#include "base/std/container/vector.h" #include "bindings/event/CustomEventTypes.h" #include "bindings/event/EventDispatcher.h" @@ -320,8 +320,8 @@ protected: static void addTask(const std::function &task); static void remove(int audioID); - static void pauseAll(std::vector *pausedAudioIDs); - static void resumeAll(std::vector *pausedAudioIDs); + static void pauseAll(ccstd::vector *pausedAudioIDs); + static void resumeAll(ccstd::vector *pausedAudioIDs); struct ProfileHelper { AudioProfile profile; @@ -376,7 +376,7 @@ private: static float sVolumeFactor; static uint32_t sOnPauseListenerID; static uint32_t sOnResumeListenerID; - static std::vector sBreakAudioID; + static ccstd::vector sBreakAudioID; static void onEnterBackground(const CustomEvent &); static void onEnterForeground(const CustomEvent &); diff --git a/native/cocos/audio/oalsoft/AudioCache.cpp b/native/cocos/audio/oalsoft/AudioCache.cpp index d0d61a9aa2..d241982522 100644 --- a/native/cocos/audio/oalsoft/AudioCache.cpp +++ b/native/cocos/audio/oalsoft/AudioCache.cpp @@ -131,7 +131,7 @@ void AudioCache::readDataTask(unsigned int selfId) { uint32_t framesRead = 0; const uint32_t framesToReadOnce = std::min(totalFrames, static_cast(sampleRate * QUEUEBUFFER_TIME_STEP * QUEUEBUFFER_NUM)); - std::vector adjustFrameBuf; + ccstd::vector adjustFrameBuf; if (decoder->seek(totalFrames)) { auto *tmpBuf = static_cast(malloc(framesToReadOnce * bytesPerFrame)); diff --git a/native/cocos/audio/oalsoft/AudioCache.h b/native/cocos/audio/oalsoft/AudioCache.h index 145773c2cc..7aff4af114 100644 --- a/native/cocos/audio/oalsoft/AudioCache.h +++ b/native/cocos/audio/oalsoft/AudioCache.h @@ -30,7 +30,6 @@ #include #include #include -#include #if defined(OPENAL_PLAIN_INCLUDES) #include #elif CC_PLATFORM == CC_PLATFORM_WINDOWS @@ -42,6 +41,7 @@ #endif #include "audio/oalsoft/AudioMacros.h" #include "base/Macros.h" +#include "base/std/container/vector.h" namespace cc { class AudioEngineImpl; @@ -92,10 +92,10 @@ protected: uint32_t _queBufferFrames; std::mutex _playCallbackMutex; - std::vector> _playCallbacks; + ccstd::vector> _playCallbacks; // loadCallbacks doesn't need mutex since it's invoked only in Cocos thread. - std::vector> _loadCallbacks; + ccstd::vector> _loadCallbacks; std::mutex _readDataTaskMutex; diff --git a/native/cocos/base/CoreStd.h b/native/cocos/base/CoreStd.h index abb93e9229..ad0a704bb8 100644 --- a/native/cocos/base/CoreStd.h +++ b/native/cocos/base/CoreStd.h @@ -53,7 +53,6 @@ #include #include #include -#include #include "base/CachedArray.h" #include "base/Log.h" diff --git a/native/cocos/base/DeferredReleasePool.cpp b/native/cocos/base/DeferredReleasePool.cpp index c201179ebf..4d5534c575 100644 --- a/native/cocos/base/DeferredReleasePool.cpp +++ b/native/cocos/base/DeferredReleasePool.cpp @@ -26,11 +26,10 @@ ****************************************************************************/ #include "base/DeferredReleasePool.h" -#include #include "base/Log.h" namespace cc { -std::vector DeferredReleasePool::managedObjectArray{}; +ccstd::vector DeferredReleasePool::managedObjectArray{}; void DeferredReleasePool::add(RefCounted *object) { DeferredReleasePool::managedObjectArray.push_back(object); diff --git a/native/cocos/base/DeferredReleasePool.h b/native/cocos/base/DeferredReleasePool.h index 2d1a36e3a3..79bcc2a8d4 100644 --- a/native/cocos/base/DeferredReleasePool.h +++ b/native/cocos/base/DeferredReleasePool.h @@ -28,7 +28,7 @@ #pragma once #include -#include +#include "base/std/container/vector.h" #include "base/RefCounted.h" namespace cc { @@ -64,7 +64,7 @@ private: * be destructed properly by calling Ref::release() even if the object * is in the pool. */ - static std::vector managedObjectArray; + static ccstd::vector managedObjectArray; }; } // namespace cc diff --git a/native/cocos/base/Log.cpp b/native/cocos/base/Log.cpp index 215a210952..01ebe2838d 100644 --- a/native/cocos/base/Log.cpp +++ b/native/cocos/base/Log.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include "base/std/container/vector.h" #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #ifndef WIN32_LEAN_AND_MEAN @@ -61,7 +61,7 @@ LogLevel Log::slogLevel = LogLevel::INFO; #endif FILE * Log::slogFile = nullptr; -const std::vector LOG_LEVEL_DESCS{"FATAL", "ERROR", "WARN", "INFO", "DEBUG"}; +const ccstd::vector LOG_LEVEL_DESCS{"FATAL", "ERROR", "WARN", "INFO", "DEBUG"}; void Log::setLogFile(const std::string &filename) { #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/base/RefMap.h b/native/cocos/base/RefMap.h index dad0e6b98d..c1f269f2db 100644 --- a/native/cocos/base/RefMap.h +++ b/native/cocos/base/RefMap.h @@ -27,6 +27,7 @@ #pragma once #include +#include "base/std/container/vector.h" #include "base/Log.h" #include "base/Random.h" #include "base/RefCounted.h" @@ -134,8 +135,8 @@ public: } /** Returns all keys in the map. */ - std::vector keys() const { - std::vector keys; + ccstd::vector keys() const { + ccstd::vector keys; if (!_data.empty()) { keys.reserve(_data.size()); @@ -148,8 +149,8 @@ public: } /** Returns all keys that matches the object. */ - std::vector keys(V object) const { - std::vector keys; + ccstd::vector keys(V object) const { + ccstd::vector keys; if (!_data.empty()) { keys.reserve(_data.size() / 10); @@ -245,7 +246,7 @@ public: * * @param keys Keys of elements to be erased. */ - void erase(const std::vector &keys) { + void erase(const ccstd::vector &keys) { for (const auto &key : keys) { this->erase(key); } diff --git a/native/cocos/base/RefVector.h b/native/cocos/base/RefVector.h index 23db3c8283..cc33e3420a 100644 --- a/native/cocos/base/RefVector.h +++ b/native/cocos/base/RefVector.h @@ -32,7 +32,6 @@ #include // for std::find #include #include -#include #include "base/Log.h" #include "base/memory/Memory.h" @@ -44,7 +43,7 @@ namespace cc { /* - * Similar to std::vector, but it will manage reference count automatically internally. + * Similar to ccstd::vector, but it will manage reference count automatically internally. * Which means it will invoke RefCounted::addRef() when adding an element, and invoke RefCounted::release() when removing an element. * @warn The element should be `RefCounted` or its sub-class. */ @@ -56,14 +55,14 @@ public: // ------------------------------------------ /** Iterator, can be used to loop the Vector. */ - using iterator = typename std::vector::iterator; + using iterator = typename ccstd::vector::iterator; /** Const iterator, can be used to loop the Vector. */ - using const_iterator = typename std::vector::const_iterator; + using const_iterator = typename ccstd::vector::const_iterator; /** Reversed iterator, can be used to loop the Vector in reverse sequence. */ - using reverse_iterator = typename std::vector::reverse_iterator; + using reverse_iterator = typename ccstd::vector::reverse_iterator; /** Reversed iterator, can be used to loop the Vector in reverse sequence. */ - using const_reverse_iterator = typename std::vector::const_reverse_iterator; + using const_reverse_iterator = typename ccstd::vector::const_reverse_iterator; /** Returns an iterator pointing the first element of the Vector. */ iterator begin() { return _data.begin(); } @@ -148,7 +147,7 @@ public: } /** Copy constructor. */ - explicit RefVector(const std::vector &other) { + explicit RefVector(const ccstd::vector &other) { static_assert(std::is_convertible::value, "Invalid Type for cc::Vector!"); // CC_LOG_INFO("In the copy constructor!"); _data = other; @@ -163,7 +162,7 @@ public: } /** Constructor with std::move semantic. */ - explicit RefVector(std::vector &&other) noexcept { + explicit RefVector(ccstd::vector &&other) noexcept { static_assert(std::is_convertible::value, "Invalid Type for cc::Vector!"); // CC_LOG_INFO("In the move constructor of Vector!"); _data = std::move(other); @@ -457,7 +456,7 @@ public: _data.shrink_to_fit(); } - const std::vector &get() const { + const ccstd::vector &get() const { return _data; } @@ -473,7 +472,7 @@ protected: } } - std::vector _data; + ccstd::vector _data; }; } // namespace cc diff --git a/native/cocos/base/Scheduler.cpp b/native/cocos/base/Scheduler.cpp index fa1c4d5cf7..96ea8ba347 100644 --- a/native/cocos/base/Scheduler.cpp +++ b/native/cocos/base/Scheduler.cpp @@ -31,7 +31,6 @@ #include #include -#include #include "base/Log.h" #include "base/Macros.h" diff --git a/native/cocos/base/Scheduler.h b/native/cocos/base/Scheduler.h index d58c86e23a..359ec58e40 100644 --- a/native/cocos/base/Scheduler.h +++ b/native/cocos/base/Scheduler.h @@ -33,8 +33,8 @@ #include #include #include -#include +#include "base/std/container/vector.h" #include "base/RefCounted.h" namespace cc { @@ -274,7 +274,7 @@ public: private: // Hash Element used for "selectors with interval" struct HashTimerEntry { - std::vector timers; + ccstd::vector timers; void * target; int timerIndex; Timer * currentTimer; @@ -295,7 +295,7 @@ private: bool _updateHashLocked = false; // Used for "perform Function" - std::vector> _functionsToPerform; + ccstd::vector> _functionsToPerform; std::mutex _performMutex; }; diff --git a/native/cocos/base/StringPool.h b/native/cocos/base/StringPool.h index 5af16d7f32..10de655deb 100644 --- a/native/cocos/base/StringPool.h +++ b/native/cocos/base/StringPool.h @@ -27,9 +27,9 @@ #include #include -#include #include "StringHandle.h" #include "base/Macros.h" +#include "base/std/container/vector.h" #include "threading/ReadWriteLock.h" namespace cc { @@ -60,7 +60,7 @@ private: StringHandle doFind(const char *str) const noexcept; std::map _stringToHandles{}; - std::vector _handleToStrings{}; + ccstd::vector _handleToStrings{}; mutable ReadWriteLock _readWriteLock{}; }; diff --git a/native/cocos/base/ThreadPool.cpp b/native/cocos/base/ThreadPool.cpp index 5ece758c81..b113958b5d 100644 --- a/native/cocos/base/ThreadPool.cpp +++ b/native/cocos/base/ThreadPool.cpp @@ -141,7 +141,7 @@ bool LegacyThreadPool::tryShrinkPool() { auto before = std::chrono::high_resolution_clock::now(); - std::vector threadIDsToJoin; + ccstd::vector threadIDsToJoin; int maxThreadNumToJoin = std::min(_initedThreadNum - _minThreadNum, _shrinkStep); for (int i = 0; i < _maxThreadNum; ++i) { @@ -254,7 +254,7 @@ void LegacyThreadPool::stopAllTasks() { void LegacyThreadPool::stopTasksByType(TaskType type) { Task task; - std::vector notStopTasks; + ccstd::vector notStopTasks; notStopTasks.reserve(_taskQueue.size()); while (_taskQueue.pop(task)) { diff --git a/native/cocos/base/ThreadPool.h b/native/cocos/base/ThreadPool.h index 356fbb09f5..f3e72c34fa 100644 --- a/native/cocos/base/ThreadPool.h +++ b/native/cocos/base/ThreadPool.h @@ -36,7 +36,6 @@ #include #include #include -#include namespace cc { @@ -145,10 +144,10 @@ private: void stretchPool(int count); - std::vector> _threads; - std::vector>> _abortFlags; - std::vector>> _idleFlags; - std::vector>> _initedFlags; + ccstd::vector> _threads; + ccstd::vector>> _abortFlags; + ccstd::vector>> _idleFlags; + ccstd::vector>> _initedFlags; template class ThreadSafeQueue { diff --git a/native/cocos/base/UTF8.cpp b/native/cocos/base/UTF8.cpp index 71ca2459ab..02e2f58a5e 100644 --- a/native/cocos/base/UTF8.cpp +++ b/native/cocos/base/UTF8.cpp @@ -62,7 +62,7 @@ std::string format(const char *format, ...) { * * Return value: the index of the last character that is not c. * */ -unsigned int getIndexOfLastNotChar16(const std::vector &str, char16_t c) { +unsigned int getIndexOfLastNotChar16(const ccstd::vector &str, char16_t c) { int len = static_cast(str.size()); int i = len - 1; @@ -83,7 +83,7 @@ unsigned int getIndexOfLastNotChar16(const std::vector &str, char16_t * * Return value: the trimmed string. * */ -static void trimUTF16VectorFromIndex(std::vector &str, int index) { //NOLINT +static void trimUTF16VectorFromIndex(ccstd::vector &str, int index) { //NOLINT int size = static_cast(str.size()); if (index >= size || index < 0) { return; @@ -114,7 +114,7 @@ bool isCJKUnicode(char16_t ch) { || (ch >= 0x31C0 && ch <= 0x4DFF); // Other extensions } -void trimUTF16Vector(std::vector &str) { +void trimUTF16Vector(ccstd::vector &str) { int len = static_cast(str.size()); if (len <= 0) { @@ -270,8 +270,8 @@ jstring newStringUTFJNI(JNIEnv *env, const std::string &utf8Str, bool *ret) { } #endif -std::vector getChar16VectorFromUTF16String(const std::u16string &utf16) { - return std::vector(utf16.begin(), utf16.end()); +ccstd::vector getChar16VectorFromUTF16String(const std::u16string &utf16) { + return ccstd::vector(utf16.begin(), utf16.end()); } long getCharacterCountInUTF8String(const std::string &utf8) { //NOLINT diff --git a/native/cocos/base/UTF8.h b/native/cocos/base/UTF8.h index b9cecb5ff3..bd96492e5c 100644 --- a/native/cocos/base/UTF8.h +++ b/native/cocos/base/UTF8.h @@ -29,7 +29,7 @@ #include #include -#include +#include "base/std/container/vector.h" #include "base/Macros.h" #if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_OHOS) @@ -137,7 +137,7 @@ CC_DLL jstring newStringUTFJNI(JNIEnv *env, const std::string &utf8Str, bool *re /** * @brief Trims the unicode spaces at the end of char16_t vector. */ -CC_DLL void trimUTF16Vector(std::vector &str); //NOLINT +CC_DLL void trimUTF16Vector(ccstd::vector &str); //NOLINT /** * @brief Whether the character is a whitespace character. @@ -173,12 +173,12 @@ CC_DLL long getCharacterCountInUTF8String(const std::string &utf8); //NOLINT * @param c The character to be searched for. * @returns The index of the last character that is not \p c. */ -CC_DLL unsigned int getIndexOfLastNotChar16(const std::vector &str, char16_t c); +CC_DLL unsigned int getIndexOfLastNotChar16(const ccstd::vector &str, char16_t c); /** * @brief Gets char16_t vector from a given utf16 string. */ -CC_DLL std::vector getChar16VectorFromUTF16String(const std::u16string &utf16); +CC_DLL ccstd::vector getChar16VectorFromUTF16String(const std::u16string &utf16); /** * Utf8 sequence @@ -191,7 +191,7 @@ public: std::string _char; bool isAnsi() { return _char.size() == 1; } }; - using CharUTF8Store = std::vector; + using CharUTF8Store = ccstd::vector; StringUTF8() = default; explicit StringUTF8(const std::string &newStr); diff --git a/native/cocos/base/Utils.h b/native/cocos/base/Utils.h index 9a5e61227b..a9dec3c7db 100644 --- a/native/cocos/base/Utils.h +++ b/native/cocos/base/Utils.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include "base/std/container/vector.h" #include "base/Macros.h" #include "base/TypeDef.h" /** @file ccUtils.h @@ -146,7 +146,7 @@ namespace array { * @param value 待移除元素。 */ template -bool remove(std::vector &array, T value) { +bool remove(ccstd::vector &array, T value) { auto iter = std::find(array.begin(), array.end(), value); if (iter != array.end()) { array.erase(iter); @@ -164,7 +164,7 @@ bool remove(std::vector &array, T value) { * @param index 待移除元素的索引。 */ template -bool removeAt(std::vector &array, int32_t index) { +bool removeAt(ccstd::vector &array, int32_t index) { if (index >= 0 && index < static_cast(array.size())) { array.erase(array.begin() + index); return true; @@ -183,7 +183,7 @@ bool removeAt(std::vector &array, int32_t index) { * @param index 待移除元素的索引。 */ template -bool fastRemoveAt(std::vector &array, int32_t index) { +bool fastRemoveAt(ccstd::vector &array, int32_t index) { const auto length = static_cast(array.size()); if (index < 0 || index >= length) { return false; @@ -205,7 +205,7 @@ bool fastRemoveAt(std::vector &array, int32_t index) { * @param value 待移除元素。 */ template -bool fastRemove(std::vector &array, T value) { +bool fastRemove(ccstd::vector &array, T value) { auto iter = std::find(array.begin(), array.end(), value); if (iter != array.end()) { *iter = array[array.size() - 1]; diff --git a/native/cocos/base/Value.h b/native/cocos/base/Value.h index 499df588d4..6ad6ac33b8 100644 --- a/native/cocos/base/Value.h +++ b/native/cocos/base/Value.h @@ -28,12 +28,13 @@ #include "base/Macros.h" #include "base/memory/StlAlloc.h" +#include "base/std/container/vector.h" namespace cc { class Value; -using ValueVector = vector; +using ValueVector = ccstd::vector; using ValueMap = unordered_map; using ValueMapIntKey = unordered_map; diff --git a/native/cocos/base/base64.cpp b/native/cocos/base/base64.cpp index c99c5a2689..8cf69f656e 100644 --- a/native/cocos/base/base64.cpp +++ b/native/cocos/base/base64.cpp @@ -30,15 +30,15 @@ #include #include #include -#include +#include "base/std/container/vector.h" namespace cc { std::string alphabet{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}; int doBase64Decode(const unsigned char *input, unsigned int inputLen, unsigned char *output, unsigned int *outputLen) { - static std::vector inalphabet(256); - static std::vector decoder(256); + static ccstd::vector inalphabet(256); + static ccstd::vector decoder(256); int i; int bits; int c = 0; diff --git a/native/cocos/base/csscolorparser.cpp b/native/cocos/base/csscolorparser.cpp index b9d17c3a6c..fb7b0d4f00 100644 --- a/native/cocos/base/csscolorparser.cpp +++ b/native/cocos/base/csscolorparser.cpp @@ -53,7 +53,7 @@ #include #include #include -#include +#include "base/std/container/vector.h" namespace CSSColorParser { @@ -63,7 +63,7 @@ struct NamedColor { Color color; }; -const std::vector NAMED_COLORS = { +const ccstd::vector NAMED_COLORS = { {"transparent", {0, 0, 0, 0}}, {"aliceblue", {240, 248, 255, 1}}, {"antiquewhite", {250, 235, 215, 1}}, @@ -267,8 +267,8 @@ float cssHueToRgb(float m1, float m2, float h) { return m1; } -std::vector split(const std::string &s, char delim) { - std::vector elems; +ccstd::vector split(const std::string &s, char delim) { + ccstd::vector elems; std::stringstream ss(s); std::string item; while (std::getline(ss, item, delim)) { @@ -325,7 +325,7 @@ Color parse(const std::string &cssStr) { size_t ep = str.find_first_of(')'); if (op != std::string::npos && ep + 1 == str.length()) { const std::string fname = str.substr(0, op); - const std::vector params = + const ccstd::vector params = split(str.substr(op + 1, ep - (op + 1)), ','); float alpha = 1.0f; diff --git a/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.cpp b/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.cpp index 2c6f4515fd..eb2d83e62d 100644 --- a/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.cpp +++ b/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.cpp @@ -34,7 +34,7 @@ namespace cc { namespace { DummyGraphNode * freeList{nullptr}; -std::vector allocatedChunks; +ccstd::vector allocatedChunks; } // namespace DummyGraphNode::~DummyGraphNode() { 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 754656123e..825610145a 100644 --- a/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.h +++ b/native/cocos/base/job-system/job-system-dummy/DummyJobGraph.h @@ -26,7 +26,7 @@ #pragma once #include -#include +#include "base/std/container/vector.h" #include "cocos/base/Macros.h" #include "cocos/base/TypeDef.h" @@ -56,7 +56,7 @@ private: bool excuted(DummyGraphNode *n) const; int _generation{0}; - std::vector _nodes; + ccstd::vector _nodes; }; class DummyGraphNodeTaskItf { 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 e2aeab1c15..7f39555e72 100644 --- a/native/cocos/base/job-system/job-system-tbb/TBBJobGraph.h +++ b/native/cocos/base/job-system/job-system-tbb/TBBJobGraph.h @@ -26,6 +26,7 @@ #pragma once #include +#include "base/std/container/vector.h" namespace cc { @@ -69,7 +70,7 @@ private: uint predecessor = 0u; uint successor = 0u; }; - vector _parallelJobs; + ccstd::vector _parallelJobs; bool _pending = false; }; diff --git a/native/cocos/base/memory/CallStack.cpp b/native/cocos/base/memory/CallStack.cpp index a629021b05..bdd0bc8f07 100644 --- a/native/cocos/base/memory/CallStack.cpp +++ b/native/cocos/base/memory/CallStack.cpp @@ -144,9 +144,9 @@ std::string CallStack::basename(const std::string &path) { } } -std::vector CallStack::backtrace() { +ccstd::vector CallStack::backtrace() { #if CC_PLATFORM == CC_PLATFORM_ANDROID - std::vector callstack; + ccstd::vector callstack; callstack.reserve(MAX_STACK_FRAMES); pthread_once(&s_once, init_once); @@ -158,7 +158,7 @@ std::vector CallStack::backtrace() { return callstack; #elif CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX - std::vector callstack; + ccstd::vector callstack; callstack.reserve(MAX_STACK_FRAMES); void *array[MAX_STACK_FRAMES]; @@ -169,7 +169,7 @@ std::vector CallStack::backtrace() { return callstack; #elif CC_PLATFORM == CC_PLATFORM_WINDOWS - std::vector callstack; + ccstd::vector callstack; callstack.reserve(MAX_STACK_FRAMES); void *array[MAX_STACK_FRAMES]; @@ -184,9 +184,9 @@ std::vector CallStack::backtrace() { #endif } -std::vector CallStack::backtraceSymbols(const std::vector &callstack) { +ccstd::vector CallStack::backtraceSymbols(const ccstd::vector &callstack) { #if CC_PLATFORM == CC_PLATFORM_ANDROID - std::vector frames; + ccstd::vector frames; size_t size = callstack.size(); for (size_t i = 0; i < size; i++) { Dl_info info; @@ -217,7 +217,7 @@ std::vector CallStack::backtraceSymbols(const std::vector &c return {}; } - std::vector frames; + ccstd::vector frames; char ** strs = ::backtrace_symbols(&callstack[0], size); for (size_t i = 0; i < size; i++) { StackFrame frame; @@ -228,7 +228,7 @@ std::vector CallStack::backtraceSymbols(const std::vector &c return frames; #elif CC_PLATFORM == CC_PLATFORM_WINDOWS - std::vector frames; + ccstd::vector frames; #if _WIN64 using PTR_DWORD = DWORD64; diff --git a/native/cocos/base/memory/CallStack.h b/native/cocos/base/memory/CallStack.h index ca0c1ec3de..7d65d6ee90 100644 --- a/native/cocos/base/memory/CallStack.h +++ b/native/cocos/base/memory/CallStack.h @@ -33,7 +33,6 @@ #endif #include #include - #include #include "../Macros.h" namespace cc { @@ -60,8 +59,8 @@ class CC_DLL CallStack { public: static std::string basename(const std::string &path); - static std::vector backtrace(); - static std::vector backtraceSymbols(const std::vector &callstack); + static ccstd::vector backtrace(); + static ccstd::vector backtraceSymbols(const ccstd::vector &callstack); #if CC_PLATFORM == CC_PLATFORM_WINDOWS static void initSym(); diff --git a/native/cocos/base/memory/MemoryHook.h b/native/cocos/base/memory/MemoryHook.h index 466e6e78a5..480b04ea95 100644 --- a/native/cocos/base/memory/MemoryHook.h +++ b/native/cocos/base/memory/MemoryHook.h @@ -33,7 +33,6 @@ #include #include - #include typedef void *(*MallocType)(size_t size); typedef void (*FreeType)(void *ptr); @@ -46,7 +45,7 @@ namespace cc { struct CC_DLL MemoryRecord { uint64_t address{0}; size_t size{0}; - std::vector callstack; + ccstd::vector callstack; }; class CC_DLL MemoryHook { diff --git a/native/cocos/base/memory/StlAlloc.h b/native/cocos/base/memory/StlAlloc.h index 394cf35ab8..0d89213fe5 100755 --- a/native/cocos/base/memory/StlAlloc.h +++ b/native/cocos/base/memory/StlAlloc.h @@ -37,8 +37,8 @@ THE SOFTWARE. namespace cc { -template -using vector = std::vector; +//template +//using vector = std::vector; template using list = std::list; @@ -46,7 +46,7 @@ using list = std::list; template using queue = std::queue; -template ::type, typename P = std::less> +template ::type, typename P = std::less> using priority_queue = std::priority_queue; template @@ -78,6 +78,6 @@ using unordered_multimap = std::unordered_multimap; using String = std::string; using WString = std::wstring; -using StringArray = vector; +using StringArray = std::vector; } // namespace cc diff --git a/native/cocos/base/std/container/vector.h b/native/cocos/base/std/container/vector.h new file mode 100644 index 0000000000..cbd4b2bf83 --- /dev/null +++ b/native/cocos/base/std/container/vector.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 vector = std::vector; + +namespace pmr { +template +using vector = std::vector>; +} +} diff --git a/native/cocos/bindings/dop/BufferPool.h b/native/cocos/bindings/dop/BufferPool.h index 3826761650..d96a8db541 100644 --- a/native/cocos/bindings/dop/BufferPool.h +++ b/native/cocos/bindings/dop/BufferPool.h @@ -32,6 +32,7 @@ #include "cocos/base/TypeDef.h" #include "cocos/base/memory/StlAlloc.h" #include "cocos/bindings/jswrapper/Object.h" +#include "base/std/container/vector.h" namespace se { @@ -58,7 +59,7 @@ private: static constexpr uint POOL_FLAG = 1 << 30; BufferAllocator _allocator; - cc::vector _chunks; + ccstd::vector _chunks; uint _entryBits = 1 << 8; uint _chunkMask = 0; uint _entryMask = 0; diff --git a/native/cocos/bindings/event/EventDispatcher.cpp b/native/cocos/bindings/event/EventDispatcher.cpp index 175b67ddcc..708b61ee69 100644 --- a/native/cocos/bindings/event/EventDispatcher.cpp +++ b/native/cocos/bindings/event/EventDispatcher.cpp @@ -33,7 +33,7 @@ namespace { se::Value tickVal; se::ValueArray tickArgsValArr(1); -std::vector jsTouchObjPool; +ccstd::vector jsTouchObjPool; se::Object * jsTouchObjArray = nullptr; se::Object * jsMouseEventObj = nullptr; se::Object * jsKeyboardEventObj = nullptr; @@ -317,7 +317,7 @@ void EventDispatcher::dispatchRecreateWindowEvent() { EventDispatcher::doDispatchEvent(EVENT_RECREATE_WINDOW, "", se::EmptyValueArray); } -void EventDispatcher::doDispatchEvent(const char *eventName, const char *jsFunctionName, const std::vector &args) { +void EventDispatcher::doDispatchEvent(const char *eventName, const char *jsFunctionName, const ccstd::vector &args) { if (!se::ScriptEngine::getInstance()->isValid()) { return; } diff --git a/native/cocos/bindings/event/EventDispatcher.h b/native/cocos/bindings/event/EventDispatcher.h index 4ea8cc5645..1994dc9a21 100644 --- a/native/cocos/bindings/event/EventDispatcher.h +++ b/native/cocos/bindings/event/EventDispatcher.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include "base/std/container/vector.h" namespace se { class Value; @@ -124,7 +124,7 @@ public: UNKNOWN }; - std::vector touches; + ccstd::vector touches; Type type = Type::UNKNOWN; }; @@ -293,7 +293,7 @@ public: static void dispatchCustomEvent(const CustomEvent &event); private: - static void doDispatchEvent(const char *eventName, const char *jsFunctionName, const std::vector &args); + static void doDispatchEvent(const char *eventName, const char *jsFunctionName, const ccstd::vector &args); struct Node { CustomEventListener listener; diff --git a/native/cocos/bindings/jswrapper/Value.h b/native/cocos/bindings/jswrapper/Value.h index 5a4d3f1788..93dab3c9bd 100644 --- a/native/cocos/bindings/jswrapper/Value.h +++ b/native/cocos/bindings/jswrapper/Value.h @@ -27,8 +27,7 @@ #pragma once #include -#include - +#include "base/std/container/vector.h" #include "HandleObject.h" #include "base/Macros.h" @@ -485,7 +484,7 @@ private: bool _autoRootUnroot; }; -using ValueArray = std::vector; +using ValueArray = ccstd::vector; extern ValueArray EmptyValueArray; // NOLINT(readability-identifier-naming) } // namespace se diff --git a/native/cocos/bindings/jswrapper/ValueArrayPool.h b/native/cocos/bindings/jswrapper/ValueArrayPool.h index 16bf40a224..bc7968d993 100644 --- a/native/cocos/bindings/jswrapper/ValueArrayPool.h +++ b/native/cocos/bindings/jswrapper/ValueArrayPool.h @@ -62,7 +62,7 @@ public: private: void initPool(uint32_t index); - std::vector> _pools; + ccstd::vector> _pools; }; extern ValueArrayPool gValueArrayPool; diff --git a/native/cocos/bindings/jswrapper/chakracore/Class.cpp b/native/cocos/bindings/jswrapper/chakracore/Class.cpp index 40427e8200..25866fcc92 100644 --- a/native/cocos/bindings/jswrapper/chakracore/Class.cpp +++ b/native/cocos/bindings/jswrapper/chakracore/Class.cpp @@ -45,7 +45,7 @@ namespace se { namespace { // std::unordered_map __clsMap; -std::vector __allClasses; +ccstd::vector __allClasses; JsValueRef emptyContructor(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState) { return JS_INVALID_REFERENCE; diff --git a/native/cocos/bindings/jswrapper/chakracore/Class.h b/native/cocos/bindings/jswrapper/chakracore/Class.h index 979f0ad5fa..b6ec598e85 100644 --- a/native/cocos/bindings/jswrapper/chakracore/Class.h +++ b/native/cocos/bindings/jswrapper/chakracore/Class.h @@ -143,10 +143,10 @@ private: JsNativeFunction _ctor; - std::vector _funcs; - std::vector _staticFuncs; - std::vector _properties; - std::vector _staticProperties; + ccstd::vector _funcs; + ccstd::vector _staticFuncs; + ccstd::vector _properties; + ccstd::vector _staticProperties; JsFinalizeCallback _finalizeOp; friend class ScriptEngine; diff --git a/native/cocos/bindings/jswrapper/chakracore/Object.cpp b/native/cocos/bindings/jswrapper/chakracore/Object.cpp index c70f395259..b07d3ce5ab 100644 --- a/native/cocos/bindings/jswrapper/chakracore/Object.cpp +++ b/native/cocos/bindings/jswrapper/chakracore/Object.cpp @@ -312,7 +312,7 @@ bool Object::call(const ValueArray &args, Object *thisObject, Value *rval /* = n JsValueRef *jsArgs = (JsValueRef *)malloc(sizeof(JsValueRef) * (args.size() + 1)); // Requires thisArg as first argument of arguments. - std::vector toUnrootedObjects; + ccstd::vector toUnrootedObjects; for (auto &arg : args) { if (arg.isObject()) { @@ -444,7 +444,7 @@ bool Object::setArrayElement(uint32_t index, const Value &data) { return true; } -bool Object::getAllKeys(std::vector *allKeys) const { +bool Object::getAllKeys(ccstd::vector *allKeys) const { assert(allKeys != nullptr); JsErrorCode err = JsNoError; diff --git a/native/cocos/bindings/jswrapper/chakracore/Object.h b/native/cocos/bindings/jswrapper/chakracore/Object.h index b204ea5657..0df58b366d 100644 --- a/native/cocos/bindings/jswrapper/chakracore/Object.h +++ b/native/cocos/bindings/jswrapper/chakracore/Object.h @@ -239,7 +239,7 @@ public: * @param[out] allKeys A string vector to store all property names. * @return true if succeed, otherwise false. */ - bool getAllKeys(std::vector *allKeys) const; + bool getAllKeys(ccstd::vector *allKeys) const; /** * @brief Sets a pointer to private data on an object. diff --git a/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.cpp b/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.cpp index 5ea1c16ceb..f67fc97e13 100644 --- a/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.cpp +++ b/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.cpp @@ -273,7 +273,7 @@ ScriptEngine::ExceptionInfo ScriptEngine::formatException(JsValueRef exception) if (exception == JS_INVALID_REFERENCE) return ret; - std::vector allKeys; + ccstd::vector allKeys; Object * exceptionObj = Object::_createJSObject(nullptr, exception); exceptionObj->getAllKeys(&allKeys); diff --git a/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.h b/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.h index 9a4fffb702..f5ce93665c 100644 --- a/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.h +++ b/native/cocos/bindings/jswrapper/chakracore/ScriptEngine.h @@ -276,11 +276,11 @@ private: ExceptionInfo formatException(JsValueRef exception); std::chrono::steady_clock::time_point _startTime; - std::vector _registerCallbackArray; - std::vector> _beforeInitHookArray; - std::vector> _afterInitHookArray; - std::vector> _beforeCleanupHookArray; - std::vector> _afterCleanupHookArray; + ccstd::vector _registerCallbackArray; + ccstd::vector> _beforeInitHookArray; + ccstd::vector> _afterInitHookArray; + ccstd::vector> _beforeCleanupHookArray; + ccstd::vector> _afterCleanupHookArray; JsRuntimeHandle _rt; JsContextRef _cx; diff --git a/native/cocos/bindings/jswrapper/jsc/Class.cpp b/native/cocos/bindings/jswrapper/jsc/Class.cpp index 1c778f2ed2..1114dcc93f 100644 --- a/native/cocos/bindings/jswrapper/jsc/Class.cpp +++ b/native/cocos/bindings/jswrapper/jsc/Class.cpp @@ -45,7 +45,7 @@ namespace se { namespace { // std::unordered_map __clsMap; JSContextRef __cx = nullptr; -std::vector __allClasses; +ccstd::vector __allClasses; void defaultFinalizeCallback(JSObjectRef _obj) { void *nativeThisObject = JSObjectGetPrivate(_obj); diff --git a/native/cocos/bindings/jswrapper/jsc/Class.h b/native/cocos/bindings/jswrapper/jsc/Class.h index c19bce5e51..c4dfa8192f 100644 --- a/native/cocos/bindings/jswrapper/jsc/Class.h +++ b/native/cocos/bindings/jswrapper/jsc/Class.h @@ -142,10 +142,10 @@ private: JSClassRef _jsCls; JSClassDefinition _jsClsDef; - std::vector _funcs; - std::vector _staticFuncs; - std::vector _properties; - std::vector _staticProperties; + ccstd::vector _funcs; + ccstd::vector _staticFuncs; + ccstd::vector _properties; + ccstd::vector _staticProperties; JSObjectFinalizeCallback _finalizeOp; friend class ScriptEngine; diff --git a/native/cocos/bindings/jswrapper/jsc/Object.h b/native/cocos/bindings/jswrapper/jsc/Object.h index 215362e320..f27882ec72 100644 --- a/native/cocos/bindings/jswrapper/jsc/Object.h +++ b/native/cocos/bindings/jswrapper/jsc/Object.h @@ -247,7 +247,7 @@ public: * @param[out] allKeys A string vector to store all property names. * @return true if succeed, otherwise false. */ - bool getAllKeys(std::vector *allKeys) const; + bool getAllKeys(ccstd::vector *allKeys) const; /** * @brief Sets a pointer to private data on an object. diff --git a/native/cocos/bindings/jswrapper/jsc/Object.mm b/native/cocos/bindings/jswrapper/jsc/Object.mm index 356d38616c..76548feb92 100644 --- a/native/cocos/bindings/jswrapper/jsc/Object.mm +++ b/native/cocos/bindings/jswrapper/jsc/Object.mm @@ -547,7 +547,7 @@ bool Object::setArrayElement(uint32_t index, const Value &data) { return true; } -bool Object::getAllKeys(std::vector *allKeys) const { +bool Object::getAllKeys(ccstd::vector *allKeys) const { JSPropertyNameArrayRef keys = JSObjectCopyPropertyNames(__cx, _obj); size_t expectedCount = JSPropertyNameArrayGetCount(keys); diff --git a/native/cocos/bindings/jswrapper/jsc/ScriptEngine.h b/native/cocos/bindings/jswrapper/jsc/ScriptEngine.h index d3c8baa839..8da0327ba3 100644 --- a/native/cocos/bindings/jswrapper/jsc/ScriptEngine.h +++ b/native/cocos/bindings/jswrapper/jsc/ScriptEngine.h @@ -302,12 +302,12 @@ private: void callExceptionCallback(const char *, const char *, const char *); std::chrono::steady_clock::time_point _startTime; - std::vector _registerCallbackArray; - std::vector> _beforeInitHookArray; - std::vector> _afterInitHookArray; + ccstd::vector _registerCallbackArray; + ccstd::vector> _beforeInitHookArray; + ccstd::vector> _afterInitHookArray; - std::vector> _beforeCleanupHookArray; - std::vector> _afterCleanupHookArray; + ccstd::vector> _beforeCleanupHookArray; + ccstd::vector> _afterCleanupHookArray; JSGlobalContextRef _cx; diff --git a/native/cocos/bindings/jswrapper/sm/Class.cpp b/native/cocos/bindings/jswrapper/sm/Class.cpp index c8f1066d38..df6362670f 100644 --- a/native/cocos/bindings/jswrapper/sm/Class.cpp +++ b/native/cocos/bindings/jswrapper/sm/Class.cpp @@ -44,7 +44,7 @@ bool empty_constructor(JSContext *cx, uint32_t argc, JS::Value *vp) { return true; } -std::vector __allClasses; +ccstd::vector __allClasses; } // namespace diff --git a/native/cocos/bindings/jswrapper/sm/Class.h b/native/cocos/bindings/jswrapper/sm/Class.h index 5d17ce26d5..710a8a6d5d 100644 --- a/native/cocos/bindings/jswrapper/sm/Class.h +++ b/native/cocos/bindings/jswrapper/sm/Class.h @@ -143,10 +143,10 @@ private: JSClass _jsCls; JSClassOps _classOps; - std::vector _funcs; - std::vector _staticFuncs; - std::vector _properties; - std::vector _staticProperties; + ccstd::vector _funcs; + ccstd::vector _staticFuncs; + ccstd::vector _properties; + ccstd::vector _staticProperties; JSFinalizeOp _finalizeOp; friend class ScriptEngine; diff --git a/native/cocos/bindings/jswrapper/sm/HelperMacros.cpp b/native/cocos/bindings/jswrapper/sm/HelperMacros.cpp index 2d43d22656..77f613d6e1 100644 --- a/native/cocos/bindings/jswrapper/sm/HelperMacros.cpp +++ b/native/cocos/bindings/jswrapper/sm/HelperMacros.cpp @@ -66,7 +66,7 @@ void clearRecordJSBInvoke() { void printJSBInvoke() { #if defined(RECORD_JSB_INVOKING) - static std::vector>> pairs; + static ccstd::vector>> pairs; for (const auto &it : __jsbFunctionInvokedRecords) { pairs.emplace_back(it); //NOLINT } diff --git a/native/cocos/bindings/jswrapper/sm/Object.cpp b/native/cocos/bindings/jswrapper/sm/Object.cpp index 24e7af5fcd..7b881062bc 100644 --- a/native/cocos/bindings/jswrapper/sm/Object.cpp +++ b/native/cocos/bindings/jswrapper/sm/Object.cpp @@ -541,14 +541,14 @@ bool Object::getArrayBufferData(uint8_t **ptr, size_t *length) const { return (*ptr != nullptr); } -bool Object::getAllKeys(std::vector *allKeys) const { +bool Object::getAllKeys(ccstd::vector *allKeys) const { assert(allKeys != nullptr); JS::RootedObject jsobj(__cx, _getJSObject()); JS::Rooted props(__cx, JS::IdVector(__cx)); if (!JS_Enumerate(__cx, jsobj, &props)) return false; - std::vector keys; + ccstd::vector keys; for (size_t i = 0, length = props.length(); i < length; ++i) { JS::RootedId id(__cx, props[i]); JS::RootedValue keyVal(__cx); diff --git a/native/cocos/bindings/jswrapper/sm/Object.h b/native/cocos/bindings/jswrapper/sm/Object.h index 831e2f3bc7..bbbefb62af 100644 --- a/native/cocos/bindings/jswrapper/sm/Object.h +++ b/native/cocos/bindings/jswrapper/sm/Object.h @@ -275,7 +275,7 @@ public: * @param[out] allKeys A string vector to store all property names. * @return true if succeed, otherwise false. */ - bool getAllKeys(std::vector *allKeys) const; + bool getAllKeys(ccstd::vector *allKeys) const; void setPrivateObject(PrivateObjectBase *data); PrivateObjectBase *getPrivateObject() const; diff --git a/native/cocos/bindings/jswrapper/sm/ScriptEngine.cpp b/native/cocos/bindings/jswrapper/sm/ScriptEngine.cpp index e150e345ef..fe5522c0b6 100644 --- a/native/cocos/bindings/jswrapper/sm/ScriptEngine.cpp +++ b/native/cocos/bindings/jswrapper/sm/ScriptEngine.cpp @@ -519,7 +519,7 @@ void ScriptEngine::addPermanentRegisterCallback(RegisterCallback cb) { static std::string inData; static std::string outData; -static std::vector g_queue; +static ccstd::vector g_queue; static std::mutex g_qMutex; static std::mutex g_rwMutex; static int clientSocket = -1; diff --git a/native/cocos/bindings/jswrapper/sm/ScriptEngine.h b/native/cocos/bindings/jswrapper/sm/ScriptEngine.h index 27f2ac68f4..127f5efaf0 100644 --- a/native/cocos/bindings/jswrapper/sm/ScriptEngine.h +++ b/native/cocos/bindings/jswrapper/sm/ScriptEngine.h @@ -316,15 +316,15 @@ private: FileOperationDelegate _fileOperationDelegate; - std::vector _registerCallbackArray; - std::vector _permRegisterCallbackArray; + ccstd::vector _registerCallbackArray; + ccstd::vector _permRegisterCallbackArray; std::chrono::steady_clock::time_point _startTime; - std::vector> _beforeInitHookArray; - std::vector> _afterInitHookArray; + ccstd::vector> _beforeInitHookArray; + ccstd::vector> _afterInitHookArray; - std::vector> _beforeCleanupHookArray; - std::vector> _afterCleanupHookArray; + ccstd::vector> _beforeCleanupHookArray; + ccstd::vector> _afterCleanupHookArray; ExceptionCallback _exceptionCallback; // name ~> JSScript map diff --git a/native/cocos/bindings/jswrapper/v8/Base.h b/native/cocos/bindings/jswrapper/v8/Base.h index d90269d9c8..002a58da0c 100644 --- a/native/cocos/bindings/jswrapper/v8/Base.h +++ b/native/cocos/bindings/jswrapper/v8/Base.h @@ -41,7 +41,6 @@ #include #include #include -#include #include "../PrivateObject.h" #include "HelperMacros.h" diff --git a/native/cocos/bindings/jswrapper/v8/Class.cpp b/native/cocos/bindings/jswrapper/v8/Class.cpp index 9eb5998973..a188c7400a 100644 --- a/native/cocos/bindings/jswrapper/v8/Class.cpp +++ b/native/cocos/bindings/jswrapper/v8/Class.cpp @@ -42,7 +42,7 @@ namespace se { namespace { // std::unordered_map __clsMap; v8::Isolate * __isolate = nullptr; // NOLINT -std::vector __allClasses; // NOLINT +ccstd::vector __allClasses; // NOLINT void invalidConstructor(const v8::FunctionCallbackInfo &args) { v8::Local thisObj = args.This(); diff --git a/native/cocos/bindings/jswrapper/v8/Class.h b/native/cocos/bindings/jswrapper/v8/Class.h index 128369aaf2..fb234a5b22 100644 --- a/native/cocos/bindings/jswrapper/v8/Class.h +++ b/native/cocos/bindings/jswrapper/v8/Class.h @@ -30,7 +30,6 @@ #if SCRIPT_ENGINE_TYPE == SCRIPT_ENGINE_V8 - #include #include "Base.h" namespace se { diff --git a/native/cocos/bindings/jswrapper/v8/HelperMacros.cpp b/native/cocos/bindings/jswrapper/v8/HelperMacros.cpp index 2d43d22656..77f613d6e1 100644 --- a/native/cocos/bindings/jswrapper/v8/HelperMacros.cpp +++ b/native/cocos/bindings/jswrapper/v8/HelperMacros.cpp @@ -66,7 +66,7 @@ void clearRecordJSBInvoke() { void printJSBInvoke() { #if defined(RECORD_JSB_INVOKING) - static std::vector>> pairs; + static ccstd::vector>> pairs; for (const auto &it : __jsbFunctionInvokedRecords) { pairs.emplace_back(it); //NOLINT } diff --git a/native/cocos/bindings/jswrapper/v8/HelperMacros.h b/native/cocos/bindings/jswrapper/v8/HelperMacros.h index 23d91a3434..811f329f9b 100644 --- a/native/cocos/bindings/jswrapper/v8/HelperMacros.h +++ b/native/cocos/bindings/jswrapper/v8/HelperMacros.h @@ -33,7 +33,6 @@ #include #include #include -#include #include "../ValueArrayPool.h" #include "../config.h" #include "base/Log.h" diff --git a/native/cocos/bindings/jswrapper/v8/Object.cpp b/native/cocos/bindings/jswrapper/v8/Object.cpp index 1a496d6d6e..d8932592c3 100644 --- a/native/cocos/bindings/jswrapper/v8/Object.cpp +++ b/native/cocos/bindings/jswrapper/v8/Object.cpp @@ -132,7 +132,7 @@ void Object::cleanup() { NativePtrToObjectMap::clear(); if (__objectMap) { - std::vector toReleaseObjects; + ccstd::vector toReleaseObjects; for (const auto &e : *__objectMap) { obj = e.first; cls = obj->_getClass(); @@ -616,11 +616,11 @@ bool Object::call(const ValueArray &args, Object *thisObject, Value *rval /* = n size_t argc = args.size(); std::array, JSB_FUNC_DEFAULT_MAX_ARG_COUNT> argv; - std::unique_ptr>> vecArgs; + std::unique_ptr>> vecArgs; v8::Local * pArgv = argv.data(); if (argc > JSB_FUNC_DEFAULT_MAX_ARG_COUNT) { - vecArgs = std::make_unique>>(); + vecArgs = std::make_unique>>(); vecArgs->resize(argc); pArgv = vecArgs->data(); } @@ -748,7 +748,7 @@ bool Object::setArrayElement(uint32_t index, const Value &data) { return ret.IsJust() && ret.FromJust(); } -bool Object::getAllKeys(std::vector *allKeys) const { +bool Object::getAllKeys(ccstd::vector *allKeys) const { assert(allKeys != nullptr); auto * thiz = const_cast(this); v8::Local context = __isolate->GetCurrentContext(); @@ -878,7 +878,7 @@ std::string Object::toStringExt() const { if (isArrayBuffer()) return "[arraybuffer]"; if (isTypedArray()) return "[typedarray]"; - std::vector keys; + ccstd::vector keys; getAllKeys(&keys); std::stringstream ss; ss << "{"; diff --git a/native/cocos/bindings/jswrapper/v8/Object.h b/native/cocos/bindings/jswrapper/v8/Object.h index d6bd04d377..a46b238f4c 100644 --- a/native/cocos/bindings/jswrapper/v8/Object.h +++ b/native/cocos/bindings/jswrapper/v8/Object.h @@ -295,7 +295,7 @@ public: * @param[out] allKeys A string vector to store all property names. * @return true if succeed, otherwise false. */ - bool getAllKeys(std::vector *allKeys) const; + bool getAllKeys(ccstd::vector *allKeys) const; void setPrivateObject(PrivateObjectBase *data); PrivateObjectBase *getPrivateObject() const; diff --git a/native/cocos/bindings/jswrapper/v8/ScriptEngine.cpp b/native/cocos/bindings/jswrapper/v8/ScriptEngine.cpp index 0977741ae2..d6f5a953da 100644 --- a/native/cocos/bindings/jswrapper/v8/ScriptEngine.cpp +++ b/native/cocos/bindings/jswrapper/v8/ScriptEngine.cpp @@ -328,7 +328,7 @@ void ScriptEngine::pushPromiseExeception(const v8::Local &promise, }); if (itr == _promiseArray.end()) { //Not found, create one - _promiseArray.emplace_back(std::make_unique>(), std::vector{}); + _promiseArray.emplace_back(std::make_unique>(), ccstd::vector{}); std::get<0>(_promiseArray.back())->Reset(_isolate, promise); current = &_promiseArray.back(); } else { @@ -963,7 +963,7 @@ bool ScriptEngine::runByteCodeFile(const std::string &pathBc, Value *ret /* = nu // generate dummy code if (filesize > 0) { - std::vector codeBuffer; + ccstd::vector codeBuffer; codeBuffer.resize(filesize + 1); std::fill(codeBuffer.begin(), codeBuffer.end(), ' '); codeBuffer[0] = '\"'; diff --git a/native/cocos/bindings/jswrapper/v8/ScriptEngine.h b/native/cocos/bindings/jswrapper/v8/ScriptEngine.h index c7cea0ce6c..04e1cae16f 100644 --- a/native/cocos/bindings/jswrapper/v8/ScriptEngine.h +++ b/native/cocos/bindings/jswrapper/v8/ScriptEngine.h @@ -372,15 +372,15 @@ private: // Push promise and exception msg to _promiseArray void pushPromiseExeception(const v8::Local &promise, const char *event, const char *stackTrace); - std::vector>, std::vector>> _promiseArray; + ccstd::vector>, ccstd::vector>> _promiseArray; std::chrono::steady_clock::time_point _startTime; - std::vector _registerCallbackArray; - std::vector _permRegisterCallbackArray; - std::vector> _beforeInitHookArray; - std::vector> _afterInitHookArray; - std::vector> _beforeCleanupHookArray; - std::vector> _afterCleanupHookArray; + ccstd::vector _registerCallbackArray; + ccstd::vector _permRegisterCallbackArray; + ccstd::vector> _beforeInitHookArray; + ccstd::vector> _afterInitHookArray; + ccstd::vector> _beforeCleanupHookArray; + ccstd::vector> _afterCleanupHookArray; v8::Persistent _context; diff --git a/native/cocos/bindings/manual/JavaScriptJavaBridge.cpp b/native/cocos/bindings/manual/JavaScriptJavaBridge.cpp index 23adecf12e..e089b33f35 100644 --- a/native/cocos/bindings/manual/JavaScriptJavaBridge.cpp +++ b/native/cocos/bindings/manual/JavaScriptJavaBridge.cpp @@ -68,7 +68,7 @@ public: FUNCTION }; - using ValueTypes = std::vector; + using ValueTypes = ccstd::vector; using ReturnValue = union { int intValue; @@ -543,7 +543,7 @@ static bool JavaScriptJavaBridge_callStaticMethod(se::State &s) { //NOLINT(reada if (call.isValid() && call.getArgumentsCount() == (argc - 3)) { int count = argc - 3; auto * jargs = new jvalue[count]; - std::vector toReleaseObjects; + ccstd::vector toReleaseObjects; for (int i = 0; i < count; ++i) { int index = i + 3; switch (call.argumentTypeAtIndex(i)) { diff --git a/native/cocos/bindings/manual/JavaScriptJavaBridge.h b/native/cocos/bindings/manual/JavaScriptJavaBridge.h index 78125870d4..ef8e500c4a 100644 --- a/native/cocos/bindings/manual/JavaScriptJavaBridge.h +++ b/native/cocos/bindings/manual/JavaScriptJavaBridge.h @@ -25,7 +25,6 @@ #pragma once #include -#include #include "cocos/bindings/jswrapper/SeApi.h" #include "platform/java/jni/JniHelper.h" namespace se { diff --git a/native/cocos/bindings/manual/JavaScriptObjCBridge.mm b/native/cocos/bindings/manual/JavaScriptObjCBridge.mm index b6edebe567..5f93af9b70 100644 --- a/native/cocos/bindings/manual/JavaScriptObjCBridge.mm +++ b/native/cocos/bindings/manual/JavaScriptObjCBridge.mm @@ -30,7 +30,6 @@ #include -#include #include #import diff --git a/native/cocos/bindings/manual/jsb_cocos_manual.cpp b/native/cocos/bindings/manual/jsb_cocos_manual.cpp index e2f92ab94f..10c7eafdb1 100644 --- a/native/cocos/bindings/manual/jsb_cocos_manual.cpp +++ b/native/cocos/bindings/manual/jsb_cocos_manual.cpp @@ -606,7 +606,7 @@ static bool js_engine_FileUtils_listFilesRecursively(const se::State &s) { // NO CC_UNUSED bool ok = true; if (argc == 2) { std::string arg0; - std::vector arg1; + ccstd::vector arg1; ok &= sevalue_to_native(args[0], &arg0); SE_PRECONDITION2(ok, false, "js_engine_FileUtils_listFilesRecursively : Error processing arguments"); cobj->listFilesRecursively(arg0, &arg1); diff --git a/native/cocos/bindings/manual/jsb_conversions.h b/native/cocos/bindings/manual/jsb_conversions.h index 8316a269fa..c7f5128987 100644 --- a/native/cocos/bindings/manual/jsb_conversions.h +++ b/native/cocos/bindings/manual/jsb_conversions.h @@ -32,6 +32,7 @@ #include #include "base/Ptr.h" #include "base/RefCounted.h" +#include "base/std/container/vector.h" #include "bindings/jswrapper/HandleObject.h" #include "bindings/jswrapper/SeApi.h" #include "bindings/manual/jsb_classtype.h" @@ -222,7 +223,7 @@ seval_to_type(const se::Value &v, bool &ok) { // NOLINT(readability-identifier-n template typename std::enable_if::value && std::is_class::type>::value, bool>::type -seval_to_std_vector(const se::Value &v, std::vector *ret) { // NOLINT(readability-identifier-naming) +seval_to_std_vector(const se::Value &v, ccstd::vector *ret) { // NOLINT(readability-identifier-naming) assert(ret != nullptr); assert(v.isObject()); se::Object *obj = v.toObject(); @@ -262,7 +263,7 @@ seval_to_std_vector(const se::Value &v, std::vector *ret) { // NOLINT(readabi template typename std::enable_if::value, bool>::type -seval_to_std_vector(const se::Value &v, std::vector *ret) { // NOLINT(readability-identifier-naming) +seval_to_std_vector(const se::Value &v, ccstd::vector *ret) { // NOLINT(readability-identifier-naming) assert(ret != nullptr); assert(v.isObject()); se::Object *obj = v.toObject(); @@ -300,7 +301,7 @@ bool seval_to_Map_string_key(const se::Value &v, cc::RefMap *ret assert(v.isObject()); se::Object *obj = v.toObject(); - std::vector allKeys; + ccstd::vector allKeys; bool ok = obj->getAllKeys(&allKeys); if (!ok) { ret->clear(); @@ -509,7 +510,7 @@ bool native_ptr_to_seval(T *vp, se::Value *ret, bool *isReturnCachedValue = null return true; } template -bool std_vector_to_seval(const std::vector &v, se::Value *ret) { // NOLINT(readability-identifier-naming) +bool std_vector_to_seval(const ccstd::vector &v, se::Value *ret) { // NOLINT(readability-identifier-naming) assert(ret != nullptr); bool ok = true; se::HandleObject obj(se::Object::createArrayObject(v.size())); @@ -712,13 +713,13 @@ template bool sevalue_to_native(const se::Value &from, std::tuple *to, se::Object *ctx); // NOLINT(readability-identifier-naming) // std::shared_ptr template -bool sevalue_to_native(const se::Value &from, std::shared_ptr> *out, se::Object *ctx); // NOLINT(readability-identifier-naming) +bool sevalue_to_native(const se::Value &from, std::shared_ptr> *out, se::Object *ctx); // NOLINT(readability-identifier-naming) template bool sevalue_to_native(const se::Value &from, std::shared_ptr *out, se::Object *ctx); // NOLINT(readability-identifier-naming) -// std::vector -template -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object *ctx); // NOLINT(readability-identifier-naming) -// std::vector +// ccstd::vector +template +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object *ctx); // NOLINT(readability-identifier-naming) +// ccstd::vector template bool sevalue_to_native(const se::Value &from, std::array *to, se::Object *ctx); // NOLINT(readability-identifier-naming) @@ -778,10 +779,10 @@ bool sevalue_to_native(const se::Value &from, std::array *to, se:: } template -bool sevalue_to_native(const se::Value &from, cc::variant> *to, se::Object *ctx) { // NOLINT +bool sevalue_to_native(const se::Value &from, cc::variant> *to, se::Object *ctx) { // NOLINT se::Object *array = from.toObject(); if (array->isArray()) { - std::vector result; + ccstd::vector result; sevalue_to_native(from, &result, ctx); *to = std::move(result); } else { @@ -846,8 +847,8 @@ sevalue_to_native(const se::Value &from, T ***to, se::Object * /*ctx*/) { // NOL return true; } -template -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object *ctx) { // NOLINT(readability-identifier-naming) +template +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object *ctx) { // NOLINT(readability-identifier-naming) if (from.isNullOrUndefined()) { to->clear(); @@ -880,7 +881,7 @@ bool sevalue_to_native(const se::Value &from, std::vector *to, se: return true; } - SE_LOGE("[warn] failed to convert to std::vector\n"); + SE_LOGE("[warn] failed to convert to ccstd::vector\n"); return false; } @@ -991,34 +992,34 @@ inline typename std::enable_if, bool>::type sevalue_to_nativ #endif // HAS_CONSTEXPR #if HAS_CONSTEXPR -template -inline bool sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { // NOLINT(readability-identifier-naming) +template +inline bool sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { // NOLINT(readability-identifier-naming) if CC_CONSTEXPR (is_jsb_object_v && std::is_pointer::value) { auto &vec = holder->data; return sevalue_to_native(from, &vec, ctx); } else if CC_CONSTEXPR (is_jsb_object_v) { - return sevalue_to_native(from, static_cast *>(&(holder->data)), ctx); + return sevalue_to_native(from, static_cast *>(&(holder->data)), ctx); } else { return sevalue_to_native(from, &(holder->data), ctx); } } #else -template +template inline typename std::enable_if && std::is_pointer::value, bool>::type -sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { +sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { auto &vec = holder->data; return sevalue_to_native(from, &vec, ctx); } -template +template inline typename std::enable_if && !std::is_pointer::value, bool>::type -sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { - return sevalue_to_native(from, (std::vector *)/* clang/xcode needs this */ &(holder->data), ctx); +sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { + return sevalue_to_native(from, (ccstd::vector *)/* clang/xcode needs this */ &(holder->data), ctx); } -template +template inline typename std::enable_if, bool>::type -sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { +sevalue_to_native(const se::Value &from, HolderType, true> *holder, se::Object *ctx) { return sevalue_to_native(from, &(holder->data), ctx); } @@ -1027,13 +1028,13 @@ sevalue_to_native(const se::Value &from, HolderType, t /////////////////// std::shared_ptr template -bool sevalue_to_native(const se::Value &from, std::shared_ptr> *out, se::Object *ctx) { +bool sevalue_to_native(const se::Value &from, std::shared_ptr> *out, se::Object *ctx) { if (from.isNullOrUndefined()) { out->reset(); return true; } - *out = std::make_shared>(); + *out = std::make_shared>(); return sevalue_to_native(from, out->get(), ctx); } @@ -1108,7 +1109,7 @@ bool sevalue_to_native(const se::Value &from, std::tuple *to, se::Objec template bool sevalue_to_native(const se::Value &from, std::unordered_map *to, se::Object *ctx) { //NOLINT se::Object * jsmap = from.toObject(); - std::vector allKeys; + ccstd::vector allKeys; jsmap->getAllKeys(&allKeys); bool ret = true; se::Value property; @@ -1226,8 +1227,8 @@ bool nativevalue_to_se(const std::reference_wrapper ref, se::Value &to, se::O template bool nativevalue_to_se(const std::tuple &from, se::Value &to, se::Object *ctx); // NOLINT -template -inline bool nativevalue_to_se(const std::vector &from, se::Value &to, se::Object *ctx); // NOLINT +template +inline bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::Object *ctx); // NOLINT template inline bool nativevalue_to_se(const std::unordered_map &from, se::Value &to, se::Object *ctx); // NOLINT @@ -1251,8 +1252,8 @@ inline bool nativevalue_to_se(const cc::TypedArrayTemp &typedArray, se::Value return true; } -template -inline bool nativevalue_to_se(const std::vector &from, se::Value &to, se::Object *ctx) { // NOLINT(readability-identifier-naming) +template +inline bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::Object *ctx) { // NOLINT(readability-identifier-naming) se::HandleObject array(se::Object::createArrayObject(from.size())); se::Value tmp; for (size_t i = 0; i < from.size(); i++) { @@ -1263,8 +1264,7 @@ inline bool nativevalue_to_se(const std::vector &from, se::Value &to, se:: return true; } -template -inline bool nativevalue_to_se(const std::vector &from, se::Value &to, se::Object * /*ctx*/) { // NOLINT +inline bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::Object * /*ctx*/) { // NOLINT se::HandleObject array(se::Object::createArrayObject(from.size())); for (auto i = 0; i < from.size(); i++) { array->setArrayElement(i, se::Value(from[i])); @@ -1454,7 +1454,7 @@ bool nativevalue_to_se(const cc::variant &from, se::Value &to, se::Obje } template -inline bool nativevalue_to_se(const std::shared_ptr> &from, se::Value &to, se::Object *ctx) { //NOLINT +inline bool nativevalue_to_se(const std::shared_ptr> &from, se::Value &to, se::Object *ctx) { //NOLINT return nativevalue_to_se(*from, to, ctx); } diff --git a/native/cocos/bindings/manual/jsb_conversions_spec.cpp b/native/cocos/bindings/manual/jsb_conversions_spec.cpp index 58429a8120..d3ba6a584d 100644 --- a/native/cocos/bindings/manual/jsb_conversions_spec.cpp +++ b/native/cocos/bindings/manual/jsb_conversions_spec.cpp @@ -104,7 +104,7 @@ static bool isNumberString(const std::string &str) { namespace { template -bool std_vector_T_to_seval(const std::vector &v, se::Value *ret) { // NOLINT(readability-identifier-naming) +bool std_vector_T_to_seval(const ccstd::vector &v, se::Value *ret) { // NOLINT(readability-identifier-naming) assert(ret != nullptr); se::HandleObject obj(se::Object::createArrayObject(v.size())); bool ok = true; @@ -344,7 +344,7 @@ bool seval_to_ccvaluemap(const se::Value &v, cc::ValueMap *ret) { // NOLINT cc::ValueMap &dict = *ret; - std::vector allKeys; + ccstd::vector allKeys; SE_PRECONDITION3(obj->getAllKeys(&allKeys), false, ret->clear()); bool ok = false; @@ -375,7 +375,7 @@ bool seval_to_ccvaluemapintkey(const se::Value &v, cc::ValueMapIntKey *ret) { cc::ValueMapIntKey &dict = *ret; - std::vector allKeys; + ccstd::vector allKeys; SE_PRECONDITION3(obj->getAllKeys(&allKeys), false, ret->clear()); bool ok = false; @@ -790,13 +790,13 @@ bool sevalue_to_native(const se::Value &from, cc::MacroValue *to, se::Object * / } // NOLINTNEXTLINE(readability-identifier-naming) -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object * /*ctx*/) { +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/) { if (from.isNullOrUndefined()) { to->clear(); return true; } - SE_PRECONDITION2(from.isObject(), false, "sevalue_to_native(std::vector), not an object"); + SE_PRECONDITION2(from.isObject(), false, "sevalue_to_native(ccstd::vector), not an object"); auto *fromObj = from.toObject(); CC_ASSERT(fromObj->isArray()); uint32_t len = 0; @@ -810,7 +810,7 @@ bool sevalue_to_native(const se::Value &from, std::vector *to, continue; } cc::MacroRecord macroRecord; - std::vector keys; + ccstd::vector keys; ok = arrElement.toObject()->getAllKeys(&keys); if (ok) { se::Value seMacroVal; @@ -955,24 +955,24 @@ bool sevalue_to_native(const se::Value &from, cc::IPreCompileInfoValueType *to, obj->getArrayLength(&len); if (len == 0) { // TODO(PatriceJiang): judge type of empty array? - *to = std::vector{}; + *to = ccstd::vector{}; return false; } se::Value firstEle; obj->getArrayElement(0, &firstEle); if (firstEle.isBoolean()) { - std::vector result; + ccstd::vector result; sevalue_to_native(from, &result, ctx); return true; } if (firstEle.isNumber()) { - std::vector result; + ccstd::vector result; sevalue_to_native(from, &result, ctx); return true; } if (firstEle.isString()) { - std::vector result; + ccstd::vector result; sevalue_to_native(from, &result, ctx); return true; } @@ -981,11 +981,11 @@ bool sevalue_to_native(const se::Value &from, cc::IPreCompileInfoValueType *to, } // NOLINTNEXTLINE(readability-identifier-naming) -bool sevalue_to_native(const se::Value &from, cc::variant, std::string> *to, se::Object * /*ctx*/) { +bool sevalue_to_native(const se::Value &from, cc::variant, std::string> *to, se::Object * /*ctx*/) { if (from.isObject() && from.toObject()->isArray()) { uint32_t len = 0; bool ok = from.toObject()->getArrayLength(&len); - std::vector arr; + ccstd::vector arr; arr.resize(len); for (uint32_t i = 0; i < len; ++i) { se::Value e; @@ -1041,7 +1041,7 @@ bool sevalue_to_native(const se::Value &from, cc::ArrayBuffer **to, se::Object * } // NOLINTNEXTLINE(readability-identifier-naming) -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object * /*ctx*/) { +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/) { if (from.isNullOrUndefined()) { to->clear(); return true; @@ -1060,7 +1060,7 @@ bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object } // NOLINTNEXTLINE(readability-identifier-naming) -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object * /*ctx*/) { +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/) { if (from.isNullOrUndefined()) { to->clear(); return true; @@ -1203,7 +1203,7 @@ bool seval_to_Map_string_key(const se::Value &v, cc::RefMap allKeys; + ccstd::vector allKeys; bool ok = obj->getAllKeys(&allKeys); if (!ok) { ret->clear(); @@ -1537,7 +1537,7 @@ bool nativevalue_to_se(const cc::Mat4 &from, se::Value &to, se::Object * /*ctx*/ #if USE_PHYSICS_PHYSX -bool nativevalue_to_se(const std::vector> &from, se::Value &to, se::Object * /*ctx*/) { +bool nativevalue_to_se(const ccstd::vector> &from, se::Value &to, se::Object * /*ctx*/) { se::HandleObject array(se::Object::createArrayObject(from.size() * cc::physics::TriggerEventPair::COUNT)); for (size_t i = 0; i < from.size(); i++) { auto t = i * cc::physics::TriggerEventPair::COUNT; @@ -1549,7 +1549,7 @@ bool nativevalue_to_se(const std::vector &from, se::Value &to, se::Object * /*ctx*/) { +bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::Object * /*ctx*/) { const auto contactCount = from.size(); se::HandleObject array(se::Object::createArrayObject(contactCount)); for (size_t i = 0; i < contactCount; i++) { @@ -1572,7 +1572,7 @@ bool nativevalue_to_se(const std::vector &from, se::V return true; } -bool nativevalue_to_se(const std::vector> &from, se::Value &to, se::Object *ctx) { +bool nativevalue_to_se(const ccstd::vector> &from, se::Value &to, se::Object *ctx) { se::HandleObject array(se::Object::createArrayObject(from.size() * cc::physics::ContactEventPair::COUNT)); for (size_t i = 0; i < from.size(); i++) { auto t = i * cc::physics::ContactEventPair::COUNT; diff --git a/native/cocos/bindings/manual/jsb_conversions_spec.h b/native/cocos/bindings/manual/jsb_conversions_spec.h index 2111367aa9..600077f0c6 100644 --- a/native/cocos/bindings/manual/jsb_conversions_spec.h +++ b/native/cocos/bindings/manual/jsb_conversions_spec.h @@ -22,7 +22,6 @@ #pragma once #include -#include #include "base/Ptr.h" #include "base/Value.h" #include "bindings/jswrapper/SeApi.h" @@ -159,7 +158,7 @@ bool sevalue_to_native(const se::Value &from, cc::any *to, se::Object *ctx); //N bool sevalue_to_native(const se::Value &from, cc::ArrayBuffer *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) bool sevalue_to_native(const se::Value &from, cc::ArrayBuffer **to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) bool sevalue_to_native(const se::Value &from, cc::MaterialProperty *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) @@ -273,7 +272,7 @@ bool sevalue_to_native(const se::Value &from, cc::Quaternion *to, se::Object * / bool sevalue_to_native(const se::Value &from, cc::Color *to, se::Object * /*unused*/); // NOLINT(readability-identifier-naming) -inline bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object * /*unused*/) { // NOLINT(readability-identifier-naming) +inline bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*unused*/) { // NOLINT(readability-identifier-naming) if (from.isNullOrUndefined()) { to->clear(); return true; @@ -332,10 +331,10 @@ inline bool sevalue_to_native(const se::Value &from, cc::ValueMap *to, se::Objec return seval_to_ccvaluemap(from, to); } -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) -bool sevalue_to_native(const se::Value &from, std::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) -bool sevalue_to_native(const se::Value &from, cc::variant, std::string> *to, se::Object *ctx); // NOLINT(readability-identifier-naming) +bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) +bool sevalue_to_native(const se::Value &from, cc::variant, std::string> *to, se::Object *ctx); // NOLINT(readability-identifier-naming) inline bool sevalue_to_native(const se::Value & /*from*/, cc::monostate * /*to*/, se::Object * /*ctx*/) { // NOLINT(readability-identifier-naming) // nothing todo return false; @@ -377,14 +376,14 @@ bool DownloadTask_to_seval(const cc::network::DownloadTask &v, se::Value *ret); bool nativevalue_to_se(const cc::ArrayBuffer &arrayBuffer, se::Value &to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) // NOLINT -inline bool nativevalue_to_se(const std::vector &from, se::Value &to, se::Object * /*ctx*/) { // NOLINT(readability-identifier-naming) +inline bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::Object * /*ctx*/) { // NOLINT(readability-identifier-naming) se::Object *array = se::Object::createTypedArray(se::Object::TypedArrayType::INT8, from.data(), from.size()); to.setObject(array); array->decRef(); return true; } -inline bool nativevalue_to_se(const std::vector &from, se::Value &to, se::Object * /*ctx*/) { // NOLINT(readability-identifier-naming) +inline bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::Object * /*ctx*/) { // NOLINT(readability-identifier-naming) se::Object *array = se::Object::createTypedArray(se::Object::TypedArrayType::UINT8, from.data(), from.size()); to.setObject(array); array->decRef(); @@ -539,9 +538,9 @@ bool seval_to_Map_string_key(const se::Value &v, cc::RefMap> &from, se::Value &to, se::Object * /*ctx*/); -bool nativevalue_to_se(const std::vector &from, se::Value &to, se::Object * /*ctx*/); -bool nativevalue_to_se(const std::vector> &from, se::Value &to, se::Object *ctx); +bool nativevalue_to_se(const ccstd::vector> &from, se::Value &to, se::Object * /*ctx*/); +bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::Object * /*ctx*/); +bool nativevalue_to_se(const ccstd::vector> &from, se::Value &to, se::Object *ctx); bool nativevalue_to_se(const cc::physics::RaycastResult &from, se::Value &to, se::Object *ctx); bool sevalue_to_native(const se::Value &from, cc::physics::ConvexDesc *to, se::Object *ctx); diff --git a/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp b/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp index fc18dc4d7e..ca67af9821 100644 --- a/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp +++ b/native/cocos/bindings/manual/jsb_dragonbones_manual.cpp @@ -494,7 +494,7 @@ bool register_all_dragonbones_manual(se::Object *obj) { factory->stopSchedule(); // Copy the dragonbones object vector since vector element will be deleted in BaseObject destructor. - std::vector allDragonBonesObjects = dragonBones::BaseObject::getAllObjects(); + ccstd::vector allDragonBonesObjects = dragonBones::BaseObject::getAllObjects(); CC_LOG_INFO("Starting to cleanup dragonbones object, count: %d\n", (int)allDragonBonesObjects.size()); for (auto dbObj : allDragonBonesObjects) { if (!dbObj->isInPool()) { diff --git a/native/cocos/bindings/manual/jsb_extension_manual.cpp b/native/cocos/bindings/manual/jsb_extension_manual.cpp index f19d08f11c..309b54153a 100644 --- a/native/cocos/bindings/manual/jsb_extension_manual.cpp +++ b/native/cocos/bindings/manual/jsb_extension_manual.cpp @@ -85,7 +85,7 @@ static bool js_cocos2dx_extension_loadRemoteImage(se::State &s) { onSuccess(texture); } else { auto downloader = new (std::nothrow) cc::network::Downloader(); - downloader->onDataTaskSuccess = [downloader, url, onSuccess, onError](const cc::network::DownloadTask &task, std::vector &data) { + downloader->onDataTaskSuccess = [downloader, url, onSuccess, onError](const cc::network::DownloadTask &task, ccstd::vector &data) { Image * img = new (std::nothrow) Image(); Texture2D *tex = nullptr; do { @@ -165,7 +165,7 @@ static bool js_cocos2dx_extension_initRemoteImage(se::State &s) { }; auto downloader = new (std::nothrow) cc::network::Downloader(); - downloader->onDataTaskSuccess = [=](const cc::network::DownloadTask &task, std::vector &data) { + downloader->onDataTaskSuccess = [=](const cc::network::DownloadTask &task, ccstd::vector &data) { bool success = false; Image *image = new (std::nothrow) Image(); diff --git a/native/cocos/bindings/manual/jsb_gfx_manual.cpp b/native/cocos/bindings/manual/jsb_gfx_manual.cpp index 43f3051d4d..a78deb43ae 100644 --- a/native/cocos/bindings/manual/jsb_gfx_manual.cpp +++ b/native/cocos/bindings/manual/jsb_gfx_manual.cpp @@ -95,7 +95,7 @@ bool js_gfx_Device_copyTextureToBuffers(se::State &s) { // NOLINT(readability-id CC_UNUSED bool ok = true; if (argc == 3) { cc::gfx::Texture * arg0 = nullptr; - cc::vector arg1; + ccstd::vector arg1; cc::gfx::BufferTextureCopyList arg2; if (args[1].isObject()) { se::Object *dataObj = args[1].toObject(); diff --git a/native/cocos/bindings/manual/jsb_global.cpp b/native/cocos/bindings/manual/jsb_global.cpp index 2a1b134404..4368e3b6aa 100644 --- a/native/cocos/bindings/manual/jsb_global.cpp +++ b/native/cocos/bindings/manual/jsb_global.cpp @@ -60,7 +60,7 @@ static cc::network::Downloader *localDownloader() { if (!gLocalDownloader) { gLocalDownloader = std::make_shared(); gLocalDownloader->onDataTaskSuccess = [=](const cc::network::DownloadTask & task, - const std::vector &data) { + const ccstd::vector &data) { if (data.empty()) { SE_REPORT_ERROR("Getting image from (%s) failed!", task.requestURL.c_str()); return; @@ -272,7 +272,7 @@ static bool jsc_dumpNativePtrToSeObjectMap(se::State &s) { //NOLINT void * ptr; }; - std::vector namePtrArray; + ccstd::vector namePtrArray; for (const auto &e : se::NativePtrToObjectMap::instance()) { se::Object *jsobj = e.second; diff --git a/native/cocos/bindings/manual/jsb_global_init.cpp b/native/cocos/bindings/manual/jsb_global_init.cpp index c0119f4e77..cf91fc0d0e 100644 --- a/native/cocos/bindings/manual/jsb_global_init.cpp +++ b/native/cocos/bindings/manual/jsb_global_init.cpp @@ -45,7 +45,6 @@ #include #include #include -#include using namespace cc; //NOLINT diff --git a/native/cocos/bindings/manual/jsb_platfrom_apple.mm b/native/cocos/bindings/manual/jsb_platfrom_apple.mm index 34b984d019..b9b357abce 100644 --- a/native/cocos/bindings/manual/jsb_platfrom_apple.mm +++ b/native/cocos/bindings/manual/jsb_platfrom_apple.mm @@ -42,8 +42,8 @@ const std::unordered_map &getFontFamilyNameMap() { return _fontFamilyNameMap; } -static std::vector getAvailableFontFamilyNames() { - std::vector ret; +static ccstd::vector getAvailableFontFamilyNames() { + ccstd::vector ret; #if CC_PLATFORM == CC_PLATFORM_MAC_OSX CFArrayRef allFamilyNames = CTFontManagerCopyAvailableFontFamilyNames(); @@ -63,7 +63,7 @@ static std::vector getAvailableFontFamilyNames() { return ret; } -static std::string getFontFamilyByCompareAvailableFontFamilyNames(const std::vector &before, const std::vector &after) { +static std::string getFontFamilyByCompareAvailableFontFamilyNames(const ccstd::vector &before, const ccstd::vector &after) { std::string ret; size_t beforeLen = before.size(); size_t afterLen = after.size(); diff --git a/native/cocos/bindings/manual/jsb_scene_manual.cpp b/native/cocos/bindings/manual/jsb_scene_manual.cpp index 8ec0f814da..c02cc080ea 100644 --- a/native/cocos/bindings/manual/jsb_scene_manual.cpp +++ b/native/cocos/bindings/manual/jsb_scene_manual.cpp @@ -877,7 +877,7 @@ static bool js_Model_registerListeners(se::State &s) // NOLINT(readability-ident se::ScriptEngine::getInstance()->callFunction(thiz, "_updateLocalDescriptors", static_cast(args.size()), args.data()); }); - cobj->getEventProcessor().on(cc::EventTypesToJS::MODEL_UPDATE_INSTANCED_ATTRIBUTES, [=](const std::vector &attributes, cc::scene::Pass *pass) { + cobj->getEventProcessor().on(cc::EventTypesToJS::MODEL_UPDATE_INSTANCED_ATTRIBUTES, [=](const ccstd::vector &attributes, cc::scene::Pass *pass) { cobj->setCalledFromJS(true); se::AutoHandleScope hs; @@ -887,7 +887,7 @@ static bool js_Model_registerListeners(se::State &s) // NOLINT(readability-ident se::ScriptEngine::getInstance()->callFunction(thiz, "_updateInstancedAttributes", static_cast(args.size()), args.data()); }); - cobj->getEventProcessor().on(cc::EventTypesToJS::MODEL_GET_MACRO_PATCHES, [=](index_t subModelIndex, std::vector *pPatches) { + cobj->getEventProcessor().on(cc::EventTypesToJS::MODEL_GET_MACRO_PATCHES, [=](index_t subModelIndex, ccstd::vector *pPatches) { cobj->setCalledFromJS(true); se::AutoHandleScope hs; diff --git a/native/cocos/bindings/manual/jsb_spine_manual.cpp b/native/cocos/bindings/manual/jsb_spine_manual.cpp index eb0d315af7..9ffd7f1519 100644 --- a/native/cocos/bindings/manual/jsb_spine_manual.cpp +++ b/native/cocos/bindings/manual/jsb_spine_manual.cpp @@ -128,7 +128,7 @@ static bool js_register_spine_initSkeletonData(se::State &s) { } if (skeletonData) { - std::vector texturesIndex; + ccstd::vector texturesIndex; for (auto it = textures.begin(); it != textures.end(); it++) { texturesIndex.push_back(it->second->getRealTextureIndex()); } diff --git a/native/cocos/bindings/manual/jsb_websocket.cpp b/native/cocos/bindings/manual/jsb_websocket.cpp index 5e2569d171..36dcb12a05 100644 --- a/native/cocos/bindings/manual/jsb_websocket.cpp +++ b/native/cocos/bindings/manual/jsb_websocket.cpp @@ -264,7 +264,7 @@ static bool webSocketConstructor(se::State &s) { cc::network::WebSocket *cobj = nullptr; if (argc >= 2) { std::string caFilePath; - std::vector protocols; + ccstd::vector protocols; if (args[1].isString()) { std::string protocol; diff --git a/native/cocos/bindings/manual/jsb_xmlhttprequest.cpp b/native/cocos/bindings/manual/jsb_xmlhttprequest.cpp index d70bc97a5b..5678a8a0b1 100644 --- a/native/cocos/bindings/manual/jsb_xmlhttprequest.cpp +++ b/native/cocos/bindings/manual/jsb_xmlhttprequest.cpp @@ -424,7 +424,7 @@ void XMLHttpRequest::onResponse(HttpClient * /*client*/, HttpResponse *response) } // set header - std::vector *headers = response->getResponseHeader(); + ccstd::vector *headers = response->getResponseHeader(); std::string header(headers->begin(), headers->end()); @@ -435,7 +435,7 @@ void XMLHttpRequest::onResponse(HttpClient * /*client*/, HttpResponse *response) } /** get the response data **/ - std::vector *buffer = response->getResponseData(); + ccstd::vector *buffer = response->getResponseData(); if (_responseType == ResponseType::STRING || _responseType == ResponseType::JSON) { _responseText.append(buffer->data(), buffer->size()); @@ -548,7 +548,7 @@ std::string XMLHttpRequest::getResponseHeader(const std::string &key) const { } void XMLHttpRequest::setHttpRequestHeader() { - std::vector header; + ccstd::vector header; for (auto &it : _requestHeader) { const char *first = it.first.c_str(); diff --git a/native/cocos/core/Root.cpp b/native/cocos/core/Root.cpp index 39c6fd3263..641ac212a4 100644 --- a/native/cocos/core/Root.cpp +++ b/native/cocos/core/Root.cpp @@ -135,7 +135,7 @@ public: bool destroy() noexcept override { return pipeline->destroy(); } - void render(const std::vector &cameras) override { + void render(const ccstd::vector &cameras) override { pipeline->render(cameras); } const MacroRecord &getMacros() const override { diff --git a/native/cocos/core/Root.h b/native/cocos/core/Root.h index 1fefd114b1..e67b618d37 100644 --- a/native/cocos/core/Root.h +++ b/native/cocos/core/Root.h @@ -25,7 +25,6 @@ #pragma once #include -#include //#include "3d/skeletal-animation/DataPoolManager.h" #include "core/memop/Pool.h" #include "renderer/pipeline/RenderPipeline.h" @@ -184,7 +183,7 @@ public: * @zh * 窗口列表 */ - inline const std::vector> &getWindows() const { return _windows; } + inline const ccstd::vector> &getWindows() const { return _windows; } /** * @zh @@ -209,7 +208,7 @@ public: * @zh * 场景列表 */ - inline const std::vector> &getScenes() const { return _scenes; } + inline const ccstd::vector> &getScenes() const { return _scenes; } /** * @zh @@ -255,12 +254,12 @@ private: IntrusivePtr _mainWindow; IntrusivePtr _curWindow; IntrusivePtr _tempWindow; - std::vector> _windows; + ccstd::vector> _windows; IntrusivePtr _pipeline{nullptr}; std::unique_ptr _pipelineRuntime; scene::DrawBatch2D * _batcher2D{nullptr}; // IntrusivePtr _dataPoolMgr; - std::vector> _scenes; + ccstd::vector> _scenes; memop::Pool * _cameraPool{nullptr}; float _cumulativeTime{0.F}; float _frameTime{0.F}; @@ -272,9 +271,9 @@ private: bool _usesCustomPipeline{false}; CallbacksInvoker * _eventProcessor{nullptr}; - // Cache std::vector to avoid allocate every frame in frameMove - std::vector _cameraList; - std::vector _swapchains; + // Cache ccstd::vector to avoid allocate every frame in frameMove + ccstd::vector _cameraList; + ccstd::vector _swapchains; // }; diff --git a/native/cocos/core/Types.h b/native/cocos/core/Types.h index c6bf553fa0..dde4de04c7 100644 --- a/native/cocos/core/Types.h +++ b/native/cocos/core/Types.h @@ -28,7 +28,6 @@ #include #include #include -#include #include "cocos/base/Optional.h" #include diff --git a/native/cocos/core/animation/SkeletalAnimationUtils.cpp b/native/cocos/core/animation/SkeletalAnimationUtils.cpp index dda70388d5..fc5a8586d6 100644 --- a/native/cocos/core/animation/SkeletalAnimationUtils.cpp +++ b/native/cocos/core/animation/SkeletalAnimationUtils.cpp @@ -29,7 +29,7 @@ namespace cc { namespace { -std::vector stack; //cjh TODO: how to release ? +ccstd::vector stack; //cjh TODO: how to release ? std::unordered_map pool; } // namespace diff --git a/native/cocos/core/assets/EffectAsset.cpp b/native/cocos/core/assets/EffectAsset.cpp index 781a75f0cd..e540d891b0 100644 --- a/native/cocos/core/assets/EffectAsset.cpp +++ b/native/cocos/core/assets/EffectAsset.cpp @@ -171,7 +171,7 @@ void EffectAsset::precompile() { } // TODO(minggo): do unit test - std::vector defines = EffectAsset::doCombine(std::vector(), combination, combination.begin()); + ccstd::vector defines = EffectAsset::doCombine(ccstd::vector(), combination, combination.begin()); for (auto &define : defines) { ProgramLib::getInstance()->getGFXShader(root->getDevice(), shader.name, define, root->getPipeline()); } @@ -213,7 +213,7 @@ const defines = [ // ... all the combinations (2x4x3 in this case) ]; */ -std::vector EffectAsset::doCombine(const std::vector &cur, const IPreCompileInfo &info, IPreCompileInfo::iterator iter) { //NOLINT(misc-no-recursion) +ccstd::vector EffectAsset::doCombine(const ccstd::vector &cur, const IPreCompileInfo &info, IPreCompileInfo::iterator iter) { //NOLINT(misc-no-recursion) if (iter == info.end()) { return cur; } @@ -221,7 +221,7 @@ std::vector EffectAsset::doCombine(const std::vector & const IPreCompileInfoValueType &values = iter->second; const std::string & key = iter->first; - std::vector records; + ccstd::vector records; if (cur.empty()) { records = EffectAsset::generateRecords(key, values); } else { @@ -231,21 +231,21 @@ std::vector EffectAsset::doCombine(const std::vector & return EffectAsset::doCombine(records, info, ++iter); } -std::vector EffectAsset::generateRecords(const std::string &key, const IPreCompileInfoValueType &value) { - std::vector ret; - if (const auto *boolValues = cc::get_if>(&value)) { +ccstd::vector EffectAsset::generateRecords(const std::string &key, const IPreCompileInfoValueType &value) { + ccstd::vector ret; + if (const auto *boolValues = cc::get_if>(&value)) { for (const bool value : *boolValues) { MacroRecord record; record[key] = value; ret.emplace_back(record); } - } else if (const auto *intValues = cc::get_if>(&value)) { + } else if (const auto *intValues = cc::get_if>(&value)) { for (const int32_t value : *intValues) { MacroRecord record; record[key] = value; ret.emplace_back(record); } - } else if (const auto *stringValues = cc::get_if>(&value)) { + } else if (const auto *stringValues = cc::get_if>(&value)) { for (const std::string &value : *stringValues) { MacroRecord record; record[key] = value; @@ -258,24 +258,24 @@ std::vector EffectAsset::generateRecords(const std::string &key, co return ret; } -std::vector EffectAsset::insertInfoValue(const std::vector &records, +ccstd::vector EffectAsset::insertInfoValue(const ccstd::vector &records, const std::string & key, const IPreCompileInfoValueType &value) { - std::vector ret; + ccstd::vector ret; for (const auto &record : records) { - if (const auto *boolValues = cc::get_if>(&value)) { + if (const auto *boolValues = cc::get_if>(&value)) { for (const bool value : *boolValues) { MacroRecord tmpRecord = record; tmpRecord[key] = value; ret.emplace_back(tmpRecord); } - } else if (const auto *intValues = cc::get_if>(&value)) { + } else if (const auto *intValues = cc::get_if>(&value)) { for (const int32_t value : *intValues) { MacroRecord tmpRecord = record; tmpRecord[key] = value; ret.emplace_back(tmpRecord); } - } else if (const auto *stringValues = cc::get_if>(&value)) { + } else if (const auto *stringValues = cc::get_if>(&value)) { for (const std::string &value : *stringValues) { MacroRecord tmpRecord = record; tmpRecord[key] = value; diff --git a/native/cocos/core/assets/EffectAsset.h b/native/cocos/core/assets/EffectAsset.h index d82ca0e78f..da99f8961d 100644 --- a/native/cocos/core/assets/EffectAsset.h +++ b/native/cocos/core/assets/EffectAsset.h @@ -42,7 +42,7 @@ namespace cc { using IPropertyHandleInfo = std::tuple; -using IPropertyValue = cc::optional, std::string>>; +using IPropertyValue = cc::optional, std::string>>; struct IPropertyInfo { int32_t type; // auto-extracted from shader @@ -284,7 +284,7 @@ struct BlendTargetInfo { } }; -using BlendTargetInfoList = std::vector; +using BlendTargetInfoList = ccstd::vector; struct BlendStateInfo { cc::optional isA2C; @@ -392,14 +392,14 @@ struct IPassInfoFull final { //cjh } : public IPassInfo { using IPassInfo = IPassInfoFull; struct ITechniqueInfo { - std::vector passes; + ccstd::vector passes; cc::optional name; }; struct IBlockInfo { int32_t binding{-1}; std::string name; - std::vector members; + ccstd::vector members; gfx::ShaderStageFlags stageFlags{gfx::ShaderStageFlags::NONE}; }; @@ -460,27 +460,27 @@ struct IAttributeInfo { bool isInstanced{false}; uint32_t location{0U}; - std::vector defines; + ccstd::vector defines; }; struct IDefineInfo { std::string name; std::string type; - cc::optional> range; //cjh number is float? ?: number[]; - cc::optional> options; + cc::optional> range; //cjh number is float? ?: number[]; + cc::optional> options; cc::optional defaultVal; }; struct IBuiltin { std::string name; - std::vector defines; + ccstd::vector defines; }; struct IBuiltinInfo { - std::vector buffers; - std::vector blocks; - std::vector samplerTextures; - std::vector images; + ccstd::vector buffers; + ccstd::vector blocks; + ccstd::vector samplerTextures; + ccstd::vector images; }; using BuiltinsStatisticsType = std::unordered_map; @@ -503,15 +503,15 @@ struct IShaderInfo { IShaderSource glsl3; IShaderSource glsl1; IBuiltins builtins; - std::vector defines; - std::vector attributes; - std::vector blocks; - std::vector samplerTextures; - std::vector samplers; - std::vector textures; - std::vector buffers; - std::vector images; - std::vector subpassInputs; + ccstd::vector defines; + ccstd::vector attributes; + ccstd::vector blocks; + ccstd::vector samplerTextures; + ccstd::vector samplers; + ccstd::vector textures; + ccstd::vector buffers; + ccstd::vector images; + ccstd::vector subpassInputs; const IShaderSource *getSource(const std::string &version) const { if (version == "glsl1") return &glsl1; @@ -521,7 +521,7 @@ struct IShaderInfo { } }; -using IPreCompileInfoValueType = cc::variant, std::vector, std::vector>; +using IPreCompileInfoValueType = cc::variant, ccstd::vector, ccstd::vector>; using IPreCompileInfo = std::unordered_map; class EffectAsset final : public Asset { @@ -556,13 +556,13 @@ public: */ static RegisteredEffectAssetMap &getAll() { return EffectAsset::effects; } - inline void setTechniques(const std::vector &val) { _techniques = val; } - inline void setShaders(const std::vector &val) { _shaders = val; } - inline void setCombinations(const std::vector &val) { _combinations = val; } + inline void setTechniques(const ccstd::vector &val) { _techniques = val; } + inline void setShaders(const ccstd::vector &val) { _shaders = val; } + inline void setCombinations(const ccstd::vector &val) { _combinations = val; } - inline const std::vector & getTechniques() const { return _techniques; } - inline const std::vector & getShaders() const { return _shaders; } - inline const std::vector &getCombinations() const { return _combinations; } + inline const ccstd::vector & getTechniques() const { return _techniques; } + inline const ccstd::vector & getShaders() const { return _shaders; } + inline const ccstd::vector &getCombinations() const { return _combinations; } /* @serializable @@ -580,9 +580,9 @@ public: bool validate() const override; protected: - static std::vector doCombine(const std::vector &cur, const IPreCompileInfo &info, IPreCompileInfo::iterator iter); - static std::vector generateRecords(const std::string &key, const IPreCompileInfoValueType &value); - static std::vector insertInfoValue(const std::vector &records, + static ccstd::vector doCombine(const ccstd::vector &cur, const IPreCompileInfo &info, IPreCompileInfo::iterator iter); + static ccstd::vector generateRecords(const std::string &key, const IPreCompileInfoValueType &value); + static ccstd::vector insertInfoValue(const ccstd::vector &records, const std::string & key, const IPreCompileInfoValueType &value); @@ -596,7 +596,7 @@ public: @serializable @editable*/ - std::vector _techniques; + ccstd::vector _techniques; /** * @en The shaders used by the current effect. @@ -604,7 +604,7 @@ public: @serializable @editable*/ - std::vector _shaders; + ccstd::vector _shaders; /** * @en The preprocess macro combinations for the shader @@ -612,7 +612,7 @@ public: @serializable @editable*/ - std::vector _combinations; + ccstd::vector _combinations; // protected: static RegisteredEffectAssetMap effects; //cjh TODO: how to clear when game exits. diff --git a/native/cocos/core/assets/Material.cpp b/native/cocos/core/assets/Material.cpp index 908413c05a..3199288952 100644 --- a/native/cocos/core/assets/Material.cpp +++ b/native/cocos/core/assets/Material.cpp @@ -51,7 +51,7 @@ uint64_t Material::getHashForMaterial(Material *material) { } Material::Material() { - _passes = std::make_shared>>(); + _passes = std::make_shared>>(); } Material::~Material() = default; @@ -180,7 +180,7 @@ CC_MATERIAL_SETPROPERTY_IMPL(GFXTexture, gfx::Texture *) #undef CC_MATERIAL_SETPROPERTY_IMPL #define CC_MATERIAL_SETPROPERTY_ARRAY_IMPL(funcNameSuffix, type) \ - void Material::setProperty##funcNameSuffix##Array(const std::string &name, const std::vector &val, index_t /*passIdx = CC_INVALID_INDEX*/) { \ + void Material::setProperty##funcNameSuffix##Array(const std::string &name, const ccstd::vector &val, index_t /*passIdx = CC_INVALID_INDEX*/) { \ MaterialPropertyList propertyArr; \ propertyArr.reserve(val.size()); \ for (const auto &e : val) { \ @@ -309,8 +309,8 @@ void Material::update(bool keepProps /* = true*/) { _hash = Material::getHashForMaterial(this); } -std::vector> Material::createPasses() { - std::vector> passes; +ccstd::vector> Material::createPasses() { + ccstd::vector> passes; ITechniqueInfo * tech = nullptr; if (_techIdx < _effectAsset->_techniques.size()) { tech = &_effectAsset->_techniques[_techIdx]; diff --git a/native/cocos/core/assets/Material.h b/native/cocos/core/assets/Material.h index 3c96168869..1e8a961140 100644 --- a/native/cocos/core/assets/Material.h +++ b/native/cocos/core/assets/Material.h @@ -27,7 +27,6 @@ #include #include -#include #include "base/Ptr.h" #include "cocos/base/Optional.h" #include "cocos/base/Variant.h" @@ -67,7 +66,7 @@ struct IMaterialInfo { */ cc::optional technique; - using DefinesType = cc::variant>; + using DefinesType = cc::variant>; /** * @en * The shader macro definitions. Default to 0 or the specified value in [[EffectAsset]]. @@ -76,7 +75,7 @@ struct IMaterialInfo { */ cc::optional defines; - using PassOverridesType = cc::variant>; + using PassOverridesType = cc::variant>; /** * @en * The override values on top of the pipeline states specified in [[EffectAsset]]. @@ -188,17 +187,17 @@ public: void setPropertyTextureBase(const std::string &name, TextureBase *val, index_t passIdx = CC_INVALID_INDEX); void setPropertyGFXTexture(const std::string &name, gfx::Texture *val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyFloat32Array(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyInt32Array(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyVec2Array(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyVec3Array(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyVec4Array(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyColorArray(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyMat3Array(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyMat4Array(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyQuaternionArray(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyTextureBaseArray(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); - void setPropertyGFXTextureArray(const std::string &name, const std::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyFloat32Array(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyInt32Array(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyVec2Array(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyVec3Array(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyVec4Array(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyColorArray(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyMat3Array(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyMat4Array(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyQuaternionArray(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyTextureBaseArray(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); + void setPropertyGFXTextureArray(const std::string &name, const ccstd::vector &val, index_t passIdx = CC_INVALID_INDEX); /** * @en @@ -232,17 +231,17 @@ public: uint32_t _techIdx{0}; /* @serializable */ - std::vector _defines; + ccstd::vector _defines; /* @serializable */ - std::vector _states; + ccstd::vector _states; /* @serializable */ - std::vector> _props; + ccstd::vector> _props; // protected: - std::shared_ptr>> _passes; + std::shared_ptr>> _passes; uint64_t _hash{0}; @@ -283,7 +282,7 @@ public: * @en The passes defined in this material. * @zh 当前正在使用的 pass 数组。 */ - std::shared_ptr>> &getPasses() { + std::shared_ptr>> &getPasses() { return _passes; } @@ -321,12 +320,12 @@ protected: void bindTexture(scene::Pass *pass, uint32_t handle, const MaterialProperty &val, index_t index = CC_INVALID_INDEX); template - void prepareInfo(const T1 &patch, std::vector &cur) { + void prepareInfo(const T1 &patch, ccstd::vector &cur) { auto *pOneElement = cc::get_if(&patch); if (pOneElement != nullptr) { size_t len = _effectAsset != nullptr ? _effectAsset->_techniques[_techIdx].passes.size() : 1; - std::vector patchArray; + ccstd::vector patchArray; patchArray.reserve(len); for (size_t i = 0; i < len; ++i) { patchArray.emplace_back(*pOneElement); @@ -338,7 +337,7 @@ protected: cur[i] = patchArray[i]; } } else { - auto *pPatchArray = cc::get_if>(&patch); + auto *pPatchArray = cc::get_if>(&patch); if (pPatchArray != nullptr) { const auto &patchArray = *pPatchArray; size_t len = patchArray.size(); @@ -353,7 +352,7 @@ protected: virtual void doDestroy(); - virtual std::vector> createPasses(); + virtual ccstd::vector> createPasses(); private: friend class MaterialDeserializer; diff --git a/native/cocos/core/assets/RenderTexture.cpp b/native/cocos/core/assets/RenderTexture.cpp index 728689e6b8..9681c7a579 100644 --- a/native/cocos/core/assets/RenderTexture.cpp +++ b/native/cocos/core/assets/RenderTexture.cpp @@ -138,7 +138,7 @@ bool RenderTexture::validate() const { return _width >= 1 && _width <= 2048 && _height >= 1 && _height <= 2048; } -std::vector RenderTexture::readPixels(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const { +ccstd::vector RenderTexture::readPixels(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const { auto *gfxTexture = getGFXTexture(); if (!gfxTexture) { debug::errorID(7606); @@ -153,7 +153,7 @@ std::vector RenderTexture::readPixels(uint32_t x, uint32_t y, uint32_t region0.texExtent.width = width; region0.texExtent.height = height; - std::vector buffer; + ccstd::vector buffer; buffer.resize(width * height * 4); uint8_t *pBuffer = buffer.data(); gfxDevice->copyTextureToBuffers(gfxTexture, &pBuffer, ®ion0, 1); diff --git a/native/cocos/core/assets/RenderTexture.h b/native/cocos/core/assets/RenderTexture.h index 1c9663c2f1..dfa32b4329 100644 --- a/native/cocos/core/assets/RenderTexture.h +++ b/native/cocos/core/assets/RenderTexture.h @@ -110,7 +110,7 @@ public: * @param width 像素宽度 * @param height 像素高度 */ - std::vector readPixels(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const; + ccstd::vector readPixels(uint32_t x, uint32_t y, uint32_t width, uint32_t height) const; private: scene::RenderWindow *_window{nullptr}; diff --git a/native/cocos/core/assets/RenderingSubMesh.cpp b/native/cocos/core/assets/RenderingSubMesh.cpp index c55ae25858..a1fc7ef026 100644 --- a/native/cocos/core/assets/RenderingSubMesh.cpp +++ b/native/cocos/core/assets/RenderingSubMesh.cpp @@ -290,7 +290,7 @@ gfx::Buffer *RenderingSubMesh::allocVertexIdBuffer(gfx::Device *device) { // TODO(minggo): This depends on how stride of a vertex buffer is defined; Consider padding problem. : _vertexBuffers.at(0)->getSize() / _vertexBuffers.at(0)->getStride(); - std::vector vertexIds(vertexCount); + ccstd::vector vertexIds(vertexCount); for (int iVertex = 0; iVertex < vertexCount; ++iVertex) { // `+0.5` because on some platforms, the "fetched integer" may have small error. // For example `26` may yield `25.99999`, which is convert to `25` instead of `26` using `int()`. diff --git a/native/cocos/core/assets/RenderingSubMesh.h b/native/cocos/core/assets/RenderingSubMesh.h index 4391dd29b2..5fa6e9379b 100644 --- a/native/cocos/core/assets/RenderingSubMesh.h +++ b/native/cocos/core/assets/RenderingSubMesh.h @@ -148,8 +148,8 @@ public: * @en Flatted vertex buffers * @zh 扁平化的顶点缓冲区。 */ - inline const std::vector &getFlatBuffers() const { return _flatBuffers; } - inline void setFlatBuffers(const std::vector &flatBuffers) { _flatBuffers = flatBuffers; } + inline const ccstd::vector &getFlatBuffers() const { return _flatBuffers; } + inline void setFlatBuffers(const ccstd::vector &flatBuffers) { _flatBuffers = flatBuffers; } void genFlatBuffers(); @@ -189,12 +189,12 @@ private: Mesh * _mesh{nullptr}; cc::optional _subMeshIdx; - std::vector _flatBuffers; + ccstd::vector _flatBuffers; // As gfx::InputAssemblerInfo needs the data structure, so not use IntrusivePtr. RefVector _jointMappedBuffers; - std::vector _jointMappedBufferIndices; + ccstd::vector _jointMappedBufferIndices; cc::optional _vertexIdChannel; diff --git a/native/cocos/core/assets/Texture2D.cpp b/native/cocos/core/assets/Texture2D.cpp index f01b35d068..9d392e70c2 100644 --- a/native/cocos/core/assets/Texture2D.cpp +++ b/native/cocos/core/assets/Texture2D.cpp @@ -35,11 +35,11 @@ namespace cc { Texture2D::Texture2D() = default; Texture2D::~Texture2D() = default; -void Texture2D::syncMipmapsForJS(const std::vector> &value) { +void Texture2D::syncMipmapsForJS(const ccstd::vector> &value) { _mipmaps = value; } -void Texture2D::setMipmaps(const std::vector> &value) { +void Texture2D::setMipmaps(const ccstd::vector> &value) { _mipmaps = value; setMipmapLevel(static_cast(_mipmaps.size())); if (!_mipmaps.empty()) { @@ -194,7 +194,7 @@ void Texture2D::initDefault(const cc::optional &uuid) { } void Texture2D::setImage(ImageAsset *value) { - std::vector> mipmaps; + ccstd::vector> mipmaps; if (value != nullptr) { mipmaps.emplace_back(value); } diff --git a/native/cocos/core/assets/Texture2D.h b/native/cocos/core/assets/Texture2D.h index 5b8f3bc27a..68c4ee03fc 100644 --- a/native/cocos/core/assets/Texture2D.h +++ b/native/cocos/core/assets/Texture2D.h @@ -35,7 +35,7 @@ namespace cc { struct ITexture2DSerializeData { std::string base; - std::vector mipmaps; + ccstd::vector mipmaps; }; /** @@ -87,18 +87,18 @@ public: * @zh 所有层级 Mipmap,注意,这里不包含自动生成的 Mipmap。 * 当设置 Mipmap 时,贴图的尺寸以及像素格式可能会改变。 */ - const std::vector> &getMipmaps() const { + const ccstd::vector> &getMipmaps() const { return _mipmaps; } - const std::vector &getMipmapsUuids() const { // TODO(xwx): temporary use _mipmaps as string array + const ccstd::vector &getMipmapsUuids() const { // TODO(xwx): temporary use _mipmaps as string array return _mipmapsUuids; } //cjh TODO: TextureCube also needs this method. - void syncMipmapsForJS(const std::vector> &value); + void syncMipmapsForJS(const ccstd::vector> &value); - void setMipmaps(const std::vector> &value); + void setMipmaps(const ccstd::vector> &value); /** * @en Level 0 mipmap image. @@ -192,9 +192,9 @@ public: bool validate() const override; private: - std::vector> _mipmaps; + ccstd::vector> _mipmaps; - std::vector _mipmapsUuids; // TODO(xwx): temporary use _mipmaps as UUIDs string array + ccstd::vector _mipmapsUuids; // TODO(xwx): temporary use _mipmaps as UUIDs string array friend class Texture2DDeserializer; diff --git a/native/cocos/core/assets/TextureCube.cpp b/native/cocos/core/assets/TextureCube.cpp index 6b0abc2ccd..0141c3b1a5 100644 --- a/native/cocos/core/assets/TextureCube.cpp +++ b/native/cocos/core/assets/TextureCube.cpp @@ -49,9 +49,9 @@ void forEachFace(const ITextureCubeMipmap &mipmap, const ForEachFaceCallback &ca } // namespace /* static */ -TextureCube *TextureCube::fromTexture2DArray(const std::vector &textures) { +TextureCube *TextureCube::fromTexture2DArray(const ccstd::vector &textures) { size_t nMipmaps = textures.size() / 6; - std::vector mipmaps; + ccstd::vector mipmaps; mipmaps.reserve(nMipmaps); for (size_t i = 0; i < nMipmaps; i++) { size_t x = i * 6; @@ -75,7 +75,7 @@ TextureCube::TextureCube() = default; TextureCube::~TextureCube() = default; -void TextureCube::setMipmaps(const std::vector &value) { +void TextureCube::setMipmaps(const ccstd::vector &value) { _mipmaps = value; setMipmapLevel(static_cast(_mipmaps.size())); if (!_mipmaps.empty()) { @@ -104,7 +104,7 @@ void TextureCube::setMipmaps(const std::vector &value) { } } -void TextureCube::setMipmapsForJS(const std::vector &value) { +void TextureCube::setMipmapsForJS(const ccstd::vector &value) { _mipmaps = value; } diff --git a/native/cocos/core/assets/TextureCube.h b/native/cocos/core/assets/TextureCube.h index 1b98cdc8c6..0b66d3f5a4 100644 --- a/native/cocos/core/assets/TextureCube.h +++ b/native/cocos/core/assets/TextureCube.h @@ -61,7 +61,7 @@ struct ITextureCubeSerializeMipmapData { struct ITextureCubeSerializeData { std::string base; bool rgbe{false}; - std::vector mipmaps; + ccstd::vector mipmaps; }; /** @@ -109,7 +109,7 @@ public: * const textureCube = TextureCube.fromTexture2DArray(textures); * ``` */ - static TextureCube *fromTexture2DArray(const std::vector &textures); + static TextureCube *fromTexture2DArray(const ccstd::vector &textures); /** * @en All levels of mipmap images, be noted, automatically generated mipmaps are not included. @@ -117,13 +117,13 @@ public: * @zh 所有层级 Mipmap,注意,这里不包含自动生成的 Mipmap。 * 当设置 Mipmap 时,贴图的尺寸以及像素格式可能会改变。 */ - const std::vector &getMipmaps() const { + const ccstd::vector &getMipmaps() const { return _mipmaps; } - void setMipmaps(const std::vector &value); + void setMipmaps(const ccstd::vector &value); - void setMipmapsForJS(const std::vector &value); + void setMipmapsForJS(const ccstd::vector &value); /** * @en Level 0 mipmap image. @@ -179,7 +179,7 @@ public: bool isRGBE{false}; /*@serializable*/ - std::vector _mipmaps; + ccstd::vector _mipmaps; private: CC_DISALLOW_COPY_MOVE_ASSIGN(TextureCube); diff --git a/native/cocos/core/builtin/BuiltinResMgr.h b/native/cocos/core/builtin/BuiltinResMgr.h index 96110f1b16..12bf115d01 100644 --- a/native/cocos/core/builtin/BuiltinResMgr.h +++ b/native/cocos/core/builtin/BuiltinResMgr.h @@ -68,7 +68,7 @@ private: gfx::Device * _device{nullptr}; Record> _resources; - std::vector> _materialsToBeCompiled; + ccstd::vector> _materialsToBeCompiled; bool _isInitialized{false}; CC_DISALLOW_COPY_MOVE_ASSIGN(BuiltinResMgr); diff --git a/native/cocos/core/builtin/ShaderSourceAssembly.h b/native/cocos/core/builtin/ShaderSourceAssembly.h index d681dfea34..ed96a0f65a 100644 --- a/native/cocos/core/builtin/ShaderSourceAssembly.h +++ b/native/cocos/core/builtin/ShaderSourceAssembly.h @@ -27,12 +27,12 @@ #include #include -#include +#include "base/std/container/vector.h" #include "base/StringUtil.h" namespace cc { using ShaderInfo = std::unordered_map; -using ShaderSource = std::vector>; +using ShaderSource = ccstd::vector>; using ShaderSourceMap = std::unordered_map; class ShaderSourceAssembly final { diff --git a/native/cocos/core/data/Object.cpp b/native/cocos/core/data/Object.cpp index d10f45d1e1..ef019af613 100644 --- a/native/cocos/core/data/Object.cpp +++ b/native/cocos/core/data/Object.cpp @@ -24,15 +24,13 @@ ****************************************************************************/ #include "core/data/Object.h" - -#include - +#include "base/std/container/vector.h" #include "core/platform/Debug.h" namespace cc { namespace { -std::vector objectsToDestroy; +ccstd::vector objectsToDestroy; } /* static */ diff --git a/native/cocos/core/data/deserializer/EffectAssetDeserializer.cpp b/native/cocos/core/data/deserializer/EffectAssetDeserializer.cpp index 6d974f0dd2..fdede521a3 100644 --- a/native/cocos/core/data/deserializer/EffectAssetDeserializer.cpp +++ b/native/cocos/core/data/deserializer/EffectAssetDeserializer.cpp @@ -32,7 +32,7 @@ template using DeserializeArrayElementCallback = std::function; template -static void deserializeArray(const rapidjson::Value &valArray, std::vector &cValArray, const DeserializeArrayElementCallback &deserializeArrayElement) { +static void deserializeArray(const rapidjson::Value &valArray, ccstd::vector &cValArray, const DeserializeArrayElementCallback &deserializeArrayElement) { CC_ASSERT(valArray.IsArray()); index_t i = 0; cValArray.resize(valArray.Size()); @@ -42,13 +42,13 @@ static void deserializeArray(const rapidjson::Value &valArray, std::vector &c } } -static void deserializeArray(const rapidjson::Value &valArray, std::vector &cValArray) { +static void deserializeArray(const rapidjson::Value &valArray, ccstd::vector &cValArray) { deserializeArray(valArray, cValArray, [](const rapidjson::Value &val, std::string &cVal) { cVal = val.GetString(); }); } -static void deserializeArray(const rapidjson::Value &valArray, std::vector &cValArray) { +static void deserializeArray(const rapidjson::Value &valArray, ccstd::vector &cValArray) { CC_ASSERT(valArray.IsArray()); index_t i = 0; cValArray.resize(valArray.Size()); @@ -61,7 +61,7 @@ static void deserializeArray(const rapidjson::Value &valArray, std::vector } template ::value && !std::is_same::value, T>> -static void deserializeArray(const rapidjson::Value &valArray, std::vector &cValArray) { +static void deserializeArray(const rapidjson::Value &valArray, ccstd::vector &cValArray) { DeserializeArrayElementCallback cb{[](const rapidjson::Value &val, T &cVal) { cVal = val.Get(); }}; @@ -136,7 +136,7 @@ static IPropertyInfo jsonToPropertyInfo(const rapidjson::Value &propertyInfoVal) if (propertyInfoVal.HasMember("value")) { const auto &val = propertyInfoVal["value"]; if (val.IsArray()) { - std::vector arr; + ccstd::vector arr; arr.reserve(val.GetArray().Size()); for (const auto &e : val.GetArray()) { if (e.IsNumber()) { @@ -552,7 +552,7 @@ static void deserializeShaderDefine(const rapidjson::Value &defineVal, IDefineIn auto & cRange = cDefine.range; const auto &rangeVal = defineVal["range"]; - cRange = std::vector{}; + cRange = ccstd::vector{}; deserializeArray(rangeVal, cRange.value()); } @@ -560,7 +560,7 @@ static void deserializeShaderDefine(const rapidjson::Value &defineVal, IDefineIn auto & cOptions = cDefine.options; const auto &optionsVal = defineVal["options"]; - cOptions = std::vector{}; + cOptions = ccstd::vector{}; deserializeArray(optionsVal, cOptions.value()); } @@ -813,15 +813,15 @@ static void deserializeShader(const rapidjson::Value &shaderVal, IShaderInfo &cS static void deserializePreCompileInfoValue(const rapidjson::Value &infoVal, IPreCompileInfoValueType &cInfo) { if (infoVal.IsBool()) { - std::vector boolInfo; + ccstd::vector boolInfo; deserializeArray(infoVal, boolInfo); cInfo = std::move(boolInfo); } else if (infoVal.IsInt()) { - std::vector intInfo; + ccstd::vector intInfo; deserializeArray(infoVal, intInfo); cInfo = std::move(intInfo); } else if (infoVal.IsString()) { - std::vector strInfo; + ccstd::vector strInfo; deserializeArray(infoVal, strInfo); cInfo = std::move(strInfo); } else { diff --git a/native/cocos/core/event/CallbacksInvoker.h b/native/cocos/core/event/CallbacksInvoker.h index 651c2ad267..efb64dd97d 100644 --- a/native/cocos/core/event/CallbacksInvoker.h +++ b/native/cocos/core/event/CallbacksInvoker.h @@ -29,7 +29,6 @@ #include #include #include -#include #include "base/Log.h" #include "base/Macros.h" @@ -60,7 +59,7 @@ struct CallbackInfoBase { bool _once{false}; bool _isCCObject{false}; #if CC_DEBUG - std::vector _argTypes; + ccstd::vector _argTypes; #endif }; @@ -126,7 +125,7 @@ struct CallbackInfo final : public CallbackInfoBase { */ class CallbackList final { public: - std::vector> _callbackInfos; + ccstd::vector> _callbackInfos; bool _isInvoking{false}; bool _containCanceled{false}; @@ -378,7 +377,7 @@ void CallbacksInvoker::off(const KeyType &key, void (Target::*memberFn)(Args...) template void CallbacksInvoker::emit(const KeyType &key, Args &&...args) { #if CC_DEBUG - std::vector argTypes{(typeid(Args).name())...}; + ccstd::vector argTypes{(typeid(Args).name())...}; #endif auto iter = _callbackTable.find(key); if (iter != _callbackTable.end()) { diff --git a/native/cocos/core/geometry/AABB.cpp b/native/cocos/core/geometry/AABB.cpp index c4031cc035..88a31cbd1e 100644 --- a/native/cocos/core/geometry/AABB.cpp +++ b/native/cocos/core/geometry/AABB.cpp @@ -81,7 +81,7 @@ void AABB::merge(const cc::Vec3 &point) { setHalfExtents(maxPos.x - center.x, maxPos.y - center.y, maxPos.z - center.z); } -void AABB::merge(const std::vector &points) { +void AABB::merge(const ccstd::vector &points) { for (const auto &p : points) { merge(p); } diff --git a/native/cocos/core/geometry/AABB.h b/native/cocos/core/geometry/AABB.h index 7123ef813d..c53d0a3301 100644 --- a/native/cocos/core/geometry/AABB.h +++ b/native/cocos/core/geometry/AABB.h @@ -26,7 +26,7 @@ #pragma once #include -#include +#include "base/std/container/vector.h" #include "core/geometry/Enums.h" #include "math/Mat3.h" #include "math/Quaternion.h" @@ -139,7 +139,7 @@ public: void getBoundary(cc::Vec3 *minPos, cc::Vec3 *maxPos) const; void merge(const AABB &aabb); void merge(const cc::Vec3 &point); - void merge(const std::vector &points); + void merge(const ccstd::vector &points); void merge(const Frustum &frustum); void set(const cc::Vec3 ¢erVal, const cc::Vec3 &halfExtentVal); void transform(const Mat4 &m, AABB *out) const; diff --git a/native/cocos/core/geometry/Curve.cpp b/native/cocos/core/geometry/Curve.cpp index ee803c7427..6ccc308c77 100644 --- a/native/cocos/core/geometry/Curve.cpp +++ b/native/cocos/core/geometry/Curve.cpp @@ -1,5 +1,4 @@ #include "cocos/core/geometry/Curve.h" -#include namespace cc { namespace geometry { @@ -8,7 +7,7 @@ float OptimizedKey::evaluate(float tt) { return evalOptCurve(t, coefficient); } -float evalOptCurve(float t, const std::vector &coefs) { +float evalOptCurve(float t, const ccstd::vector &coefs) { return (t * (t * (t * coefs[0] + coefs[1]) + coefs[2])) + coefs[3]; } } // namespace geometry diff --git a/native/cocos/core/geometry/Curve.h b/native/cocos/core/geometry/Curve.h index e5f8ddae9a..285c553bd6 100644 --- a/native/cocos/core/geometry/Curve.h +++ b/native/cocos/core/geometry/Curve.h @@ -1,6 +1,5 @@ #pragma once -#include namespace cc { namespace geometry { @@ -38,13 +37,13 @@ struct Keyframe { float outTangent = 0; }; -float evalOptCurve(float t, const std::vector &coefs); +float evalOptCurve(float t, const ccstd::vector &coefs); struct OptimizedKey { float index; float time; float endTime; - std::vector coefficient; + ccstd::vector coefficient; OptimizedKey() { index = -1; time = 0; @@ -66,7 +65,7 @@ private: // _curve ! : RealCurve; public: - static std::vector defaultKF = [ { + static ccstd::vector defaultKF = [ { time : 0, value : 1, inTangent : 0, diff --git a/native/cocos/core/geometry/Frustum.cpp b/native/cocos/core/geometry/Frustum.cpp index b4d9fd7d75..d441058e54 100644 --- a/native/cocos/core/geometry/Frustum.cpp +++ b/native/cocos/core/geometry/Frustum.cpp @@ -32,7 +32,7 @@ namespace cc { namespace geometry { namespace { -const std::vector VEC_VALS{ +const ccstd::vector VEC_VALS{ {1, 1, 1}, {-1, 1, 1}, {-1, -1, 1}, diff --git a/native/cocos/core/geometry/Intersect.cpp b/native/cocos/core/geometry/Intersect.cpp index 77f1ef353b..8e02fe6b5d 100644 --- a/native/cocos/core/geometry/Intersect.cpp +++ b/native/cocos/core/geometry/Intersect.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include "3d/assets/Mesh.h" #include "base/Macros.h" #include "core/TypedArray.h" @@ -217,7 +216,7 @@ float rayCapsule(const Ray &ray, const Capsule &capsule) { } namespace { -void fillResult(float *minDis, ERaycastMode m, float d, float i0, float i1, float i2, cc::optional> &r) { +void fillResult(float *minDis, ERaycastMode m, float d, float i0, float i1, float i2, cc::optional> &r) { if (m == ERaycastMode::CLOSEST) { if (*minDis > d || *minDis == 0.0F) { *minDis = d; diff --git a/native/cocos/core/geometry/Spec.h b/native/cocos/core/geometry/Spec.h index b8c81980f7..ec0c674f76 100644 --- a/native/cocos/core/geometry/Spec.h +++ b/native/cocos/core/geometry/Spec.h @@ -2,7 +2,6 @@ #include #include -#include #include "base/Optional.h" namespace cc { @@ -110,7 +109,7 @@ struct IRaySubMeshOptions { * @zh * 用于存储射线检测结果的数组。 */ - cc::optional> result{}; + cc::optional> result{}; /** * @en @@ -134,7 +133,7 @@ struct IRayMeshOptions : public IRaySubMeshOptions { * @zh * 子网格的索引。 */ - cc::optional> subIndices{}; + cc::optional> subIndices{}; }; /** diff --git a/native/cocos/core/geometry/Sphere.cpp b/native/cocos/core/geometry/Sphere.cpp index f0b0ccadc3..8449ec7e3f 100644 --- a/native/cocos/core/geometry/Sphere.cpp +++ b/native/cocos/core/geometry/Sphere.cpp @@ -80,7 +80,7 @@ Sphere *Sphere::mergePoint(Sphere *out, const Sphere &s, const Vec3 &point) { return out; } -void Sphere::merge(const std::vector &points) { +void Sphere::merge(const ccstd::vector &points) { if (points.empty()) return; _radius = -1.0F; for (const auto &p : points) { diff --git a/native/cocos/core/geometry/Sphere.h b/native/cocos/core/geometry/Sphere.h index a38ee17b05..3bbc14066b 100644 --- a/native/cocos/core/geometry/Sphere.h +++ b/native/cocos/core/geometry/Sphere.h @@ -134,7 +134,7 @@ public: void mergeFrustum(const Frustum &frustum); inline void merge(const AABB *aabb) { mergeAABB(aabb); } inline void merge(const Vec3 &point) { mergePoint(point); } - void merge(const std::vector &points); + void merge(const ccstd::vector &points); inline void merge(const Frustum &frustum) { mergeFrustum(frustum); } bool interset(const Frustum &frustum) const; int interset(const Plane &plane) const; diff --git a/native/cocos/core/memop/CachedArray.h b/native/cocos/core/memop/CachedArray.h index 8689f99dfd..39b11ff55e 100644 --- a/native/cocos/core/memop/CachedArray.h +++ b/native/cocos/core/memop/CachedArray.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include "base/std/container/vector.h" namespace cc { @@ -147,7 +147,7 @@ public: * 添加一个指定数组中的所有元素到当前数组末尾 * @param array The given array to be appended */ - void concat(const std::vector &array) { + void concat(const ccstd::vector &array) { size_t freeSize = _array.capacity() - _length; size_t elementsToConcat = std::min(freeSize, array.size()); _array.insert(_array.begin() + _length, array.begin(), array.begin() + elementsToConcat); @@ -182,7 +182,7 @@ public: return -1; } - std::vector _array; + ccstd::vector _array; uint32_t _length{0}; private: diff --git a/native/cocos/core/memop/Pool.h b/native/cocos/core/memop/Pool.h index 0f5ef55454..def9cdc167 100644 --- a/native/cocos/core/memop/Pool.h +++ b/native/cocos/core/memop/Pool.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include "base/std/container/vector.h" #include "base/TypeDef.h" namespace cc { @@ -91,7 +91,7 @@ public: * @zh 将一组对象放回对象池中。 * @param objs An array of objects to be put back into the pool */ - void freeArray(const std::vector &objs) { + void freeArray(const ccstd::vector &objs) { _freepool.reserve(_nextAvail + 1 + objs.size()); _freepool.insert(_freepool.begin() + _nextAvail + 1, objs.begin(), objs.end()); @@ -119,7 +119,7 @@ private: std::function _ctor{nullptr}; uint32_t _elementsPerBatch{0}; index_t _nextAvail{-1}; - std::vector _freepool; + ccstd::vector _freepool; }; } // namespace memop diff --git a/native/cocos/core/memop/RecyclePool.h b/native/cocos/core/memop/RecyclePool.h index 0f5476c4e2..21944a5016 100644 --- a/native/cocos/core/memop/RecyclePool.h +++ b/native/cocos/core/memop/RecyclePool.h @@ -27,7 +27,7 @@ #include #include -#include +#include "base/std/container/vector.h" namespace cc { @@ -69,7 +69,7 @@ public: * @en The underlying array of all pool elements. * @zh 实际对象池数组。 */ - inline const std::vector &getData() const { return _data; } + inline const ccstd::vector &getData() const { return _data; } /** * @en Resets the object pool. Only changes the length to 0 @@ -100,7 +100,7 @@ public: private: uint32_t _count{0}; - std::vector _data; + ccstd::vector _data; }; } // namespace cc diff --git a/native/cocos/core/platform/Macro.cpp b/native/cocos/core/platform/Macro.cpp index ba3aabaf7a..331145640b 100644 --- a/native/cocos/core/platform/Macro.cpp +++ b/native/cocos/core/platform/Macro.cpp @@ -28,7 +28,7 @@ namespace cc { namespace macro { -const std::vector SUPPORT_TEXTURE_FORMATS = { +const ccstd::vector SUPPORT_TEXTURE_FORMATS = { ".astc", ".pkm", ".pvr", ".webp", ".jpg", ".jpeg", ".bmp", ".png"}; } diff --git a/native/cocos/core/platform/Macro.h b/native/cocos/core/platform/Macro.h index 32fd531bee..3b435ae588 100644 --- a/native/cocos/core/platform/Macro.h +++ b/native/cocos/core/platform/Macro.h @@ -26,8 +26,7 @@ #pragma once #include -#include - +#include "base/std/container/vector.h" #include "math/Math.h" namespace cc { @@ -40,7 +39,7 @@ namespace macro { * 引擎默认支持的图片格式,支持的格式可能在不同的构建平台和设备类型上有所差别。 * 目前所有平台和设备支持的格式有 ['.webp', '.jpg', '.jpeg', '.bmp', '.png']. The iOS mobile platform also supports the PVR format。 */ -extern const std::vector SUPPORT_TEXTURE_FORMATS; +extern const ccstd::vector SUPPORT_TEXTURE_FORMATS; /** * @en Key map for keyboard event * @zh 键盘事件的按键值。 diff --git a/native/cocos/core/scene-graph/Layers.h b/native/cocos/core/scene-graph/Layers.h index 99e1a58466..f4be26930d 100644 --- a/native/cocos/core/scene-graph/Layers.h +++ b/native/cocos/core/scene-graph/Layers.h @@ -24,7 +24,6 @@ */ #pragma once -#include #include "base/Macros.h" #include "base/TypeDef.h" @@ -68,7 +67,7 @@ public: * @param includes All accepted layers * @return A filter which can detect all accepted layers */ - static uint32_t makeMaskInclude(const std::vector &includes) { + static uint32_t makeMaskInclude(const ccstd::vector &includes) { uint32_t mask = 0; for (uint32_t inc : includes) { mask |= inc; @@ -84,7 +83,7 @@ public: * @param excludes All excluded layers * @return A filter which can detect for excluded layers */ - static uint32_t makeMaskExclude(const std::vector &excludes) { + static uint32_t makeMaskExclude(const ccstd::vector &excludes) { return ~makeMaskInclude(excludes); } diff --git a/native/cocos/core/scene-graph/Node.cpp b/native/cocos/core/scene-graph/Node.cpp index f03b9e2ab6..3f701e43d4 100644 --- a/native/cocos/core/scene-graph/Node.cpp +++ b/native/cocos/core/scene-graph/Node.cpp @@ -50,7 +50,7 @@ const uint32_t Node::DESTROYING{static_cast(CCObject::Fl const uint32_t Node::DEACTIVATING{static_cast(CCObject::Flags::DEACTIVATING)}; const uint32_t Node::DONT_DESTROY{static_cast(CCObject::Flags::DONT_DESTROY)}; index_t Node::stackId{0}; -std::vector> Node::stacks; +ccstd::vector> Node::stacks; // namespace { @@ -58,7 +58,7 @@ CachedArray allNodes{128}; //cjh how to clear ? const std::string EMPTY_NODE_NAME; IDGenerator idGenerator("Node"); -std::vector dirtyNodes; +ccstd::vector dirtyNodes; CC_FORCE_INLINE void setDirtyNode(const index_t idx, Node *node) { if (idx >= dirtyNodes.size()) { if (idx >= dirtyNodes.capacity()) { @@ -293,7 +293,7 @@ void Node::walk(const std::function &preFunc) { void Node::walk(const std::function &preFunc, const std::function &postFunc) { index_t index{1}; index_t i{0}; - const std::vector> *children = nullptr; + const ccstd::vector> *children = nullptr; Node * curr{nullptr}; auto stacksCount = static_cast(Node::stacks.size()); if (stackId >= stacksCount) { @@ -453,7 +453,7 @@ void Node::updateScene() { emit(EventTypesToJS::NODE_SCENE_UPDATED, _scene); } -index_t Node::getIdxOfChild(const std::vector> &child, Node *target) { +index_t Node::getIdxOfChild(const ccstd::vector> &child, Node *target) { auto iteChild = std::find(child.begin(), child.end(), target); if (iteChild != child.end()) { return static_cast(iteChild - child.begin()); @@ -502,7 +502,7 @@ void Node::setSiblingIndex(index_t index) { debug::errorID(3821); return; } - std::vector> &siblings = _parent->_children; + ccstd::vector> &siblings = _parent->_children; index = index != -1 ? index : static_cast(siblings.size()) - 1; index_t oldIdx = getIdxOfChild(siblings, this); if (index != oldIdx) { @@ -523,7 +523,7 @@ void Node::setSiblingIndex(index_t index) { Node *Node::getChildByPath(const std::string &path) const { size_t end = 0; - std::vector segments = StringUtil::split(path, "/"); + ccstd::vector segments = StringUtil::split(path, "/"); auto * lastNode = const_cast(this); for (const std::string &segment : segments) { if (segment.empty()) { @@ -1027,7 +1027,7 @@ void Node::onHierarchyChanged(Node *oldParent) { // return _children.size(); //} // -void Node::_setChildren(std::vector> &&children) { +void Node::_setChildren(ccstd::vector> &&children) { _children = std::move(children); } diff --git a/native/cocos/core/scene-graph/Node.h b/native/cocos/core/scene-graph/Node.h index eb0f60c25a..c11af72bd9 100644 --- a/native/cocos/core/scene-graph/Node.h +++ b/native/cocos/core/scene-graph/Node.h @@ -25,7 +25,6 @@ #pragma once -#include #include "base/Ptr.h" #include "base/TypeDef.h" #include "cocos/base/Any.h" @@ -78,11 +77,11 @@ public: static Node *instantiate(Node *cloned, bool isSyncedNode); // for walk - static std::vector> stacks; + static ccstd::vector> stacks; static index_t stackId; static void setScene(Node *); - static index_t getIdxOfChild(const std::vector> &, Node *); + static index_t getIdxOfChild(const ccstd::vector> &, Node *); static bool isStatic; // cjh TODO: add getter / setter @@ -262,7 +261,7 @@ public: inline void setActiveInHierarchyPtr(uint8_t *ptr) { _activeInHierarchyArr = ptr; } virtual void onPostActivated(bool active) {} - inline const std::vector> &getChildren() const { return _children; } + inline const ccstd::vector> &getChildren() const { return _children; } inline Node * getParent() const { return _parent; } inline NodeEventProcessor * getEventProcessor() const { return _eventProcessor; } @@ -529,21 +528,21 @@ public: // } // // template ::value>> - // static Component *findComponents(Node * /*node*/, const std::vector & /*components*/) { + // static Component *findComponents(Node * /*node*/, const ccstd::vector & /*components*/) { // // cjh TODO: // CC_ASSERT(false); // return nullptr; // } // // template ::value>> - // static Component *findChildComponent(const std::vector & /*children*/) { + // static Component *findChildComponent(const ccstd::vector & /*children*/) { // // cjh TODO: // CC_ASSERT(false); // return nullptr; // } // // template ::value>> - // static void findChildComponents(const std::vector & /*children*/, std::vector & /*components*/) { + // static void findChildComponents(const ccstd::vector & /*children*/, ccstd::vector & /*components*/) { // // cjh TODO: // CC_ASSERT(false); // } @@ -578,7 +577,7 @@ public: // // // TODO(Lenovo): // template ::value>> - // std::vector getComponents() const { + // ccstd::vector getComponents() const { // // cjh TODO: // CC_ASSERT(false); // return {}; @@ -592,16 +591,16 @@ public: // } // // template ::value>> - // std::vector getComponentsInChildren() const { + // ccstd::vector getComponentsInChildren() const { // // cjh TODO: // CC_ASSERT(false); // return {}; // } // - // inline std::vector getComponents() const { return _components; } + // inline ccstd::vector getComponents() const { return _components; } // // void checkMultipleComp(Component *comp) {} - // std::vector _components; + // ccstd::vector _components; // // friend void componentCorrupted(Node *node, Component *comp, uint32_t index); // ------------------ Component code end ----------------------------- @@ -611,7 +610,7 @@ public: // Node * _getChild(index_t i); // void _setChildrenSize(uint32_t size); // uint32_t _getChildrenSize(); - void _setChildren(std::vector> &&children); // NOLINT + void _setChildren(ccstd::vector> &&children); // NOLINT // For JS wrapper. inline uint32_t getEventMask() const { return _eventMask; } inline void setEventMask(uint32_t mask) { _eventMask = mask; } @@ -683,7 +682,7 @@ public: index_t _siblingIndex{0}; // For deserialization std::string _id; - std::vector> _children; + ccstd::vector> _children; Node * _parent{nullptr}; bool _active{true}; diff --git a/native/cocos/core/scene-graph/NodeEventProcessor.cpp b/native/cocos/core/scene-graph/NodeEventProcessor.cpp index b7e9e2f82a..b1c99f0bb2 100644 --- a/native/cocos/core/scene-graph/NodeEventProcessor.cpp +++ b/native/cocos/core/scene-graph/NodeEventProcessor.cpp @@ -32,7 +32,7 @@ #include "math/Vec2.h" namespace { -std::vector cachedArray(16); +ccstd::vector cachedArray(16); cc::Node * currentHovered = nullptr; cc::Vec2 pos; @@ -246,9 +246,9 @@ cc::Vec2 pos; //} // //template ::value, T>> -//std::vector searchComponentsInParent(cc::Node *node) { +//ccstd::vector searchComponentsInParent(cc::Node *node) { // index_t index = 0; -// std::vector list; +// ccstd::vector list; // // for (cc::Node *curr = node; curr != nullptr && cc::Node::isNode(curr); curr = curr->getParent(), ++index) { // auto *comp = curr->getComponent(); @@ -259,7 +259,7 @@ cc::Vec2 pos; // info.comp = comp; // } // } -// return list.empty() ? std::vector() : list; +// return list.empty() ? ccstd::vector() : list; //} } // namespace @@ -273,7 +273,7 @@ NodeEventProcessor::~NodeEventProcessor() { // delete _mouseListener; } -bool NodeEventProcessor::checkListeners(cc::Node *node, const std::vector &events) { +bool NodeEventProcessor::checkListeners(cc::Node *node, const ccstd::vector &events) { if (!node->isPersistNode()) { if (node->getEventProcessor()->_bubblingTargets) { for (const auto &event : events) { @@ -295,7 +295,7 @@ bool NodeEventProcessor::checkListeners(cc::Node *node, const std::vector currMask; + // ccstd::vector currMask; // _node->walk( // [&](Node *node) { // if (currMask.empty()) { @@ -446,7 +446,7 @@ void NodeEventProcessor::targetOff(const CallbacksInvoker::KeyType &target) { // } } -void NodeEventProcessor::getCapturingTargets(const CallbacksInvoker::KeyType &type, std::vector &targets) const { +void NodeEventProcessor::getCapturingTargets(const CallbacksInvoker::KeyType &type, ccstd::vector &targets) const { auto *parent = _node->getParent(); while (parent != nullptr) { if (parent->getEventProcessor()->_capturingTargets != nullptr && parent->getEventProcessor()->_capturingTargets->hasEventListener(type)) { @@ -456,7 +456,7 @@ void NodeEventProcessor::getCapturingTargets(const CallbacksInvoker::KeyType &ty } } -void NodeEventProcessor::getBubblingTargets(const CallbacksInvoker::KeyType &type, std::vector &targets) const { +void NodeEventProcessor::getBubblingTargets(const CallbacksInvoker::KeyType &type, ccstd::vector &targets) const { auto *parent = _node->getParent(); while (parent != nullptr) { if (parent->getEventProcessor()->_bubblingTargets != nullptr && parent->getEventProcessor()->_bubblingTargets->hasEventListener(type)) { diff --git a/native/cocos/core/scene-graph/NodeEventProcessor.h b/native/cocos/core/scene-graph/NodeEventProcessor.h index abf9fb2f0b..04762734f3 100644 --- a/native/cocos/core/scene-graph/NodeEventProcessor.h +++ b/native/cocos/core/scene-graph/NodeEventProcessor.h @@ -33,13 +33,13 @@ #include "core/scene-graph/NodeEvent.h" namespace cc { -const std::vector TOUCH_EVENTS{ +const ccstd::vector TOUCH_EVENTS{ cc::NodeEventType::TOUCH_START, cc::NodeEventType::TOUCH_MOVE, cc::NodeEventType::TOUCH_END, cc::NodeEventType::TOUCH_CANCEL}; -const std::vector MOUSE_EVENTS{ +const ccstd::vector MOUSE_EVENTS{ cc::NodeEventType::MOUSE_DOWN, cc::NodeEventType::MOUSE_ENTER, cc::NodeEventType::MOUSE_MOVE, @@ -78,7 +78,7 @@ public: template bool hasEventListener(const CallbacksInvoker::KeyType &type, void (Target::*memberFn)(Args...), Target *target) const; - static bool checkListeners(Node *node, const std::vector &events); + static bool checkListeners(Node *node, const ccstd::vector &events); template void on(const CallbacksInvoker::KeyType &type, std::function &&callback, CallbackInfoBase::ID &cbID, bool useCapture = false); @@ -133,8 +133,8 @@ public: void targetOff(const CallbacksInvoker::KeyType &target); - void getCapturingTargets(const CallbacksInvoker::KeyType &type, std::vector &targets) const; - void getBubblingTargets(const CallbacksInvoker::KeyType &type, std::vector &targets) const; + void getCapturingTargets(const CallbacksInvoker::KeyType &type, ccstd::vector &targets) const; + void getBubblingTargets(const CallbacksInvoker::KeyType &type, ccstd::vector &targets) const; inline CallbacksInvoker *getBubblingTargets() const { return _bubblingTargets; } inline CallbacksInvoker *getCapturingTargets() const { return _capturingTargets; } diff --git a/native/cocos/core/utils/MutableForwardIterator.cpp b/native/cocos/core/utils/MutableForwardIterator.cpp index 2d1692d8c8..b9935a4de1 100644 --- a/native/cocos/core/utils/MutableForwardIterator.cpp +++ b/native/cocos/core/utils/MutableForwardIterator.cpp @@ -9,7 +9,7 @@ namespace cc { void MutableForwardIteratorTest() { using namespace cc; - std::vector myarr{1, 2, 3, 43, 4, 5}; + ccstd::vector myarr{1, 2, 3, 43, 4, 5}; MutableForwardIterator iter{myarr}; iter.fastRemoveAt(2); diff --git a/native/cocos/core/utils/MutableForwardIterator.h b/native/cocos/core/utils/MutableForwardIterator.h index 00cd8621b0..a3fab247e4 100644 --- a/native/cocos/core/utils/MutableForwardIterator.h +++ b/native/cocos/core/utils/MutableForwardIterator.h @@ -26,7 +26,7 @@ #pragma once #include // for std::find -#include +#include "base/std/container/vector.h" namespace cc { @@ -45,7 +45,7 @@ namespace cc { template class MutableForwardIterator { public: - explicit MutableForwardIterator(std::vector &array) + explicit MutableForwardIterator(ccstd::vector &array) : array(array) {} int32_t getLength() const { @@ -103,7 +103,7 @@ public: } int32_t i = 0; - std::vector &array; + ccstd::vector &array; }; } // namespace cc diff --git a/native/cocos/core/utils/Path.cpp b/native/cocos/core/utils/Path.cpp index a90bb703eb..82fa4434ad 100644 --- a/native/cocos/core/utils/Path.cpp +++ b/native/cocos/core/utils/Path.cpp @@ -45,7 +45,7 @@ std::string &removeLastSlash(std::string &path) { } // namespace -std::string join(const std::vector &segments) { +std::string join(const ccstd::vector &segments) { std::string result; for (const auto &segment : segments) { diff --git a/native/cocos/core/utils/Path.h b/native/cocos/core/utils/Path.h index 8853eef1d4..262c3b8fef 100644 --- a/native/cocos/core/utils/Path.h +++ b/native/cocos/core/utils/Path.h @@ -26,7 +26,7 @@ #pragma once #include -#include +#include "base/std/container/vector.h" namespace cc { @@ -35,7 +35,7 @@ namespace cc { * @zh 拼接字符串为路径。 * @example {@link cocos/core/utils/CCPath/join.js} */ -std::string join(const std::vector &segments); +std::string join(const ccstd::vector &segments); /** * @en Get the ext name of a path including '.', like '.png'. diff --git a/native/cocos/core/utils/Pool.h b/native/cocos/core/utils/Pool.h index 671231a881..466c81a15e 100644 --- a/native/cocos/core/utils/Pool.h +++ b/native/cocos/core/utils/Pool.h @@ -173,7 +173,7 @@ public: int32_t getCount() const { return _count; } private: - std::vector _pool; + ccstd::vector _pool; CleanUpFunction _cleanup{nullptr}; /** diff --git a/native/cocos/editor-support/MeshBuffer.h b/native/cocos/editor-support/MeshBuffer.h index 23dc64832e..721d771c39 100644 --- a/native/cocos/editor-support/MeshBuffer.h +++ b/native/cocos/editor-support/MeshBuffer.h @@ -84,8 +84,8 @@ private: void init(); void afterCleanupHandle(); - std::vector _ibArr; - std::vector _vbArr; + ccstd::vector _ibArr; + ccstd::vector _vbArr; std::size_t _bufferPos = 0; IOBuffer _vb; IOBuffer _ib; diff --git a/native/cocos/editor-support/MiddlewareManager.h b/native/cocos/editor-support/MiddlewareManager.h index 2ae13ee33a..dab435f5b4 100644 --- a/native/cocos/editor-support/MiddlewareManager.h +++ b/native/cocos/editor-support/MiddlewareManager.h @@ -117,8 +117,8 @@ public: private: void clearRemoveList(); - std::vector _updateList; - std::vector _removeList; + ccstd::vector _updateList; + ccstd::vector _removeList; std::map _mbMap; SharedBufferManager _renderInfo; diff --git a/native/cocos/editor-support/TypedArrayPool.h b/native/cocos/editor-support/TypedArrayPool.h index 49aa00d7e3..978b2d82b6 100644 --- a/native/cocos/editor-support/TypedArrayPool.h +++ b/native/cocos/editor-support/TypedArrayPool.h @@ -54,7 +54,7 @@ public: private: using arrayType = se::Object::TypedArrayType; - using objPool = std::vector; + using objPool = ccstd::vector; using fitMap = std::map; using typeMap = std::map; diff --git a/native/cocos/math/Vertex.cpp b/native/cocos/math/Vertex.cpp index 20d77dc646..b8215f2511 100644 --- a/native/cocos/math/Vertex.cpp +++ b/native/cocos/math/Vertex.cpp @@ -26,12 +26,11 @@ ****************************************************************************/ #include "math/Vertex.h" -#include #include "base/Macros.h" namespace cc { -void ccVertexLineToPolygon(const std::vector &points, float stroke, unsigned int offset, unsigned int nuPoints, std::vector *vertices) { +void ccVertexLineToPolygon(const ccstd::vector &points, float stroke, unsigned int offset, unsigned int nuPoints, ccstd::vector *vertices) { GP_ASSERT(vertices); nuPoints += offset; if (nuPoints <= 1) return; diff --git a/native/cocos/math/Vertex.h b/native/cocos/math/Vertex.h index 09f448ee80..300ff37c1e 100644 --- a/native/cocos/math/Vertex.h +++ b/native/cocos/math/Vertex.h @@ -27,7 +27,7 @@ #ifndef __CCVERTEX_H__ #define __CCVERTEX_H__ -#include +#include "base/std/container/vector.h" #include "base/Macros.h" #include "math/Vec2.h" @@ -41,7 +41,7 @@ namespace cc { /** @file CCVertex.h */ /** converts a line to a polygon */ -void CC_DLL ccVertexLineToPolygon(const std::vector &points, float stroke, unsigned int offset, unsigned int nuPoints, std::vector *vertices); +void CC_DLL ccVertexLineToPolygon(const ccstd::vector &points, float stroke, unsigned int offset, unsigned int nuPoints, ccstd::vector *vertices); /** returns whether or not the line intersects */ bool CC_DLL ccVertexLineIntersect(float ax, float ay, diff --git a/native/cocos/network/Downloader-java.cpp b/native/cocos/network/Downloader-java.cpp index 7c853111ac..92353fc8fd 100644 --- a/native/cocos/network/Downloader-java.cpp +++ b/native/cocos/network/Downloader-java.cpp @@ -194,7 +194,7 @@ void DownloaderJava::abort(const std::unique_ptr &task) { DownloadTaskAndroid *coTask = iter->second; _taskMap.erase(iter); - std::vector emptyBuffer; + ccstd::vector emptyBuffer; onTaskFinish(*coTask->task, DownloadTask::ERROR_ABORT, DownloadTask::ERROR_ABORT, @@ -218,7 +218,7 @@ void DownloaderJava::onProcessImpl(int taskId, int64_t dl, int64_t dlNow, int64_ onTaskProgress(*coTask->task, dl, dlNow, dlTotal, transferDataToBuffer); } -void DownloaderJava::onFinishImpl(int taskId, int errCode, const char *errStr, const std::vector &data) { +void DownloaderJava::onFinishImpl(int taskId, int errCode, const char *errStr, const ccstd::vector &data) { DLLOG("DownloaderJava::onFinishImpl(taskId: %d, errCode: %d, errStr: %s)", taskId, errCode, (errStr) ? errStr : "null"); auto iter = _taskMap.find(taskId); if (_taskMap.end() == iter) { @@ -256,7 +256,7 @@ JNIEXPORT void JNICALL JNI_DOWNLOADER(nativeOnProgress)(JNIEnv * /*env*/, jclass JNIEXPORT void JNICALL JNI_DOWNLOADER(nativeOnFinish)(JNIEnv *env, jclass /*clazz*/, jint id, jint taskId, jint errCode, jstring errStr, jbyteArray data) { std::string errStrTmp; - std::vector dataTmp; + ccstd::vector dataTmp; if (errStr) { const char *nativeErrStr = env->GetStringUTFChars(errStr, JNI_FALSE); errStrTmp = nativeErrStr; @@ -275,7 +275,7 @@ JNIEXPORT void JNICALL JNI_DOWNLOADER(nativeOnFinish)(JNIEnv *env, jclass /*claz DLLOG("_nativeOnFinish can't find downloader id: %d for task: %d", id, taskId); return; } - std::vector buf; + ccstd::vector buf; if (!errStrTmp.empty()) { // failure downloader->onFinishImpl((int)taskId, (int)errCode, errStrTmp.c_str(), buf); diff --git a/native/cocos/network/Downloader-java.h b/native/cocos/network/Downloader-java.h index c036f5df9b..8c9e2613f3 100644 --- a/native/cocos/network/Downloader-java.h +++ b/native/cocos/network/Downloader-java.h @@ -46,7 +46,7 @@ public: // designed called by internal void onProcessImpl(int taskId, int64_t dl, int64_t dlNow, int64_t dlTotal); - void onFinishImpl(int taskId, int errCode, const char *errStr, const std::vector &data); + void onFinishImpl(int taskId, int errCode, const char *errStr, const ccstd::vector &data); protected: int _id; diff --git a/native/cocos/network/Downloader.cpp b/native/cocos/network/Downloader.cpp index b108db6b52..35ae8cfcb9 100644 --- a/native/cocos/network/Downloader.cpp +++ b/native/cocos/network/Downloader.cpp @@ -86,7 +86,7 @@ Downloader::Downloader(const DownloaderHints &hints) { int errorCode, int errorCodeInternal, const std::string & errorStr, - const std::vector &data) { + const ccstd::vector &data) { if (DownloadTask::ERROR_NO_ERROR != errorCode) { if (onTaskError) { onTaskError(task, errorCode, errorCodeInternal, errorStr); diff --git a/native/cocos/network/Downloader.h b/native/cocos/network/Downloader.h index b7032c29e0..15d726b15c 100644 --- a/native/cocos/network/Downloader.h +++ b/native/cocos/network/Downloader.h @@ -31,8 +31,7 @@ #include #include #include -#include - +#include "base/std/container/vector.h" #include "base/Macros.h" namespace cc { @@ -76,7 +75,7 @@ public: ~Downloader(); std::function &data)> + const ccstd::vector &data)> onDataTaskSuccess; std::function onFileTaskSuccess; diff --git a/native/cocos/network/DownloaderImpl-apple.mm b/native/cocos/network/DownloaderImpl-apple.mm index b38396d7b1..2db701349c 100644 --- a/native/cocos/network/DownloaderImpl-apple.mm +++ b/native/cocos/network/DownloaderImpl-apple.mm @@ -417,7 +417,7 @@ void DownloaderApple::abort(const std::unique_ptr &task) { errorCode = cc::network::DownloadTask::ERROR_ABORT; errorMsg = @"downloadFile:fail abort"; } - std::vector buf; // just a placeholder + ccstd::vector buf; // just a placeholder _outer->onTaskFinish(*[wrapper get], cc::network::DownloadTask::ERROR_IMPL_INTERNAL, errorCode, @@ -429,7 +429,7 @@ void DownloaderApple::abort(const std::unique_ptr &task) { std::string errorString; const int64_t buflen = [wrapper totalBytesReceived]; - std::vector data((size_t)buflen); + ccstd::vector data((size_t)buflen); char *buf = (char *)data.data(); [wrapper transferDataToBuffer:buf lengthOfBuffer:buflen]; @@ -443,7 +443,7 @@ void DownloaderApple::abort(const std::unique_ptr &task) { // Check for error status code if (statusCode >= 400) { - std::vector buf; // just a placeholder + ccstd::vector buf; // just a placeholder const char *originalURL = [task.originalRequest.URL.absoluteString cStringUsingEncoding:NSUTF8StringEncoding]; std::string errorMessage = cc::StringUtils::format("Downloader: Failed to download %s with status code (%d)", originalURL, (int)statusCode); @@ -597,7 +597,7 @@ void DownloaderApple::abort(const std::unique_ptr &task) { errorString = [error.localizedDescription cStringUsingEncoding:NSUTF8StringEncoding]; } } - std::vector buf; // just a placeholder + ccstd::vector buf; // just a placeholder _outer->onTaskFinish(*[wrapper get], errorCode, errorCodeInternal, errorString, buf); } diff --git a/native/cocos/network/DownloaderImpl.h b/native/cocos/network/DownloaderImpl.h index 96cf46c36a..e485d23bcb 100644 --- a/native/cocos/network/DownloaderImpl.h +++ b/native/cocos/network/DownloaderImpl.h @@ -30,8 +30,7 @@ #include #include #include -#include - +#include "base/std/container/vector.h" #include "base/Macros.h" //#define CC_DOWNLOADER_DEBUG @@ -67,7 +66,7 @@ public: int errorCode, int errorCodeInternal, const std::string & errorStr, - const std::vector &data)> + const ccstd::vector &data)> onTaskFinish; virtual IDownloadTask *createCoTask(std::shared_ptr &task) = 0; diff --git a/native/cocos/network/HttpClient-apple.mm b/native/cocos/network/HttpClient-apple.mm index 1e75d4cea0..3f1373c46b 100644 --- a/native/cocos/network/HttpClient-apple.mm +++ b/native/cocos/network/HttpClient-apple.mm @@ -142,7 +142,7 @@ static int processTask(HttpClient *client, HttpRequest *request, NSString *reque [nsrequest setHTTPMethod:requestType]; /* get custom header data (if set) */ - std::vector headers = request->getHeaders(); + ccstd::vector headers = request->getHeaders(); if (!headers.empty()) { /* append custom headers one by one */ for (auto &header : headers) { @@ -258,13 +258,13 @@ static int processTask(HttpClient *client, HttpRequest *request, NSString *reque [header deleteCharactersInRange:range]; } NSData *headerData = [header dataUsingEncoding:NSUTF8StringEncoding]; - std::vector *headerBuffer = (std::vector *)headerStream; + ccstd::vector *headerBuffer = (ccstd::vector *)headerStream; const void *headerptr = [headerData bytes]; long headerlen = [headerData length]; headerBuffer->insert(headerBuffer->end(), (char *)headerptr, (char *)headerptr + headerlen); //handle response data - std::vector *recvBuffer = (std::vector *)stream; + ccstd::vector *recvBuffer = (ccstd::vector *)stream; const void *ptr = [httpAsynConn.responseData bytes]; long len = [httpAsynConn.responseData length]; recvBuffer->insert(recvBuffer->end(), (char *)ptr, (char *)ptr + len); diff --git a/native/cocos/network/HttpClient-java.cpp b/native/cocos/network/HttpClient-java.cpp index 2dc1f59999..ed89167273 100644 --- a/native/cocos/network/HttpClient-java.cpp +++ b/native/cocos/network/HttpClient-java.cpp @@ -47,9 +47,9 @@ namespace cc { namespace network { -using HttpRequestHeaders = std::vector; +using HttpRequestHeaders = ccstd::vector; using HttpRequestHeadersIter = HttpRequestHeaders::iterator; -using HttpCookies = std::vector; +using HttpCookies = ccstd::vector; using HttpCookiesIter = HttpCookies::iterator; static HttpClient *gHttpClient = nullptr; // pointer to singleton @@ -66,7 +66,7 @@ struct CookiesInfo { //static size_t writeData(void *ptr, size_t size, size_t nmemb, void *stream) static size_t writeData(void *buffer, size_t sizes, HttpResponse *response) { - auto *recvBuffer = static_cast *>(response->getResponseData()); + auto *recvBuffer = static_cast *>(response->getResponseData()); recvBuffer->clear(); recvBuffer->insert(recvBuffer->end(), static_cast(buffer), (static_cast(buffer)) + sizes); return sizes; @@ -74,7 +74,7 @@ static size_t writeData(void *buffer, size_t sizes, HttpResponse *response) { //static size_t writeHeaderData(void *ptr, size_t size, size_t nmemb, void *stream) size_t writeHeaderData(void *buffer, size_t sizes, HttpResponse *response) { - auto *recvBuffer = static_cast *>(response->getResponseHeader()); + auto *recvBuffer = static_cast *>(response->getResponseHeader()); recvBuffer->clear(); recvBuffer->insert(recvBuffer->end(), static_cast(buffer), static_cast(buffer) + sizes); return sizes; @@ -433,7 +433,7 @@ private: return; } - std::vector cookiesInfoVec; + ccstd::vector cookiesInfoVec; cookiesInfoVec.clear(); for (auto &cookies : cookiesVec) { @@ -448,7 +448,7 @@ private: CookiesInfo co; std::stringstream streamInfo(cookies); std::string item; - std::vector elems; + ccstd::vector elems; while (std::getline(streamInfo, item, '\t')) { elems.push_back(item); @@ -669,7 +669,7 @@ void HttpClient::processResponse(HttpResponse *response, char *responseMessage) int contentLength = urlConnection.getResponseHeaderByKeyInt("Content-Length"); char *contentInfo = urlConnection.getResponseContent(response); if (nullptr != contentInfo) { - auto *recvBuffer = static_cast *>(response->getResponseData()); + auto *recvBuffer = static_cast *>(response->getResponseData()); recvBuffer->clear(); recvBuffer->insert(recvBuffer->begin(), contentInfo, contentInfo + urlConnection.getContentLength()); } diff --git a/native/cocos/network/HttpClient.cpp b/native/cocos/network/HttpClient.cpp index ec45d526cf..5d8a5e66c7 100644 --- a/native/cocos/network/HttpClient.cpp +++ b/native/cocos/network/HttpClient.cpp @@ -50,7 +50,7 @@ typedef size_t (*write_callback)(void *ptr, size_t size, size_t nmemb, void *str // Callback function used by libcurl for collect response data static size_t writeData(void *ptr, size_t size, size_t nmemb, void *stream) { - std::vector *recvBuffer = (std::vector *)stream; + ccstd::vector *recvBuffer = (ccstd::vector *)stream; size_t sizes = size * nmemb; // add data to the end of recvBuffer @@ -62,7 +62,7 @@ static size_t writeData(void *ptr, size_t size, size_t nmemb, void *stream) { // Callback function used by libcurl for collect header data static size_t writeHeaderData(void *ptr, size_t size, size_t nmemb, void *stream) { - std::vector *recvBuffer = (std::vector *)stream; + ccstd::vector *recvBuffer = (ccstd::vector *)stream; size_t sizes = size * nmemb; // add data to the end of recvBuffer @@ -233,7 +233,7 @@ public: return false; /* get custom header data (if set) */ - std::vector headers = request->getHeaders(); + ccstd::vector headers = request->getHeaders(); if (!headers.empty()) { /* append custom headers one by one */ for (auto &header : headers) diff --git a/native/cocos/network/HttpCookie.cpp b/native/cocos/network/HttpCookie.cpp index 29b84aec19..ead4be6d92 100644 --- a/native/cocos/network/HttpCookie.cpp +++ b/native/cocos/network/HttpCookie.cpp @@ -33,7 +33,7 @@ void HttpCookie::readFile() { std::string inString = cc::FileUtils::getInstance()->getStringFromFile(_cookieFileName); if (!inString.empty()) { - std::vector cookiesVec; + ccstd::vector cookiesVec; cookiesVec.clear(); std::stringstream stream(inString); @@ -63,7 +63,7 @@ void HttpCookie::readFile() { CookiesInfo co; std::stringstream streamInfo(cookie); - std::vector elems; + ccstd::vector elems; std::string elemsItem; while (std::getline(streamInfo, elemsItem, '\t')) { @@ -85,7 +85,7 @@ void HttpCookie::readFile() { } } -const std::vector *HttpCookie::getCookies() const { +const ccstd::vector *HttpCookie::getCookies() const { return &_cookies; } diff --git a/native/cocos/network/HttpCookie.h b/native/cocos/network/HttpCookie.h index fb4a0e6f71..28b36f4c0a 100644 --- a/native/cocos/network/HttpCookie.h +++ b/native/cocos/network/HttpCookie.h @@ -29,7 +29,7 @@ /// @cond DO_NOT_SHOW #include -#include +#include "base/std/container/vector.h" struct CookiesInfo { std::string domain; @@ -48,13 +48,13 @@ public: void writeFile(); void setCookieFileName(const std::string &fileName); - const std::vector *getCookies() const; + const ccstd::vector *getCookies() const; const CookiesInfo * getMatchCookie(const std::string &url) const; void updateOrAddCookie(CookiesInfo *cookie); private: std::string _cookieFileName; - std::vector _cookies; + ccstd::vector _cookies; }; /// @endcond diff --git a/native/cocos/network/HttpRequest.h b/native/cocos/network/HttpRequest.h index 2d28927648..7f1ba74078 100644 --- a/native/cocos/network/HttpRequest.h +++ b/native/cocos/network/HttpRequest.h @@ -33,7 +33,6 @@ #include #include -#include /** * @addtogroup network @@ -239,16 +238,16 @@ public: * * @param pHeaders the string vector of custom-defined headers. */ - inline void setHeaders(const std::vector &headers) { + inline void setHeaders(const ccstd::vector &headers) { _headers = headers; } /** * Get custom headers. * - * @return std::vector the string vector of custom-defined headers. + * @return ccstd::vector the string vector of custom-defined headers. */ - inline std::vector getHeaders() const { + inline ccstd::vector getHeaders() const { return _headers; } @@ -264,11 +263,11 @@ protected: // properties Type _requestType{Type::UNKNOWN}; /// kHttpRequestGet, kHttpRequestPost or other enums std::string _url; /// target url that this request is sent to - std::vector _requestData; /// used for POST + ccstd::vector _requestData; /// used for POST std::string _tag; /// user defined tag, to identify different requests in response callback ccHttpRequestCallback _callback; /// C++11 style callbacks void * _userData{nullptr}; /// You can add your customed data here - std::vector _headers; /// custom http headers + ccstd::vector _headers; /// custom http headers float _timeoutInSeconds{10.F}; }; diff --git a/native/cocos/network/HttpResponse.h b/native/cocos/network/HttpResponse.h index d54b680ca6..4eb93852d9 100644 --- a/native/cocos/network/HttpResponse.h +++ b/native/cocos/network/HttpResponse.h @@ -105,17 +105,17 @@ public: /** * Get the http response data. - * @return std::vector* the pointer that point to the _responseData. + * @return ccstd::vector* the pointer that point to the _responseData. */ - inline std::vector *getResponseData() { + inline ccstd::vector *getResponseData() { return &_responseData; } /** * Get the response headers. - * @return std::vector* the pointer that point to the _responseHeader. + * @return ccstd::vector* the pointer that point to the _responseHeader. */ - inline std::vector *getResponseHeader() { + inline ccstd::vector *getResponseHeader() { return &_responseHeader; } @@ -153,7 +153,7 @@ public: * Set the http response data buffer, it is used by HttpClient. * @param data the pointer point to the response data buffer. */ - inline void setResponseData(std::vector *data) { + inline void setResponseData(ccstd::vector *data) { _responseData = *data; } @@ -161,7 +161,7 @@ public: * Set the http response headers buffer, it is used by HttpClient. * @param data the pointer point to the response headers buffer. */ - inline void setResponseHeader(std::vector *data) { + inline void setResponseHeader(ccstd::vector *data) { _responseHeader = *data; } @@ -207,8 +207,8 @@ protected: // properties HttpRequest * _pHttpRequest; /// the corresponding HttpRequest pointer who leads to this response bool _succeed; /// to indicate if the http request is successful simply - std::vector _responseData; /// the returned raw data. You can also dump it as a string - std::vector _responseHeader; /// the returned raw header data. You can also dump it as a string + ccstd::vector _responseData; /// the returned raw data. You can also dump it as a string + ccstd::vector _responseHeader; /// the returned raw header data. You can also dump it as a string long _responseCode; /// the status code returned from libcurl, e.g. 200, 404 std::string _errorBuffer; /// if _responseCode != 200, please read _errorBuffer to find the reason std::string _responseDataString; // the returned raw data. You can also dump it as a string diff --git a/native/cocos/network/SocketIO.cpp b/native/cocos/network/SocketIO.cpp index 43742566fb..c5f662c56d 100644 --- a/native/cocos/network/SocketIO.cpp +++ b/native/cocos/network/SocketIO.cpp @@ -73,7 +73,7 @@ public: const std::string &getEvent() const { return _name; }; void addData(const std::string &data); - std::vector getData() const { return _args; }; + ccstd::vector getData() const { return _args; }; virtual std::string stringify() const; static SocketIOPacket *createPacketWithType(const std::string &type, SocketIOVersion version); @@ -83,12 +83,12 @@ protected: std::string _pId; //id message std::string _ack; // std::string _name; //event name - std::vector _args; //we will be using a vector of strings to store multiple data + ccstd::vector _args; //we will be using a vector of strings to store multiple data std::string _endpoint; // std::string _endpointseparator; //socket.io 1.x requires a ',' between endpoint and payload std::string _type; //message type std::string _separator; //for stringify the object - std::vector _types; //types of messages + ccstd::vector _types; //types of messages }; class SocketIOPacketV10x : public SocketIOPacket { @@ -99,7 +99,7 @@ public: std::string stringify() const override; private: - std::vector _typesMessage; + ccstd::vector _typesMessage; }; SocketIOPacket::SocketIOPacket() : _separator(":") { @@ -226,7 +226,7 @@ SocketIOPacketV10x::SocketIOPacketV10x() { } int SocketIOPacketV10x::typeAsNumber() const { - std::vector::size_type num = 0; + ccstd::vector::size_type num = 0; auto item = std::find(_typesMessage.begin(), _typesMessage.end(), _type); if (item != _typesMessage.end()) { //it's a message num = item - _typesMessage.begin(); @@ -412,7 +412,7 @@ void SIOClientImpl::handshakeResponse(HttpClient * /*sender*/, HttpResponse *res CC_LOG_INFO("SIOClientImpl::handshake() succeeded"); - std::vector *buffer = response->getResponseData(); + ccstd::vector *buffer = response->getResponseData(); std::stringstream s; s.str(""); diff --git a/native/cocos/network/Uri.cpp b/native/cocos/network/Uri.cpp index 16678ecb6c..08c0f9ddfe 100644 --- a/native/cocos/network/Uri.cpp +++ b/native/cocos/network/Uri.cpp @@ -282,7 +282,7 @@ void Uri::clear() { _queryParams.clear(); } -const std::vector> &Uri::getQueryParams() { +const ccstd::vector> &Uri::getQueryParams() { if (!_query.empty() && _queryParams.empty()) { // Parse query string static const std::regex queryParamRegex( diff --git a/native/cocos/network/Uri.h b/native/cocos/network/Uri.h index b855d6e16c..7edde48cad 100644 --- a/native/cocos/network/Uri.h +++ b/native/cocos/network/Uri.h @@ -19,11 +19,10 @@ #pragma once -#include "base/Macros.h" - #include -#include #include +#include "base/Macros.h" +#include "base/std/container/vector.h" /** * @addtogroup network @@ -150,7 +149,7 @@ public: * pair of which the first element is parameter name and the second * one is parameter value */ - const std::vector> &getQueryParams(); + const ccstd::vector> &getQueryParams(); /** Clears all parts of the URI. */ void clear(); @@ -172,7 +171,7 @@ private: std::string _path; std::string _query; std::string _fragment; - std::vector> _queryParams; + ccstd::vector> _queryParams; }; } // namespace network diff --git a/native/cocos/network/WebSocket-apple.mm b/native/cocos/network/WebSocket-apple.mm index 5104158435..217c05c84b 100644 --- a/native/cocos/network/WebSocket-apple.mm +++ b/native/cocos/network/WebSocket-apple.mm @@ -32,7 +32,7 @@ #error WebSocket must be compiled with ARC enabled #endif -static std::vector *__websocketInstances = nullptr; +static ccstd::vector *__websocketInstances = nullptr; @interface WebSocketImpl : NSObject { } @@ -204,7 +204,7 @@ void WebSocket::closeAllConnections() { WebSocket::WebSocket() : _impl(nil) { if (__websocketInstances == nullptr) { - __websocketInstances = new (std::nothrow) std::vector(); + __websocketInstances = new (std::nothrow) ccstd::vector(); } __websocketInstances->push_back(this); @@ -225,7 +225,7 @@ WebSocket::~WebSocket() { bool WebSocket::init(const Delegate & delegate, const std::string & url, - const std::vector *protocols /* = nullptr*/, + const ccstd::vector *protocols /* = nullptr*/, const std::string & caFilePath /* = ""*/) { if (url.empty()) return false; diff --git a/native/cocos/network/WebSocket-libwebsockets.cpp b/native/cocos/network/WebSocket-libwebsockets.cpp index 24a98d99a9..ffdae837d1 100644 --- a/native/cocos/network/WebSocket-libwebsockets.cpp +++ b/native/cocos/network/WebSocket-libwebsockets.cpp @@ -53,7 +53,6 @@ #include #include #include -#include #include "application/ApplicationManager.h" #include "base/Scheduler.h" #include "network/Uri.h" @@ -210,7 +209,7 @@ public: bool init(const cc::network::WebSocket::Delegate &delegate, const std::string & url, - const std::vector * protocols = nullptr, + const ccstd::vector * protocols = nullptr, const std::string & caFilePath = ""); void send(const std::string &message); @@ -243,7 +242,7 @@ private: cc::network::WebSocket::State _readyState; std::mutex _readyStateMutex; std::string _url; - std::vector _receivedData; + ccstd::vector _receivedData; struct lws * _wsInstance; struct lws_protocols *_lwsProtocols; @@ -256,7 +255,7 @@ private: std::mutex _closeMutex; std::condition_variable _closeCondition; - std::vector _enabledExtensions; + ccstd::vector _enabledExtensions; enum class CloseState { NONE, @@ -280,7 +279,7 @@ enum WsMsg { class WsThreadHelper; -static std::vector *websocketInstances{nullptr}; +static ccstd::vector *websocketInstances{nullptr}; static std::recursive_mutex instanceMutex; static struct lws_context * wsContext{nullptr}; static WsThreadHelper * wsHelper{nullptr}; @@ -577,7 +576,7 @@ private: ssize_t _payloadLength{0}; ssize_t _frameLength{0}; - std::vector _data; + ccstd::vector _data; }; // @@ -611,7 +610,7 @@ WebSocketImpl::WebSocketImpl(cc::network::WebSocket *ws) { std::lock_guard lk(instanceMutex); if (websocketInstances == nullptr) { - websocketInstances = new (std::nothrow) std::vector(); + websocketInstances = new (std::nothrow) ccstd::vector(); } websocketInstances->push_back(this); } @@ -661,7 +660,7 @@ WebSocketImpl::~WebSocketImpl() { bool WebSocketImpl::init(const cc::network::WebSocket::Delegate &delegate, const std::string & url, - const std::vector * protocols /* = nullptr*/, + const ccstd::vector * protocols /* = nullptr*/, const std::string & caFilePath /* = ""*/) { _delegate = const_cast(&delegate); _url = url; @@ -1154,7 +1153,7 @@ int WebSocketImpl::onClientReceivedData(void *in, ssize_t len) { // LOGD("remainingSize: %d, isFinalFragment: %d\n", (int)remainingSize, isFinalFragment); if (remainingSize == 0 && isFinalFragment) { - auto *frameData = new (std::nothrow) std::vector(std::move(_receivedData)); + auto *frameData = new (std::nothrow) ccstd::vector(std::move(_receivedData)); // reset capacity of received data buffer _receivedData.reserve(WS_RESERVE_RECEIVE_BUFFER_SIZE); @@ -1355,7 +1354,7 @@ WebSocket::~WebSocket() { bool WebSocket::init(const Delegate & delegate, const std::string & url, - const std::vector *protocols /* = nullptr*/, + const ccstd::vector *protocols /* = nullptr*/, const std::string & caFilePath /* = ""*/) { return _impl->init(delegate, url, protocols, caFilePath); } diff --git a/native/cocos/network/WebSocket.h b/native/cocos/network/WebSocket.h index e26e1bbc32..a6eb45aeff 100644 --- a/native/cocos/network/WebSocket.h +++ b/native/cocos/network/WebSocket.h @@ -29,11 +29,11 @@ #include "base/Macros.h" #include "base/RefCounted.h" +#include "base/std/container/vector.h" #include "platform/StdC.h" #include #include -#include #ifndef OBJC_CLASS #ifdef __OBJC__ #define OBJC_CLASS(name) @class name @@ -168,7 +168,7 @@ public: */ bool init(const Delegate & delegate, const std::string & url, - const std::vector *protocols = nullptr, + const ccstd::vector *protocols = nullptr, const std::string & caFilePath = ""); /** diff --git a/native/cocos/network/WebSocketServer.cpp b/native/cocos/network/WebSocketServer.cpp index 7ad8660c3a..c336a118c4 100644 --- a/native/cocos/network/WebSocketServer.cpp +++ b/native/cocos/network/WebSocketServer.cpp @@ -273,9 +273,9 @@ void WebSocketServer::listenAsync(std::shared_ptr &server, int }).detach(); } -std::vector> WebSocketServer::getConnections() const { +ccstd::vector> WebSocketServer::getConnections() const { std::lock_guard guard(_connsMtx); - std::vector> ret; + ccstd::vector> ret; for (auto itr : _conns) { ret.emplace_back(itr.second); } @@ -472,7 +472,7 @@ int WebSocketServerConnection::onDrainData() { int finish_len = 0; int flags = 0; - std::vector buff(SEND_BUFF + LWS_PRE); + ccstd::vector buff(SEND_BUFF + LWS_PRE); if (!_sendQueue.empty()) { std::shared_ptr frag = _sendQueue.front(); @@ -526,7 +526,7 @@ void WebSocketServerConnection::onHTTP() { _headers.clear(); int n = 0, len; - std::vector buf(256); + ccstd::vector buf(256); const char * c; do { lws_token_indexes idx = static_cast(n); @@ -570,8 +570,8 @@ void WebSocketServerConnection::onDestroyClient() { } } -std::vector WebSocketServerConnection::getProtocols() { - std::vector ret; +ccstd::vector WebSocketServerConnection::getProtocols() { + ccstd::vector ret; if (_wsi) { //TODO cause abort //const struct lws_protocols* protos = lws_get_protocol(_wsi); diff --git a/native/cocos/network/WebSocketServer.h b/native/cocos/network/WebSocketServer.h index 1404314b1d..860ea92769 100644 --- a/native/cocos/network/WebSocketServer.h +++ b/native/cocos/network/WebSocketServer.h @@ -42,7 +42,6 @@ #include #include #include - #include #if CC_PLATFORM == CC_PLATFORM_OHOS #include "libwebsockets.h" @@ -98,7 +97,7 @@ public: unsigned char *getData() { return _underlyingData.data() + LWS_PRE; } private: - std::vector _underlyingData; + ccstd::vector _underlyingData; int _consumed = 0; bool _isBinary = false; std::function _callback; @@ -139,7 +138,7 @@ public: std::map getHeaders(); - std::vector getProtocols(); + ccstd::vector getProtocols(); inline void setOnClose(std::function cb) { _onclose = cb; @@ -222,7 +221,7 @@ public: static void listenAsync(std::shared_ptr &server, int port, const std::string &host, std::function callback); void closeAsync(std::function callback = nullptr); - std::vector> getConnections() const; + ccstd::vector> getConnections() const; void setOnListening(std::function cb) { _onlistening = cb; diff --git a/native/cocos/physics/physx/PhysXEventManager.h b/native/cocos/physics/physx/PhysXEventManager.h index 21282f0aba..c0a51cc0e6 100644 --- a/native/cocos/physics/physx/PhysXEventManager.h +++ b/native/cocos/physics/physx/PhysXEventManager.h @@ -26,8 +26,8 @@ #pragma once #include -#include #include "base/Macros.h" +#include "base/std/container/vector.h" #include "physics/physx/PhysXInc.h" #include "physics/spec/IWorld.h" @@ -58,13 +58,13 @@ public: }; inline SimulationEventCallback & getEventCallback() { return *_mCallback; } - inline std::vector> &getTriggerPairs() { return _mTriggerPairs; } - inline std::vector> &getConatctPairs() { return _mConatctPairs; } + inline ccstd::vector> &getTriggerPairs() { return _mTriggerPairs; } + inline ccstd::vector> &getConatctPairs() { return _mConatctPairs; } void refreshPairs(); private: - std::vector> _mTriggerPairs; - std::vector> _mConatctPairs; + ccstd::vector> _mTriggerPairs; + ccstd::vector> _mConatctPairs; SimulationEventCallback * _mCallback; }; diff --git a/native/cocos/physics/physx/PhysXSharedBody.h b/native/cocos/physics/physx/PhysXSharedBody.h index fe04d7124a..cc56fdf8b2 100644 --- a/native/cocos/physics/physx/PhysXSharedBody.h +++ b/native/cocos/physics/physx/PhysXSharedBody.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "base/Macros.h" #include "core/scene-graph/Node.h" #include "physics/physx/PhysXInc.h" @@ -97,9 +96,9 @@ private: physx::PxRigidDynamic * _mDynamicActor; PhysXWorld * _mWrappedWorld; PhysXRigidBody * _mWrappedBody; - std::vector _mWrappedShapes; - std::vector _mWrappedJoints0; - std::vector _mWrappedJoints1; + ccstd::vector _mWrappedShapes; + ccstd::vector _mWrappedJoints0; + ccstd::vector _mWrappedJoints1; PhysXSharedBody(Node *node, PhysXWorld *world, PhysXRigidBody *body); ~PhysXSharedBody(); void initActor(); diff --git a/native/cocos/physics/physx/PhysXUtils.h b/native/cocos/physics/physx/PhysXUtils.h index 115dd8060a..a16883a8d1 100644 --- a/native/cocos/physics/physx/PhysXUtils.h +++ b/native/cocos/physics/physx/PhysXUtils.h @@ -26,7 +26,7 @@ #pragma once #include -#include +#include "base/std/container/vector.h" #include "base/Macros.h" #include "math/Vec3.h" #include "math/Vec4.h" @@ -138,8 +138,8 @@ inline physx::PxMaterial &getDefaultMaterial() { return *(reinterpret_cast(getPxMaterialMap()[0])); } -inline std::vector &getPxRaycastHitBuffer() { - static std::vector m{12}; +inline ccstd::vector &getPxRaycastHitBuffer() { + static ccstd::vector m{12}; return m; } diff --git a/native/cocos/physics/physx/PhysXWorld.cpp b/native/cocos/physics/physx/PhysXWorld.cpp index 3523713e51..ca4a8aef27 100644 --- a/native/cocos/physics/physx/PhysXWorld.cpp +++ b/native/cocos/physics/physx/PhysXWorld.cpp @@ -276,8 +276,8 @@ bool PhysXWorld::raycast(RaycastOptions &opt) { return true; } -std::vector &PhysXWorld::raycastResult() { - static std::vector hits; +ccstd::vector &PhysXWorld::raycastResult() { + static ccstd::vector hits; return hits; } diff --git a/native/cocos/physics/physx/PhysXWorld.h b/native/cocos/physics/physx/PhysXWorld.h index a66d62b6eb..949d95e3a6 100644 --- a/native/cocos/physics/physx/PhysXWorld.h +++ b/native/cocos/physics/physx/PhysXWorld.h @@ -27,6 +27,7 @@ #include #include "base/Macros.h" +#include "base/std/container/vector.h" #include "core/scene-graph/Node.h" #include "physics/physx/PhysXEventManager.h" #include "physics/physx/PhysXFilterShader.h" @@ -53,17 +54,17 @@ public: void setCollisionMatrix(uint32_t index, uint32_t mask) override; bool raycast(RaycastOptions &opt) override; bool raycastClosest(RaycastOptions &opt) override; - std::vector & raycastResult() override; + ccstd::vector & raycastResult() override; RaycastResult & raycastClosestResult() override; uintptr_t createConvex(ConvexDesc &desc) override; uintptr_t createTrimesh(TrimeshDesc &desc) override; uintptr_t createHeightField(HeightFieldDesc &desc) override; uintptr_t createMaterial(uint16_t id, float f, float df, float r, uint8_t m0, uint8_t m1) override; - inline std::vector> &getTriggerEventPairs() override { + inline ccstd::vector> &getTriggerEventPairs() override { return _mEventMgr->getTriggerPairs(); } - inline std::vector> &getContactEventPairs() override { + inline ccstd::vector> &getContactEventPairs() override { return _mEventMgr->getConatctPairs(); } void syncSceneToPhysics() override; @@ -94,7 +95,7 @@ private: physx::PxScene * _mScene; PhysXEventManager * _mEventMgr; uint32_t _mCollisionMatrix[31]; - std::vector _mSharedBodies; + ccstd::vector _mSharedBodies; }; } // namespace physics diff --git a/native/cocos/physics/sdk/World.cpp b/native/cocos/physics/sdk/World.cpp index 7b4307ad5c..9c415c3413 100644 --- a/native/cocos/physics/sdk/World.cpp +++ b/native/cocos/physics/sdk/World.cpp @@ -71,11 +71,11 @@ void World::destroy() { _impl->destroy(); } -std::vector> &World::getTriggerEventPairs() { +ccstd::vector> &World::getTriggerEventPairs() { return _impl->getTriggerEventPairs(); } -std::vector> &World::getContactEventPairs() { +ccstd::vector> &World::getContactEventPairs() { return _impl->getContactEventPairs(); } @@ -99,7 +99,7 @@ bool World::raycast(RaycastOptions &opt) { return _impl->raycast(opt); } -std::vector &World::raycastResult() { +ccstd::vector &World::raycastResult() { return _impl->raycastResult(); } diff --git a/native/cocos/physics/sdk/World.h b/native/cocos/physics/sdk/World.h index 6b56f3ec93..cd14acac97 100644 --- a/native/cocos/physics/sdk/World.h +++ b/native/cocos/physics/sdk/World.h @@ -42,11 +42,11 @@ public: void syncSceneToPhysics() override; void syncSceneWithCheck() override; void setCollisionMatrix(uint32_t i, uint32_t m) override; - std::vector> &getTriggerEventPairs() override; - std::vector> &getContactEventPairs() override; + ccstd::vector> &getTriggerEventPairs() override; + ccstd::vector> &getContactEventPairs() override; bool raycast(RaycastOptions &opt) override; bool raycastClosest(RaycastOptions &opt) override; - std::vector & raycastResult() override; + ccstd::vector & raycastResult() override; RaycastResult & raycastClosestResult() override; uintptr_t createConvex(ConvexDesc &desc) override; uintptr_t createTrimesh(TrimeshDesc &desc) override; diff --git a/native/cocos/physics/spec/IWorld.h b/native/cocos/physics/spec/IWorld.h index 118e8e7798..036f41205b 100644 --- a/native/cocos/physics/spec/IWorld.h +++ b/native/cocos/physics/spec/IWorld.h @@ -27,7 +27,7 @@ #include #include -#include +#include "base/std/container/vector.h" #include "base/TypeDef.h" #include "math/Vec3.h" @@ -65,7 +65,7 @@ struct ContactEventPair { uintptr_t shapeA; uintptr_t shapeB; ETouchState state; - std::vector contacts; + ccstd::vector contacts; static constexpr uint8_t COUNT = 4; ContactEventPair(const uintptr_t a, const uintptr_t b) : shapeA(a), @@ -118,11 +118,11 @@ public: virtual void syncSceneWithCheck() = 0; virtual void destroy() = 0; virtual void setCollisionMatrix(uint32_t i, uint32_t m) = 0; - virtual std::vector> &getTriggerEventPairs() = 0; - virtual std::vector> &getContactEventPairs() = 0; + virtual ccstd::vector> &getTriggerEventPairs() = 0; + virtual ccstd::vector> &getContactEventPairs() = 0; virtual bool raycast(RaycastOptions &opt) = 0; virtual bool raycastClosest(RaycastOptions &opt) = 0; - virtual std::vector & raycastResult() = 0; + virtual ccstd::vector & raycastResult() = 0; virtual RaycastResult & raycastClosestResult() = 0; virtual uintptr_t createConvex(ConvexDesc &desc) = 0; virtual uintptr_t createTrimesh(TrimeshDesc &desc) = 0; diff --git a/native/cocos/platform/BasePlatform.h b/native/cocos/platform/BasePlatform.h index 241e795619..4ba68671f1 100644 --- a/native/cocos/platform/BasePlatform.h +++ b/native/cocos/platform/BasePlatform.h @@ -27,13 +27,12 @@ #include "base/Log.h" #include "base/Macros.h" - +#include "base/std/container/vector.h" #include "bindings/event/EventDispatcher.h" #include "platform/interfaces/modules/ISystem.h" #include #include -#include namespace cc { @@ -155,7 +154,7 @@ public: } private: - std::vector _osInterfaces; + ccstd::vector _osInterfaces; CC_DISALLOW_COPY_MOVE_ASSIGN(BasePlatform); }; } // namespace cc @@ -168,4 +167,4 @@ private: return -1; \ } \ return platform->run(argc, argv); \ - } while (0) \ No newline at end of file + } while (0) diff --git a/native/cocos/platform/FileUtils.cpp b/native/cocos/platform/FileUtils.cpp index 4246830c11..8fa571777c 100644 --- a/native/cocos/platform/FileUtils.cpp +++ b/native/cocos/platform/FileUtils.cpp @@ -678,11 +678,11 @@ std::string FileUtils::fullPathFromRelativeFile(const std::string &filename, con return relativeFile.substr(0, relativeFile.rfind('/') + 1) + filename; } -const std::vector &FileUtils::getSearchPaths() const { +const ccstd::vector &FileUtils::getSearchPaths() const { return _searchPathArray; } -const std::vector &FileUtils::getOriginalSearchPaths() const { +const ccstd::vector &FileUtils::getOriginalSearchPaths() const { return _originalSearchPaths; } @@ -707,7 +707,7 @@ void FileUtils::setDefaultResourceRootPath(const std::string &path) { } } -void FileUtils::setSearchPaths(const std::vector &searchPaths) { +void FileUtils::setSearchPaths(const ccstd::vector &searchPaths) { bool existDefaultRootPath = false; _originalSearchPaths = searchPaths; @@ -809,9 +809,9 @@ bool FileUtils::isDirectoryExist(const std::string &dirPath) const { return false; } -std::vector FileUtils::listFiles(const std::string &dirPath) const { +ccstd::vector FileUtils::listFiles(const std::string &dirPath) const { std::string fullpath = fullPathForFilename(dirPath); - std::vector files; + ccstd::vector files; if (isDirectoryExist(fullpath)) { tinydir_dir dir; #ifdef UNICODE @@ -859,7 +859,7 @@ std::vector FileUtils::listFiles(const std::string &dirPath) const return files; } -void FileUtils::listFilesRecursively(const std::string &dirPath, std::vector *files) const { // NOLINT(misc-no-recursion) +void FileUtils::listFilesRecursively(const std::string &dirPath, ccstd::vector *files) const { // NOLINT(misc-no-recursion) std::string fullpath = fullPathForFilename(dirPath); if (!fullpath.empty() && isDirectoryExist(fullpath)) { tinydir_dir dir; @@ -984,7 +984,7 @@ bool FileUtils::createDirectory(const std::string &path) { size_t start = 0; size_t found = path.find_first_of("/\\", start); std::string subpath; - std::vector dirs; + ccstd::vector dirs; if (found != std::string::npos) { while (true) { diff --git a/native/cocos/platform/FileUtils.h b/native/cocos/platform/FileUtils.h index 40dd993af3..66102f3c55 100644 --- a/native/cocos/platform/FileUtils.h +++ b/native/cocos/platform/FileUtils.h @@ -28,8 +28,7 @@ #include #include #include -#include - +#include "base/std/container/vector.h" #include "base/Data.h" #include "base/Macros.h" #include "base/Value.h" @@ -67,9 +66,9 @@ public: } }; -template -class ResizableBufferAdapter> : public ResizableBuffer { - using BufferType = std::vector; +template +class ResizableBufferAdapter> : public ResizableBuffer { + using BufferType = ccstd::vector; BufferType *_buffer; public: @@ -174,20 +173,20 @@ public: * - read file in binary mode (does not convert CRLF to LF). * - does not truncate the string when '\0' is found (returned string of getContents may have '\0' in the middle.). * - * The template version of can accept cc::Data, std::basic_string and std::vector. + * The template version of can accept cc::Data, std::basic_string and ccstd::vector. * * @code * std::string sbuf; * FileUtils::getInstance()->getContents("path/to/file", &sbuf); * - * std::vector vbuf; + * ccstd::vector vbuf; * FileUtils::getInstance()->getContents("path/to/file", &vbuf); * * Data dbuf; * FileUtils::getInstance()->getContents("path/to/file", &dbuf); * @endcode * - * Note: if you read to std::vector and std::basic_string where T is not 8 bit type, + * Note: if you read to ccstd::vector and std::basic_string where T is not 8 bit type, * you may get 0 ~ sizeof(T)-1 bytes padding. * * - To write a new buffer class works with getContents, just extend ResizableBuffer. @@ -319,7 +318,7 @@ public: * In js:var setSearchPaths(var jsval); * @lua NA */ - virtual void setSearchPaths(const std::vector &searchPaths); + virtual void setSearchPaths(const ccstd::vector &searchPaths); /** * Get default resource root path. @@ -348,13 +347,13 @@ public: * @see fullPathForFilename(const char*). * @lua NA */ - virtual const std::vector &getSearchPaths() const; + virtual const ccstd::vector &getSearchPaths() const; /** * Gets the original search path array set by 'setSearchPaths' or 'addSearchPath'. * @return The array of the original search paths */ - virtual const std::vector &getOriginalSearchPaths() const; + virtual const ccstd::vector &getOriginalSearchPaths() const; /** * Gets the writable path. @@ -480,7 +479,7 @@ public: * @param dirPath The path of the directory, it could be a relative or an absolute path. * @return File paths in a string vector */ - virtual std::vector listFiles(const std::string &dirPath) const; + virtual ccstd::vector listFiles(const std::string &dirPath) const; /** * List all files recursively in a directory. @@ -488,7 +487,7 @@ public: * @param dirPath The path of the directory, it could be a relative or an absolute path. * @return File paths in a string vector */ - virtual void listFilesRecursively(const std::string &dirPath, std::vector *files) const; + virtual void listFilesRecursively(const std::string &dirPath, ccstd::vector *files) const; /** * Creates a directory. @@ -603,12 +602,12 @@ protected: * The vector contains search paths. * The lower index of the element in this vector, the higher priority for this search path. */ - std::vector _searchPathArray; + ccstd::vector _searchPathArray; /** * The search paths which was set by 'setSearchPaths' / 'addSearchPath'. */ - std::vector _originalSearchPaths; + ccstd::vector _originalSearchPaths; /** * The default root path of resources. diff --git a/native/cocos/platform/SAXParser.cpp b/native/cocos/platform/SAXParser.cpp index cb7dd4ca41..330a0095c1 100644 --- a/native/cocos/platform/SAXParser.cpp +++ b/native/cocos/platform/SAXParser.cpp @@ -28,9 +28,6 @@ ****************************************************************************/ #include "platform/SAXParser.h" - -#include // because its based on windows 8 build :P - #include "platform/FileUtils.h" #include "tinyxml2/tinyxml2.h" @@ -56,7 +53,7 @@ private: bool XmlSaxHander::VisitEnter(const tinyxml2::XMLElement &element, const tinyxml2::XMLAttribute *firstAttribute) { //log(" VisitEnter %s",element.Value()); - std::vector attsVector; + ccstd::vector attsVector; for (const tinyxml2::XMLAttribute *attrib = firstAttribute; attrib; attrib = attrib->Next()) { //log("%s", attrib->Name()); attsVector.push_back(attrib->Name()); diff --git a/native/cocos/platform/android/FileUtils-android.h b/native/cocos/platform/android/FileUtils-android.h index 61690357e3..fff7d853b8 100644 --- a/native/cocos/platform/android/FileUtils-android.h +++ b/native/cocos/platform/android/FileUtils-android.h @@ -28,7 +28,6 @@ #pragma once #include -#include #include "android/asset_manager.h" #include "base/Macros.h" #include "jni.h" diff --git a/native/cocos/platform/android/jni/JniCocosActivity.cpp b/native/cocos/platform/android/jni/JniCocosActivity.cpp index 2e72db6b50..b9bee8a1e4 100644 --- a/native/cocos/platform/android/jni/JniCocosActivity.cpp +++ b/native/cocos/platform/android/jni/JniCocosActivity.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include "platform/android/FileUtils-android.h" #include "platform/java/jni/JniHelper.h" diff --git a/native/cocos/platform/apple/FileUtils-apple.h b/native/cocos/platform/apple/FileUtils-apple.h index 1d61c85529..a81123bac6 100644 --- a/native/cocos/platform/apple/FileUtils-apple.h +++ b/native/cocos/platform/apple/FileUtils-apple.h @@ -31,7 +31,6 @@ #include #include -#include #include "base/Macros.h" #include "platform/FileUtils.h" diff --git a/native/cocos/platform/interfaces/OSInterface.h b/native/cocos/platform/interfaces/OSInterface.h index 0d6fdb8fdc..69e8053719 100644 --- a/native/cocos/platform/interfaces/OSInterface.h +++ b/native/cocos/platform/interfaces/OSInterface.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "base/Macros.h" #include "bindings/event/EventDispatcher.h" diff --git a/native/cocos/platform/java/jni/JniHelper.h b/native/cocos/platform/java/jni/JniHelper.h index 450e491c83..54e72dc87a 100644 --- a/native/cocos/platform/java/jni/JniHelper.h +++ b/native/cocos/platform/java/jni/JniHelper.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include "base/std/container/vector.h" #include "base/Log.h" #include "base/Macros.h" #include "math/Vec3.h" @@ -70,7 +70,7 @@ using JniMethodInfo = struct JniMethodInfo_ { //NOLINT(readability-identifier-na class CC_DLL JniHelper { public: - using LocalRefMapType = std::unordered_map>; + using LocalRefMapType = std::unordered_map>; static JavaVM *getJavaVM(); static JNIEnv *getEnv(); diff --git a/native/cocos/platform/java/modules/SystemWindow.cpp b/native/cocos/platform/java/modules/SystemWindow.cpp index aad61b4c7a..6bed432ce4 100644 --- a/native/cocos/platform/java/modules/SystemWindow.cpp +++ b/native/cocos/platform/java/modules/SystemWindow.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include "base/Log.h" #include "base/Macros.h" #include "platform/java/jni/JniImp.h" diff --git a/native/cocos/platform/mac/cocos2d-prefix.pch b/native/cocos/platform/mac/cocos2d-prefix.pch index 48ed638a43..ed45f45f74 100644 --- a/native/cocos/platform/mac/cocos2d-prefix.pch +++ b/native/cocos/platform/mac/cocos2d-prefix.pch @@ -20,7 +20,6 @@ #endif #ifdef __cplusplus - #include #include #include #include diff --git a/native/cocos/platform/ohos/FileUtils-ohos.cpp b/native/cocos/platform/ohos/FileUtils-ohos.cpp index 8e11b181db..29bbc7e270 100644 --- a/native/cocos/platform/ohos/FileUtils-ohos.cpp +++ b/native/cocos/platform/ohos/FileUtils-ohos.cpp @@ -245,7 +245,7 @@ std::pair> FileUtilsOHOS::getFd(const std::string &pa RawFile *rf = OpenRawFile(ohosResourceMgr, fullpath.c_str()); // FIXME: try reuse file const auto bufSize = GetRawFileSize(rf); - auto fileCache = std::vector(bufSize); + auto fileCache = ccstd::vector(bufSize); auto * buf = fileCache.data(); // Fill buffer const auto readBytes = ReadRawFile(rf, buf, bufSize); diff --git a/native/cocos/platform/ohos/jni/JniCocosAbility.cpp b/native/cocos/platform/ohos/jni/JniCocosAbility.cpp index 7a54eb9ca6..848a69f18b 100644 --- a/native/cocos/platform/ohos/jni/JniCocosAbility.cpp +++ b/native/cocos/platform/ohos/jni/JniCocosAbility.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include "base/Log.h" #include "platform/java/jni/JniHelper.h" diff --git a/native/cocos/platform/win32/FileUtils-win32.cpp b/native/cocos/platform/win32/FileUtils-win32.cpp index 815dce78f4..12603f303e 100644 --- a/native/cocos/platform/win32/FileUtils-win32.cpp +++ b/native/cocos/platform/win32/FileUtils-win32.cpp @@ -283,7 +283,7 @@ bool FileUtilsWin32::createDirectory(const std::string &dirPath) { size_t start = 0; size_t found = path.find_first_of(L"/\\", start); std::wstring subpath; - std::vector dirs; + ccstd::vector dirs; if (found != std::wstring::npos) { while (true) { diff --git a/native/cocos/platform/win32/FileUtils-win32.h b/native/cocos/platform/win32/FileUtils-win32.h index 727731a5bd..919340a283 100644 --- a/native/cocos/platform/win32/FileUtils-win32.h +++ b/native/cocos/platform/win32/FileUtils-win32.h @@ -31,7 +31,6 @@ #if CC_PLATFORM == CC_PLATFORM_WINDOWS #include - #include #include "base/Macros.h" #include "platform/FileUtils.h" diff --git a/native/cocos/primitive/Box.cpp b/native/cocos/primitive/Box.cpp index ba0a866999..f0d18d85a5 100644 --- a/native/cocos/primitive/Box.cpp +++ b/native/cocos/primitive/Box.cpp @@ -28,7 +28,7 @@ namespace cc { namespace { -const std::vector> FACE_AXES{ +const ccstd::vector> FACE_AXES{ {2, 3, 1}, // FRONT {4, 5, 7}, // BACK {7, 6, 2}, // TOP @@ -37,7 +37,7 @@ const std::vector> FACE_AXES{ {5, 0, 6} // LEFT }; -const std::vector> FACE_NORMALS{ +const ccstd::vector> FACE_NORMALS{ {0, 0, 1}, // FRONT {0, 0, -1}, // BACK {0, 1, 0}, // TOP @@ -46,7 +46,7 @@ const std::vector> FACE_NORMALS{ {-1, 0, 0} // LEFT }; -const std::vector> FACE_TANGENTS{ +const ccstd::vector> FACE_TANGENTS{ {-1, 0, 0, 1}, // FRONT {-1, 0, 0, 1}, // BACK {-1, 0, 0, 1}, // TOP @@ -65,13 +65,13 @@ IGeometry box(const cc::optional &options) { const float hh = options->height.has_value() ? options->height.value() / 2 : 1.0F / 2; const float hl = options->length.has_value() ? options->length.value() / 2 : 1.0F / 2; - std::vector corners{Vec3{-hw, -hh, hl}, Vec3{hw, -hh, hl}, Vec3{hw, hh, hl}, Vec3{-hw, hh, hl}, Vec3{hw, -hh, -hl}, Vec3{-hw, -hh, -hl}, Vec3{-hw, hh, -hl}, Vec3{hw, hh, -hl}}; + ccstd::vector corners{Vec3{-hw, -hh, hl}, Vec3{hw, -hh, hl}, Vec3{hw, hh, hl}, Vec3{-hw, hh, hl}, Vec3{hw, -hh, -hl}, Vec3{-hw, -hh, -hl}, Vec3{-hw, hh, -hl}, Vec3{hw, hh, -hl}}; - std::vector positions; - std::vector normals; - std::vector uvs; - std::vector tangents; - std::vector indices; + ccstd::vector positions; + ccstd::vector normals; + ccstd::vector uvs; + ccstd::vector tangents; + ccstd::vector indices; const Vec3 minPos(-hw, -hh, -hl); const Vec3 maxPos(hw, hh, hl); float boundingRadius{static_cast(sqrt(hw * hw + hh * hh + hl * hl))}; @@ -80,9 +80,9 @@ IGeometry box(const cc::optional &options) { float u = 0; float v = 0; const auto offset = static_cast(positions.size() / 3); - const vector faceAxe = FACE_AXES[side]; - const vector faceNormal = FACE_NORMALS[side]; - const vector faceTangent = FACE_TANGENTS[side]; + const ccstd::vector faceAxe = FACE_AXES[side]; + const ccstd::vector faceNormal = FACE_NORMALS[side]; + const ccstd::vector faceTangent = FACE_TANGENTS[side]; for (index_t iy = 0; iy <= vSegments; ++iy) { for (index_t ix = 0; ix <= uSegments; ++ix) { @@ -145,4 +145,4 @@ IGeometry box(const cc::optional &options) { return info; } -} // namespace cc \ No newline at end of file +} // namespace cc diff --git a/native/cocos/primitive/Capsule.cpp b/native/cocos/primitive/Capsule.cpp index ddd3f358a0..117c976cc5 100644 --- a/native/cocos/primitive/Capsule.cpp +++ b/native/cocos/primitive/Capsule.cpp @@ -44,17 +44,17 @@ IGeometry capsule(float radiusTop, float radiusBottom, float height, const cc::o const float arc = opts.has_value() ? opts->arc : math::PI_2; // calculate vertex count - std::vector positions; - std::vector normals; - std::vector uvs; - std::vector indices; + ccstd::vector positions; + ccstd::vector normals; + ccstd::vector uvs; + ccstd::vector indices; const float maxRadius = std::max(radiusTop, radiusBottom); const Vec3 minPos(-maxRadius, -height / 2, -maxRadius); const Vec3 maxPos(maxRadius, height / 2, maxRadius); const float boundingRadius = height / 2; uint32_t index = 0; - std::vector> indexArray; + ccstd::vector> indexArray; // ======================= // internal functions @@ -65,7 +65,7 @@ IGeometry capsule(float radiusTop, float radiusBottom, float height, const cc::o // generate positions, normals and uvs for (uint32_t y = 0; y <= torSegments; y++) { - std::vector indexRow; + ccstd::vector indexRow; const float lat = static_cast(y) / static_cast(torSegments); const float radius = lat * (radiusTop - radiusBottom) + radiusBottom; diff --git a/native/cocos/primitive/Circle.cpp b/native/cocos/primitive/Circle.cpp index ecc5481858..414c0e3169 100644 --- a/native/cocos/primitive/Circle.cpp +++ b/native/cocos/primitive/Circle.cpp @@ -30,11 +30,11 @@ namespace cc { IGeometry circle(cc::optional &options) { if (!options.has_value()) options = ICircleOptions(); const uint32_t segments = options->segments; - std::vector positions(3 * (segments + 1)); + ccstd::vector positions(3 * (segments + 1)); positions[0] = 0; positions[1] = 0; positions[2] = 0; - std::vector indices(1 + segments * 2); + ccstd::vector indices(1 + segments * 2); indices[0] = 0; const float step = math::PI * 2 / static_cast(segments); for (uint32_t iSegment = 0; iSegment < segments; ++iSegment) { diff --git a/native/cocos/primitive/Cylinder.cpp b/native/cocos/primitive/Cylinder.cpp index 7712fa0c0e..f9ea039b9b 100644 --- a/native/cocos/primitive/Cylinder.cpp +++ b/native/cocos/primitive/Cylinder.cpp @@ -61,10 +61,10 @@ IGeometry cylinder(float radiusTop, float radiusBottom, float height, const cc:: indexCount += radialSegments * cntCap * 3; } - std::vector indices(indexCount); - std::vector positions(vertCount * 3); - std::vector normals(vertCount * 3); - std::vector uvs(vertCount * 2); + ccstd::vector indices(indexCount); + ccstd::vector positions(vertCount * 3); + ccstd::vector normals(vertCount * 3); + ccstd::vector uvs(vertCount * 2); const float maxRadius = std::max(radiusTop, radiusBottom); const Vec3 minPos(-maxRadius, -halfHeight, -maxRadius); const Vec3 maxPos(maxRadius, halfHeight, maxRadius); @@ -77,7 +77,7 @@ IGeometry cylinder(float radiusTop, float radiusBottom, float height, const cc:: // internal functions // ======================= auto generateTorso = [&]() { - std::vector> indexArray; + ccstd::vector> indexArray; // this will be used to calculate the normal const float r = radiusTop - radiusBottom; @@ -85,7 +85,7 @@ IGeometry cylinder(float radiusTop, float radiusBottom, float height, const cc:: const float slope = r * r / height * sign(r); // generate positions, normals and uvs for (uint32_t y = 0; y <= heightSegments; y++) { - std::vector indexRow; + ccstd::vector indexRow; const float v = static_cast(y) / static_cast(heightSegments); // calculate the radius of the current row diff --git a/native/cocos/primitive/Plane.cpp b/native/cocos/primitive/Plane.cpp index 09e6dae929..6b8642df53 100644 --- a/native/cocos/primitive/Plane.cpp +++ b/native/cocos/primitive/Plane.cpp @@ -39,9 +39,9 @@ IGeometry plane(cc::optional options) { const float hw = width * 0.5F; const float hl = length * 0.5F; - std::vector positions; - std::vector uvs; - std::vector indices; + ccstd::vector positions; + ccstd::vector uvs; + ccstd::vector indices; const Vec3 minPos(-hw, 0, -hl); const Vec3 maxPos(hw, 0, hl); const float boundingRadius = sqrt(width * width + length * length); @@ -94,7 +94,7 @@ IGeometry plane(cc::optional options) { if (options->includeNormal) { const uint32_t nVertex = (vSegments + 1) * (uSegments + 1); - std::vector normals(3 * nVertex); + ccstd::vector normals(3 * nVertex); for (uint32_t i = 0; i < nVertex; ++i) { normals[i * 3 + 0] = 0; normals[i * 3 + 1] = 1; diff --git a/native/cocos/primitive/PrimitiveDefine.h b/native/cocos/primitive/PrimitiveDefine.h index 06c20da042..970b849f78 100644 --- a/native/cocos/primitive/PrimitiveDefine.h +++ b/native/cocos/primitive/PrimitiveDefine.h @@ -24,7 +24,6 @@ ****************************************************************************/ #pragma once -#include #include "cocos/base/Optional.h" #include "core/TypedArray.h" #include "math/Vec3.h" @@ -59,7 +58,7 @@ struct IGeometryOptions { struct CustomAttribute { gfx::Attribute attr; - std::vector values; + ccstd::vector values; }; /** @@ -75,7 +74,7 @@ struct IGeometry { * @zh * 顶点位置。 */ - std::vector positions; + ccstd::vector positions; /** * @en @@ -83,7 +82,7 @@ struct IGeometry { * @zh * 顶点法线。 */ - cc::optional> normals; + cc::optional> normals; /** * @en @@ -91,7 +90,7 @@ struct IGeometry { * @zh * 纹理坐标。 */ - cc::optional> uvs; + cc::optional> uvs; /** * @en @@ -99,7 +98,7 @@ struct IGeometry { * @zh * 顶点切线。 */ - cc::optional> tangents; + cc::optional> tangents; /** * @en @@ -107,7 +106,7 @@ struct IGeometry { * @zh * 顶点颜色。 */ - cc::optional> colors; + cc::optional> colors; /** * @en @@ -123,7 +122,7 @@ struct IGeometry { * @zh * 定制属性列表。 */ - cc::optional> customAttributes; + cc::optional> customAttributes; /** * @en @@ -155,7 +154,7 @@ struct IGeometry { * @zh * 几何索引,当使用索引绘制时。 */ - cc::optional> indices; //cjh uint16_t ? + cc::optional> indices; //cjh uint16_t ? /** * @en @@ -232,7 +231,7 @@ struct IDynamicGeometry { * @zh * 定制属性列表。 */ - cc::optional> customAttributes; + cc::optional> customAttributes; /** * @en diff --git a/native/cocos/primitive/Quad.cpp b/native/cocos/primitive/Quad.cpp index 867bd31850..06d3a6498f 100644 --- a/native/cocos/primitive/Quad.cpp +++ b/native/cocos/primitive/Quad.cpp @@ -30,20 +30,20 @@ IGeometry quad(cc::optional options) { options = IGeometryOptions(); } IGeometry result; - result.positions = std::vector{-0.5, -0.5, 0, -0.5, 0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0}; + result.positions = ccstd::vector{-0.5, -0.5, 0, -0.5, 0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0}; result.boundingRadius = sqrt(0.5 * 0.5 + 0.5 * 0.5); result.minPos = Vec3(-0.5, -0.5, 0); result.maxPos = Vec3(0.5, 0.5, 0); - result.indices = std::vector{0, 3, 1, 3, 2, 1}; + result.indices = ccstd::vector{0, 3, 1, 3, 2, 1}; if (options->includeNormal) { - result.normals = std::vector{ + result.normals = ccstd::vector{ 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1}; } if (options->includeUV) { - result.uvs = std::vector{ + result.uvs = ccstd::vector{ 0, 0, 0, 1, 1, 1, diff --git a/native/cocos/primitive/Sphere.cpp b/native/cocos/primitive/Sphere.cpp index b847419747..32e6240c73 100644 --- a/native/cocos/primitive/Sphere.cpp +++ b/native/cocos/primitive/Sphere.cpp @@ -32,10 +32,10 @@ IGeometry sphere(float radius, const cc::optional &opts) { // lat === latitude // lon === longitude - std::vector positions; - std::vector normals; - std::vector uvs; - std::vector indices; + ccstd::vector positions; + ccstd::vector normals; + ccstd::vector uvs; + ccstd::vector indices; const Vec3 minPos(-radius, -radius, -radius); const Vec3 maxPos(radius, radius, radius); const float boundingRadius = radius; diff --git a/native/cocos/primitive/Torus.cpp b/native/cocos/primitive/Torus.cpp index 16e02d4219..b9ce8bec2f 100644 --- a/native/cocos/primitive/Torus.cpp +++ b/native/cocos/primitive/Torus.cpp @@ -31,10 +31,10 @@ IGeometry torus(float radius, float tube, const cc::optional &opt const uint32_t tubularSegments = opts.has_value() ? opts->tubularSegments : 32; const float arc = opts.has_value() ? opts->arc : math::PI_2; - std::vector positions; - std::vector normals; - std::vector uvs; - std::vector indices; + ccstd::vector positions; + ccstd::vector normals; + ccstd::vector uvs; + ccstd::vector indices; const Vec3 minPos(-radius - tube, -tube, -radius - tube); const Vec3 maxPos(radius + tube, tube, radius + tube); const float boundingRadius = radius + tube; diff --git a/native/cocos/primitive/Transform.cpp b/native/cocos/primitive/Transform.cpp index fd909c9da9..e83fdd0c5d 100644 --- a/native/cocos/primitive/Transform.cpp +++ b/native/cocos/primitive/Transform.cpp @@ -101,8 +101,8 @@ IGeometry wireframed(IGeometry &geometry) { } // const offsets = [ [ 0, 1 ], [ 1, 2 ], [ 2, 0 ] ]; - std::vector> offsets{{0, 1}, {1, 2}, {2, 0}}; - std::vector lines; + ccstd::vector> offsets{{0, 1}, {1, 2}, {2, 0}}; + ccstd::vector lines; std::unordered_map lineIDs; for (uint32_t i = 0; i < indices->size(); i += 3) { for (uint32_t k = 0; k < 3; ++k) { diff --git a/native/cocos/renderer/core/MaterialInstance.cpp b/native/cocos/renderer/core/MaterialInstance.cpp index d9fa71ed59..b9bcabd452 100644 --- a/native/cocos/renderer/core/MaterialInstance.cpp +++ b/native/cocos/renderer/core/MaterialInstance.cpp @@ -35,7 +35,7 @@ void MaterialInstance::overridePipelineStates(const PassOverrides &overrides, in return; } - std::vector &passInfos = _effectAsset->_techniques[getTechniqueIndex()].passes; + ccstd::vector &passInfos = _effectAsset->_techniques[getTechniqueIndex()].passes; if (passIdx == CC_INVALID_INDEX) { for (size_t i = 0, len = passes.size(); i < len; i++) { auto *pass = passes[i].get(); @@ -61,8 +61,8 @@ bool MaterialInstance::destroy() { return true; } -std::vector> MaterialInstance::createPasses() { - std::vector> passes; +ccstd::vector> MaterialInstance::createPasses() { + ccstd::vector> passes; auto & parentPasses = _parent->getPasses(); passes.reserve(parentPasses->size()); diff --git a/native/cocos/renderer/core/MaterialInstance.h b/native/cocos/renderer/core/MaterialInstance.h index 3ad03c7482..df0d6fce3c 100644 --- a/native/cocos/renderer/core/MaterialInstance.h +++ b/native/cocos/renderer/core/MaterialInstance.h @@ -78,7 +78,7 @@ public: // protected: - std::vector> createPasses() override; + ccstd::vector> createPasses() override; private: IntrusivePtr _parent; diff --git a/native/cocos/renderer/core/PassUtils.cpp b/native/cocos/renderer/core/PassUtils.cpp index 7fc77699ec..ecf6b1cb47 100644 --- a/native/cocos/renderer/core/PassUtils.cpp +++ b/native/cocos/renderer/core/PassUtils.cpp @@ -207,8 +207,8 @@ const std::unordered_map type2writer = { }}, }; -const std::vector &getDefaultFloatArrayFromType(gfx::Type type) { - static const std::vector DEFAULT_FLOAT_VALUES[] = { +const ccstd::vector &getDefaultFloatArrayFromType(gfx::Type type) { + static const ccstd::vector DEFAULT_FLOAT_VALUES[] = { {0}, {0, 0}, {0, 0, 0, 0}, diff --git a/native/cocos/renderer/core/PassUtils.h b/native/cocos/renderer/core/PassUtils.h index f26d6fbeb5..b6cf691de4 100644 --- a/native/cocos/renderer/core/PassUtils.h +++ b/native/cocos/renderer/core/PassUtils.h @@ -74,7 +74,7 @@ using MacroRecord = Record; using MaterialProperty = cc::variant /*10*/, IntrusivePtr /*11*/>; -using MaterialPropertyList = std::vector; +using MaterialPropertyList = ccstd::vector; using MaterialPropertyVariant = cc::variant; @@ -92,7 +92,7 @@ extern const std::unordered_map type2writer; / * @zh 根据指定的 Uniform 类型来获取默认值 * @param type The type of the uniform */ -const std::vector &getDefaultFloatArrayFromType(gfx::Type type); +const ccstd::vector &getDefaultFloatArrayFromType(gfx::Type type); const std::string & getDefaultStringFromType(gfx::Type type); /** diff --git a/native/cocos/renderer/core/ProgramLib.cpp b/native/cocos/renderer/core/ProgramLib.cpp index 4423e04dc8..8ae18c10bb 100644 --- a/native/cocos/renderer/core/ProgramLib.cpp +++ b/native/cocos/renderer/core/ProgramLib.cpp @@ -83,8 +83,8 @@ std::string mapDefine(const IDefineInfo &info, const cc::optional prepareDefines(const MacroRecord &records, const std::vector &defList) { - std::vector macros{}; +ccstd::vector prepareDefines(const MacroRecord &records, const ccstd::vector &defList) { + ccstd::vector macros{}; for (const auto &tmp : defList) { const auto &name = tmp.name; auto it = records.find(name); @@ -99,7 +99,7 @@ std::vector prepareDefines(const MacroRecord &records, const std::ve return macros; } -std::string getShaderInstanceName(const std::string &name, const std::vector ¯os) { +std::string getShaderInstanceName(const std::string &name, const ccstd::vector ¯os) { std::stringstream ret; ret << name; for (const auto &cur : macros) { @@ -111,12 +111,12 @@ std::string getShaderInstanceName(const std::string &name, const std::vector *outBindings) { + const std::string &type, ccstd::vector *outBindings) { CC_ASSERT(type == "locals" || type == "globals"); const auto &target = type == "globals" ? tmpl.builtins.globals : tmpl.builtins.locals; // Blocks - std::vector tempBlocks{}; + ccstd::vector tempBlocks{}; for (const auto &b : target.blocks) { auto infoIt = source.blocks.find(b.name); if (infoIt == source.blocks.end()) { @@ -139,7 +139,7 @@ void insertBuiltinBindings(const IProgramInfo &tmpl, ITemplateInfo &tmplInfo, co tmplInfo.shaderInfo.blocks.insert(tmplInfo.shaderInfo.blocks.begin(), tempBlocks.begin(), tempBlocks.end()); // SamplerTextures - std::vector tempSamplerTextures; + ccstd::vector tempSamplerTextures; for (const auto &s : target.samplerTextures) { auto infoIt = source.samplers.find(s.name); if (infoIt == source.samplers.end()) { @@ -199,7 +199,7 @@ auto genHandles(const IProgramInfo &tmpl) { return handleMap; } -bool dependencyCheck(const std::vector &dependencies, const MacroRecord &defines) { +bool dependencyCheck(const ccstd::vector &dependencies, const MacroRecord &defines) { for (const auto &d : dependencies) { // NOLINT(readability-use-anyofallof) if (d[0] == '!') { // negative dependency if (defines.find(d.substr(1)) != defines.end()) { @@ -212,8 +212,8 @@ bool dependencyCheck(const std::vector &dependencies, const MacroRe return true; } -std::vector getActiveAttributes(const IProgramInfo &tmpl, const ITemplateInfo &tmplInfo, const MacroRecord &defines) { - std::vector out{}; +ccstd::vector getActiveAttributes(const IProgramInfo &tmpl, const ITemplateInfo &tmplInfo, const MacroRecord &defines) { + ccstd::vector out{}; const auto & attributes = tmpl.attributes; const auto & gfxAttributes = tmplInfo.gfxAttributes; for (auto i = 0; i < attributes.size(); i++) { @@ -241,7 +241,7 @@ const char *getDeviceShaderVersion(const gfx::Device *device) { } // -static void copyDefines(const std::vector &from, std::vector &to) { +static void copyDefines(const ccstd::vector &from, ccstd::vector &to) { to.resize(from.size()); for (size_t i = 0, len = from.size(); i < len; ++i) { to[i].name = from[i].name; @@ -393,7 +393,7 @@ IProgramInfo *ProgramLib::define(IShaderInfo &shader) { bindingsInfo.descriptorType = gfx::DescriptorType::UNIFORM_BUFFER; bindingsInfo.count = 1; bindingsInfo.stageFlags = block.stageFlags; - std::vector uniforms; + ccstd::vector uniforms; { // construct uniforms uniforms.reserve(block.members.size()); @@ -625,11 +625,11 @@ std::string ProgramLib::getKey(const std::string &name, const MacroRecord &defin void ProgramLib::destroyShaderByDefines(const MacroRecord &defines) { if (defines.empty()) return; - std::vector defineValues; + ccstd::vector defineValues; for (const auto &i : defines) { defineValues.emplace_back(i.first + recordAsString(i.second)); } - std::vector matchedKeys; + ccstd::vector matchedKeys; for (const auto &i : _cache) { bool matched = true; for (const auto &v : defineValues) { @@ -682,7 +682,7 @@ gfx::Shader *ProgramLib::getGFXShader(gfx::Device *device, const std::string &na tmplInfo.pipelineLayout = device->createPipelineLayout(gfx::PipelineLayoutInfo{tmplInfo.setLayouts.get()}); } - std::vector macroArray = prepareDefines(defines, tmpl.defines); + ccstd::vector macroArray = prepareDefines(defines, tmpl.defines); std::stringstream ss; ss << std::endl; for (const auto &m : macroArray) { diff --git a/native/cocos/renderer/core/ProgramLib.h b/native/cocos/renderer/core/ProgramLib.h index 22c8da4528..64c822a947 100644 --- a/native/cocos/renderer/core/ProgramLib.h +++ b/native/cocos/renderer/core/ProgramLib.h @@ -30,7 +30,6 @@ #include #include #include -#include #include "base/RefVector.h" #include "cocos/base/Optional.h" #include "core/Types.h" @@ -57,19 +56,19 @@ struct IMacroInfo { }; struct ITemplateInfo { - std::vector gfxAttributes; + ccstd::vector gfxAttributes; gfx::ShaderInfo shaderInfo; - std::vector blockSizes; + ccstd::vector blockSizes; RefVector setLayouts; IntrusivePtr pipelineLayout; Record handleMap; - std::vector bindings; + ccstd::vector bindings; int32_t samplerStartBinding{-1}; }; struct IProgramInfo : public IShaderInfo { std::string effectName; - std::vector defines; + ccstd::vector defines; std::string constantMacros; bool uber{false}; // macro number exceeds default limits, will fallback to string hash diff --git a/native/cocos/renderer/core/TextureBufferPool.cpp b/native/cocos/renderer/core/TextureBufferPool.cpp index 4c73b6edca..6954a196a9 100644 --- a/native/cocos/renderer/core/TextureBufferPool.cpp +++ b/native/cocos/renderer/core/TextureBufferPool.cpp @@ -241,7 +241,7 @@ index_t TextureBufferPool::findAvailableSpace(uint32_t size, index_t chunkIdx) c isFound = true; } else { start = 0; // try to find from head again - std::vector handles; + ccstd::vector handles; for (auto h : _handles) { if (h.chunkIdx == chunkIdx) { handles.emplace_back(h); diff --git a/native/cocos/renderer/core/TextureBufferPool.h b/native/cocos/renderer/core/TextureBufferPool.h index 59534c8c99..72c10aa745 100644 --- a/native/cocos/renderer/core/TextureBufferPool.h +++ b/native/cocos/renderer/core/TextureBufferPool.h @@ -82,9 +82,9 @@ private: gfx::Device * _device{nullptr}; gfx::Format _format{gfx::Format::UNKNOWN}; uint32_t _formatSize{0}; - std::vector _chunks; + ccstd::vector _chunks; uint32_t _chunkCount{0}; - std::vector _handles; + ccstd::vector _handles; gfx::BufferTextureCopy _region0; gfx::BufferTextureCopy _region1; gfx::BufferTextureCopy _region2; diff --git a/native/cocos/renderer/frame-graph/DevicePass.cpp b/native/cocos/renderer/frame-graph/DevicePass.cpp index bdddd3c8cc..355037ccd8 100644 --- a/native/cocos/renderer/frame-graph/DevicePass.cpp +++ b/native/cocos/renderer/frame-graph/DevicePass.cpp @@ -39,15 +39,15 @@ namespace cc { namespace framegraph { -DevicePass::DevicePass(const FrameGraph &graph, std::vector const &subpassNodes) { - std::vector attachments; +DevicePass::DevicePass(const FrameGraph &graph, ccstd::vector const &subpassNodes) { + ccstd::vector attachments; for (const PassNode *passNode : subpassNodes) { append(graph, passNode, &attachments); } std::sort(attachments.begin(), attachments.end(), RenderTargetAttachment::Sorter()); - std::vector renderTargets; + ccstd::vector renderTargets; for (auto &attachment : attachments) { const ResourceNode &resourceNode = graph.getResourceNode(attachment.textureHandle); @@ -98,7 +98,7 @@ void DevicePass::execute() { end(cmdBuff); } -void DevicePass::append(const FrameGraph &graph, const PassNode *passNode, std::vector *attachments) { +void DevicePass::append(const FrameGraph &graph, const PassNode *passNode, ccstd::vector *attachments) { _subpasses.emplace_back(); Subpass &subpass = _subpasses.back(); @@ -131,7 +131,7 @@ void DevicePass::append(const FrameGraph &graph, const PassNode *passNode, std:: } void DevicePass::append(const FrameGraph &graph, const RenderTargetAttachment &attachment, - std::vector *attachments, gfx::SubpassInfo *subpass, const std::vector &reads) { + ccstd::vector *attachments, gfx::SubpassInfo *subpass, const ccstd::vector &reads) { RenderTargetAttachment::Usage usage{attachment.desc.usage}; uint32_t slot{attachment.desc.slot}; if (attachment.desc.usage == RenderTargetAttachment::Usage::COLOR) { @@ -203,7 +203,7 @@ void DevicePass::begin(gfx::CommandBuffer *cmdBuff) { gfx::FramebufferInfo fboInfo; float clearDepth = 1.F; uint32_t clearStencil = 0; - static std::vector clearColors; + static ccstd::vector clearColors; clearColors.clear(); bool hasDefaultViewport{false}; diff --git a/native/cocos/renderer/frame-graph/DevicePass.h b/native/cocos/renderer/frame-graph/DevicePass.h index 7f5f12e2cb..9923863a90 100644 --- a/native/cocos/renderer/frame-graph/DevicePass.h +++ b/native/cocos/renderer/frame-graph/DevicePass.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "CallbackPass.h" #include "RenderTargetAttachment.h" #include "gfx-base/GFXDef.h" @@ -37,7 +36,7 @@ namespace framegraph { class DevicePass final { public: DevicePass() = delete; - DevicePass(const FrameGraph &graph, std::vector const &subpassNodes); + DevicePass(const FrameGraph &graph, ccstd::vector const &subpassNodes); DevicePass(const DevicePass &) = delete; DevicePass(DevicePass &&) = delete; ~DevicePass() = default; @@ -55,7 +54,7 @@ private: }; struct Subpass final { - std::vector logicPasses{}; + ccstd::vector logicPasses{}; gfx::SubpassInfo desc; }; @@ -64,15 +63,15 @@ private: gfx::Texture * renderTarget{nullptr}; }; - void append(const FrameGraph &graph, const PassNode *passNode, std::vector *attachments); + void append(const FrameGraph &graph, const PassNode *passNode, ccstd::vector *attachments); void append(const FrameGraph &graph, const RenderTargetAttachment &attachment, - std::vector *attachments, gfx::SubpassInfo *subpass, const std::vector &reads); + ccstd::vector *attachments, gfx::SubpassInfo *subpass, const ccstd::vector &reads); void begin(gfx::CommandBuffer *cmdBuff); void next(gfx::CommandBuffer *cmdBuff) noexcept; void end(gfx::CommandBuffer *cmdBuff); - std::vector _subpasses{}; - std::vector _attachments{}; + ccstd::vector _subpasses{}; + ccstd::vector _attachments{}; uint16_t _usedRenderTargetSlotMask{0}; DevicePassResourceTable _resourceTable; diff --git a/native/cocos/renderer/frame-graph/DevicePassResourceTable.cpp b/native/cocos/renderer/frame-graph/DevicePassResourceTable.cpp index c12732d2ba..27bab8556b 100644 --- a/native/cocos/renderer/frame-graph/DevicePassResourceTable.cpp +++ b/native/cocos/renderer/frame-graph/DevicePassResourceTable.cpp @@ -39,7 +39,7 @@ gfx::GFXObject *DevicePassResourceTable::get(const ResourceDictionary &from, Han void DevicePassResourceTable::extract(const FrameGraph & graph, const PassNode * passNode, - std::vector const &renderTargets) noexcept { + ccstd::vector const &renderTargets) noexcept { do { extract(graph, passNode->_reads, _reads, false, renderTargets); extract(graph, passNode->_writes, _writes, true, renderTargets); @@ -49,10 +49,10 @@ void DevicePassResourceTable::extract(const FrameGraph & g } void DevicePassResourceTable::extract(const FrameGraph & graph, - std::vector const & from, + ccstd::vector const & from, ResourceDictionary & to, bool ignoreRenderTarget, - std::vector const &renderTargets) noexcept { + ccstd::vector const &renderTargets) noexcept { std::for_each(from.cbegin(), from.cend(), [&](const Handle handle) { if (to.find(handle) != to.cend()) { return; diff --git a/native/cocos/renderer/frame-graph/DevicePassResourceTable.h b/native/cocos/renderer/frame-graph/DevicePassResourceTable.h index 6966c83a4a..c00ad8ad5a 100644 --- a/native/cocos/renderer/frame-graph/DevicePassResourceTable.h +++ b/native/cocos/renderer/frame-graph/DevicePassResourceTable.h @@ -61,8 +61,8 @@ private: using ResourceDictionary = std::unordered_map; static gfx::GFXObject *get(const ResourceDictionary &from, Handle handle) noexcept; - void extract(const FrameGraph &graph, const PassNode *passNode, std::vector const &renderTargets) noexcept; - static void extract(const FrameGraph &graph, std::vector const &from, ResourceDictionary &to, bool ignoreRenderTarget, std::vector const &renderTargets) noexcept; + void extract(const FrameGraph &graph, const PassNode *passNode, ccstd::vector const &renderTargets) noexcept; + static void extract(const FrameGraph &graph, ccstd::vector const &from, ResourceDictionary &to, bool ignoreRenderTarget, ccstd::vector const &renderTargets) noexcept; ResourceDictionary _reads{}; ResourceDictionary _writes{}; diff --git a/native/cocos/renderer/frame-graph/FrameGraph.cpp b/native/cocos/renderer/frame-graph/FrameGraph.cpp index 8a605dcfc7..54a81170df 100644 --- a/native/cocos/renderer/frame-graph/FrameGraph.cpp +++ b/native/cocos/renderer/frame-graph/FrameGraph.cpp @@ -230,7 +230,7 @@ void FrameGraph::cull() { } } - static std::vector stack; + static ccstd::vector stack; stack.clear(); stack.reserve(_resourceNodes.size()); @@ -439,7 +439,7 @@ void FrameGraph::generateDevicePasses() { ID passId = 1; - static std::vector subpassNodes; + static ccstd::vector subpassNodes; subpassNodes.clear(); for (const auto &passNode : _passNodes) { diff --git a/native/cocos/renderer/frame-graph/FrameGraph.h b/native/cocos/renderer/frame-graph/FrameGraph.h index 8f1a0bcf5d..f349d1bbc5 100644 --- a/native/cocos/renderer/frame-graph/FrameGraph.h +++ b/native/cocos/renderer/frame-graph/FrameGraph.h @@ -27,7 +27,6 @@ #include #include -#include #include "Blackboard.h" #include "CallbackPass.h" #include "DevicePass.h" @@ -90,10 +89,10 @@ private: void generateDevicePasses(); ResourceNode *getResourceNode(const VirtualResource *virtualResource, uint8_t version) noexcept; - std::vector> _passNodes{}; - std::vector _resourceNodes{}; - std::vector> _virtualResources{}; - std::vector> _devicePasses{}; + ccstd::vector> _passNodes{}; + ccstd::vector _resourceNodes{}; + ccstd::vector> _virtualResources{}; + ccstd::vector> _devicePasses{}; ResourceHandleBlackboard _blackboard; bool _merge{true}; diff --git a/native/cocos/renderer/frame-graph/PassInsertPointManager.h b/native/cocos/renderer/frame-graph/PassInsertPointManager.h index 8d94c166b3..3cfefe2b35 100644 --- a/native/cocos/renderer/frame-graph/PassInsertPointManager.h +++ b/native/cocos/renderer/frame-graph/PassInsertPointManager.h @@ -25,7 +25,6 @@ #pragma once -#include #include "Handle.h" #include "base/Macros.h" @@ -53,7 +52,7 @@ private: inline PassInsertPoint get(StringHandle name) const; StringPool _stringPool; - std::vector _insertPoints{}; + ccstd::vector _insertPoints{}; }; ////////////////////////////////////////////////////////////////////////// diff --git a/native/cocos/renderer/frame-graph/PassNode.h b/native/cocos/renderer/frame-graph/PassNode.h index 02a399de05..3e49a6295e 100644 --- a/native/cocos/renderer/frame-graph/PassNode.h +++ b/native/cocos/renderer/frame-graph/PassNode.h @@ -64,11 +64,11 @@ private: Handle getWriteResourceNodeHandle(const FrameGraph &graph, const VirtualResource *resource) const; std::unique_ptr _pass{nullptr}; - std::vector _reads{}; - std::vector _writes{}; - std::vector _attachments{}; - std::vector _resourceRequestArray{}; - std::vector _resourceReleaseArray{}; + ccstd::vector _reads{}; + ccstd::vector _writes{}; + ccstd::vector _attachments{}; + ccstd::vector _resourceRequestArray{}; + ccstd::vector _resourceReleaseArray{}; const StringHandle _name; uint32_t _refCount{0}; PassNode * _head{nullptr}; diff --git a/native/cocos/renderer/frame-graph/ResourceAllocator.h b/native/cocos/renderer/frame-graph/ResourceAllocator.h index 9645461834..d23b1fb8d7 100644 --- a/native/cocos/renderer/frame-graph/ResourceAllocator.h +++ b/native/cocos/renderer/frame-graph/ResourceAllocator.h @@ -50,7 +50,7 @@ public: void gc(uint32_t unusedFrameCount) noexcept; private: - using DeviceResourcePool = std::vector; + using DeviceResourcePool = ccstd::vector; ResourceAllocator() noexcept = default; ~ResourceAllocator() = default; diff --git a/native/cocos/renderer/gfx-agent/BufferAgent.h b/native/cocos/renderer/gfx-agent/BufferAgent.h index fc1883778c..bd89701e8d 100644 --- a/native/cocos/renderer/gfx-agent/BufferAgent.h +++ b/native/cocos/renderer/gfx-agent/BufferAgent.h @@ -52,7 +52,7 @@ private: static constexpr uint32_t STAGING_BUFFER_THRESHOLD = MessageQueue::MEMORY_CHUNK_SIZE / 2; - vector _stagingBuffers; + ccstd::vector _stagingBuffers; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-base/GFXCommandBuffer.h b/native/cocos/renderer/gfx-base/GFXCommandBuffer.h index 26bd531460..a9dec20331 100644 --- a/native/cocos/renderer/gfx-base/GFXCommandBuffer.h +++ b/native/cocos/renderer/gfx-base/GFXCommandBuffer.h @@ -30,6 +30,7 @@ #include "GFXObject.h" #include "base/Utils.h" #include "base/RefCounted.h" +#include "base/std/container/vector.h" namespace cc { namespace gfx { @@ -79,7 +80,7 @@ public: inline void execute(const CommandBufferList &cmdBuffs, uint32_t count); inline void bindDescriptorSet(uint32_t set, DescriptorSet *descriptorSet); - inline void bindDescriptorSet(uint32_t set, DescriptorSet *descriptorSet, const vector &dynamicOffsets); + inline void bindDescriptorSet(uint32_t set, DescriptorSet *descriptorSet, const ccstd::vector &dynamicOffsets); inline void beginRenderPass(RenderPass *renderPass, Framebuffer *fbo, const Rect &renderArea, const ColorList &colors, float depth, uint32_t stencil, const CommandBufferList &secondaryCBs); inline void beginRenderPass(RenderPass *renderPass, Framebuffer *fbo, const Rect &renderArea, const ColorList &colors, float depth, uint32_t stencil); @@ -138,7 +139,7 @@ void CommandBuffer::bindDescriptorSet(uint32_t set, DescriptorSet *descriptorSet bindDescriptorSet(set, descriptorSet, 0, nullptr); } -void CommandBuffer::bindDescriptorSet(uint32_t set, DescriptorSet *descriptorSet, const vector &dynamicOffsets) { +void CommandBuffer::bindDescriptorSet(uint32_t set, DescriptorSet *descriptorSet, const ccstd::vector &dynamicOffsets) { bindDescriptorSet(set, descriptorSet, utils::toUint(dynamicOffsets.size()), dynamicOffsets.data()); } diff --git a/native/cocos/renderer/gfx-base/GFXDef-common.h b/native/cocos/renderer/gfx-base/GFXDef-common.h index 40b9e5f7a9..bd1505cfb5 100644 --- a/native/cocos/renderer/gfx-base/GFXDef-common.h +++ b/native/cocos/renderer/gfx-base/GFXDef-common.h @@ -26,6 +26,7 @@ #pragma once #include "base/TypeDef.h" +#include "base/std/container/vector.h" #include "base/memory/Memory.h" #include "math/Math.h" @@ -77,12 +78,12 @@ class QueryPool; class Window; class Context; -using TextureBarrierList = vector; -using BufferDataList = vector; -using BufferSrcList = vector; -using CommandBufferList = vector; -using QueryPoolList = vector; -using IndexList = vector; +using TextureBarrierList = ccstd::vector; +using BufferDataList = ccstd::vector; +using BufferSrcList = ccstd::vector; +using CommandBufferList = ccstd::vector; +using QueryPoolList = ccstd::vector; +using IndexList = ccstd::vector; constexpr uint32_t MAX_ATTACHMENTS = 4U; constexpr uint32_t INVALID_BINDING = ~0U; @@ -91,10 +92,10 @@ constexpr uint32_t SUBPASS_EXTERNAL = ~0U; // Although the standard is not limited, some devices do not support up to 65536 queries constexpr uint32_t DEFAULT_MAX_QUERY_OBJECTS = 32767; -using BufferList = vector; -using TextureList = vector; -using SamplerList = vector; -using DescriptorSetLayoutList = vector; +using BufferList = ccstd::vector; +using TextureList = ccstd::vector; +using SamplerList = ccstd::vector; +using DescriptorSetLayoutList = ccstd::vector; enum class ObjectType : uint32_t { UNKNOWN, @@ -719,7 +720,7 @@ enum class DynamicStateFlagBit : uint32_t { using DynamicStateFlags = DynamicStateFlagBit; CC_ENUM_BITWISE_OPERATORS(DynamicStateFlagBit); -using DynamicStateList = vector; +using DynamicStateList = ccstd::vector; enum class StencilFace : uint32_t { FRONT = 0x1, @@ -879,7 +880,7 @@ struct TextureBlit { EXPOSE_COPY_FN(TextureBlit) }; -using TextureBlitList = vector; +using TextureBlitList = ccstd::vector; struct BufferTextureCopy { uint32_t buffStride{0}; @@ -890,7 +891,7 @@ struct BufferTextureCopy { EXPOSE_COPY_FN(BufferTextureCopy) }; -using BufferTextureCopyList = vector; +using BufferTextureCopyList = ccstd::vector; struct Viewport { int32_t left{0}; @@ -911,7 +912,7 @@ struct Color { EXPOSE_COPY_FN(Color) }; -using ColorList = vector; +using ColorList =ccstd:: vector; /** * For non-vulkan backends, to maintain compatibility and maximize @@ -989,7 +990,7 @@ struct DrawInfo { EXPOSE_COPY_FN(DrawInfo) }; -using DrawInfoList = vector; +using DrawInfoList = ccstd::vector; struct DispatchInfo { uint32_t groupCountX{0}; @@ -1002,7 +1003,7 @@ struct DispatchInfo { EXPOSE_COPY_FN(DispatchInfo) }; -using DispatchInfoList = vector; +using DispatchInfoList = ccstd::vector; struct IndirectBuffer { DrawInfoList drawInfos; @@ -1065,7 +1066,7 @@ struct Uniform { EXPOSE_COPY_FN(Uniform) }; -using UniformList = vector; +using UniformList = ccstd::vector; struct UniformBlock { uint32_t set{0}; @@ -1077,7 +1078,7 @@ struct UniformBlock { EXPOSE_COPY_FN(UniformBlock) }; -using UniformBlockList = vector; +using UniformBlockList = ccstd::vector; struct UniformSamplerTexture { uint32_t set{0}; @@ -1089,7 +1090,7 @@ struct UniformSamplerTexture { EXPOSE_COPY_FN(UniformSamplerTexture) }; -using UniformSamplerTextureList = vector; +using UniformSamplerTextureList = ccstd::vector; struct UniformSampler { uint32_t set{0}; @@ -1100,7 +1101,7 @@ struct UniformSampler { EXPOSE_COPY_FN(UniformSampler) }; -using UniformSamplerList = vector; +using UniformSamplerList = ccstd::vector; struct UniformTexture { uint32_t set{0}; @@ -1112,7 +1113,7 @@ struct UniformTexture { EXPOSE_COPY_FN(UniformTexture) }; -using UniformTextureList = vector; +using UniformTextureList = ccstd::vector; struct UniformStorageImage { uint32_t set{0}; @@ -1125,7 +1126,7 @@ struct UniformStorageImage { EXPOSE_COPY_FN(UniformStorageImage) }; -using UniformStorageImageList = vector; +using UniformStorageImageList = ccstd::vector; struct UniformStorageBuffer { uint32_t set{0}; @@ -1137,7 +1138,7 @@ struct UniformStorageBuffer { EXPOSE_COPY_FN(UniformStorageBuffer) }; -using UniformStorageBufferList = vector; +using UniformStorageBufferList = ccstd::vector; struct UniformInputAttachment { uint32_t set{0}; @@ -1148,7 +1149,7 @@ struct UniformInputAttachment { EXPOSE_COPY_FN(UniformInputAttachment) }; -using UniformInputAttachmentList = vector; +using UniformInputAttachmentList = ccstd::vector; struct ShaderStage { ShaderStageFlagBit stage{ShaderStageFlagBit::NONE}; @@ -1157,7 +1158,7 @@ struct ShaderStage { EXPOSE_COPY_FN(ShaderStage) }; -using ShaderStageList = vector; +using ShaderStageList = ccstd::vector; struct Attribute { String name; @@ -1170,7 +1171,7 @@ struct Attribute { EXPOSE_COPY_FN(Attribute) }; -using AttributeList = vector; +using AttributeList = ccstd::vector; constexpr const char *ATTR_NAME_POSITION = "a_position"; constexpr const char *ATTR_NAME_NORMAL = "a_normal"; @@ -1231,7 +1232,7 @@ struct ALIGNAS(8) ColorAttachment { EXPOSE_COPY_FN(ColorAttachment) }; -using ColorAttachmentList = vector; +using ColorAttachmentList = ccstd::vector; struct ALIGNAS(8) DepthStencilAttachment { Format format{Format::UNKNOWN}; @@ -1263,7 +1264,7 @@ struct SubpassInfo { EXPOSE_COPY_FN(SubpassInfo) }; -using SubpassInfoList = vector; +using SubpassInfoList = ccstd::vector; struct ALIGNAS(8) SubpassDependency { uint32_t srcSubpass{0}; @@ -1276,7 +1277,7 @@ struct ALIGNAS(8) SubpassDependency { EXPOSE_COPY_FN(SubpassDependency) }; -using SubpassDependencyList = vector; +using SubpassDependencyList = ccstd::vector; struct RenderPassInfo { ColorAttachmentList colorAttachments; @@ -1293,7 +1294,7 @@ struct ALIGNAS(8) GeneralBarrierInfo { EXPOSE_COPY_FN(GeneralBarrierInfo) }; -using GeneralBarrierInfoList = vector; +using GeneralBarrierInfoList = ccstd::vector; struct ALIGNAS(8) TextureBarrierInfo { AccessFlags prevAccesses{AccessFlagBit::NONE}; @@ -1306,7 +1307,7 @@ struct ALIGNAS(8) TextureBarrierInfo { EXPOSE_COPY_FN(TextureBarrierInfo) }; -using TextureBarrierInfoList = vector; +using TextureBarrierInfoList = ccstd::vector; struct FramebufferInfo { RenderPass *renderPass{nullptr}; @@ -1325,7 +1326,7 @@ struct DescriptorSetLayoutBinding { EXPOSE_COPY_FN(DescriptorSetLayoutBinding) }; -using DescriptorSetLayoutBindingList = vector; +using DescriptorSetLayoutBindingList = ccstd::vector; struct DescriptorSetLayoutInfo { DescriptorSetLayoutBindingList bindings; @@ -1419,7 +1420,7 @@ struct BlendTarget { EXPOSE_COPY_FN(BlendTarget) }; -using BlendTargetList = vector; +using BlendTargetList = ccstd::vector; // The memory layout of this structure should exactly match a plain `Uint32Array` struct BlendState { diff --git a/native/cocos/renderer/gfx-base/GFXDescriptorSet.cpp b/native/cocos/renderer/gfx-base/GFXDescriptorSet.cpp index 1a235b1266..aff50b59b1 100644 --- a/native/cocos/renderer/gfx-base/GFXDescriptorSet.cpp +++ b/native/cocos/renderer/gfx-base/GFXDescriptorSet.cpp @@ -100,7 +100,7 @@ bool DescriptorSet::bindSamplerJSB(uint32_t binding, Sampler *sampler, uint32_t } Buffer *DescriptorSet::getBuffer(uint32_t binding, uint32_t index) const { - const vector &descriptorIndices = _layout->getDescriptorIndices(); + const ccstd::vector &descriptorIndices = _layout->getDescriptorIndices(); if (binding >= descriptorIndices.size()) return nullptr; const uint32_t descriptorIndex = descriptorIndices[binding] + index; if (descriptorIndex >= _buffers.size()) return nullptr; @@ -108,7 +108,7 @@ Buffer *DescriptorSet::getBuffer(uint32_t binding, uint32_t index) const { } Texture *DescriptorSet::getTexture(uint32_t binding, uint32_t index) const { - const vector &descriptorIndices = _layout->getDescriptorIndices(); + const ccstd::vector &descriptorIndices = _layout->getDescriptorIndices(); if (binding >= descriptorIndices.size()) return nullptr; const uint32_t descriptorIndex = descriptorIndices[binding] + index; if (descriptorIndex >= _textures.size()) return nullptr; @@ -116,7 +116,7 @@ Texture *DescriptorSet::getTexture(uint32_t binding, uint32_t index) const { } Sampler *DescriptorSet::getSampler(uint32_t binding, uint32_t index) const { - const vector &descriptorIndices = _layout->getDescriptorIndices(); + const ccstd::vector &descriptorIndices = _layout->getDescriptorIndices(); if (binding >= descriptorIndices.size()) return nullptr; const uint32_t descriptorIndex = descriptorIndices[binding] + index; if (descriptorIndex >= _samplers.size()) return nullptr; diff --git a/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.cpp b/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.cpp index bc8f549c05..e1bec03941 100644 --- a/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.cpp +++ b/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.cpp @@ -45,7 +45,7 @@ void DescriptorSetLayout::initialize(const DescriptorSetLayoutInfo &info) { if (bindingCount) { uint32_t maxBinding = 0U; - vector flattenedIndices(bindingCount); + ccstd::vector flattenedIndices(bindingCount); for (uint32_t i = 0U; i < bindingCount; i++) { const DescriptorSetLayoutBinding &binding = _bindings[i]; if (binding.binding > maxBinding) maxBinding = binding.binding; diff --git a/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.h b/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.h index 232ad895d0..c44e8a72ad 100644 --- a/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.h +++ b/native/cocos/renderer/gfx-base/GFXDescriptorSetLayout.h @@ -40,9 +40,9 @@ public: void destroy(); inline const DescriptorSetLayoutBindingList &getBindings() const { return _bindings; } - inline const vector & getDynamicBindings() const { return _dynamicBindings; } - inline const vector & getBindingIndices() const { return _bindingIndices; } - inline const vector & getDescriptorIndices() const { return _descriptorIndices; } + inline const ccstd::vector & getDynamicBindings() const { return _dynamicBindings; } + inline const ccstd::vector & getBindingIndices() const { return _bindingIndices; } + inline const ccstd::vector & getDescriptorIndices() const { return _descriptorIndices; } inline uint32_t getDescriptorCount() const { return _descriptorCount; } protected: @@ -51,9 +51,9 @@ protected: DescriptorSetLayoutBindingList _bindings; uint32_t _descriptorCount = 0U; - vector _bindingIndices; - vector _descriptorIndices; - vector _dynamicBindings; + ccstd::vector _bindingIndices; + ccstd::vector _descriptorIndices; + ccstd::vector _dynamicBindings; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-base/GFXDevice.h b/native/cocos/renderer/gfx-base/GFXDevice.h index fc361c4527..9b7628eeaf 100644 --- a/native/cocos/renderer/gfx-base/GFXDevice.h +++ b/native/cocos/renderer/gfx-base/GFXDevice.h @@ -95,8 +95,8 @@ public: inline void copyTextureToBuffers(Texture *src, BufferSrcList &buffers, const BufferTextureCopyList ®ions); inline void copyBuffersToTexture(const BufferDataList &buffers, Texture *dst, const BufferTextureCopyList ®ions); - inline void flushCommands(const vector &cmdBuffs); - inline void acquire(const vector &swapchains); + inline void flushCommands(const ccstd::vector &cmdBuffs); + inline void acquire(const ccstd::vector &swapchains); inline Queue * getQueue() const { return _queue; } inline QueryPool * getQueryPool() const { return _queryPool; } @@ -181,7 +181,7 @@ protected: unordered_map> _textureBarriers; private: - vector _swapchains; // weak reference + ccstd::vector _swapchains; // weak reference }; ////////////////////////////////////////////////////////////////////////// @@ -291,11 +291,11 @@ void Device::copyTextureToBuffers(Texture *src, BufferSrcList &buffers, const Bu copyTextureToBuffers(src, buffers.data(), regions.data(), utils::toUint(regions.size())); } -void Device::flushCommands(const vector &cmdBuffs) { +void Device::flushCommands(const ccstd::vector &cmdBuffs) { flushCommands(cmdBuffs.data(), utils::toUint(cmdBuffs.size())); } -void Device::acquire(const vector &swapchains) { +void Device::acquire(const ccstd::vector &swapchains) { acquire(swapchains.data(), utils::toUint(swapchains.size())); } diff --git a/native/cocos/renderer/gfx-base/SPIRVUtils.cpp b/native/cocos/renderer/gfx-base/SPIRVUtils.cpp index 3cd0ee2543..1e37307f49 100644 --- a/native/cocos/renderer/gfx-base/SPIRVUtils.cpp +++ b/native/cocos/renderer/gfx-base/SPIRVUtils.cpp @@ -137,9 +137,9 @@ void SPIRVUtils::compileGLSL(ShaderStageFlagBit type, const String &source) { } void SPIRVUtils::compressInputLocations(gfx::AttributeList &attributes) { - static std::vector ids; - static vector activeLocations; - static vector newLocations; + static ccstd::vector ids; + static ccstd::vector activeLocations; + static ccstd::vector newLocations; uint32_t *code = _output.data(); uint32_t codeSize = utils::toUint(_output.size()); diff --git a/native/cocos/renderer/gfx-base/SPIRVUtils.h b/native/cocos/renderer/gfx-base/SPIRVUtils.h index 7d49ab55af..139913c20b 100644 --- a/native/cocos/renderer/gfx-base/SPIRVUtils.h +++ b/native/cocos/renderer/gfx-base/SPIRVUtils.h @@ -59,7 +59,7 @@ private: std::unique_ptr _shader{nullptr}; std::unique_ptr _program{nullptr}; - vector _output; + ccstd::vector _output; static SPIRVUtils instance; }; diff --git a/native/cocos/renderer/gfx-gles-common/GLESCommandPool.h b/native/cocos/renderer/gfx-gles-common/GLESCommandPool.h index c6875b1f80..9f71bfdab3 100644 --- a/native/cocos/renderer/gfx-gles-common/GLESCommandPool.h +++ b/native/cocos/renderer/gfx-gles-common/GLESCommandPool.h @@ -62,8 +62,8 @@ enum class GLESCmdType : uint8_t { }; struct GLESBindingMapping { - vector blockOffsets; - vector samplerTextureOffsets; + ccstd::vector blockOffsets; + ccstd::vector samplerTextureOffsets; uint32_t flexibleSet{0}; }; diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cpp b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cpp index a2bc6e9d25..47a187aee7 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cpp @@ -386,7 +386,7 @@ void GLES2CommandBuffer::bindStates() { cmd->gpuDescriptorSets = _curGPUDescriptorSets; if (_curGPUPipelineState) { - vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; + ccstd::vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; cmd->dynamicOffsets.resize(_curGPUPipelineState->gpuPipelineLayout->dynamicOffsetCount); for (size_t i = 0U; i < _curDynamicOffsets.size(); i++) { size_t count = dynamicOffsetOffsets[i + 1] - dynamicOffsetOffsets[i]; diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h index c148e390c8..2693b471a4 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h @@ -83,8 +83,8 @@ protected: uint32_t _curSubpassIdx = 0U; GLES2GPUPipelineState * _curGPUPipelineState = nullptr; - vector _curGPUDescriptorSets; - vector> _curDynamicOffsets; + ccstd::vector _curGPUDescriptorSets; + ccstd::vector> _curDynamicOffsets; GLES2GPUInputAssembler * _curGPUInputAssember = nullptr; DynamicStates _curDynamicStates; diff --git a/native/cocos/renderer/gfx-gles2/GLES2Commands.cpp b/native/cocos/renderer/gfx-gles2/GLES2Commands.cpp index 979b65d204..78894192bb 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Commands.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2Commands.cpp @@ -1088,8 +1088,8 @@ void cmdFuncGLES2CreateShader(GLES2Device *device, GLES2GPUShader *gpuShader) { } // texture unit index mapping optimization - vector glActiveSamplerTextures; - vector glActiveSamplerLocations; + ccstd::vector glActiveSamplerTextures; + ccstd::vector glActiveSamplerLocations; const GLESBindingMapping & bindingMappings = device->bindingMappings(); unordered_map & texUnitCacheMap = device->stateCache()->texUnitCacheMap; @@ -1120,7 +1120,7 @@ void cmdFuncGLES2CreateShader(GLES2Device *device, GLES2GPUShader *gpuShader) { } if (!glActiveSamplerTextures.empty()) { - vector usedTexUnits(device->getCapabilities().maxTextureUnits, false); + ccstd::vector usedTexUnits(device->getCapabilities().maxTextureUnits, false); // try to reuse existing mappings first for (uint32_t i = 0U; i < glActiveSamplerTextures.size(); i++) { GLES2GPUUniformSamplerTexture &glSamplerTexture = glActiveSamplerTextures[i]; @@ -1251,7 +1251,7 @@ void cmdFuncGLES2CreateInputAssembler(GLES2Device *device, GLES2GPUInputAssemble } } - vector streamOffsets(device->getCapabilities().maxVertexAttributes, 0U); + ccstd::vector streamOffsets(device->getCapabilities().maxVertexAttributes, 0U); gpuInputAssembler->glAttribs.resize(gpuInputAssembler->attributes.size()); for (size_t i = 0; i < gpuInputAssembler->glAttribs.size(); ++i) { @@ -1291,12 +1291,12 @@ void cmdFuncGLES2DestroyInputAssembler(GLES2Device *device, GLES2GPUInputAssembl } static GLES2GPUFramebuffer::GLFramebufferInfo doCreateFramebuffer(GLES2Device * device, - const vector &attachments, const uint32_t *colors, size_t colorCount, + const ccstd::vector &attachments, const uint32_t *colors, size_t colorCount, const GLES2GPUTexture *depthStencil, const uint32_t * resolves = nullptr, const GLES2GPUTexture *depthStencilResolve = nullptr, GLbitfield * resolveMask = nullptr) { - static vector drawBuffers; + static ccstd::vector drawBuffers; GLES2GPUStateCache * cache = device->stateCache(); GLES2GPUFramebuffer::GLFramebufferInfo res; @@ -1384,7 +1384,7 @@ static GLES2GPUFramebuffer::GLFramebufferInfo doCreateFramebuffer(GLES2Device * return res; } -static GLES2GPUSwapchain *getSwapchainIfExists(const vector &textures, const uint32_t *indices, size_t count) { +static GLES2GPUSwapchain *getSwapchainIfExists(const ccstd::vector &textures, const uint32_t *indices, size_t count) { GLES2GPUSwapchain *swapchain{nullptr}; if (indices) { size_t offscreenCount{0}; @@ -1401,7 +1401,7 @@ static GLES2GPUSwapchain *getSwapchainIfExists(const vector & return swapchain; } -static void doCreateFramebufferInstance(GLES2Device *device, GLES2GPUFramebuffer *gpuFBO, const vector &colors, +static void doCreateFramebufferInstance(GLES2Device *device, GLES2GPUFramebuffer *gpuFBO, const ccstd::vector &colors, uint32_t depthStencil, GLES2GPUFramebuffer::Framebuffer *outFBO, const uint32_t *resolves = nullptr, uint32_t depthStencilResolve = INVALID_BINDING) { GLES2GPUSwapchain *swapchain{getSwapchainIfExists(gpuFBO->gpuColorTextures, colors.data(), colors.size())}; @@ -1503,7 +1503,7 @@ void cmdFuncGLES2DestroyFramebuffer(GLES2Device *device, GLES2GPUFramebuffer *gp void cmdFuncGLES2BeginRenderPass(GLES2Device *device, uint32_t subpassIdx, GLES2GPURenderPass *gpuRenderPass, GLES2GPUFramebuffer *gpuFramebuffer, const Rect *renderArea, const Color *clearColors, float clearDepth, uint32_t clearStencil) { - static vector invalidAttachments; + static ccstd::vector invalidAttachments; GLES2GPUStateCache *cache = device->stateCache(); GLES2ObjectCache & gfxStateCache = cache->gfxStateCache; @@ -1694,7 +1694,7 @@ void cmdFuncGLES2BeginRenderPass(GLES2Device *device, uint32_t subpassIdx, GLES2 } void cmdFuncGLES2EndRenderPass(GLES2Device *device) { - static vector invalidAttachments; + static ccstd::vector invalidAttachments; GLES2GPUStateCache * cache = device->stateCache(); GLES2ObjectCache & gfxStateCache = cache->gfxStateCache; @@ -2045,7 +2045,7 @@ void cmdFuncGLES2BindState(GLES2Device *device, GLES2GPUPipelineState *gpuPipeli // bind descriptor sets if (gpuPipelineState && gpuPipelineState->gpuShader && gpuPipelineState->gpuPipelineLayout) { size_t blockLen{gpuPipelineState->gpuShader->glBlocks.size()}; - const vector> &dynamicOffsetIndices{gpuPipelineState->gpuPipelineLayout->dynamicOffsetIndices}; + const ccstd::vector> &dynamicOffsetIndices{gpuPipelineState->gpuPipelineLayout->dynamicOffsetIndices}; uint8_t * uniformBuffBase{nullptr}; uint8_t * uniformBuff{nullptr}; uint8_t * uniformCachedBuff{nullptr}; @@ -2064,7 +2064,7 @@ void cmdFuncGLES2BindState(GLES2Device *device, GLES2GPUPipelineState *gpuPipeli } uint32_t offset = 0U; - const vector &dynamicOffsetIndexSet = dynamicOffsetIndices[glBlock.set]; + const ccstd::vector &dynamicOffsetIndexSet = dynamicOffsetIndices[glBlock.set]; if (dynamicOffsetIndexSet.size() > glBlock.binding) { int dynamicOffsetIndex = dynamicOffsetIndexSet[glBlock.binding]; if (dynamicOffsetIndex >= 0) offset = dynamicOffsets[dynamicOffsetIndex]; diff --git a/native/cocos/renderer/gfx-gles2/GLES2Commands.h b/native/cocos/renderer/gfx-gles2/GLES2Commands.h index ba2fe2d8e9..fe3457b4be 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Commands.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Commands.h @@ -54,8 +54,8 @@ class GLES2CmdBindStates final : public GLESCmd { public: GLES2GPUPipelineState * gpuPipelineState = nullptr; GLES2GPUInputAssembler * gpuInputAssembler = nullptr; - vector gpuDescriptorSets; - vector dynamicOffsets; + ccstd::vector gpuDescriptorSets; + ccstd::vector dynamicOffsets; DynamicStates dynamicStates; GLES2CmdBindStates() : GLESCmd(GLESCmdType::BIND_STATES) {} diff --git a/native/cocos/renderer/gfx-gles2/GLES2Device.h b/native/cocos/renderer/gfx-gles2/GLES2Device.h index da6da27b4c..3edb6f04c8 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Device.h +++ b/native/cocos/renderer/gfx-gles2/GLES2Device.h @@ -127,7 +127,7 @@ protected: GLES2GPUConstantRegistry * _gpuConstantRegistry{nullptr}; GLES2GPUFramebufferCacheMap *_gpuFramebufferCacheMap{nullptr}; - vector _swapchains; + ccstd::vector _swapchains; std::array(Format::COUNT)> _textureExclusive; diff --git a/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp b/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp index 887a642779..28e1a68fa8 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp @@ -131,7 +131,7 @@ bool GLES2GPUContext::initialize(GLES2GPUStateCache *stateCache, GLES2GPUConstan EGL_NONE}; int numConfig{0}; - vector eglConfigs; + ccstd::vector eglConfigs; EGL_CHECK(success = eglChooseConfig(eglDisplay, defaultAttribs, nullptr, 0, &numConfig)); if (success) { diff --git a/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h b/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h index ad745aab57..244309d7c6 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h +++ b/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h @@ -57,7 +57,7 @@ public: EGLint eglMinorVersion{0}; EGLDisplay eglDisplay{EGL_NO_DISPLAY}; EGLConfig eglConfig{nullptr}; - vector eglAttributes; + ccstd::vector eglAttributes; EGLSurface eglDefaultSurface{EGL_NO_SURFACE}; EGLContext eglDefaultContext{EGL_NO_CONTEXT}; @@ -102,7 +102,7 @@ struct GLES2GPUBuffer { uint8_t * buffer = nullptr; DrawInfoList indirects; }; -using GLES2GPUBufferList = vector; +using GLES2GPUBufferList = ccstd::vector; struct GLES2GPUBufferView { GLES2GPUBuffer *gpuBuffer = nullptr; @@ -139,7 +139,7 @@ struct GLES2GPUTexture { GLES2GPUSwapchain *swapchain{nullptr}; }; -using GLES2GPUTextureList = vector; +using GLES2GPUTextureList = ccstd::vector; struct GLES2GPUSwapchain { EGLSurface eglSurface{EGL_NO_SURFACE}; @@ -172,7 +172,7 @@ struct GLES2GPUInput { GLenum glType = 0; GLint glLoc = -1; }; -using GLES2GPUInputList = vector; +using GLES2GPUInputList = ccstd::vector; struct GLES2GPUUniform { uint32_t binding = INVALID_BINDING; @@ -184,9 +184,9 @@ struct GLES2GPUUniform { uint32_t offset = 0; GLenum glType = 0; GLint glLoc = -1; - vector buff; + ccstd::vector buff; }; -using GLES2GPUUniformList = vector; +using GLES2GPUUniformList = ccstd::vector; struct GLES2GPUUniformBlock { uint32_t set = 0; @@ -196,9 +196,9 @@ struct GLES2GPUUniformBlock { uint32_t size = 0; GLES2GPUUniformList glUniforms; GLES2GPUUniformList glActiveUniforms; - vector activeUniformIndices; + ccstd::vector activeUniformIndices; }; -using GLES2GPUUniformBlockList = vector; +using GLES2GPUUniformBlockList = ccstd::vector; struct GLES2GPUUniformSamplerTexture { uint32_t set = 0; @@ -207,18 +207,18 @@ struct GLES2GPUUniformSamplerTexture { Type type = Type::UNKNOWN; uint32_t count = 0U; - vector units; + ccstd::vector units; GLenum glType = 0; GLint glLoc = -1; }; -using GLES2GPUUniformSamplerTextureList = vector; +using GLES2GPUUniformSamplerTextureList = ccstd::vector; struct GLES2GPUShaderStage { ShaderStageFlagBit type = ShaderStageFlagBit::NONE; String source; GLuint glShader = 0; }; -using GLES2GPUShaderStageList = vector; +using GLES2GPUShaderStageList = ccstd::vector; struct GLES2GPUShader { String name; @@ -244,7 +244,7 @@ struct GLES2GPUAttribute { bool isInstanced = false; uint32_t offset = 0; }; -using GLES2GPUAttributeList = vector; +using GLES2GPUAttributeList = ccstd::vector; struct GLES2GPUInputAssembler { AttributeList attributes; @@ -266,7 +266,7 @@ struct GLES2GPURenderPass { DepthStencilAttachment depthStencilAttachment; SubpassInfoList subpasses; - vector statistics; // per attachment + ccstd::vector statistics; // per attachment }; class GLES2GPUFramebufferCacheMap; @@ -314,9 +314,9 @@ public: }; // one per subpass, if not using FBF - vector instances; + ccstd::vector instances; - vector uberColorAttachmentIndices; + ccstd::vector uberColorAttachmentIndices; uint32_t uberDepthStencil{INVALID_BINDING}; Framebuffer uberInstance; @@ -328,21 +328,21 @@ public: struct GLES2GPUDescriptorSetLayout { DescriptorSetLayoutBindingList bindings; - vector dynamicBindings; + ccstd::vector dynamicBindings; - vector bindingIndices; - vector descriptorIndices; + ccstd::vector bindingIndices; + ccstd::vector descriptorIndices; uint32_t descriptorCount = 0U; }; -using GLES2GPUDescriptorSetLayoutList = vector; +using GLES2GPUDescriptorSetLayoutList = ccstd::vector; struct GLES2GPUPipelineLayout { GLES2GPUDescriptorSetLayoutList setLayouts; // helper storages - vector> dynamicOffsetIndices; - vector dynamicOffsetOffsets; - vector dynamicOffsets; + ccstd::vector> dynamicOffsetIndices; + ccstd::vector dynamicOffsetOffsets; + ccstd::vector dynamicOffsets; uint32_t dynamicOffsetCount = 0U; }; @@ -365,11 +365,11 @@ struct GLES2GPUDescriptor { GLES2GPUTexture * gpuTexture = nullptr; GLES2GPUSampler * gpuSampler = nullptr; }; -using GLES2GPUDescriptorList = vector; +using GLES2GPUDescriptorList = ccstd::vector; struct GLES2GPUDescriptorSet { GLES2GPUDescriptorList gpuDescriptors; - const vector *descriptorIndices = nullptr; + const ccstd::vector *descriptorIndices = nullptr; }; class GLES2GPUFence final { @@ -396,10 +396,10 @@ public: GLuint glUniformBuffer = 0; GLuint glVAO = 0; uint32_t texUint = 0; - vector glTextures; + ccstd::vector glTextures; GLuint glProgram = 0; - vector glEnabledAttribLocs; - vector glCurrentAttribLocs; + ccstd::vector glEnabledAttribLocs; + ccstd::vector glCurrentAttribLocs; GLuint glFramebuffer = 0; GLuint glRenderbuffer = 0; GLuint glReadFBO = 0; @@ -588,7 +588,7 @@ public: void update(GLES2GPUTexture *texture); private: - unordered_map> _framebuffers; + unordered_map> _framebuffers; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cpp b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cpp index 1fc0092368..3cb2307bc3 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cpp @@ -51,7 +51,7 @@ void GLES2PipelineLayout::doInit(const PipelineLayoutInfo & /*info*/) { DescriptorSetLayout * setLayout = _setLayouts[i]; GLES2GPUDescriptorSetLayout *gpuSetLayout = static_cast(setLayout)->gpuDescriptorSetLayout(); uint32_t dynamicCount = utils::toUint(gpuSetLayout->dynamicBindings.size()); - vector & indices = _gpuPipelineLayout->dynamicOffsetIndices[i]; + ccstd::vector & indices = _gpuPipelineLayout->dynamicOffsetIndices[i]; indices.assign(setLayout->getBindingIndices().size(), -1); for (uint32_t j = 0U; j < dynamicCount; j++) { diff --git a/native/cocos/renderer/gfx-gles2/GLES2PrimaryCommandBuffer.cpp b/native/cocos/renderer/gfx-gles2/GLES2PrimaryCommandBuffer.cpp index c22c52ee58..1f977c7a12 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2PrimaryCommandBuffer.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2PrimaryCommandBuffer.cpp @@ -84,8 +84,8 @@ void GLES2PrimaryCommandBuffer::nextSubpass() { void GLES2PrimaryCommandBuffer::draw(const DrawInfo &info) { CC_PROFILE(GLES2PrimaryCommandBufferDraw); if (_isStateInvalid) { - vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; - vector &dynamicOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsets; + ccstd::vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; + ccstd::vector &dynamicOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsets; for (size_t i = 0U; i < _curDynamicOffsets.size(); i++) { size_t count = dynamicOffsetOffsets[i + 1] - dynamicOffsetOffsets[i]; //CCASSERT(_curDynamicOffsets[i].size() >= count, "missing dynamic offsets?"); @@ -182,8 +182,8 @@ void GLES2PrimaryCommandBuffer::execute(CommandBuffer *const *cmdBuffs, uint32_t void GLES2PrimaryCommandBuffer::bindStates() { if (_curGPUPipelineState) { - vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; - vector &dynamicOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsets; + ccstd::vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; + ccstd::vector &dynamicOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsets; for (size_t i = 0U; i < _curDynamicOffsets.size(); i++) { size_t count = dynamicOffsetOffsets[i + 1] - dynamicOffsetOffsets[i]; //CCASSERT(_curDynamicOffsets[i].size() >= count, "missing dynamic offsets?"); diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cpp b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cpp index ac3957587b..5b58cccc94 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cpp @@ -396,7 +396,7 @@ void GLES3CommandBuffer::bindStates() { cmd->gpuDescriptorSets = _curGPUDescriptorSets; if (_curGPUPipelineState) { - vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; + ccstd::vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; cmd->dynamicOffsets.resize(_curGPUPipelineState->gpuPipelineLayout->dynamicOffsetCount); for (size_t i = 0U; i < _curDynamicOffsets.size(); i++) { size_t count = dynamicOffsetOffsets[i + 1] - dynamicOffsetOffsets[i]; diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h index 1e9eec90f5..6ef2d8921d 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h @@ -87,8 +87,8 @@ protected: uint32_t _curSubpassIdx = 0U; GLES3GPUPipelineState * _curGPUPipelineState = nullptr; GLES3GPUInputAssembler * _curGPUInputAssember = nullptr; - vector _curGPUDescriptorSets; - vector> _curDynamicOffsets; + ccstd::vector _curGPUDescriptorSets; + ccstd::vector> _curDynamicOffsets; DynamicStates _curDynamicStates; bool _isStateInvalid = false; diff --git a/native/cocos/renderer/gfx-gles3/GLES3Commands.cpp b/native/cocos/renderer/gfx-gles3/GLES3Commands.cpp index 69b5ddfdd1..373103e902 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Commands.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3Commands.cpp @@ -696,7 +696,7 @@ void cmdFuncGLES3DestroyBuffer(GLES3Device *device, GLES3GPUBuffer *gpuBuffer) { device->stateCache()->glElementArrayBuffer = 0; } } else if (hasFlag(gpuBuffer->usage, BufferUsageBit::UNIFORM)) { - vector &ubo = device->stateCache()->glBindUBOs; + ccstd::vector &ubo = device->stateCache()->glBindUBOs; for (GLuint i = 0; i < ubo.size(); i++) { if (ubo[i] == gpuBuffer->glBuffer) { GL_CHECK(glBindBufferBase(GL_UNIFORM_BUFFER, i, 0)); @@ -710,7 +710,7 @@ void cmdFuncGLES3DestroyBuffer(GLES3Device *device, GLES3GPUBuffer *gpuBuffer) { } } if (hasFlag(gpuBuffer->usage, BufferUsageBit::STORAGE)) { - vector &ssbo = device->stateCache()->glBindSSBOs; + ccstd::vector &ssbo = device->stateCache()->glBindSSBOs; for (GLuint i = 0; i < ssbo.size(); i++) { if (ssbo[i] == gpuBuffer->glBuffer) { GL_CHECK(glBindBufferBase(GL_UNIFORM_BUFFER, i, 0)); @@ -800,7 +800,7 @@ void cmdFuncGLES3ResizeBuffer(GLES3Device *device, GLES3GPUBuffer *gpuBuffer) { } void cmdFuncGLES3CreateTexture(GLES3Device *device, GLES3GPUTexture *gpuTexture) { - static vector supportedSampleCounts; + static ccstd::vector supportedSampleCounts; gpuTexture->glInternalFmt = mapGLInternalFormat(gpuTexture->format); gpuTexture->glFormat = mapGLFormat(gpuTexture->format); @@ -1216,8 +1216,8 @@ void cmdFuncGLES3CreateShader(GLES3Device *device, GLES3GPUShader *gpuShader) { } // texture unit index mapping optimization - vector glActiveSamplerTextures; - vector glActiveSamplerLocations; + ccstd::vector glActiveSamplerTextures; + ccstd::vector glActiveSamplerLocations; const GLESBindingMapping & bindingMappings = device->bindingMappings(); unordered_map & texUnitCacheMap = device->stateCache()->texUnitCacheMap; @@ -1250,7 +1250,7 @@ void cmdFuncGLES3CreateShader(GLES3Device *device, GLES3GPUShader *gpuShader) { } if (!glActiveSamplerTextures.empty()) { - vector usedTexUnits(device->getCapabilities().maxTextureUnits, false); + ccstd::vector usedTexUnits(device->getCapabilities().maxTextureUnits, false); // try to reuse existing mappings first for (uint32_t i = 0U; i < glActiveSamplerTextures.size(); i++) { GLES3GPUUniformSamplerTexture &glSamplerTexture = glActiveSamplerTextures[i]; @@ -1398,7 +1398,7 @@ void cmdFuncGLES3CreateInputAssembler(GLES3Device *device, GLES3GPUInputAssemble } } - vector streamOffsets(device->getCapabilities().maxVertexAttributes, 0U); + ccstd::vector streamOffsets(device->getCapabilities().maxVertexAttributes, 0U); gpuInputAssembler->glAttribs.resize(gpuInputAssembler->attributes.size()); for (size_t i = 0; i < gpuInputAssembler->glAttribs.size(); ++i) { @@ -1437,12 +1437,12 @@ void cmdFuncGLES3DestroyInputAssembler(GLES3Device *device, GLES3GPUInputAssembl } static GLES3GPUFramebuffer::GLFramebufferInfo doCreateFramebuffer(GLES3Device * device, - const vector &attachments, const uint32_t *colors, size_t colorCount, + const ccstd::vector &attachments, const uint32_t *colors, size_t colorCount, const GLES3GPUTextureView *depthStencilView, const uint32_t * resolves = nullptr, const GLES3GPUTextureView *depthStencilResolveView = nullptr, GLbitfield * resolveMask = nullptr) { - static vector drawBuffers; + static ccstd::vector drawBuffers; GLES3GPUStateCache * cache = device->stateCache(); GLES3GPUFramebuffer::GLFramebufferInfo res; @@ -1538,7 +1538,7 @@ static GLES3GPUFramebuffer::GLFramebufferInfo doCreateFramebuffer(GLES3Device * return res; } -static GLES3GPUSwapchain *getSwapchainIfExists(const vector &textureViews, const uint32_t *indices, size_t count) { +static GLES3GPUSwapchain *getSwapchainIfExists(const ccstd::vector &textureViews, const uint32_t *indices, size_t count) { GLES3GPUSwapchain *swapchain{nullptr}; if (indices) { size_t offscreenCount{0}; @@ -1555,7 +1555,7 @@ static GLES3GPUSwapchain *getSwapchainIfExists(const vector &colors, +static void doCreateFramebufferInstance(GLES3Device *device, GLES3GPUFramebuffer *gpuFBO, const ccstd::vector &colors, uint32_t depthStencil, GLES3GPUFramebuffer::Framebuffer *outFBO, const uint32_t *resolves = nullptr, uint32_t depthStencilResolve = INVALID_BINDING) { GLES3GPUSwapchain *swapchain{getSwapchainIfExists(gpuFBO->gpuColorViews, colors.data(), colors.size())}; @@ -1771,7 +1771,7 @@ void cmdFuncGLES3Query(GLES3Device * /*device*/, GLES3QueryPool *queryPool, GLES } case GLES3QueryType::GET_RESULTS: { auto queryCount = queryPool->getIdCount(); - std::vector results(queryCount); + ccstd::vector results(queryCount); for (auto queryId = 0U; queryId < queryCount; queryId++) { GLuint glQueryId = gpuQueryPool->mapGLQueryId(queryId); @@ -1810,7 +1810,7 @@ void cmdFuncGLES3Query(GLES3Device * /*device*/, GLES3QueryPool *queryPool, GLES void cmdFuncGLES3BeginRenderPass(GLES3Device *device, uint32_t subpassIdx, GLES3GPURenderPass *gpuRenderPass, GLES3GPUFramebuffer *gpuFramebuffer, const Rect *renderArea, const Color *clearColors, float clearDepth, uint32_t clearStencil) { - static vector invalidAttachments; + static ccstd::vector invalidAttachments; GLES3GPUStateCache *cache = device->stateCache(); GLES3ObjectCache & gfxStateCache = cache->gfxStateCache; @@ -2010,7 +2010,7 @@ static void ensureScissorRect(GLES3GPUStateCache *cache, int32_t x, int32_t y, u } void cmdFuncGLES3EndRenderPass(GLES3Device *device) { - static vector invalidAttachments; + static ccstd::vector invalidAttachments; GLES3GPUStateCache * cache = device->stateCache(); GLES3ObjectCache & gfxStateCache = cache->gfxStateCache; @@ -2368,7 +2368,7 @@ void cmdFuncGLES3BindState(GLES3Device *device, GLES3GPUPipelineState *gpuPipeli // bind descriptor sets if (gpuPipelineState && gpuPipelineState->gpuShader && gpuPipelineState->gpuPipelineLayout) { - const vector> &dynamicOffsetIndices = gpuPipelineState->gpuPipelineLayout->dynamicOffsetIndices; + const ccstd::vector> &dynamicOffsetIndices = gpuPipelineState->gpuPipelineLayout->dynamicOffsetIndices; size_t bufferLen = gpuPipelineState->gpuShader->glBuffers.size(); for (size_t j = 0; j < bufferLen; j++) { @@ -2386,7 +2386,7 @@ void cmdFuncGLES3BindState(GLES3Device *device, GLES3GPUPipelineState *gpuPipeli uint32_t offset = gpuDescriptor.gpuBuffer->glOffset; - const vector &dynamicOffsetSetIndices = dynamicOffsetIndices[glBuffer.set]; + const ccstd::vector &dynamicOffsetSetIndices = dynamicOffsetIndices[glBuffer.set]; int dynamicOffsetIndex = glBuffer.binding < dynamicOffsetSetIndices.size() ? dynamicOffsetSetIndices[glBuffer.binding] : -1; if (dynamicOffsetIndex >= 0) offset += dynamicOffsets[dynamicOffsetIndex]; diff --git a/native/cocos/renderer/gfx-gles3/GLES3Commands.h b/native/cocos/renderer/gfx-gles3/GLES3Commands.h index 846276b286..6cb8076990 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Commands.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Commands.h @@ -55,8 +55,8 @@ class GLES3CmdBindStates final : public GLESCmd { public: GLES3GPUPipelineState * gpuPipelineState = nullptr; GLES3GPUInputAssembler * gpuInputAssembler = nullptr; - vector gpuDescriptorSets; - vector dynamicOffsets; + ccstd::vector gpuDescriptorSets; + ccstd::vector dynamicOffsets; DynamicStates dynamicStates; GLES3CmdBindStates() : GLESCmd(GLESCmdType::BIND_STATES) {} diff --git a/native/cocos/renderer/gfx-gles3/GLES3Device.h b/native/cocos/renderer/gfx-gles3/GLES3Device.h index 55a18fb874..7d2e3c2fee 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Device.h +++ b/native/cocos/renderer/gfx-gles3/GLES3Device.h @@ -125,7 +125,7 @@ protected: GLES3GPUConstantRegistry * _gpuConstantRegistry{nullptr}; GLES3GPUFramebufferCacheMap *_gpuFramebufferCacheMap{nullptr}; - vector _swapchains; + ccstd::vector _swapchains; GLESBindingMapping _bindingMappings; diff --git a/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp b/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp index 4b89851f6f..bf8e68d38b 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp @@ -131,7 +131,7 @@ bool GLES3GPUContext::initialize(GLES3GPUStateCache *stateCache, GLES3GPUConstan EGL_NONE}; int numConfig{0}; - vector eglConfigs; + ccstd::vector eglConfigs; EGL_CHECK(success = eglChooseConfig(eglDisplay, defaultAttribs, nullptr, 0, &numConfig)); if (success) { diff --git a/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h b/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h index fb18426945..1a3ebcc02f 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h +++ b/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h @@ -55,7 +55,7 @@ public: EGLint eglMinorVersion{0}; EGLDisplay eglDisplay{EGL_NO_DISPLAY}; EGLConfig eglConfig{nullptr}; - vector eglAttributes; + ccstd::vector eglAttributes; EGLSurface eglDefaultSurface{EGL_NO_SURFACE}; EGLContext eglDefaultContext{EGL_NO_CONTEXT}; @@ -94,7 +94,7 @@ public: QueryType type{QueryType::OCCLUSION}; uint32_t maxQueryObjects{0}; bool forceWait{true}; - std::vector glQueryIds; + ccstd::vector glQueryIds; inline GLuint mapGLQueryId(uint32_t queryId) { if (queryId < maxQueryObjects) { @@ -117,7 +117,7 @@ struct GLES3GPUBuffer { uint8_t * buffer = nullptr; DrawInfoList indirects; }; -using GLES3GPUBufferList = vector; +using GLES3GPUBufferList = ccstd::vector; struct GLES3GPUTexture { TextureType type{TextureType::TEX2D}; @@ -156,7 +156,7 @@ struct GLES3GPUTextureView { uint32_t levelCount = 1U; }; -using GLES3GPUTextureViewList = vector; +using GLES3GPUTextureViewList = ccstd::vector; struct GLES3GPUSwapchain { EGLSurface eglSurface{EGL_NO_SURFACE}; @@ -180,7 +180,7 @@ public: GLenum glWrapR = 0; ~GLES3GPUSampler() { - vector glSampelrs; + ccstd::vector glSampelrs; for (const auto &pair : _cache) { glSampelrs.push_back(pair.second); } @@ -203,7 +203,7 @@ struct GLES3GPUInput { GLenum glType = 0; GLint glLoc = -1; }; -using GLES3GPUInputList = vector; +using GLES3GPUInputList = ccstd::vector; struct GLES3GPUUniform { uint32_t binding = INVALID_BINDING; @@ -216,7 +216,7 @@ struct GLES3GPUUniform { GLenum glType = 0; GLint glLoc = -1; }; -using GLES3GPUUniformList = vector; +using GLES3GPUUniformList = ccstd::vector; struct GLES3GPUUniformBuffer { uint32_t set = INVALID_BINDING; @@ -226,7 +226,7 @@ struct GLES3GPUUniformBuffer { uint32_t glBinding = 0xffffffff; bool isStorage = false; }; -using GLES3GPUUniformBufferList = vector; +using GLES3GPUUniformBufferList = ccstd::vector; struct GLES3GPUUniformSamplerTexture { uint32_t set = 0; @@ -235,11 +235,11 @@ struct GLES3GPUUniformSamplerTexture { Type type = Type::UNKNOWN; uint32_t count = 0U; - vector units; + ccstd::vector units; GLenum glType = 0; GLint glLoc = -1; }; -using GLES3GPUUniformSamplerTextureList = vector; +using GLES3GPUUniformSamplerTextureList = ccstd::vector; struct GLES3GPUUniformStorageImage { uint32_t set = 0; @@ -248,11 +248,11 @@ struct GLES3GPUUniformStorageImage { Type type = Type::UNKNOWN; uint32_t count = 0U; - vector units; + ccstd::vector units; GLenum glMemoryAccess = GL_READ_WRITE; GLint glLoc = -1; }; -using GLES3GPUUniformStorageImageList = vector; +using GLES3GPUUniformStorageImageList = ccstd::vector; struct GLES3GPUShaderStage { GLES3GPUShaderStage(ShaderStageFlagBit t, String s, GLuint shader = 0) @@ -263,7 +263,7 @@ struct GLES3GPUShaderStage { String source; GLuint glShader = 0; }; -using GLES3GPUShaderStageList = vector; +using GLES3GPUShaderStageList = ccstd::vector; struct GLES3GPUShader { String name; @@ -295,7 +295,7 @@ struct GLES3GPUAttribute { bool isInstanced = false; uint32_t offset = 0; }; -using GLES3GPUAttributeList = vector; +using GLES3GPUAttributeList = ccstd::vector; struct GLES3GPUInputAssembler { AttributeList attributes; @@ -325,9 +325,9 @@ struct GLES3GPURenderPass { DepthStencilAttachment depthStencilAttachment; SubpassInfoList subpasses; - vector statistics; // per attachment + ccstd::vector statistics; // per attachment - vector barriers; // per subpass + ccstd::vector barriers; // per subpass }; class GLES3GPUFramebufferCacheMap; @@ -373,9 +373,9 @@ public: }; // one per subpass, if not using FBF - vector instances; + ccstd::vector instances; - vector uberColorAttachmentIndices; + ccstd::vector uberColorAttachmentIndices; uint32_t uberDepthStencil{INVALID_BINDING}; Framebuffer uberInstance; @@ -387,21 +387,21 @@ public: struct GLES3GPUDescriptorSetLayout { DescriptorSetLayoutBindingList bindings; - vector dynamicBindings; + ccstd::vector dynamicBindings; - vector bindingIndices; - vector descriptorIndices; + ccstd::vector bindingIndices; + ccstd::vector descriptorIndices; uint32_t descriptorCount = 0U; }; -using GLES3GPUDescriptorSetLayoutList = vector; +using GLES3GPUDescriptorSetLayoutList = ccstd::vector; struct GLES3GPUPipelineLayout { GLES3GPUDescriptorSetLayoutList setLayouts; // helper storages - vector> dynamicOffsetIndices; - vector dynamicOffsetOffsets; - vector dynamicOffsets; + ccstd::vector> dynamicOffsetIndices; + ccstd::vector dynamicOffsetOffsets; + ccstd::vector dynamicOffsets; uint32_t dynamicOffsetCount; }; @@ -423,11 +423,11 @@ struct GLES3GPUDescriptor { GLES3GPUTextureView *gpuTextureView = nullptr; GLES3GPUSampler * gpuSampler = nullptr; }; -using GLES3GPUDescriptorList = vector; +using GLES3GPUDescriptorList = ccstd::vector; struct GLES3GPUDescriptorSet { GLES3GPUDescriptorList gpuDescriptors; - const vector *descriptorIndices = nullptr; + const ccstd::vector *descriptorIndices = nullptr; }; struct GLES3GPUDispatchInfo { @@ -457,20 +457,20 @@ public: GLuint glArrayBuffer = 0; GLuint glElementArrayBuffer = 0; GLuint glUniformBuffer = 0; - vector glBindUBOs; - vector glBindUBOOffsets; + ccstd::vector glBindUBOs; + ccstd::vector glBindUBOOffsets; GLuint glShaderStorageBuffer = 0; - vector glBindSSBOs; - vector glBindSSBOOffsets; + ccstd::vector glBindSSBOs; + ccstd::vector glBindSSBOOffsets; GLuint glDispatchIndirectBuffer = 0; GLuint glVAO = 0; uint32_t texUint = 0; - vector glTextures; - vector glImages; - vector glSamplers; + ccstd::vector glTextures; + ccstd::vector glImages; + ccstd::vector glSamplers; GLuint glProgram = 0; - vector glEnabledAttribLocs; - vector glCurrentAttribLocs; + ccstd::vector glEnabledAttribLocs; + ccstd::vector glCurrentAttribLocs; GLuint glReadFramebuffer = 0; GLuint glDrawFramebuffer = 0; GLuint glRenderbuffer = 0; @@ -643,7 +643,7 @@ private: GLuint glFramebuffer{0}; bool isExternal{false}; }; - using CacheMap = unordered_map>; + using CacheMap = unordered_map>; CacheMap _renderbufferMap; // renderbuffer -> mip level -> framebuffer CacheMap _textureMap; // texture -> mip level -> framebuffer }; @@ -666,7 +666,7 @@ public: void update(GLES3GPUTexture *texture); private: - unordered_map> _framebuffers; + unordered_map> _framebuffers; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cpp b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cpp index 0f731b6bc1..c23999b3da 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cpp @@ -50,7 +50,7 @@ void GLES3PipelineLayout::doInit(const PipelineLayoutInfo & /*info*/) { DescriptorSetLayout * setLayout = _setLayouts[i]; GLES3GPUDescriptorSetLayout *gpuSetLayout = static_cast(setLayout)->gpuDescriptorSetLayout(); uint32_t dynamicCount = utils::toUint(gpuSetLayout->dynamicBindings.size()); - vector & indices = _gpuPipelineLayout->dynamicOffsetIndices[i]; + ccstd::vector & indices = _gpuPipelineLayout->dynamicOffsetIndices[i]; indices.assign(setLayout->getBindingIndices().size(), -1); for (uint32_t j = 0U; j < dynamicCount; j++) { diff --git a/native/cocos/renderer/gfx-gles3/GLES3PrimaryCommandBuffer.cpp b/native/cocos/renderer/gfx-gles3/GLES3PrimaryCommandBuffer.cpp index af5600e876..c2a5a151f0 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3PrimaryCommandBuffer.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3PrimaryCommandBuffer.cpp @@ -198,8 +198,8 @@ void GLES3PrimaryCommandBuffer::execute(CommandBuffer *const *cmdBuffs, uint32_t void GLES3PrimaryCommandBuffer::bindStates() { if (_curGPUPipelineState) { - vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; - vector &dynamicOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsets; + ccstd::vector &dynamicOffsetOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsetOffsets; + ccstd::vector &dynamicOffsets = _curGPUPipelineState->gpuPipelineLayout->dynamicOffsets; for (size_t i = 0U, len = dynamicOffsetOffsets.size() - 1; i < len; i++) { size_t count = dynamicOffsetOffsets[i + 1] - dynamicOffsetOffsets[i]; //CCASSERT(_curDynamicOffsets[i].size() >= count, "missing dynamic offsets?"); diff --git a/native/cocos/renderer/gfx-gles3/GLES3QueryPool.h b/native/cocos/renderer/gfx-gles3/GLES3QueryPool.h index 69b22d4a52..e8d145011e 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3QueryPool.h +++ b/native/cocos/renderer/gfx-gles3/GLES3QueryPool.h @@ -25,7 +25,6 @@ #pragma once -#include #include "GLES3Std.h" #include "gfx-base/GFXQueryPool.h" @@ -54,7 +53,7 @@ protected: void doDestroy() override; GLES3GPUQueryPool * _gpuQueryPool = nullptr; - std::vector _ids; + ccstd::vector _ids; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-metal/MTLBuffer.h b/native/cocos/renderer/gfx-metal/MTLBuffer.h index 92073f4af8..e61ce53b61 100644 --- a/native/cocos/renderer/gfx-metal/MTLBuffer.h +++ b/native/cocos/renderer/gfx-metal/MTLBuffer.h @@ -72,8 +72,8 @@ protected: uint _bufferViewOffset = 0; bool _isDrawIndirectByIndex = false; - vector _indexedPrimitivesIndirectArguments; - vector _primitiveIndirectArguments; + ccstd::vector _indexedPrimitivesIndirectArguments; + ccstd::vector _primitiveIndirectArguments; DrawInfoList _drawInfos; CCMTLGPUBuffer *_gpuBuffer = nullptr; diff --git a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h index a1fcdc8fed..91d18e8de5 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h +++ b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.h @@ -98,8 +98,8 @@ protected: id getMTLCommandBuffer(); - vector _GPUDescriptorSets; // NOLINT(bugprone-reserved-identifier) - vector> _dynamicOffsets; + ccstd::vector _GPUDescriptorSets; // NOLINT(bugprone-reserved-identifier) + ccstd::vector> _dynamicOffsets; uint _firstDirtyDescriptorSet = UINT_MAX; bool _indirectDrawSuppotred = false; diff --git a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm index 117ec0667c..965f465845 100644 --- a/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm +++ b/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm @@ -200,7 +200,7 @@ void CCMTLCommandBuffer::beginRenderPass(RenderPass *renderPass, Framebuffer *fb } } else { // TODO: cache state. - vector visited(colorAttachments.size(), false); + ccstd::vector visited(colorAttachments.size(), false); for (size_t i = 0; i < subpasses.size(); ++i) { for (size_t j = 0; j < subpasses[i].inputs.size(); ++j) { uint32_t input = subpasses[i].inputs[j]; @@ -667,8 +667,8 @@ void CCMTLCommandBuffer::copyBuffersToTexture(const uint8_t *const *buffers, Tex } uint totalSize = 0; - vector bufferSize(count); - vector stagingRegions(count); + ccstd::vector bufferSize(count); + ccstd::vector stagingRegions(count); auto format = texture->getFormat(); auto * mtlTexture = static_cast(texture); auto convertedFormat = mtlTexture->getConvertedFormat(); @@ -933,7 +933,7 @@ void CCMTLCommandBuffer::copyTextureToBuffers(Texture *src, uint8_t *const *buff } else { id mtlCommandBuffer = getMTLCommandBuffer(); - std::vector> stagingAddrs(count); + ccstd::vector> stagingAddrs(count); for (size_t i = 0; i < count; ++i) { uint32_t width = regions[i].texExtent.width; uint32_t height = regions[i].texExtent.height; diff --git a/native/cocos/renderer/gfx-metal/MTLDevice.h b/native/cocos/renderer/gfx-metal/MTLDevice.h index 51f38535d6..41c2761704 100644 --- a/native/cocos/renderer/gfx-metal/MTLDevice.h +++ b/native/cocos/renderer/gfx-metal/MTLDevice.h @@ -132,7 +132,7 @@ protected: CCMTLSemaphore * _inFlightSemaphore = nullptr; CC_UNUSED uint32_t _memoryAlarmListenerId = 0; - std::vector _swapchains; + ccstd::vector _swapchains; CCMTLGPUDeviceObject *_gpuDeviceObj = nullptr; }; diff --git a/native/cocos/renderer/gfx-metal/MTLDevice.mm b/native/cocos/renderer/gfx-metal/MTLDevice.mm index b861101c7c..bb816c91b8 100644 --- a/native/cocos/renderer/gfx-metal/MTLDevice.mm +++ b/native/cocos/renderer/gfx-metal/MTLDevice.mm @@ -211,7 +211,7 @@ void CCMTLDevice::present() { _currentBufferPoolId = _currentFrameIndex; _currentFrameIndex = (_currentFrameIndex + 1) % MAX_FRAMES_IN_FLIGHT; - std::vector> releaseQ; + ccstd::vector> releaseQ; for (auto *swapchain : _swapchains) { auto drawable = swapchain->currentDrawable(); if (drawable) { diff --git a/native/cocos/renderer/gfx-metal/MTLGPUObjects.h b/native/cocos/renderer/gfx-metal/MTLGPUObjects.h index 1853c88b54..73035f3d70 100644 --- a/native/cocos/renderer/gfx-metal/MTLGPUObjects.h +++ b/native/cocos/renderer/gfx-metal/MTLGPUObjects.h @@ -57,16 +57,16 @@ constexpr size_t MAX_COLORATTACHMENTS = 16u; struct CCMTLGPUDescriptorSetLayout { DescriptorSetLayoutBindingList bindings; - vector dynamicBindings; - vector descriptorIndices; - vector bindingIndices; + ccstd::vector dynamicBindings; + ccstd::vector descriptorIndices; + ccstd::vector bindingIndices; uint descriptorCount = 0; }; -typedef vector MTLGPUDescriptorSetLayoutList; +typedef ccstd::vector MTLGPUDescriptorSetLayoutList; struct CCMTLGPUPipelineLayout { MTLGPUDescriptorSetLayoutList setLayouts; - vector> dynamicOffsetIndices; + ccstd::vector> dynamicOffsetIndices; }; struct CCMTLGPUUniformBlock { @@ -100,8 +100,8 @@ struct CCMTLGPUShader { unordered_map blocks; unordered_map samplers; - vector inputs; - vector outputs; + ccstd::vector inputs; + ccstd::vector outputs; NSString *shaderSrc = nil; bool specializeColor = true; @@ -121,7 +121,7 @@ struct CCMTLGPUPipelineState { id mtlComputePipelineState = nil; uint stencilRefFront = 0; uint stencilRefBack = 0; - vector> vertexBufferBindingInfo; + ccstd::vector> vertexBufferBindingInfo; const CCMTLGPUPipelineLayout * gpuPipelineLayout = nullptr; const CCMTLGPUShader * gpuShader = nullptr; }; @@ -148,7 +148,7 @@ struct CCMTLGPUTextureViewObject { struct CCMTLGPUInputAssembler { id mtlIndexBuffer = nil; id mtlIndirectBuffer = nil; - vector> mtlVertexBufers; + ccstd::vector> mtlVertexBufers; }; struct CCMTLGPUDescriptor { @@ -157,11 +157,11 @@ struct CCMTLGPUDescriptor { CCMTLTexture * texture = nullptr; CCMTLSampler * sampler = nullptr; }; -typedef vector MTLGPUDescriptorList; +typedef ccstd::vector MTLGPUDescriptorList; struct CCMTLGPUDescriptorSet { MTLGPUDescriptorList gpuDescriptors; - const vector * descriptorIndices = nullptr; + const ccstd::vector * descriptorIndices = nullptr; }; class CCMTLGPUStagingBufferPool final { @@ -262,7 +262,7 @@ public: protected: struct Buffer { id mtlBuffer = nil; - vector> dynamicDataBuffers{MAX_FRAMES_IN_FLIGHT}; + ccstd::vector> dynamicDataBuffers{MAX_FRAMES_IN_FLIGHT}; uint8_t * mappedData = nullptr; uint curOffset = 0; }; @@ -270,7 +270,7 @@ protected: bool _tripleEnabled = false; uint _inflightIndex = 0; id _device = nil; - vector _pool; + ccstd::vector _pool; }; struct CCMTLGPUBufferImageCopy { diff --git a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm index c8e0e32d77..4a73c30208 100644 --- a/native/cocos/renderer/gfx-metal/MTLPipelineState.mm +++ b/native/cocos/renderer/gfx-metal/MTLPipelineState.mm @@ -212,10 +212,10 @@ bool CCMTLPipelineState::createMTLRenderPipelineState() { //TODO: reconstruction void CCMTLPipelineState::setVertexDescriptor(MTLRenderPipelineDescriptor *descriptor) { auto activeAttributes = static_cast(_shader)->getAttributes(); - vector> layouts; + ccstd::vector> layouts; unordered_map> map; - vector streamOffsets(CCMTLDevice::getInstance()->getCapabilities().maxVertexAttributes, 0u); - vector activeAttribIdx(activeAttributes.size(), false); + ccstd::vector streamOffsets(CCMTLDevice::getInstance()->getCapabilities().maxVertexAttributes, 0u); + ccstd::vector activeAttribIdx(activeAttributes.size(), false); for (const auto &inputAttrib : _inputState.attributes) { auto bufferIndex = static_cast(_shader)->getAvailableBufferBindingIndex(ShaderStageFlagBit::VERTEX, inputAttrib.stream); @@ -266,8 +266,8 @@ void CCMTLPipelineState::setMTLFunctionsAndFormats(MTLRenderPipelineDescriptor * const ColorAttachmentList &colorAttachments = _renderPass->getColorAttachments(); const auto & ccShader = static_cast(_shader); - std::vector bindingIndices; - std::vector bindingOffsets; + ccstd::vector bindingIndices; + ccstd::vector bindingOffsets; const CCMTLGPUShader *gpuShader = ccShader->gpuShader(); uint32_t outputNum = static_cast(gpuShader->outputs.size()); diff --git a/native/cocos/renderer/gfx-metal/MTLQueryPool.h b/native/cocos/renderer/gfx-metal/MTLQueryPool.h index c938eeb84b..28e2c20b70 100644 --- a/native/cocos/renderer/gfx-metal/MTLQueryPool.h +++ b/native/cocos/renderer/gfx-metal/MTLQueryPool.h @@ -47,7 +47,7 @@ protected: void doDestroy() override; CCMTLGPUQueryPool * _gpuQueryPool{nullptr}; - std::vector _ids; + ccstd::vector _ids; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-metal/MTLRenderPass.h b/native/cocos/renderer/gfx-metal/MTLRenderPass.h index 24ee83bbcf..25d2f8f1cc 100644 --- a/native/cocos/renderer/gfx-metal/MTLRenderPass.h +++ b/native/cocos/renderer/gfx-metal/MTLRenderPass.h @@ -47,7 +47,7 @@ public: inline MTLRenderPassDescriptor *getMTLRenderPassDescriptor() const { return _mtlRenderPassDescriptor; } inline uint getColorRenderTargetNums() const { return _colorRenderTargetNums; } - inline const vector & getRenderTargetSizes() const { return _renderTargetSizes; } + inline const ccstd::vector & getRenderTargetSizes() const { return _renderTargetSizes; } inline void nextSubpass() { _currentSubpassIndex++; } inline uint getCurrentSubpassIndex() { return _currentSubpassIndex; } inline void reset() { _currentSubpassIndex = 0; } @@ -60,7 +60,7 @@ protected: uint _currentSubpassIndex = 0; MTLRenderPassDescriptor *_mtlRenderPassDescriptor = nil; uint _colorRenderTargetNums = 0; - vector _renderTargetSizes; + ccstd::vector _renderTargetSizes; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-metal/MTLShader.h b/native/cocos/renderer/gfx-metal/MTLShader.h index 45d1c2cd02..121a4b8119 100644 --- a/native/cocos/renderer/gfx-metal/MTLShader.h +++ b/native/cocos/renderer/gfx-metal/MTLShader.h @@ -80,8 +80,8 @@ protected: NSMutableDictionary> *_specializedFragFuncs = nil; unordered_map _mtlFragmentSamplerBindings; - vector _availableVertexBufferBindingIndex; - vector _availableFragmentBufferBindingIndex; + ccstd::vector _availableVertexBufferBindingIndex; + ccstd::vector _availableFragmentBufferBindingIndex; CCMTLGPUShader *_gpuShader = nullptr; diff --git a/native/cocos/renderer/gfx-validator/BufferValidator.h b/native/cocos/renderer/gfx-validator/BufferValidator.h index 04f6b718af..8109b54fce 100644 --- a/native/cocos/renderer/gfx-validator/BufferValidator.h +++ b/native/cocos/renderer/gfx-validator/BufferValidator.h @@ -48,7 +48,7 @@ protected: void doResize(uint32_t size, uint32_t count) override; void doDestroy() override; - vector _buffer; + ccstd::vector _buffer; uint64_t _lastUpdateFrame{0U}; uint64_t _totalUpdateTimes{0U}; diff --git a/native/cocos/renderer/gfx-validator/CommandBufferValidator.cpp b/native/cocos/renderer/gfx-validator/CommandBufferValidator.cpp index 29b76b32a3..308892ecc7 100644 --- a/native/cocos/renderer/gfx-validator/CommandBufferValidator.cpp +++ b/native/cocos/renderer/gfx-validator/CommandBufferValidator.cpp @@ -158,7 +158,7 @@ void CommandBufferValidator::beginRenderPass(RenderPass *renderPass, Framebuffer /////////// execute /////////// - static vector secondaryCBActors; + static ccstd::vector secondaryCBActors; secondaryCBActors.resize(secondaryCBCount); CommandBuffer **actorSecondaryCBs = nullptr; @@ -213,7 +213,7 @@ void CommandBufferValidator::execute(CommandBuffer *const *cmdBuffs, uint32_t co /////////// execute /////////// - static vector cmdBuffActors; + static ccstd::vector cmdBuffActors; cmdBuffActors.resize(count); for (uint32_t i = 0U; i < count; ++i) { @@ -460,7 +460,7 @@ void CommandBufferValidator::pipelineBarrier(const GeneralBarrier *barrier, cons /////////// execute /////////// - static vector textureActors; + static ccstd::vector textureActors; textureActors.resize(textureBarrierCount); Texture **actorTextures = nullptr; diff --git a/native/cocos/renderer/gfx-validator/DescriptorSetLayoutValidator.h b/native/cocos/renderer/gfx-validator/DescriptorSetLayoutValidator.h index 8437a46b3c..3507cfea11 100644 --- a/native/cocos/renderer/gfx-validator/DescriptorSetLayoutValidator.h +++ b/native/cocos/renderer/gfx-validator/DescriptorSetLayoutValidator.h @@ -44,7 +44,7 @@ protected: void doInit(const DescriptorSetLayoutInfo &info) override; void doDestroy() override; - vector _typeCounts; + ccstd::vector _typeCounts; bool _inited{false}; }; diff --git a/native/cocos/renderer/gfx-validator/DescriptorSetValidator.cpp b/native/cocos/renderer/gfx-validator/DescriptorSetValidator.cpp index 33ee6fe4f8..5adbc3645b 100644 --- a/native/cocos/renderer/gfx-validator/DescriptorSetValidator.cpp +++ b/native/cocos/renderer/gfx-validator/DescriptorSetValidator.cpp @@ -112,7 +112,7 @@ void DescriptorSetValidator::bindBuffer(uint32_t binding, Buffer *buffer, uint32 CCASSERT(isInited(), "alread destroyed?"); CCASSERT(buffer && static_cast(buffer)->isInited(), "already destroyed?"); - const vector & bindingIndices = _layout->getBindingIndices(); + const ccstd::vector & bindingIndices = _layout->getBindingIndices(); const DescriptorSetLayoutBindingList &bindings = _layout->getBindings(); CCASSERT(binding < bindingIndices.size() && bindingIndices[binding] < bindings.size(), "Illegal binding"); @@ -140,7 +140,7 @@ void DescriptorSetValidator::bindTexture(uint32_t binding, Texture *texture, uin CCASSERT(isInited(), "alread destroyed?"); CCASSERT(texture && static_cast(texture)->isInited(), "already destroyed?"); - const vector & bindingIndices = _layout->getBindingIndices(); + const ccstd::vector & bindingIndices = _layout->getBindingIndices(); const DescriptorSetLayoutBindingList &bindings = _layout->getBindings(); CCASSERT(binding < bindingIndices.size() && bindingIndices[binding] < bindings.size(), "Illegal binding"); @@ -165,7 +165,7 @@ void DescriptorSetValidator::bindTexture(uint32_t binding, Texture *texture, uin void DescriptorSetValidator::bindSampler(uint32_t binding, Sampler *sampler, uint32_t index) { CCASSERT(isInited(), "alread destroyed?"); - const vector & bindingIndices = _layout->getBindingIndices(); + const ccstd::vector & bindingIndices = _layout->getBindingIndices(); const DescriptorSetLayoutBindingList &bindings = _layout->getBindings(); CCASSERT(binding < bindingIndices.size() && bindingIndices[binding] < bindings.size(), "Illegal binding"); diff --git a/native/cocos/renderer/gfx-validator/DeviceValidator.cpp b/native/cocos/renderer/gfx-validator/DeviceValidator.cpp index 1512246c1c..afea73f1a8 100644 --- a/native/cocos/renderer/gfx-validator/DeviceValidator.cpp +++ b/native/cocos/renderer/gfx-validator/DeviceValidator.cpp @@ -141,7 +141,7 @@ void DeviceValidator::doDestroy() { } void DeviceValidator::acquire(Swapchain *const *swapchains, uint32_t count) { - static vector swapchainActors; + static ccstd::vector swapchainActors; swapchainActors.resize(count); for (uint32_t i = 0U; i < count; ++i) { @@ -315,7 +315,7 @@ void DeviceValidator::flushCommands(CommandBuffer *const *cmdBuffs, uint32_t cou /////////// execute /////////// - static vector cmdBuffActors; + static ccstd::vector cmdBuffActors; cmdBuffActors.resize(count); for (uint32_t i = 0U; i < count; ++i) { diff --git a/native/cocos/renderer/gfx-validator/QueueValidator.cpp b/native/cocos/renderer/gfx-validator/QueueValidator.cpp index daf6c0ff79..415c483ec0 100644 --- a/native/cocos/renderer/gfx-validator/QueueValidator.cpp +++ b/native/cocos/renderer/gfx-validator/QueueValidator.cpp @@ -73,7 +73,7 @@ void QueueValidator::submit(CommandBuffer *const *cmdBuffs, uint32_t count) { /////////// execute /////////// - static vector cmdBuffActors; + static ccstd::vector cmdBuffActors; cmdBuffActors.resize(count); for (uint32_t i = 0U; i < count; ++i) { diff --git a/native/cocos/renderer/gfx-validator/ValidationUtils.cpp b/native/cocos/renderer/gfx-validator/ValidationUtils.cpp index a3ac131d7a..b42cf825e8 100644 --- a/native/cocos/renderer/gfx-validator/ValidationUtils.cpp +++ b/native/cocos/renderer/gfx-validator/ValidationUtils.cpp @@ -93,13 +93,13 @@ void CommandRecorder::clear() { _drawcallCommands.clear(); } -vector CommandRecorder::serialize(const CommandRecorder &recorder) { - vector bytes; +ccstd::vector CommandRecorder::serialize(const CommandRecorder &recorder) { + ccstd::vector bytes; bytes.push_back(static_cast(recorder._commands.size())); return bytes; } -CommandRecorder CommandRecorder::deserialize(const vector &bytes) { +CommandRecorder CommandRecorder::deserialize(const ccstd::vector &bytes) { CommandRecorder recorder; recorder._commands.resize(bytes[0]); return recorder; diff --git a/native/cocos/renderer/gfx-validator/ValidationUtils.h b/native/cocos/renderer/gfx-validator/ValidationUtils.h index e7b6392ffa..234ab3c019 100644 --- a/native/cocos/renderer/gfx-validator/ValidationUtils.h +++ b/native/cocos/renderer/gfx-validator/ValidationUtils.h @@ -44,7 +44,7 @@ struct RenderPassSnapshot { RenderPass * renderPass = nullptr; Framebuffer * framebuffer = nullptr; Rect renderArea; - vector clearColors; + ccstd::vector clearColors; float clearDepth = 1.F; uint32_t clearStencil = 0U; }; @@ -52,8 +52,8 @@ struct RenderPassSnapshot { struct DrawcallSnapshot { PipelineState * pipelineState; InputAssembler * inputAssembler; - vector descriptorSets; - vector> dynamicOffsets; + ccstd::vector descriptorSets; + ccstd::vector> dynamicOffsets; }; struct CommandBufferStorage : public DynamicStates, RenderPassSnapshot, DrawcallSnapshot {}; @@ -65,8 +65,8 @@ public: void recordEndRenderPass(); void clear(); - static vector serialize(const CommandRecorder &recorder); - static CommandRecorder deserialize(const vector &bytes); + static ccstd::vector serialize(const CommandRecorder &recorder); + static CommandRecorder deserialize(const ccstd::vector &bytes); static bool compare(const CommandRecorder &test, const CommandRecorder &baseline); private: @@ -81,7 +81,7 @@ private: DepthStencilAttachment depthStencilAttachment; Rect renderArea; - vector clearColors; + ccstd::vector clearColors; float clearDepth = 1.F; uint32_t clearStencil = 0U; }; @@ -97,17 +97,17 @@ private: DrawInfo drawInfo; - vector descriptorSets; - vector dynamicOffsets; + ccstd::vector descriptorSets; + ccstd::vector dynamicOffsets; }; - vector _commands; - vector _renderPassCommands; - vector _drawcallCommands; + ccstd::vector _commands; + ccstd::vector _renderPassCommands; + ccstd::vector _drawcallCommands; struct BufferData { BufferInfo info; - vector data; + ccstd::vector data; }; unordered_map _bufferMap; }; @@ -135,11 +135,11 @@ private: String initStack; }; - static vector resources; + static ccstd::vector resources; }; template -vector::ResourceRecord> DeviceResourceTracker::resources; +ccstd::vector::ResourceRecord> DeviceResourceTracker::resources; template template diff --git a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cpp b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cpp index 36530b0bfd..feb47921d2 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.cpp @@ -141,7 +141,7 @@ void CCVKCommandBuffer::beginRenderPass(RenderPass *renderPass, Framebuffer *fbo framebuffer = _curGPUFBO->swapchain->vkSwapchainFramebufferListMap[_curGPUFBO][_curGPUFBO->swapchain->curImageIndex]; } - vector &clearValues = _curGPURenderPass->clearValues; + ccstd::vector &clearValues = _curGPURenderPass->clearValues; bool depthEnabled = _curGPURenderPass->depthStencilAttachment.format != Format::UNKNOWN; size_t attachmentCount = depthEnabled ? clearValues.size() - 1 : clearValues.size(); @@ -562,7 +562,7 @@ void CCVKCommandBuffer::bindDescriptorSets(VkPipelineBindPoint bindPoint) { CCVKDevice * device = CCVKDevice::getInstance(); CCVKGPUDevice * gpuDevice = device->gpuDevice(); CCVKGPUPipelineLayout *pipelineLayout = _curGPUPipelineState->gpuPipelineLayout; - vector & dynamicOffsetOffsets = pipelineLayout->dynamicOffsetOffsets; + ccstd::vector & dynamicOffsetOffsets = pipelineLayout->dynamicOffsetOffsets; uint32_t descriptorSetCount = utils::toUint(pipelineLayout->setLayouts.size()); _curDynamicOffsets.resize(pipelineLayout->dynamicOffsetCount); diff --git a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h index 048d9b1b4e..897f498350 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h +++ b/native/cocos/renderer/gfx-vulkan/VKCommandBuffer.h @@ -77,10 +77,10 @@ protected: CCVKGPUCommandBuffer *_gpuCommandBuffer = nullptr; CCVKGPUPipelineState * _curGPUPipelineState = nullptr; - vector _curGPUDescriptorSets; - vector _curVkDescriptorSets; - vector _curDynamicOffsets; - vector> _curDynamicOffsetsArray; + ccstd::vector _curGPUDescriptorSets; + ccstd::vector _curVkDescriptorSets; + ccstd::vector _curDynamicOffsets; + ccstd::vector> _curDynamicOffsetsArray; uint32_t _firstDirtyDescriptorSet = UINT_MAX; CCVKGPUInputAssembler *_curGPUInputAssember = nullptr; @@ -92,9 +92,9 @@ protected: DynamicStates _curDynamicStates; // temp storage - vector _blitRegions; - vector _imageMemoryBarriers; - vector _vkCommandBuffers; + ccstd::vector _blitRegions; + ccstd::vector _imageMemoryBarriers; + ccstd::vector _vkCommandBuffers; queue _pendingQueue; }; diff --git a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp index 3c0039983b..9245356661 100644 --- a/native/cocos/renderer/gfx-vulkan/VKCommands.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKCommands.cpp @@ -56,7 +56,7 @@ CCVKGPUDescriptorSetPool *CCVKGPUDevice::getDescriptorSetPool(uint32_t layoutID) return _descriptorSetPools[layoutID].get(); } -void insertVkDynamicStates(vector *out, const vector &dynamicStates) { +void insertVkDynamicStates(ccstd::vector *out, const ccstd::vector &dynamicStates) { for (DynamicStateFlagBit dynamicState : dynamicStates) { switch (dynamicState) { case DynamicStateFlagBit::LINE_WIDTH: out->push_back(VK_DYNAMIC_STATE_LINE_WIDTH); break; @@ -314,7 +314,7 @@ struct AttachmentStatistics final { CC_ENUM_BITWISE_OPERATORS(AttachmentStatistics::SubpassUsage) struct SubpassDependencyManager final { - vector subpassDependencies; + ccstd::vector subpassDependencies; void clear() { subpassDependencies.clear(); @@ -345,13 +345,13 @@ private: }; void cmdFuncCCVKCreateRenderPass(CCVKDevice *device, CCVKGPURenderPass *gpuRenderPass) { - static vector depthStencilResolves; - static vector attachmentDescriptions; - static vector attachmentReferences; - static vector subpassDescriptions; - static vector beginAccessInfos; - static vector endAccessInfos; - static vector attachmentStatistics; + static ccstd::vector depthStencilResolves; + static ccstd::vector attachmentDescriptions; + static ccstd::vector attachmentReferences; + static ccstd::vector subpassDescriptions; + static ccstd::vector beginAccessInfos; + static ccstd::vector endAccessInfos; + static ccstd::vector attachmentStatistics; static SubpassDependencyManager dependencyManager; const size_t colorAttachmentCount = gpuRenderPass->colorAttachments.size(); @@ -735,7 +735,7 @@ void cmdFuncCCVKCreateRenderPass(CCVKDevice *device, CCVKGPURenderPass *gpuRende void cmdFuncCCVKCreateFramebuffer(CCVKDevice *device, CCVKGPUFramebuffer *gpuFramebuffer) { size_t colorViewCount = gpuFramebuffer->gpuColorViews.size(); bool hasDepth = gpuFramebuffer->gpuRenderPass->depthStencilAttachment.format != Format::UNKNOWN; - vector attachments(colorViewCount + hasDepth); + ccstd::vector attachments(colorViewCount + hasDepth); VkFramebufferCreateInfo createInfo{VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO}; createInfo.width = createInfo.height = UINT_MAX; @@ -845,9 +845,9 @@ void cmdFuncCCVKCreateDescriptorSetLayout(CCVKDevice *device, CCVKGPUDescriptorS gpuDescriptorSetLayout->defaultDescriptorSet = pool->request(0); if (gpuDevice->useDescriptorUpdateTemplate && bindingCount) { - const vector &bindings = gpuDescriptorSetLayout->vkBindings; + const ccstd::vector &bindings = gpuDescriptorSetLayout->vkBindings; - vector entries(bindingCount); + ccstd::vector entries(bindingCount); for (size_t j = 0U, k = 0U; j < bindingCount; ++j) { const VkDescriptorSetLayoutBinding &binding = bindings[j]; if (binding.descriptorType != VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT) { @@ -878,7 +878,7 @@ void cmdFuncCCVKCreatePipelineLayout(CCVKDevice *device, CCVKGPUPipelineLayout * CCVKGPUDevice *gpuDevice = device->gpuDevice(); size_t layoutCount = gpuPipelineLayout->setLayouts.size(); - vector descriptorSetLayouts(layoutCount); + ccstd::vector descriptorSetLayouts(layoutCount); for (uint32_t i = 0; i < layoutCount; ++i) { descriptorSetLayouts[i] = gpuPipelineLayout->setLayouts[i]->vkDescriptorSetLayout; } @@ -910,12 +910,12 @@ void cmdFuncCCVKCreateComputePipelineState(CCVKDevice *device, CCVKGPUPipelineSt } void cmdFuncCCVKCreateGraphicsPipelineState(CCVKDevice *device, CCVKGPUPipelineState *gpuPipelineState) { - static vector stageInfos; - static vector bindingDescriptions; - static vector attributeDescriptions; - static vector offsets; - static vector dynamicStates; - static vector blendTargets; + static ccstd::vector stageInfos; + static ccstd::vector bindingDescriptions; + static ccstd::vector attributeDescriptions; + static ccstd::vector offsets; + static ccstd::vector dynamicStates; + static ccstd::vector blendTargets; VkGraphicsPipelineCreateInfo createInfo{VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO}; @@ -1213,7 +1213,7 @@ void cmdFuncCCVKUpdateBuffer(CCVKDevice *device, CCVKGPUBuffer *gpuBuffer, const void cmdFuncCCVKCopyBuffersToTexture(CCVKDevice *device, const uint8_t *const *buffers, CCVKGPUTexture *gpuTexture, const BufferTextureCopy *regions, uint32_t count, const CCVKGPUCommandBuffer *gpuCommandBuffer) { - vector &curTypes = gpuTexture->currentAccessTypes; + ccstd::vector &curTypes = gpuTexture->currentAccessTypes; ThsvsImageBarrier barrier{}; barrier.image = gpuTexture->vkImage; @@ -1335,7 +1335,7 @@ void cmdFuncCCVKCopyBuffersToTexture(CCVKDevice *device, const uint8_t *const *b void cmdFuncCCVKCopyTextureToBuffers(CCVKDevice *device, CCVKGPUTexture *srcTexture, CCVKGPUBuffer *destBuffer, const BufferTextureCopy *regions, uint32_t count, const CCVKGPUCommandBuffer *gpuCommandBuffer) { - vector &curTypes = srcTexture->currentAccessTypes; + ccstd::vector &curTypes = srcTexture->currentAccessTypes; ThsvsImageBarrier barrier{}; barrier.image = srcTexture->vkImage; @@ -1354,7 +1354,7 @@ void cmdFuncCCVKCopyTextureToBuffers(CCVKDevice *device, CCVKGPUTexture *srcText cmdFuncCCVKImageMemoryBarrier(gpuCommandBuffer, barrier); } - vector stagingRegions(count); + ccstd::vector stagingRegions(count); VkDeviceSize offset = 0; for (size_t i = 0U; i < count; ++i) { const BufferTextureCopy ®ion = regions[i]; @@ -1578,9 +1578,9 @@ VkSampleCountFlagBits CCVKGPUContext::getSampleCountForAttachments(Format format void CCVKGPUBarrierManager::update(CCVKGPUTransportHub *transportHub) { if (_buffersToBeChecked.empty() && _texturesToBeChecked.empty()) return; - static vector prevAccesses; - static vector nextAccesses; - static vector vkImageBarriers; + static ccstd::vector prevAccesses; + static ccstd::vector nextAccesses; + static ccstd::vector vkImageBarriers; VkPipelineStageFlags srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; vkImageBarriers.clear(); @@ -1588,7 +1588,7 @@ void CCVKGPUBarrierManager::update(CCVKGPUTransportHub *transportHub) { nextAccesses.clear(); for (CCVKGPUBuffer *gpuBuffer : _buffersToBeChecked) { - vector &render = gpuBuffer->renderAccessTypes; + ccstd::vector &render = gpuBuffer->renderAccessTypes; if (gpuBuffer->transferAccess == THSVS_ACCESS_NONE) continue; if (std::find(prevAccesses.begin(), prevAccesses.end(), gpuBuffer->transferAccess) == prevAccesses.end()) { prevAccesses.push_back(gpuBuffer->transferAccess); @@ -1624,9 +1624,9 @@ void CCVKGPUBarrierManager::update(CCVKGPUTransportHub *transportHub) { imageBarrier.prevAccessCount = 1; for (CCVKGPUTexture *gpuTexture : _texturesToBeChecked) { - vector &render = gpuTexture->renderAccessTypes; + ccstd::vector &render = gpuTexture->renderAccessTypes; if (gpuTexture->transferAccess == THSVS_ACCESS_NONE || render.empty()) continue; - vector ¤t = gpuTexture->currentAccessTypes; + ccstd::vector ¤t = gpuTexture->currentAccessTypes; imageBarrier.pPrevAccesses = &gpuTexture->transferAccess; imageBarrier.nextAccessCount = utils::toUint(render.size()); imageBarrier.pNextAccesses = render.data(); diff --git a/native/cocos/renderer/gfx-vulkan/VKDescriptorSet.cpp b/native/cocos/renderer/gfx-vulkan/VKDescriptorSet.cpp index c4ecb14b0e..61f9eaac36 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDescriptorSet.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKDescriptorSet.cpp @@ -116,7 +116,7 @@ void CCVKDescriptorSet::doInit(const DescriptorSetInfo & /*info*/) { } if (!gpuDevice->useDescriptorUpdateTemplate) { - vector &entries = instance.descriptorUpdateEntries; + ccstd::vector &entries = instance.descriptorUpdateEntries; entries.resize(descriptorCount, {VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET}); for (uint32_t i = 0U, j = 0U; i < bindingCount; i++) { diff --git a/native/cocos/renderer/gfx-vulkan/VKDevice.cpp b/native/cocos/renderer/gfx-vulkan/VKDevice.cpp index 456561a744..88d78eb68f 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDevice.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKDevice.cpp @@ -108,8 +108,8 @@ bool CCVKDevice::doInit(const DeviceInfo & /*info*/) { _gpuDevice->minorVersion = _gpuContext->minorVersion; // only enable the absolute essentials - vector requestedLayers{}; - vector requestedExtensions{ + ccstd::vector requestedLayers{}; + ccstd::vector requestedExtensions{ VK_KHR_SWAPCHAIN_EXTENSION_NAME, }; if (_gpuDevice->minorVersion < 2) { @@ -161,8 +161,8 @@ bool CCVKDevice::doInit(const DeviceInfo & /*info*/) { // prepare the device queues uint32_t queueFamilyPropertiesCount = utils::toUint(_gpuContext->queueFamilyProperties.size()); - vector queueCreateInfos(queueFamilyPropertiesCount, {VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO}); - vector> queuePriorities(queueFamilyPropertiesCount); + ccstd::vector queueCreateInfos(queueFamilyPropertiesCount, {VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO}); + ccstd::vector> queuePriorities(queueFamilyPropertiesCount); for (uint32_t queueFamilyIndex = 0U; queueFamilyIndex < queueFamilyPropertiesCount; ++queueFamilyIndex) { const VkQueueFamilyProperties &queueFamilyProperty = _gpuContext->queueFamilyProperties[queueFamilyIndex]; @@ -543,11 +543,11 @@ void CCVKDevice::doDestroy() { } namespace { -vector vkSwapchains; -vector vkSwapchainIndices; -vector gpuSwapchains; -vector vkAcquireBarriers; -vector vkPresentBarriers; + ccstd::vector vkSwapchains; + ccstd::vector vkSwapchainIndices; + ccstd::vector gpuSwapchains; + ccstd::vector vkAcquireBarriers; + ccstd::vector vkPresentBarriers; VkImageMemoryBarrier acquireBarrier{ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, @@ -671,7 +671,7 @@ CCVKGPURecycleBin * CCVKDevice::gpuRecycleBin() { return _gpuRecycleBins[_ CCVKGPUStagingBufferPool *CCVKDevice::gpuStagingBufferPool() { return _gpuStagingBufferPools[_gpuDevice->curBackBufferIndex]; } void CCVKDevice::waitAllFences() { - static vector fences; + static ccstd::vector fences; fences.clear(); for (auto *fencePool : _gpuFencePools) { @@ -816,7 +816,7 @@ void CCVKDevice::copyTextureToBuffers(Texture *srcTexture, uint8_t *const *buffe CC_PROFILE(CCVKDeviceCopyTextureToBuffers); uint32_t totalSize = 0U; Format format = srcTexture->getFormat(); - vector> regionOffsetSizes(count); + ccstd::vector> regionOffsetSizes(count); for (size_t i = 0U; i < count; ++i) { const BufferTextureCopy ®ion = regions[i]; uint32_t w = region.buffStride > 0 ? region.buffStride : region.texExtent.width; @@ -858,7 +858,7 @@ void CCVKDevice::getQueryPoolResults(QueryPool *queryPool) { uint32_t width = bWait ? 1U : 2U; uint64_t stride = sizeof(uint64_t) * width; VkQueryResultFlagBits flag = bWait ? VK_QUERY_RESULT_WAIT_BIT : VK_QUERY_RESULT_WITH_AVAILABILITY_BIT; - std::vector results(queryCount * width, 0ULL); + ccstd::vector results(queryCount * width, 0ULL); if (queryCount > 0U) { VkResult result = vkGetQueryPoolResults( @@ -900,14 +900,14 @@ static VkResult VKAPI_PTR vkCreateRenderPass2KHRFallback( const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks * pAllocator, VkRenderPass * pRenderPass) { - static vector attachmentDescriptions; - static vector subpassDescriptions; - static vector attachmentReferences; - static vector subpassDependencies; - static vector inputs; - static vector colors; - static vector resolves; - static vector depths; + static ccstd::vector attachmentDescriptions; + static ccstd::vector subpassDescriptions; + static ccstd::vector attachmentReferences; + static ccstd::vector subpassDependencies; + static ccstd::vector inputs; + static ccstd::vector colors; + static ccstd::vector resolves; + static ccstd::vector depths; attachmentDescriptions.resize(pCreateInfo->attachmentCount); for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) { diff --git a/native/cocos/renderer/gfx-vulkan/VKDevice.h b/native/cocos/renderer/gfx-vulkan/VKDevice.h index 56c3dc3a54..834ec3c26f 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDevice.h +++ b/native/cocos/renderer/gfx-vulkan/VKDevice.h @@ -137,11 +137,11 @@ protected: CCVKGPUDevice * _gpuDevice = nullptr; CCVKGPUContext * _gpuContext = nullptr; - vector _depthStencilTextures; + ccstd::vector _depthStencilTextures; - vector _gpuFencePools; - vector _gpuRecycleBins; - vector _gpuStagingBufferPools; + ccstd::vector _gpuFencePools; + ccstd::vector _gpuRecycleBins; + ccstd::vector _gpuStagingBufferPools; CCVKGPUBufferHub * _gpuBufferHub{nullptr}; CCVKGPUTransportHub * _gpuTransportHub{nullptr}; @@ -151,8 +151,8 @@ protected: CCVKGPUFramebufferHub * _gpuFramebufferHub{nullptr}; CCVKGPUDescriptorSetHub *_gpuDescriptorSetHub{nullptr}; - vector _layers; - vector _extensions; + ccstd::vector _layers; + ccstd::vector _extensions; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-vulkan/VKGPUContext.cpp b/native/cocos/renderer/gfx-vulkan/VKGPUContext.cpp index 9b1c3a82a0..e1e6cb67ed 100644 --- a/native/cocos/renderer/gfx-vulkan/VKGPUContext.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKGPUContext.cpp @@ -95,10 +95,10 @@ VKAPI_ATTR VkBool32 VKAPI_CALL debugReportCallback(VkDebugReportFlagsEXT flags, bool CCVKGPUContext::initialize() { // only enable the absolute essentials - vector requestedLayers{ + ccstd::vector requestedLayers{ //"VK_LAYER_KHRONOS_synchronization2", }; - vector requestedExtensions{ + ccstd::vector requestedExtensions{ VK_KHR_SURFACE_EXTENSION_NAME, }; @@ -123,12 +123,12 @@ bool CCVKGPUContext::initialize() { uint32_t availableLayerCount; VK_CHECK(vkEnumerateInstanceLayerProperties(&availableLayerCount, nullptr)); - vector supportedLayers(availableLayerCount); + ccstd::vector supportedLayers(availableLayerCount); VK_CHECK(vkEnumerateInstanceLayerProperties(&availableLayerCount, supportedLayers.data())); uint32_t availableExtensionCount; VK_CHECK(vkEnumerateInstanceExtensionProperties(nullptr, &availableExtensionCount, nullptr)); - vector supportedExtensions(availableExtensionCount); + ccstd::vector supportedExtensions(availableExtensionCount); VK_CHECK(vkEnumerateInstanceExtensionProperties(nullptr, &availableExtensionCount, supportedExtensions.data())); #if defined(VK_USE_PLATFORM_ANDROID_KHR) @@ -267,10 +267,10 @@ bool CCVKGPUContext::initialize() { return false; } - vector physicalDeviceHandles(physicalDeviceCount); + ccstd::vector physicalDeviceHandles(physicalDeviceCount); VK_CHECK(vkEnumeratePhysicalDevices(vkInstance, &physicalDeviceCount, physicalDeviceHandles.data())); - vector physicalDevicePropertiesList(physicalDeviceCount); + ccstd::vector physicalDevicePropertiesList(physicalDeviceCount); uint32_t deviceIndex; for (deviceIndex = 0U; deviceIndex < physicalDeviceCount; ++deviceIndex) { diff --git a/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h b/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h index dacd540787..f57acde788 100644 --- a/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h +++ b/native/cocos/renderer/gfx-vulkan/VKGPUObjects.h @@ -52,15 +52,15 @@ public: VkPhysicalDeviceProperties physicalDeviceProperties{}; VkPhysicalDeviceProperties2 physicalDeviceProperties2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2}; VkPhysicalDeviceMemoryProperties physicalDeviceMemoryProperties{}; - vector queueFamilyProperties; + ccstd::vector queueFamilyProperties; uint32_t majorVersion = 0; uint32_t minorVersion = 0; bool validationEnabled = false; - vector layers; - vector extensions; + ccstd::vector layers; + ccstd::vector extensions; inline bool checkExtension(const String &extension) const { return std::any_of(extensions.begin(), extensions.end(), [&extension](auto &ext) { @@ -83,8 +83,8 @@ struct CCVKGPUGeneralBarrier { VkPipelineStageFlags dstStageMask = 0U; VkMemoryBarrier vkBarrier{}; - vector prevAccesses; - vector nextAccesses; + ccstd::vector prevAccesses; + ccstd::vector nextAccesses; ThsvsGlobalBarrier barrier{}; }; @@ -99,8 +99,8 @@ public: VkRenderPass vkRenderPass; // helper storage - vector clearValues; - vector sampleCounts; // per subpass + ccstd::vector clearValues; + ccstd::vector sampleCounts; // per subpass const CCVKGPUGeneralBarrier *getBarrier(size_t index, CCVKGPUDevice *gpuDevice) const; }; @@ -126,13 +126,13 @@ struct CCVKGPUTexture { VmaAllocation vmaAllocation = VK_NULL_HANDLE; CCVKGPUSwapchain * swapchain = nullptr; - vector swapchainVkImages; - vector swapchainVmaAllocations; + ccstd::vector swapchainVkImages; + ccstd::vector swapchainVmaAllocations; - vector currentAccessTypes; + ccstd::vector currentAccessTypes; // for barrier manager - vector renderAccessTypes; // gathered from descriptor sets + ccstd::vector renderAccessTypes; // gathered from descriptor sets ThsvsAccessType transferAccess = THSVS_ACCESS_NONE; }; @@ -145,7 +145,7 @@ struct CCVKGPUTextureView { uint32_t baseLayer = 0U; uint32_t layerCount = 1U; - vector swapchainVkImageViews; + ccstd::vector swapchainVkImageViews; // descriptor infos VkImageView vkImageView = VK_NULL_HANDLE; @@ -173,8 +173,8 @@ struct CCVKGPUBuffer { void * buffer = nullptr; bool isDrawIndirectByIndex = false; - vector indirectCmds; - vector indexedIndirectCmds; + ccstd::vector indirectCmds; + ccstd::vector indexedIndirectCmds; uint8_t * mappedData = nullptr; VmaAllocation vmaAllocation = VK_NULL_HANDLE; @@ -187,7 +187,7 @@ struct CCVKGPUBuffer { VkDeviceSize instanceSize = 0U; // per-back-buffer instance // for barrier manager - vector renderAccessTypes; // gathered from descriptor sets + ccstd::vector renderAccessTypes; // gathered from descriptor sets ThsvsAccessType transferAccess = THSVS_ACCESS_NONE; VkDeviceSize getStartOffset(uint32_t curBackBufferIndex) const { @@ -207,7 +207,7 @@ struct CCVKGPUBufferView { struct CCVKGPUFramebuffer { CCVKGPURenderPass * gpuRenderPass = nullptr; - vector gpuColorViews; + ccstd::vector gpuColorViews; CCVKGPUTextureView * gpuDepthStencilView = nullptr; VkFramebuffer vkFramebuffer = VK_NULL_HANDLE; CCVKGPUSwapchain * swapchain = nullptr; @@ -216,7 +216,7 @@ struct CCVKGPUFramebuffer { uint32_t height = 0U; }; -using FramebufferList = vector; +using FramebufferList = ccstd::vector; using FramebufferListMap = unordered_map; using FramebufferListMapIter = FramebufferListMap::iterator; @@ -227,11 +227,11 @@ struct CCVKGPUSwapchain { uint32_t curImageIndex = 0U; VkSwapchainKHR vkSwapchain = VK_NULL_HANDLE; FramebufferListMap vkSwapchainFramebufferListMap; - vector queueFamilyPresentables; + ccstd::vector queueFamilyPresentables; VkResult lastPresentResult = VK_NOT_READY; // external references - vector swapchainImages; + ccstd::vector swapchainImages; }; struct CCVKGPUCommandBuffer { @@ -246,10 +246,10 @@ struct CCVKGPUQueue { QueueType type = QueueType::GRAPHICS; VkQueue vkQueue = VK_NULL_HANDLE; uint32_t queueFamilyIndex = 0U; - vector possibleQueueFamilyIndices; - vector lastSignaledSemaphores; - vector submitStageMasks; - vector commandBuffers; + ccstd::vector possibleQueueFamilyIndices; + ccstd::vector lastSignaledSemaphores; + ccstd::vector submitStageMasks; + ccstd::vector commandBuffers; }; struct CCVKGPUQueryPool { @@ -272,16 +272,16 @@ struct CCVKGPUShaderStage { struct CCVKGPUShader { String name; AttributeList attributes; - vector gpuStages; + ccstd::vector gpuStages; }; struct CCVKGPUInputAssembler { AttributeList attributes; - vector gpuVertexBuffers; + ccstd::vector gpuVertexBuffers; CCVKGPUBufferView * gpuIndexBuffer = nullptr; CCVKGPUBufferView * gpuIndirectBuffer = nullptr; - vector vertexBuffers; - vector vertexBufferOffsets; + ccstd::vector vertexBuffers; + ccstd::vector vertexBufferOffsets; }; union CCVKDescriptorInfo { @@ -291,7 +291,7 @@ union CCVKDescriptorInfo { }; struct CCVKGPUDescriptor { DescriptorType type = DescriptorType::UNKNOWN; - vector accessTypes; + ccstd::vector accessTypes; CCVKGPUBufferView * gpuBufferView = nullptr; CCVKGPUTextureView * gpuTextureView = nullptr; CCVKGPUSampler * gpuSampler = nullptr; @@ -299,28 +299,28 @@ struct CCVKGPUDescriptor { struct CCVKGPUDescriptorSetLayout; struct CCVKGPUDescriptorSet { - vector gpuDescriptors; + ccstd::vector gpuDescriptors; // references CCVKGPUDescriptorSetLayout *gpuLayout = nullptr; struct Instance { VkDescriptorSet vkDescriptorSet = VK_NULL_HANDLE; - vector descriptorInfos; - vector descriptorUpdateEntries; + ccstd::vector descriptorInfos; + ccstd::vector descriptorUpdateEntries; }; - vector instances; // per swapchain image + ccstd::vector instances; // per swapchain image uint32_t layoutID = 0U; }; struct CCVKGPUPipelineLayout { - vector setLayouts; + ccstd::vector setLayouts; VkPipelineLayout vkPipelineLayout = VK_NULL_HANDLE; // helper storage - vector dynamicOffsetOffsets; + ccstd::vector dynamicOffsetOffsets; uint32_t dynamicOffsetCount; }; @@ -344,8 +344,8 @@ struct CCVKGPUTextureBarrier { VkPipelineStageFlags dstStageMask = 0U; VkImageMemoryBarrier vkBarrier{}; - vector prevAccesses; - vector nextAccesses; + ccstd::vector prevAccesses; + ccstd::vector nextAccesses; ThsvsImageBarrier barrier{}; }; @@ -355,8 +355,8 @@ class CCVKGPUDescriptorSetPool; class CCVKGPUDevice final { public: VkDevice vkDevice{VK_NULL_HANDLE}; - vector layers; - vector extensions; + ccstd::vector layers; + ccstd::vector extensions; VmaAllocator memoryAllocator{VK_NULL_HANDLE}; VkPipelineCache vkPipelineCache{VK_NULL_HANDLE}; uint32_t minorVersion{0U}; @@ -445,7 +445,7 @@ public: private: CCVKGPUDevice * _device = nullptr; uint32_t _count = 0U; - vector _fences; + ccstd::vector _fences; }; /** @@ -490,7 +490,7 @@ public: private: CCVKGPUDevice * _device; uint32_t _count = 0U; - vector _semaphores; + ccstd::vector _semaphores; }; /** @@ -499,7 +499,7 @@ private: class CCVKGPUDescriptorSetPool final { public: ~CCVKGPUDescriptorSetPool() { - for (vector &market : _fleaMarkets) { + for (ccstd::vector &market : _fleaMarkets) { for (VkDescriptorSet set : market) { for (DescriptorSetPool &pool : _pools) { if (pool.activeSets.count(set)) { @@ -520,7 +520,7 @@ public: _pools.clear(); } - void link(CCVKGPUDevice *device, uint32_t maxSetsPerPool, const vector &bindings, VkDescriptorSetLayout setLayout) { + void link(CCVKGPUDevice *device, uint32_t maxSetsPerPool, const ccstd::vector &bindings, VkDescriptorSetLayout setLayout) { _device = device; _maxSetsPerPool = maxSetsPerPool; _setLayouts.insert(_setLayouts.cbegin(), _maxSetsPerPool, setLayout); @@ -604,28 +604,28 @@ private: struct DescriptorSetPool { VkDescriptorPool vkPool = VK_NULL_HANDLE; unordered_set activeSets; - vector freeSets; + ccstd::vector freeSets; }; - vector _pools; + ccstd::vector _pools; - vector> _fleaMarkets; // per back buffer + ccstd::vector> _fleaMarkets; // per back buffer - vector _poolSizes; - vector _setLayouts; + ccstd::vector _poolSizes; + ccstd::vector _setLayouts; uint32_t _maxSetsPerPool = 0U; }; struct CCVKGPUDescriptorSetLayout { DescriptorSetLayoutBindingList bindings; - vector dynamicBindings; + ccstd::vector dynamicBindings; - vector vkBindings; + ccstd::vector vkBindings; VkDescriptorSetLayout vkDescriptorSetLayout = VK_NULL_HANDLE; VkDescriptorUpdateTemplate vkDescriptorUpdateTemplate = VK_NULL_HANDLE; VkDescriptorSet defaultDescriptorSet = VK_NULL_HANDLE; - vector bindingIndices; - vector descriptorIndices; + ccstd::vector bindingIndices; + ccstd::vector descriptorIndices; uint32_t descriptorCount = 0U; uint32_t id = 0U; @@ -804,7 +804,7 @@ private: }; CCVKGPUDevice *_device = nullptr; - vector _pool; + ccstd::vector _pool; }; /** @@ -860,7 +860,7 @@ private: _updateFn(_device->vkDevice, instance.vkDescriptorSet, gpuDescriptorSet->gpuLayout->vkDescriptorUpdateTemplate, instance.descriptorInfos.data()); } else { - const vector &entries = instance.descriptorUpdateEntries; + const ccstd::vector &entries = instance.descriptorUpdateEntries; vkUpdateDescriptorSets(_device->vkDevice, utils::toUint(entries.size()), entries.data(), 0, nullptr); } } @@ -868,7 +868,7 @@ private: using DescriptorSetList = unordered_set; CCVKGPUDevice * _device = nullptr; - vector _setsToBeUpdated; + ccstd::vector _setsToBeUpdated; PFN_vkUpdateDescriptorSetWithTemplate _updateFn = nullptr; }; @@ -1189,7 +1189,7 @@ private: }; }; CCVKGPUDevice * _device = nullptr; - vector _resources; + ccstd::vector _resources; size_t _count = 0U; }; @@ -1283,7 +1283,7 @@ public: } void checkIn(CCVKGPUTexture *gpuTexture, const ThsvsAccessType *newTypes = nullptr, uint32_t newTypeCount = 0) { - vector &target = gpuTexture->renderAccessTypes; + ccstd::vector &target = gpuTexture->renderAccessTypes; for (uint32_t i = 0U; i < newTypeCount; ++i) { if (std::find(target.begin(), target.end(), newTypes[i]) == target.end()) { target.push_back(newTypes[i]); @@ -1344,7 +1344,7 @@ private: bool canMemcpy = false; }; - vector> _buffersToBeUpdated; + ccstd::vector> _buffersToBeUpdated; CCVKGPUDevice *_device = nullptr; }; @@ -1367,7 +1367,7 @@ public: void update(CCVKGPUTexture *texture); private: - unordered_map> _framebuffers; + unordered_map> _framebuffers; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-vulkan/VKQueryPool.h b/native/cocos/renderer/gfx-vulkan/VKQueryPool.h index 48c55e6e35..4972a73899 100644 --- a/native/cocos/renderer/gfx-vulkan/VKQueryPool.h +++ b/native/cocos/renderer/gfx-vulkan/VKQueryPool.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "VKStd.h" #include "gfx-base/GFXQueryPool.h" @@ -50,7 +49,7 @@ protected: void doDestroy() override; CCVKGPUQueryPool * _gpuQueryPool{nullptr}; - std::vector _ids; + ccstd::vector _ids; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-vulkan/VKSwapchain.cpp b/native/cocos/renderer/gfx-vulkan/VKSwapchain.cpp index d6a10abd3b..d1d3e178a8 100644 --- a/native/cocos/renderer/gfx-vulkan/VKSwapchain.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKSwapchain.cpp @@ -81,12 +81,12 @@ void CCVKSwapchain::doInit(const SwapchainInfo &info) { uint32_t surfaceFormatCount = 0U; VK_CHECK(vkGetPhysicalDeviceSurfaceFormatsKHR(gpuContext->physicalDevice, _gpuSwapchain->vkSurface, &surfaceFormatCount, nullptr)); - vector surfaceFormats(surfaceFormatCount); + ccstd::vector surfaceFormats(surfaceFormatCount); VK_CHECK(vkGetPhysicalDeviceSurfaceFormatsKHR(gpuContext->physicalDevice, _gpuSwapchain->vkSurface, &surfaceFormatCount, surfaceFormats.data())); uint32_t presentModeCount = 0U; VK_CHECK(vkGetPhysicalDeviceSurfacePresentModesKHR(gpuContext->physicalDevice, _gpuSwapchain->vkSurface, &presentModeCount, nullptr)); - vector presentModes(presentModeCount); + ccstd::vector presentModes(presentModeCount); VK_CHECK(vkGetPhysicalDeviceSurfacePresentModesKHR(gpuContext->physicalDevice, _gpuSwapchain->vkSurface, &presentModeCount, presentModes.data())); VkFormat colorFormat = VK_FORMAT_B8G8R8A8_UNORM; @@ -125,7 +125,7 @@ void CCVKSwapchain::doInit(const SwapchainInfo &info) { // Select a present mode for the swapchain - vector presentModePriorityList; + ccstd::vector presentModePriorityList; switch (_vsyncMode) { case VsyncMode::OFF: presentModePriorityList.insert(presentModePriorityList.end(), {VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_FIFO_KHR}); break; @@ -156,7 +156,7 @@ void CCVKSwapchain::doInit(const SwapchainInfo &info) { // Find a supported composite alpha format (not all devices support alpha opaque) VkCompositeAlphaFlagBitsKHR compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; // Simply select the first composite alpha format available - vector compositeAlphaFlags = { + ccstd::vector compositeAlphaFlags = { VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR, VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR, @@ -307,7 +307,7 @@ bool CCVKSwapchain::checkSwapchainStatus(uint32_t width, uint32_t height) { _depthStencilTexture->resize(newWidth, newHeight); bool hasStencil = GFX_FORMAT_INFOS[toNumber(_depthStencilTexture->getFormat())].hasStencil; - vector barriers(imageCount * 2, VkImageMemoryBarrier{}); + ccstd::vector barriers(imageCount * 2, VkImageMemoryBarrier{}); VkPipelineStageFlags srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; ThsvsImageBarrier tempBarrier{}; diff --git a/native/cocos/renderer/gfx-vulkan/VKUtils.cpp b/native/cocos/renderer/gfx-vulkan/VKUtils.cpp index c79fc0e230..698e02d1a4 100644 --- a/native/cocos/renderer/gfx-vulkan/VKUtils.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKUtils.cpp @@ -567,7 +567,7 @@ const ThsvsAccessType *getAccessType(AccessFlagBit flag) { return &THSVS_ACCESS_TYPES[utils::getBitPosition(toNumber(flag))]; } -void getAccessTypes(AccessFlags flag, vector &v) { +void getAccessTypes(AccessFlags flag, ccstd::vector &v) { for (uint32_t mask = toNumber(flag); mask; mask = utils::clearLowestBit(mask)) { v.push_back(THSVS_ACCESS_TYPES[utils::getBitPosition(utils::getLowestBit(mask))]); } @@ -577,7 +577,7 @@ VkDeviceSize roundUp(VkDeviceSize numToRound, uint32_t multiple) { return ((numToRound + multiple - 1) / multiple) * multiple; } -bool isLayerSupported(const char *required, const vector &available) { +bool isLayerSupported(const char *required, const ccstd::vector &available) { for (const VkLayerProperties &availableLayer : available) { if (strcmp(availableLayer.layerName, required) == 0) { return true; @@ -586,7 +586,7 @@ bool isLayerSupported(const char *required, const vector &ava return false; } -bool isExtensionSupported(const char *required, const vector &available) { +bool isExtensionSupported(const char *required, const ccstd::vector &available) { for (const VkExtensionProperties &availableExtension : available) { if (strcmp(availableExtension.extensionName, required) == 0) { return true; diff --git a/native/cocos/renderer/gfx-vulkan/VKUtils.h b/native/cocos/renderer/gfx-vulkan/VKUtils.h index 6604304574..4e030c14d4 100644 --- a/native/cocos/renderer/gfx-vulkan/VKUtils.h +++ b/native/cocos/renderer/gfx-vulkan/VKUtils.h @@ -73,10 +73,10 @@ String mapVendorName(uint32_t vendorID); void fullPipelineBarrier(VkCommandBuffer cmdBuff); const ThsvsAccessType *getAccessType(AccessFlagBit flag); -void getAccessTypes(AccessFlags flag, vector &v); +void getAccessTypes(AccessFlags flag, ccstd::vector &v); VkDeviceSize roundUp(VkDeviceSize numToRound, uint32_t multiple); -bool isLayerSupported(const char *required, const vector &available); -bool isExtensionSupported(const char *required, const vector &available); +bool isLayerSupported(const char *required, const ccstd::vector &available); +bool isExtensionSupported(const char *required, const ccstd::vector &available); bool isFormatSupported(VkPhysicalDevice device, VkFormat format); extern const VkSurfaceTransformFlagsKHR TRANSFORMS_THAT_REQUIRE_FLIPPING; diff --git a/native/cocos/renderer/gfx-vulkan/vk_mem_alloc.h b/native/cocos/renderer/gfx-vulkan/vk_mem_alloc.h index 49793f5560..147ee28464 100644 --- a/native/cocos/renderer/gfx-vulkan/vk_mem_alloc.h +++ b/native/cocos/renderer/gfx-vulkan/vk_mem_alloc.h @@ -985,12 +985,12 @@ The way it works is: // Given following variables already initialized: VkDevice device; VmaAllocator allocator; -std::vector buffers; -std::vector allocations; +ccstd::vector buffers; +ccstd::vector allocations; const uint32_t allocCount = (uint32_t)allocations.size(); -std::vector allocationsChanged(allocCount); +ccstd::vector allocationsChanged(allocCount); VmaDefragmentationInfo2 defragInfo = {}; defragInfo.allocationCount = allocCount; @@ -1053,12 +1053,12 @@ Example: VkDevice device; VmaAllocator allocator; VkCommandBuffer commandBuffer; -std::vector buffers; -std::vector allocations; +ccstd::vector buffers; +ccstd::vector allocations; const uint32_t allocCount = (uint32_t)allocations.size(); -std::vector allocationsChanged(allocCount); +ccstd::vector allocationsChanged(allocCount); VkCommandBufferBeginInfo cmdBufBeginInfo = ...; vkBeginCommandBuffer(commandBuffer, &cmdBufBeginInfo); @@ -4054,7 +4054,7 @@ internally, like: //#define VMA_USE_STL_CONTAINERS 1 /* Set this macro to 1 to make the library including and using STL containers: -std::pair, std::vector, std::list, std::unordered_map. +std::pair, ccstd::vector, std::list, std::unordered_map. Set it to 0 or undefined to make the library using its own implementation of the containers. @@ -4967,23 +4967,23 @@ public: #if VMA_USE_STL_VECTOR -#define VmaVector std::vector +#define VmaVector ccstd::vector template -static void VmaVectorInsert(std::vector& vec, size_t index, const T& item) +static void VmaVectorInsert(ccstd::vector& vec, size_t index, const T& item) { vec.insert(vec.begin() + index, item); } template -static void VmaVectorRemove(std::vector& vec, size_t index) +static void VmaVectorRemove(ccstd::vector& vec, size_t index) { vec.erase(vec.begin() + index); } #else // #if VMA_USE_STL_VECTOR -/* Class with interface compatible with subset of std::vector. +/* Class with interface compatible with subset of ccstd::vector. T must be POD because constructors and destructors are not called and memcpy is used for these objects. */ template @@ -5008,7 +5008,7 @@ public: { } - // This version of the constructor is here for compatibility with pre-C++14 std::vector. + // This version of the constructor is here for compatibility with pre-C++14 ccstd::vector. // value is unused. VmaVector(size_t count, const T& value, const AllocatorT& allocator) : VmaVector(count, allocator) {} diff --git a/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h b/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h index 1d77d8160b..9f0e1afc1e 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUBuffer.h @@ -50,7 +50,7 @@ public: inline uint getOffset() const { return _offset; } void update(const emscripten::val &v, uint size) { - std::vector buffer = emscripten::convertJSArrayToNumberVector(v); + ccstd::vector buffer = emscripten::convertJSArrayToNumberVector(v); update(reinterpret_cast(buffer.data()), size); } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp index 5b4a1cbae2..089b8e9cf3 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.cpp @@ -108,7 +108,7 @@ void CCWGPUCommandBuffer::beginRenderPass(RenderPass *renderPass, Framebuffer *f CCWGPUSwapchain * swapchain = ccFrameBuffer->swapchain(); WGPURenderPassDescriptor & renderPassDesc = _gpuCommandBufferObj->renderPassDescriptor; - std::vector colorAttachments; + ccstd::vector colorAttachments; if (colorConfigs.empty()) { renderPassDesc.nextInChain = nullptr; renderPassDesc.label = "swapchain"; @@ -137,7 +137,7 @@ void CCWGPUCommandBuffer::beginRenderPass(RenderPass *renderPass, Framebuffer *f } } - std::vector depthStencils; + ccstd::vector depthStencils; if (dsTexture) { WGPURenderPassDepthStencilAttachment depthStencil = { .view = static_cast(dsTexture)->gpuTextureObject()->selfView, @@ -276,7 +276,7 @@ void CCWGPUCommandBuffer::bindStates() { // printf("ppl binding %p\n", pipelineState); - // std::vector wgpuLayouts; + // ccstd::vector wgpuLayouts; if (pipelineState->getBindPoint() == PipelineBindPoint::GRAPHICS) { //bindgroup & descriptorset diff --git a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h index b8f8a28d90..7e5085e012 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUCommandBuffer.h @@ -78,7 +78,7 @@ public: void updateIndirectBuffer(Buffer *buffer, const DrawInfoList &list); void updateBuffer(Buffer *buff, const emscripten::val &v, uint size) { - std::vector buffer = emscripten::convertJSArrayToNumberVector(v); + ccstd::vector buffer = emscripten::convertJSArrayToNumberVector(v); updateBuffer(buff, reinterpret_cast(buffer.data()), size); } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDef.h b/native/cocos/renderer/gfx-wgpu/WGPUDef.h index 5234510beb..24fe31ecbf 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDef.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDef.h @@ -196,7 +196,7 @@ private: class SPVShaderStageInstance { public: ShaderStageFlagBit stage{ShaderStageFlagBit::NONE}; - std::vector spv; + ccstd::vector spv; inline void setStage(ShaderStageFlagBit stageIn) { stage = stageIn; } inline void setSPVData(const emscripten::val &v) { spv = emscripten::convertJSArrayToNumberVector(v); } @@ -206,7 +206,7 @@ class SPVShaderInfoInstance { public: inline void setName(String name) { info.name = name; } inline void setAttributes(AttributeList attrs) { info.attributes = attrs; } - inline void setStages(std::vector spvStages) { stages = spvStages; } + inline void setStages(ccstd::vector spvStages) { stages = spvStages; } inline void setBlocks(UniformBlockList blocks) { info.blocks = blocks; } inline void setBuffers(UniformStorageBufferList buffers) { info.buffers = buffers; } inline void setSamplerTextures(UniformSamplerTextureList list) { info.samplerTextures = list; } @@ -216,7 +216,7 @@ public: inline void setSubpasses(UniformInputAttachmentList subpassInputs) { info.subpassInputs = subpassInputs; } ShaderInfo info; - std::vector stages; + ccstd::vector stages; }; class DescriptorSetLayoutBindingInstance { @@ -256,7 +256,7 @@ private: class DescriptorSetLayoutInfoInstance { public: - inline void setBindings(std::vector bindings) { info.bindings = std::vector(bindings.begin(), bindings.end()); } + inline void setBindings(ccstd::vector bindings) { info.bindings = ccstd::vector(bindings.begin(), bindings.end()); } explicit operator const DescriptorSetLayoutInfo() const { return info; } diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp index 4957f09620..9c65ad608b 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp @@ -192,7 +192,7 @@ void CCWGPUDescriptorSet::prepare() { if (_isDirty || forceUpdate || !_gpuBindGroupObj->bindgroup) { auto *dsLayout = static_cast(_layout); dsLayout->prepare(forceUpdate); - // std::vector + // ccstd::vector // bindGroupEntries; // bindGroupEntries.assign(_gpuBindGroupObj->bindGroupEntries.begin(), _gpuBindGroupObj->bindGroupEntries.end()); // bindGroupEntries.erase(std::remove_if( diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h index e9d099bfe0..439a25dd63 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.h @@ -27,14 +27,13 @@ #include #include -#include #include "gfx-base/GFXDescriptorSet.h" namespace cc { namespace gfx { struct CCWGPUBindGroupObject; -using Pairs = std::vector>; +using Pairs = ccstd::vector>; class CCWGPUDescriptorSet final : public emscripten::wrapper { public: diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp index c09490049c..21aca0b191 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp @@ -239,7 +239,7 @@ void CCWGPUDescriptorSetLayout::prepare(bool forceUpdate) { if (_gpuLayoutEntryObj->bindGroupLayout && !forceUpdate) { return; } - // std::vector bindGroupLayoutEntries; + // ccstd::vector bindGroupLayoutEntries; // bindGroupLayoutEntries.assign(_gpuLayoutEntryObj->bindGroupLayoutEntries.begin(), _gpuLayoutEntryObj->bindGroupLayoutEntries.end()); // bindGroupLayoutEntries.erase(std::remove_if( // bindGroupLayoutEntries.begin(), bindGroupLayoutEntries.end(), [&bindingInUse, &bindGroupLayoutEntries](const WGPUBindGroupLayoutEntry& entry) { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDevice.h b/native/cocos/renderer/gfx-wgpu/WGPUDevice.h index f8cb340b17..8730e2d58e 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDevice.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUDevice.h @@ -117,8 +117,8 @@ public: void copyBuffersToTexture(const emscripten::val &v, Texture *dst, const BufferTextureCopyList ®ions) { uint32_t len = v["length"].as(); - std::vector> lifeProlonger(len); - std::vector buffers; + ccstd::vector> lifeProlonger(len); + ccstd::vector buffers; for (size_t i = 0; i < len; i++) { lifeProlonger[i] = EMSArraysToU8Vec(v, i); buffers.push_back(lifeProlonger[i].data()); @@ -157,7 +157,7 @@ protected: void getQueryPoolResults(QueryPool *queryPool) override; CCWGPUDeviceObject * _gpuDeviceObj = nullptr; - std::vector _swapchains; + ccstd::vector _swapchains; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUObject.h b/native/cocos/renderer/gfx-wgpu/WGPUObject.h index 8296e8a9b4..891511679b 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUObject.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUObject.h @@ -127,8 +127,8 @@ static_assert(sizeof(CCWGPUDrawIndirectObject) == 16, "WGPU drawIndirect structu struct CCWGPUBufferObject { WGPUBuffer wgpuBuffer = wgpuDefaultHandle; - std::vector indexedIndirectObjs; - std::vector indirectObjs; + ccstd::vector indexedIndirectObjs; + ccstd::vector indirectObjs; bool mapped = false; bool hasDynamicOffsets = false; }; @@ -150,12 +150,12 @@ struct CCWGPUSamplerObject { struct CCWGPUBindGroupLayoutObject { WGPUBindGroupLayout bindGroupLayout = wgpuDefaultHandle; - std::vector bindGroupLayoutEntries; + ccstd::vector bindGroupLayoutEntries; }; struct CCWGPUBindGroupObject { WGPUBindGroup bindgroup = wgpuDefaultHandle; - std::vector bindGroupEntries; + ccstd::vector bindGroupEntries; std::set bindingSet; }; @@ -167,7 +167,7 @@ struct CCWGPUPipelineStateObject { WGPURenderPipeline wgpuRenderPipeline = wgpuDefaultHandle; WGPUComputePipeline wgpuComputePipeline = wgpuDefaultHandle; - std::vector redundantAttr; + ccstd::vector redundantAttr; uint32_t maxAttrLength = 0; }; @@ -217,7 +217,7 @@ struct CCWGPUStateCache { uint32_t minAttachmentWidth = 0; uint32_t minAttachmentHeight = 0; - std::vector descriptorSets; + ccstd::vector descriptorSets; std::map stencilMasks; }; @@ -239,7 +239,7 @@ struct CCWGPUCommandBufferObject { struct CCWGPUQueryPoolObject { QueryType type = QueryType::OCCLUSION; uint32_t maxQueryObjects = 0; - std::vector idPool; + ccstd::vector idPool; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp index 98218ea125..02a482bcdf 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.cpp @@ -42,7 +42,7 @@ void CCWGPUPipelineLayout::doInit(const PipelineLayoutInfo &info) { } void CCWGPUPipelineLayout::prepare(const std::set &setInUse) { - std::vector layouts; + ccstd::vector layouts; // _bgLayouts.clear(); for (size_t i = 0; i < _setLayouts.size(); i++) { auto *descriptorSetLayout = static_cast(_setLayouts[i]); diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h index 7e54c3df3a..73f91d3253 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineLayout.h @@ -43,7 +43,7 @@ public: //bindgroup not ready yet so delay creation void prepare(const std::set &setInUse); - // const std::vector & layouts()const{return _bgLayouts;} + // const ccstd::vector & layouts()const{return _bgLayouts;} protected: void doInit(const PipelineLayoutInfo &info) override; @@ -51,7 +51,7 @@ protected: CCWGPUPipelineLayoutObject *_gpuPipelineLayoutObj = nullptr; - // std::vector _bgLayouts; + // ccstd::vector _bgLayouts; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp index 461b76af88..268d7e5546 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUPipelineState.cpp @@ -73,12 +73,12 @@ void CCWGPUPipelineState::prepare(const std::set &setInUse) { const uint8_t streamCount = (*maxStreamAttr).stream + 1; - std::vector vbLayouts(streamCount); - std::vector> wgpuAttrsVec(streamCount); + ccstd::vector vbLayouts(streamCount); + ccstd::vector> wgpuAttrsVec(streamCount); const AttributeList &attrs = _shader->getAttributes(); uint64_t offset[256] = {0}; - // std::vector wgpuAttrs; + // ccstd::vector wgpuAttrs; bool isInstance = attrs.empty() ? false : attrs[0].isInstanced; uint8_t index = 0; @@ -209,9 +209,9 @@ void CCWGPUPipelineState::prepare(const std::set &setInUse) { }; const ColorAttachmentList & colors = _renderPass->getColorAttachments(); - std::vector colorTargetStates(colors.size()); + ccstd::vector colorTargetStates(colors.size()); - std::vector blendState(colors.size()); + ccstd::vector blendState(colors.size()); for (size_t i = 0, targetIndex = 0; i < colors.size(); i++) { colorTargetStates[i].format = toWGPUTextureFormat(colors[i].format); diff --git a/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h b/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h index f2425effd1..abaf05a8df 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUQueryPool.h @@ -25,7 +25,6 @@ #pragma once -#include #include "gfx-base/GFXQueryPool.h" namespace cc { @@ -51,7 +50,7 @@ protected: void doDestroy() override; CCWGPUQueryPoolObject *_gpuQueryPool = nullptr; - std::vector _ids; + ccstd::vector _ids; }; } // namespace gfx diff --git a/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp b/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp index 0a8c7e4477..bd8c1f1c43 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUQueue.cpp @@ -25,7 +25,6 @@ #include "WGPUQueue.h" #include -#include #include "WGPUCommandBuffer.h" #include "WGPUDevice.h" #include "WGPUObject.h" @@ -55,7 +54,7 @@ void CCWGPUQueue::doDestroy() { } void CCWGPUQueue::submit(CommandBuffer *const *cmdBuffs, uint count) { - // std::vector commandBuffs(count); + // ccstd::vector commandBuffs(count); // for (size_t i = 0; i < count; i++) { // auto* commandBuff = static_cast(cmdBuffs[i]); // commandBuffs[i] = commandBuff->gpuCommandBufferObject()->wgpuCommandBuffer; diff --git a/native/cocos/renderer/pipeline/BatchedBuffer.cpp b/native/cocos/renderer/pipeline/BatchedBuffer.cpp index 033a3a766a..a89667dc2f 100644 --- a/native/cocos/renderer/pipeline/BatchedBuffer.cpp +++ b/native/cocos/renderer/pipeline/BatchedBuffer.cpp @@ -175,9 +175,9 @@ void BatchedBuffer::merge(const scene::SubModel *subModel, uint passIdx, const s } // Create a new batch - vector vbs(flatBuffersCount, nullptr); - vector vbDatas(flatBuffersCount, nullptr); - vector totalVBs(flatBuffersCount + 1, nullptr); + ccstd::vector vbs(flatBuffersCount, nullptr); + ccstd::vector vbDatas(flatBuffersCount, nullptr); + ccstd::vector totalVBs(flatBuffersCount + 1, nullptr); for (uint i = 0; i < flatBuffersCount; ++i) { const auto &flatBuffer = flatBuffers[i]; @@ -208,7 +208,7 @@ void BatchedBuffer::merge(const scene::SubModel *subModel, uint passIdx, const s indexBuffer->update(indexData, static_cast(indexBufferSize)); totalVBs[flatBuffersCount] = indexBuffer; - vector attributes = subModel->getInputAssembler()->getAttributes(); + ccstd::vector attributes = subModel->getInputAssembler()->getAttributes(); gfx::Attribute attrib = { "a_dyn_batch_id", gfx::Format::R32F, diff --git a/native/cocos/renderer/pipeline/BatchedBuffer.h b/native/cocos/renderer/pipeline/BatchedBuffer.h index 05f3b35ba2..2d105e4d92 100644 --- a/native/cocos/renderer/pipeline/BatchedBuffer.h +++ b/native/cocos/renderer/pipeline/BatchedBuffer.h @@ -39,7 +39,7 @@ namespace pipeline { struct CC_DLL BatchedItem { gfx::BufferList vbs; - vector vbDatas; + ccstd::vector vbDatas; gfx::Buffer * indexBuffer = nullptr; float * indexData = nullptr; uint vbCount = 0; @@ -51,8 +51,8 @@ struct CC_DLL BatchedItem { const scene::Pass * pass = nullptr; gfx::Shader * shader = nullptr; }; -using BatchedItemList = vector; -using DynamicOffsetList = vector; +using BatchedItemList = ccstd::vector; +using DynamicOffsetList = ccstd::vector; class CC_DLL BatchedBuffer : public RefCounted { public: diff --git a/native/cocos/renderer/pipeline/ClusterLightCulling.h b/native/cocos/renderer/pipeline/ClusterLightCulling.h index ccf8eaf8d3..02cb27de3d 100644 --- a/native/cocos/renderer/pipeline/ClusterLightCulling.h +++ b/native/cocos/renderer/pipeline/ClusterLightCulling.h @@ -130,8 +130,8 @@ private: std::array _constants{}; gfx::Buffer * _constantsBuffer{nullptr}; - vector _validLights; - std::vector _lightBufferData; + ccstd::vector _validLights; + ccstd::vector _lightBufferData; gfx::GeneralBarrier *_resetBarrier{nullptr}; @@ -146,7 +146,7 @@ private: // only rebuild clusters when camera project matrix changed bool _rebuildClusters{false}; - vector _oldCamProjMats; + ccstd::vector _oldCamProjMats; bool _initialized{false}; }; diff --git a/native/cocos/renderer/pipeline/Define.h b/native/cocos/renderer/pipeline/Define.h index bec737526f..1672cc19c0 100644 --- a/native/cocos/renderer/pipeline/Define.h +++ b/native/cocos/renderer/pipeline/Define.h @@ -31,6 +31,7 @@ #include "base/TypeDef.h" #include "base/Value.h" #include "renderer/gfx-base/GFXDef.h" +#include "base/std/container/vector.h" namespace cc { @@ -59,7 +60,7 @@ struct CC_DLL RenderObject { float depth = 0; const scene::Model *model = nullptr; }; -using RenderObjectList = vector; +using RenderObjectList = ccstd::vector; struct CC_DLL RenderTargetInfo { uint width = 0; @@ -73,10 +74,10 @@ struct CC_DLL RenderPass { uint passIndex = 0; const scene::SubModel *subModel = nullptr; }; -using RenderPassList = vector; +using RenderPassList = ccstd::vector; using ColorDesc = gfx::ColorAttachment; -using ColorDescList = vector; +using ColorDescList = ccstd::vector; using DepthStencilDesc = gfx::DepthStencilAttachment; @@ -85,7 +86,7 @@ struct CC_DLL RenderPassDesc { ColorDescList colorAttachments; DepthStencilDesc depthStencilAttachment; }; -using RenderPassDescList = vector; +using RenderPassDescList = ccstd::vector; struct CC_DLL RenderTextureDesc { String name; @@ -95,15 +96,15 @@ struct CC_DLL RenderTextureDesc { int width = -1; int height = -1; }; -using RenderTextureDescList = vector; +using RenderTextureDescList = ccstd::vector; struct CC_DLL FrameBufferDesc { String name; uint renderPass = 0; - vector colorTextures; + ccstd::vector colorTextures; String depthStencilTexture; }; -using FrameBufferDescList = vector; +using FrameBufferDescList = ccstd::vector; enum class RenderFlowType : uint8_t { SCENE, @@ -112,10 +113,10 @@ enum class RenderFlowType : uint8_t { }; CC_ENUM_CONVERSION_OPERATOR(RenderFlowType) -using RenderStageList = vector; -using RenderFlowList = vector; -using LightList = vector; -using UintList = vector; +using RenderStageList = ccstd::vector; +using RenderFlowList = ccstd::vector; +using LightList = ccstd::vector; +using UintList = ccstd::vector; enum class CC_DLL RenderPassStage { DEFAULT = 100, @@ -160,7 +161,7 @@ struct CC_DLL RenderQueueDesc { RenderQueueSortMode sortMode = RenderQueueSortMode::FRONT_TO_BACK; StringArray stages; }; -using RenderQueueDescList = std::vector; +using RenderQueueDescList = ccstd::vector; uint getPhaseID(const String &phase); diff --git a/native/cocos/renderer/pipeline/GeometryRenderer.cpp b/native/cocos/renderer/pipeline/GeometryRenderer.cpp index 2902d3aac5..b8d5a6d33f 100644 --- a/native/cocos/renderer/pipeline/GeometryRenderer.cpp +++ b/native/cocos/renderer/pipeline/GeometryRenderer.cpp @@ -120,7 +120,7 @@ private: } uint32_t _maxVertices{0}; - std::vector _vertices; + ccstd::vector _vertices; gfx::Buffer * _buffer{nullptr}; gfx::InputAssembler *_inputAssembler{nullptr}; @@ -471,9 +471,9 @@ void GeometryRenderer::addCapsule(const Vec3 ¢er, float radius, float height Vec3 bottomCenter{center.x, center.y - height / 2.0F, center.z}; Vec3 topCenter{center.x, center.y + height / 2.0F, center.z}; - using CircleList = std::vector; - std::vector bottomPoints; - std::vector topPoints; + using CircleList = ccstd::vector; + ccstd::vector bottomPoints; + ccstd::vector topPoints; for (auto i = 0U; i < hemiSegmentsV + 1; i++) { CircleList bottomList; @@ -528,8 +528,8 @@ void GeometryRenderer::addCylinder(const Vec3 ¢er, float radius, float heigh const auto deltaPhi = math::PI_2 / static_cast(segments); Vec3 bottomCenter{center.x, center.y - height / 2.0F, center.z}; Vec3 topCenter{center.x, center.y + height / 2.0F, center.z}; - std::vector bottomPoints; - std::vector topPoints; + ccstd::vector bottomPoints; + ccstd::vector topPoints; for (auto i = 0U; i < segments + 1; i++) { float phi = static_cast(i) * deltaPhi; @@ -561,7 +561,7 @@ void GeometryRenderer::addCone(const Vec3 ¢er, float radius, float height, g const auto deltaPhi = math::PI_2 / static_cast(segments); Vec3 bottomCenter{center.x, center.y - height / 2.0F, center.z}; Vec3 topCenter{center.x, center.y + height / 2.0F, center.z}; - std::vector bottomPoints; + ccstd::vector bottomPoints; for (auto i = 0U; i < segments + 1; i++) { Vec3 point{radius * cosf(static_cast(i) * deltaPhi), 0.0F, radius * sinf(static_cast(i) * deltaPhi)}; @@ -585,7 +585,7 @@ void GeometryRenderer::addCone(const Vec3 ¢er, float radius, float height, g void GeometryRenderer::addCircle(const Vec3 ¢er, float radius, gfx::Color color, uint32_t segments, bool depthTest, bool useTransform, const Mat4 &transform) { const auto deltaPhi = math::PI_2 / static_cast(segments); - std::vector points; + ccstd::vector points; for (auto i = 0U; i < segments + 1; i++) { Vec3 point{radius * cosf(static_cast(i) * deltaPhi), 0.0F, radius * sinf(static_cast(i) * deltaPhi)}; @@ -607,7 +607,7 @@ void GeometryRenderer::addArc(const Vec3 ¢er, float radius, gfx::Color color float startRadian = math::DEG_TO_RAD * startAngle; float endRadian = math::DEG_TO_RAD * endAngle; const auto deltaPhi = (endRadian - startRadian) / static_cast(segments); - std::vector points; + ccstd::vector points; for (auto i = 0U; i < segments + 1; i++) { Vec3 point{radius * cosf(static_cast(i) * deltaPhi + startRadian), 0.0F, radius * sinf(static_cast(i) * deltaPhi + startRadian)}; @@ -635,7 +635,7 @@ void GeometryRenderer::addPolygon(const Vec3 ¢er, float radius, gfx::Color c void GeometryRenderer::addDisc(const Vec3 ¢er, float radius, gfx::Color color, uint32_t segments, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { const auto deltaPhi = math::PI_2 / static_cast(segments); - std::vector points; + ccstd::vector points; Vec3 newCenter = center; for (auto i = 0U; i < segments + 1; i++) { @@ -667,7 +667,7 @@ void GeometryRenderer::addSector(const Vec3 ¢er, float radius, gfx::Color co float startRadian = math::DEG_TO_RAD * startAngle; float endRadian = math::DEG_TO_RAD * endAngle; const auto deltaPhi = (endRadian - startRadian) / static_cast(segments); - std::vector points; + ccstd::vector points; Vec3 newCenter = center; for (auto i = 0U; i < segments + 1; i++) { @@ -699,8 +699,8 @@ void GeometryRenderer::addSphere(const Vec3 ¢er, float radius, gfx::Color co const auto deltaPhi = math::PI_2 / static_cast(segmentsU); const auto deltaTheta = math::PI / static_cast(segmentsV); - using CircleList = std::vector; - std::vector points; + using CircleList = ccstd::vector; + ccstd::vector points; for (auto i = 0U; i < segmentsV + 1; i++) { CircleList list; @@ -740,8 +740,8 @@ void GeometryRenderer::addTorus(const Vec3 ¢er, float bigRadius, float radiu const auto deltaPhi = math::PI_2 / static_cast(segmentsU); const auto deltaTheta = math::PI_2 / static_cast(segmentsV); - using CircleList = std::vector; - std::vector points; + using CircleList = ccstd::vector; + ccstd::vector points; for (auto i = 0U; i < segmentsU + 1; i++) { CircleList list; @@ -778,7 +778,7 @@ void GeometryRenderer::addTorus(const Vec3 ¢er, float bigRadius, float radiu } void GeometryRenderer::addOctahedron(const Vec3 ¢er, float radius, gfx::Color color, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { - std::vector points; + ccstd::vector points; points.emplace_back(Vec3(radius, 0.0F, 0.0F) + center); points.emplace_back(Vec3(0.0F, 0.0F, -radius) + center); @@ -822,7 +822,7 @@ void GeometryRenderer::addOctahedron(const Vec3 ¢er, float radius, gfx::Colo void GeometryRenderer::addBezier(const Vec3 &v0, const Vec3 &v1, const Vec3 &v2, const Vec3 &v3, gfx::Color color, uint32_t segments, bool depthTest, bool useTransform, const Mat4 &transform) { const auto deltaT = 1.0F / static_cast(segments); - std::vector points; + ccstd::vector points; Vec3 newV0 = v0; Vec3 newV1 = v1; @@ -851,7 +851,7 @@ void GeometryRenderer::addBezier(const Vec3 &v0, const Vec3 &v1, const Vec3 &v2, } } -void GeometryRenderer::addMesh(const Vec3 ¢er, const std::vector &vertices, gfx::Color color, bool depthTest, bool useTransform, const Mat4 &transform) { +void GeometryRenderer::addMesh(const Vec3 ¢er, const ccstd::vector &vertices, gfx::Color color, bool depthTest, bool useTransform, const Mat4 &transform) { for (auto i = 0U; i < vertices.size(); i += 3) { Vec3 v0 = center + vertices[i]; Vec3 v1 = center + vertices[i + 1]; @@ -869,7 +869,7 @@ void GeometryRenderer::addMesh(const Vec3 ¢er, const std::vector &vert } } -void GeometryRenderer::addIndexedMesh(const Vec3 ¢er, const std::vector &vertices, const std::vector &indices, gfx::Color color, bool depthTest, bool useTransform, const Mat4 &transform) { +void GeometryRenderer::addIndexedMesh(const Vec3 ¢er, const ccstd::vector &vertices, const ccstd::vector &indices, gfx::Color color, bool depthTest, bool useTransform, const Mat4 &transform) { for (auto i = 0U; i < indices.size(); i += 3) { Vec3 v0 = center + vertices[indices[i]]; Vec3 v1 = center + vertices[indices[i + 1]]; diff --git a/native/cocos/renderer/pipeline/GeometryRenderer.h b/native/cocos/renderer/pipeline/GeometryRenderer.h index e376ff116d..6ccee7fef7 100644 --- a/native/cocos/renderer/pipeline/GeometryRenderer.h +++ b/native/cocos/renderer/pipeline/GeometryRenderer.h @@ -25,7 +25,6 @@ #pragma once -#include #include "base/Macros.h" #include "base/RefCounted.h" #include "gfx-base/GFXDef-common.h" @@ -98,8 +97,8 @@ public: void addTorus(const Vec3 ¢er, float bigRadius, float radius, gfx::Color color, uint32_t segmentsU = 32U, uint32_t segmentsV = 32U, bool wireframe = true, bool depthTest = true, bool unlit = false, bool useTransform = false, const Mat4 &transform = Mat4()); void addOctahedron(const Vec3 ¢er, float radius, gfx::Color color, bool wireframe = true, bool depthTest = true, bool unlit = false, bool useTransform = false, const Mat4 &transform = Mat4()); void addBezier(const Vec3 &v0, const Vec3 &v1, const Vec3 &v2, const Vec3 &v3, gfx::Color color, uint32_t segments = 32U, bool depthTest = true, bool useTransform = false, const Mat4 &transform = Mat4()); - void addMesh(const Vec3 ¢er, const std::vector &vertices, gfx::Color color, bool depthTest = true, bool useTransform = false, const Mat4 &transform = Mat4()); - void addIndexedMesh(const Vec3 ¢er, const std::vector &vertices, const std::vector &indices, gfx::Color color, bool depthTest = true, bool useTransform = false, const Mat4 &transform = Mat4()); + void addMesh(const Vec3 ¢er, const ccstd::vector &vertices, gfx::Color color, bool depthTest = true, bool useTransform = false, const Mat4 &transform = Mat4()); + void addIndexedMesh(const Vec3 ¢er, const ccstd::vector &vertices, const ccstd::vector &indices, gfx::Color color, bool depthTest = true, bool useTransform = false, const Mat4 &transform = Mat4()); private: void update(); diff --git a/native/cocos/renderer/pipeline/GlobalDescriptorSetManager.h b/native/cocos/renderer/pipeline/GlobalDescriptorSetManager.h index 2b9266b8d6..818226f706 100644 --- a/native/cocos/renderer/pipeline/GlobalDescriptorSetManager.h +++ b/native/cocos/renderer/pipeline/GlobalDescriptorSetManager.h @@ -27,6 +27,7 @@ #include "base/CoreStd.h" #include "base/Ptr.h" +#include "base/std/container/vector.h" namespace cc { namespace gfx { @@ -67,7 +68,7 @@ private: IntrusivePtr _descriptorSetLayout; gfx::DescriptorSet * _globalDescriptorSet = nullptr; std::unordered_map _descriptorSetMap{}; - std::vector _shadowUBOs; + ccstd::vector _shadowUBOs; }; } // namespace pipeline diff --git a/native/cocos/renderer/pipeline/InstancedBuffer.h b/native/cocos/renderer/pipeline/InstancedBuffer.h index 059ae64389..4b9ee9e585 100644 --- a/native/cocos/renderer/pipeline/InstancedBuffer.h +++ b/native/cocos/renderer/pipeline/InstancedBuffer.h @@ -52,8 +52,8 @@ struct CC_DLL InstancedItem { gfx::DescriptorSet * descriptorSet = nullptr; gfx::Texture * lightingMap = nullptr; }; -using InstancedItemList = vector; -using DynamicOffsetList = vector; +using InstancedItemList = ccstd::vector; +using DynamicOffsetList = ccstd::vector; class InstancedBuffer : public RefCounted { public: diff --git a/native/cocos/renderer/pipeline/PipelineSceneData.h b/native/cocos/renderer/pipeline/PipelineSceneData.h index fd06fe82c4..c20e751bce 100644 --- a/native/cocos/renderer/pipeline/PipelineSceneData.h +++ b/native/cocos/renderer/pipeline/PipelineSceneData.h @@ -63,8 +63,8 @@ public: inline void setDirShadowObjects(RenderObjectList &&ro) { _dirShadowObjects = std::forward(ro); } inline const RenderObjectList & isCastShadowObjects() const { return _castShadowObjects; } inline void setCastShadowObjects(RenderObjectList &&ro) { _castShadowObjects = std::forward(ro); } - inline const vector & getValidPunctualLights() const { return _validPunctualLights; } - inline void setValidPunctualLights(vector &&validPunctualLights) { _validPunctualLights = std::forward>(validPunctualLights); } + inline const ccstd::vector & getValidPunctualLights() const { return _validPunctualLights; } + inline void setValidPunctualLights(ccstd::vector &&validPunctualLights) { _validPunctualLights = std::forward>(validPunctualLights); } inline bool isHDR() const { return _isHDR; } inline void setHDR(bool val) { _isHDR = val; } inline scene::Shadows * getShadows() const { return _shadow; } @@ -75,9 +75,9 @@ public: inline gfx::InputAssembler * getOcclusionQueryInputAssembler() const { return _occlusionQueryInputAssembler; } inline scene::Pass * getOcclusionQueryPass() const { return _occlusionQueryPass; } inline gfx::Shader * getOcclusionQueryShader() const { return _occlusionQueryShader; } - inline const std::vector> & getGeometryRendererMaterials() const { return _geometryRendererMaterials; } - inline const std::vector & getGeometryRendererPasses() const { return _geometryRendererPasses; } - inline const std::vector & getGeometryRendererShaders() const { return _geometryRendererShaders; } + inline const ccstd::vector> & getGeometryRendererMaterials() const { return _geometryRendererMaterials; } + inline const ccstd::vector & getGeometryRendererPasses() const { return _geometryRendererPasses; } + inline const ccstd::vector & getGeometryRendererShaders() const { return _geometryRendererShaders; } inline scene::Pass * getDebugRendererPass() const { return _debugRendererPass; } inline gfx::Shader * getDebugRendererShader() const { return _debugRendererShader; } inline void addRenderObject(RenderObject &&obj) { _renderObjects.emplace_back(obj); } @@ -100,7 +100,7 @@ protected: RenderObjectList _renderObjects; RenderObjectList _dirShadowObjects; RenderObjectList _castShadowObjects; - vector _validPunctualLights; + ccstd::vector _validPunctualLights; gfx::Buffer * _occlusionQueryVertexBuffer{nullptr}; gfx::Buffer * _occlusionQueryIndicesBuffer{nullptr}; gfx::InputAssembler * _occlusionQueryInputAssembler{nullptr}; @@ -109,9 +109,9 @@ protected: gfx::Shader * _occlusionQueryShader{nullptr}; // weak reference scene::Pass * _occlusionQueryPass{nullptr}; // weak reference - std::vector> _geometryRendererMaterials; - std::vector _geometryRendererPasses; // weak reference - std::vector _geometryRendererShaders; // weak reference + ccstd::vector> _geometryRendererMaterials; + ccstd::vector _geometryRendererPasses; // weak reference + ccstd::vector _geometryRendererShaders; // weak reference IntrusivePtr _debugRendererMaterial{nullptr}; gfx::Shader * _debugRendererShader{nullptr}; diff --git a/native/cocos/renderer/pipeline/PipelineUBO.cpp b/native/cocos/renderer/pipeline/PipelineUBO.cpp index cf0c427a7f..a1748e15b3 100644 --- a/native/cocos/renderer/pipeline/PipelineUBO.cpp +++ b/native/cocos/renderer/pipeline/PipelineUBO.cpp @@ -396,7 +396,7 @@ void PipelineUBO::updateCameraUBO(const scene::Camera *camera) { cmdBuffer->updateBuffer(_cameraBuffer, _cameraUBOs.data()); } -void PipelineUBO::updateMultiCameraUBO(const vector &cameras) { +void PipelineUBO::updateMultiCameraUBO(const ccstd::vector &cameras) { const auto cameraCount = cameras.size(); const auto totalUboSize = static_cast(_alignedCameraUBOSize * cameraCount); diff --git a/native/cocos/renderer/pipeline/PipelineUBO.h b/native/cocos/renderer/pipeline/PipelineUBO.h index 04532bbb22..67cda1fb12 100644 --- a/native/cocos/renderer/pipeline/PipelineUBO.h +++ b/native/cocos/renderer/pipeline/PipelineUBO.h @@ -49,7 +49,7 @@ public: void destroy(); void updateGlobalUBO(const scene::Camera *camera); void updateCameraUBO(const scene::Camera *camera); - void updateMultiCameraUBO(const vector &cameras); + void updateMultiCameraUBO(const ccstd::vector &cameras); void updateShadowUBO(const scene::Camera *camera); void updateShadowUBOLight(gfx::DescriptorSet *globalDS, const scene::Light *light); void updateShadowUBORange(uint offset, const Mat4 *data); @@ -64,9 +64,9 @@ private: std::array _globalUBO; std::array _shadowUBO; - std::vector _ubos; + ccstd::vector _ubos; void initCombineSignY(); - std::vector _cameraUBOs; + ccstd::vector _cameraUBOs; gfx::Buffer * _cameraBuffer{nullptr}; uint _currentCameraUBOOffset{0}; uint _alignedCameraUBOSize{0}; diff --git a/native/cocos/renderer/pipeline/PlanarShadowQueue.h b/native/cocos/renderer/pipeline/PlanarShadowQueue.h index a9b8bba17a..ee81614c96 100644 --- a/native/cocos/renderer/pipeline/PlanarShadowQueue.h +++ b/native/cocos/renderer/pipeline/PlanarShadowQueue.h @@ -56,8 +56,8 @@ public: private: RenderPipeline * _pipeline = nullptr; RenderInstancedQueue * _instancedQueue = nullptr; - std::vector _castModels; - std::vector _pendingModels; + ccstd::vector _castModels; + ccstd::vector _pendingModels; }; } // namespace pipeline } // namespace cc diff --git a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp index 512988ba56..623361a32b 100644 --- a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp +++ b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp @@ -114,7 +114,7 @@ void RenderAdditiveLightQueue::recordCommandBuffer(gfx::Device *device, scene::C } void RenderAdditiveLightQueue::gatherLightPasses(const scene::Camera *camera, gfx::CommandBuffer *cmdBuffer) { - static vector lightPassIndices; + static ccstd::vector lightPassIndices; clear(); @@ -385,7 +385,7 @@ void RenderAdditiveLightQueue::updateLightDescriptorSet(const scene::Camera *cam } } -bool RenderAdditiveLightQueue::getLightPassIndex(const scene::Model *model, vector *lightPassIndices) const { +bool RenderAdditiveLightQueue::getLightPassIndex(const scene::Model *model, ccstd::vector *lightPassIndices) const { lightPassIndices->clear(); bool hasValidLightPass = false; diff --git a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h index 880bdc5b2c..cbf0359984 100644 --- a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h +++ b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h @@ -47,8 +47,8 @@ struct AdditiveLightPass { const scene::SubModel *subModel = nullptr; const scene::Pass * pass = nullptr; gfx::Shader * shader = nullptr; - vector dynamicOffsets; - vector lights; + ccstd::vector dynamicOffsets; + ccstd::vector lights; }; class RenderAdditiveLightQueue final { @@ -67,17 +67,17 @@ private: void addRenderQueue(const scene::Pass *pass, const scene::SubModel *subModel, const scene::Model *model, uint lightPassIdx); void updateUBOs(const scene::Camera *camera, gfx::CommandBuffer *cmdBuffer); void updateLightDescriptorSet(const scene::Camera *camera, gfx::CommandBuffer *cmdBuffer); - bool getLightPassIndex(const scene::Model *model, vector *lightPassIndices) const; + bool getLightPassIndex(const scene::Model *model, ccstd::vector *lightPassIndices) const; void lightCulling(const scene::Model *model); RenderPipeline * _pipeline = nullptr; - vector> _sortedSubModelsArray; - vector> _sortedPSOCIArray; - vector _validPunctualLights; - vector _lightIndices; - vector _lightPasses; - vector _dynamicOffsets; - vector _lightBufferData; + ccstd::vector> _sortedSubModelsArray; + ccstd::vector> _sortedPSOCIArray; + ccstd::vector _validPunctualLights; + ccstd::vector _lightIndices; + ccstd::vector _lightPasses; + ccstd::vector _dynamicOffsets; + ccstd::vector _lightBufferData; RenderInstancedQueue * _instancedQueue = nullptr; RenderBatchedQueue * _batchedQueue = nullptr; gfx::Buffer * _lightBuffer = nullptr; diff --git a/native/cocos/renderer/pipeline/RenderPipeline.cpp b/native/cocos/renderer/pipeline/RenderPipeline.cpp index c7979b8dbb..878ec3a16b 100644 --- a/native/cocos/renderer/pipeline/RenderPipeline.cpp +++ b/native/cocos/renderer/pipeline/RenderPipeline.cpp @@ -100,7 +100,7 @@ bool RenderPipeline::activate(gfx::Swapchain * /*swapchain*/) { return true; } -void RenderPipeline::render(const vector &cameras) { +void RenderPipeline::render(const ccstd::vector &cameras) { for (auto *const flow : _flows) { for (auto *camera : cameras) { flow->render(camera); @@ -222,7 +222,7 @@ bool RenderPipeline::createQuadInputAssembler(gfx::Buffer *quadIB, gfx::Buffer * return (*quadIA) != nullptr; } -void RenderPipeline::ensureEnoughSize(const vector &cameras) { +void RenderPipeline::ensureEnoughSize(const ccstd::vector &cameras) { for (auto *camera : cameras) { _width = std::max(camera->getWindow()->getWidth(), _width); _height = std::max(camera->getWindow()->getHeight(), _height); diff --git a/native/cocos/renderer/pipeline/RenderPipeline.h b/native/cocos/renderer/pipeline/RenderPipeline.h index ff0edd1026..dba9450360 100644 --- a/native/cocos/renderer/pipeline/RenderPipeline.h +++ b/native/cocos/renderer/pipeline/RenderPipeline.h @@ -73,7 +73,7 @@ public: virtual bool activate(gfx::Swapchain *swapchain); bool destroy() override; virtual bool initialize(const RenderPipelineInfo &info); - virtual void render(const vector &cameras); + virtual void render(const ccstd::vector &cameras); virtual void onGlobalPipelineStateChanged(); inline const RenderFlowList & getFlows() const { return _flows; } @@ -107,7 +107,7 @@ public: gfx::Color getClearcolor(scene::Camera *camera) const; gfx::InputAssembler * getIAByRenderArea(const gfx::Rect &renderArea); void updateQuadVertexData(const Vec4 &viewport, gfx::Buffer *buffer); - void ensureEnoughSize(const vector &cameras); + void ensureEnoughSize(const ccstd::vector &cameras); bool createQuadInputAssembler(gfx::Buffer *quadIB, gfx::Buffer **quadVB, gfx::InputAssembler **quadIA); float getShadingScale() const; @@ -153,7 +153,7 @@ protected: uint _width{0}; uint _height{0}; gfx::Buffer * _quadIB{nullptr}; - std::vector _quadVB; + ccstd::vector _quadVB; std::unordered_map> _quadIA; framegraph::FrameGraph _fg; diff --git a/native/cocos/renderer/pipeline/RenderStage.h b/native/cocos/renderer/pipeline/RenderStage.h index d5c93e02c8..3245aab612 100644 --- a/native/cocos/renderer/pipeline/RenderStage.h +++ b/native/cocos/renderer/pipeline/RenderStage.h @@ -69,7 +69,7 @@ protected: // Generate quad ia, cannot be updated inside renderpass gfx::InputAssembler * _inputAssembler{nullptr}; RenderQueueDescList _renderQueueDescriptors; - vector _renderQueues; + ccstd::vector _renderQueues; RenderPipeline * _pipeline = nullptr; RenderFlow * _flow = nullptr; gfx::Device * _device = nullptr; diff --git a/native/cocos/renderer/pipeline/SceneCulling.cpp b/native/cocos/renderer/pipeline/SceneCulling.cpp index 0559337f7c..9465c2fe2a 100644 --- a/native/cocos/renderer/pipeline/SceneCulling.cpp +++ b/native/cocos/renderer/pipeline/SceneCulling.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include -#include #include "Define.h" #include "PipelineSceneData.h" @@ -387,7 +386,7 @@ void sceneCulling(RenderPipeline *pipeline, scene::Camera *camera) { } if (isShadowMap) { - std::vector casters; + ccstd::vector casters; casters.reserve(scene->getModels().size() / 4); octree->queryVisibility(camera, dirLightFrustum, true, casters); @@ -396,7 +395,7 @@ void sceneCulling(RenderPipeline *pipeline, scene::Camera *camera) { } } - std::vector models; + ccstd::vector models; models.reserve(scene->getModels().size() / 4); octree->queryVisibility(camera, camera->getFrustum(), false, models); for (const auto *model : models) { diff --git a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h index 2400ba55d7..d5ae08fc98 100644 --- a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h +++ b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h @@ -55,9 +55,9 @@ private: int getShadowPassIndex(const scene::Model *model) const; RenderPipeline * _pipeline = nullptr; - vector _subModels; - vector _passes; - vector _shaders; + ccstd::vector _subModels; + ccstd::vector _passes; + ccstd::vector _shaders; RenderInstancedQueue * _instancedQueue = nullptr; RenderBatchedQueue * _batchedQueue = nullptr; gfx::Buffer * _buffer = nullptr; diff --git a/native/cocos/renderer/pipeline/custom/NativePipelineImpl.cpp b/native/cocos/renderer/pipeline/custom/NativePipelineImpl.cpp index 259503ddd4..6251e25b5b 100644 --- a/native/cocos/renderer/pipeline/custom/NativePipelineImpl.cpp +++ b/native/cocos/renderer/pipeline/custom/NativePipelineImpl.cpp @@ -109,7 +109,7 @@ bool NativePipeline::destroy() noexcept { } // NOLINTNEXTLINE -void NativePipeline::render(const std::vector &cameras) { +void NativePipeline::render(const ccstd::vector &cameras) { } const MacroRecord &NativePipeline::getMacros() const { diff --git a/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h b/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h index abbd030251..1340ebecf0 100644 --- a/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h +++ b/native/cocos/renderer/pipeline/custom/NativePipelineTypes.h @@ -61,7 +61,7 @@ public: bool activate(gfx::Swapchain * swapchain) override; bool destroy() noexcept override; - void render(const std::vector& cameras) override; + void render(const ccstd::vector& cameras) override; const MacroRecord &getMacros() const override; pipeline::GlobalDSManager *getGlobalDSManager() const override; diff --git a/native/cocos/renderer/pipeline/custom/RenderExampleGraphs.h b/native/cocos/renderer/pipeline/custom/RenderExampleGraphs.h index f926ad50dc..505c3cef78 100644 --- a/native/cocos/renderer/pipeline/custom/RenderExampleGraphs.h +++ b/native/cocos/renderer/pipeline/custom/RenderExampleGraphs.h @@ -179,7 +179,7 @@ inline void remove_edge(RenderDependencyGraph::out_edge_iterator iter, RenderDep template inline void remove_out_edge_if(RenderDependencyGraph::vertex_descriptor u, Predicate&& pred, RenderDependencyGraph& g) { // NOLINT - std::vector::iterator> garbage; + ccstd::vector::iterator> garbage; for (auto pair = out_edges(u, g); pair.first != pair.second; ++pair.first) { auto& outIter = pair.first; auto& outEnd = pair.second; @@ -202,7 +202,7 @@ inline void remove_out_edge_if(RenderDependencyGraph::vertex_descriptor u, Predi template inline void remove_in_edge_if(RenderDependencyGraph::vertex_descriptor v, Predicate&& pred, RenderDependencyGraph& g) { // NOLINT - std::vector::iterator> garbage; + ccstd::vector::iterator> garbage; for (auto pair = in_edges(v, g); pair.first != pair.second; ++pair.first) { auto& inIter = pair.first; auto& inEnd = pair.second; diff --git a/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h b/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h index 2b8f4f31c9..6494b1f737 100644 --- a/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h +++ b/native/cocos/renderer/pipeline/custom/RenderInterfaceTypes.h @@ -79,7 +79,7 @@ public: virtual bool activate(gfx::Swapchain * swapchain) = 0; virtual bool destroy() noexcept = 0; - virtual void render(const std::vector& cameras) = 0; + virtual void render(const ccstd::vector& cameras) = 0; virtual const MacroRecord &getMacros() const = 0; virtual pipeline::GlobalDSManager *getGlobalDSManager() const = 0; diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp index 5da2a6b76c..5885f0756e 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp @@ -103,7 +103,7 @@ bool DeferredPipeline::activate(gfx::Swapchain *swapchain) { return true; } -void DeferredPipeline::render(const vector &cameras) { +void DeferredPipeline::render(const ccstd::vector &cameras) { CC_PROFILE(DeferredPipelineRender); auto *device = gfx::Device::getInstance(); bool enableOcclusionQuery = isOcclusionQueryEnabled(); diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h index 592e3fc194..e6a197b9f9 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h @@ -47,7 +47,7 @@ public: bool initialize(const RenderPipelineInfo &info) override; bool destroy() override; bool activate(gfx::Swapchain *swapchain) override; - void render(const vector &cameras) override; + void render(const ccstd::vector &cameras) override; void onGlobalPipelineStateChanged() override; inline gfx::Buffer * getLightsUBO() const { return _lightsUBO; } diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h index 2fa5cd664e..d9686dc70e 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h @@ -53,9 +53,9 @@ public: inline scene::Pass * getLightPass() const { return _lightPass; } inline gfx::Shader * getBloomPrefilterPassShader() const { return _bloomPrefilterPassShader; } inline scene::Pass * getBloomPrefilterPass() const { return _bloomPrefilterPass; } - inline const std::vector &getBloomUpSamplePasses() const { return _bloomUpSamplePasses; } + inline const ccstd::vector &getBloomUpSamplePasses() const { return _bloomUpSamplePasses; } inline gfx::Shader * getBloomUpSamplePassShader() const { return _bloomUpSamplePassShader; } - inline const std::vector &getBloomDownSamplePasses() const { return _bloomDownSamplePasses; } + inline const ccstd::vector &getBloomDownSamplePasses() const { return _bloomDownSamplePasses; } inline gfx::Shader * getBloomDownSamplePassShader() const { return _bloomDownSamplePassShader; } inline scene::Pass * getBloomCombinePass() const { return _bloomCombinePass; } inline gfx::Shader * getBloomCombinePassShader() const { return _bloomCombinePassShader; } @@ -83,9 +83,9 @@ private: gfx::Shader * _bloomPrefilterPassShader{nullptr}; // weak reference scene::Pass * _bloomCombinePass{nullptr}; // weak reference gfx::Shader * _bloomCombinePassShader{nullptr}; // weak reference - std::vector _bloomUpSamplePasses; // weak reference + ccstd::vector _bloomUpSamplePasses; // weak reference gfx::Shader * _bloomUpSamplePassShader{nullptr}; // weak reference - std::vector _bloomDownSamplePasses; // weak reference + ccstd::vector _bloomDownSamplePasses; // weak reference gfx::Shader * _bloomDownSamplePassShader{nullptr}; // weak reference AntiAliasing _antiAliasing{AntiAliasing::NONE}; diff --git a/native/cocos/renderer/pipeline/deferred/LightingStage.cpp b/native/cocos/renderer/pipeline/deferred/LightingStage.cpp index 0023da2dbb..f731a57174 100644 --- a/native/cocos/renderer/pipeline/deferred/LightingStage.cpp +++ b/native/cocos/renderer/pipeline/deferred/LightingStage.cpp @@ -390,7 +390,7 @@ void LightingStage::fgLightingPass(scene::Camera *camera) { // no need to bind localSet in cluster if (!_pipeline->isClusterEnabled()) { - vector dynamicOffsets = {0}; + ccstd::vector dynamicOffsets = {0}; cmdBuff->bindDescriptorSet(localSet, _descriptorSet, dynamicOffsets); } @@ -500,7 +500,7 @@ void LightingStage::fgTransparent(scene::Camera *camera) { // no need to bind localSet in cluster if (!_pipeline->isClusterEnabled()) { - vector dynamicOffsets = {0}; + ccstd::vector dynamicOffsets = {0}; cmdBuff->bindDescriptorSet(localSet, _descriptorSet, dynamicOffsets); } diff --git a/native/cocos/renderer/pipeline/deferred/LightingStage.h b/native/cocos/renderer/pipeline/deferred/LightingStage.h index ab8fa193f1..71f6633f43 100644 --- a/native/cocos/renderer/pipeline/deferred/LightingStage.h +++ b/native/cocos/renderer/pipeline/deferred/LightingStage.h @@ -74,7 +74,7 @@ private: gfx::Buffer * _deferredLitsBufs{nullptr}; gfx::Buffer * _deferredLitsBufView{nullptr}; - std::vector _lightBufferData; + ccstd::vector _lightBufferData; uint _lightBufferStride{0}; uint _lightBufferElementCount{0}; bool _isTransparentQueueEmpty{true}; @@ -87,7 +87,7 @@ private: RenderQueue * _reflectionRenderQueue{nullptr}; uint _reflectionPhaseID{0}; - std::vector _reflectionElems; + ccstd::vector _reflectionElems; uint _denoiseIndex = 0; // use to get corrrect texture string handle gfx::Sampler *_defaultSampler{nullptr}; diff --git a/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp b/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp index 704c760fb0..de0ebf3b8f 100644 --- a/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp +++ b/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp @@ -89,7 +89,7 @@ bool ForwardPipeline::activate(gfx::Swapchain *swapchain) { return true; } -void ForwardPipeline::render(const vector &cameras) { +void ForwardPipeline::render(const ccstd::vector &cameras) { CC_PROFILE(ForwardPipelineRender); auto * device = gfx::Device::getInstance(); const bool enableOcclusionQuery = isOcclusionQueryEnabled(); diff --git a/native/cocos/renderer/pipeline/forward/ForwardPipeline.h b/native/cocos/renderer/pipeline/forward/ForwardPipeline.h index b8c6f06431..07645ea265 100644 --- a/native/cocos/renderer/pipeline/forward/ForwardPipeline.h +++ b/native/cocos/renderer/pipeline/forward/ForwardPipeline.h @@ -44,7 +44,7 @@ public: bool initialize(const RenderPipelineInfo &info) override; bool destroy() override; bool activate(gfx::Swapchain *swapchain) override; - void render(const vector &cameras) override; + void render(const ccstd::vector &cameras) override; inline gfx::Buffer * getLightsUBO() const { return _lightsUBO; } inline const LightList & getValidLights() const { return _validLights; } diff --git a/native/cocos/renderer/pipeline/helper/Utils.cpp b/native/cocos/renderer/pipeline/helper/Utils.cpp index dad4f243c3..e14b013d42 100644 --- a/native/cocos/renderer/pipeline/helper/Utils.cpp +++ b/native/cocos/renderer/pipeline/helper/Utils.cpp @@ -39,7 +39,7 @@ namespace pipeline { const scene::Camera *profilerCamera{nullptr}; -void decideProfilerCamera(const vector &cameras) { +void decideProfilerCamera(const ccstd::vector &cameras) { for (int i = static_cast(cameras.size() - 1); i >= 0; --i) { if (cameras[i]->getWindow()->getSwapchain()) { profilerCamera = cameras[i]; diff --git a/native/cocos/renderer/pipeline/helper/Utils.h b/native/cocos/renderer/pipeline/helper/Utils.h index 26b0cb2d26..e7f53c5d71 100644 --- a/native/cocos/renderer/pipeline/helper/Utils.h +++ b/native/cocos/renderer/pipeline/helper/Utils.h @@ -68,7 +68,7 @@ inline void linearToSrgb(gfx::Color *out, const gfx::Color &linear) { extern const scene::Camera *profilerCamera; -void decideProfilerCamera(const vector &cameras); +void decideProfilerCamera(const ccstd::vector &cameras); void renderProfiler(gfx::RenderPass *renderPass, gfx::CommandBuffer *cmdBuff, scene::Model *profiler, const scene::Camera *camera); } // namespace pipeline diff --git a/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp b/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp index a728fa06d7..23ebd1b545 100644 --- a/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp +++ b/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp @@ -125,7 +125,7 @@ void ShadowFlow::render(scene::Camera *camera) { void ShadowFlow::lightCollecting() { _validLights.clear(); - const vector validPunctualLights = _pipeline->getPipelineSceneData()->getValidPunctualLights(); + const ccstd::vector validPunctualLights = _pipeline->getPipelineSceneData()->getValidPunctualLights(); for (const scene::Light *light : validPunctualLights) { if (light->getType() == scene::LightType::SPOT) { _validLights.emplace_back(light); @@ -268,7 +268,7 @@ void ShadowFlow::initShadowFrameBuffer(RenderPipeline *pipeline, const scene::Li renderPassHashMap.insert({rpHash, _renderPass}); } - vector renderTargets; + ccstd::vector renderTargets; renderTargets.emplace_back(device->createTexture({ gfx::TextureType::TEX2D, gfx::TextureUsageBit::COLOR_ATTACHMENT | gfx::TextureUsageBit::SAMPLED, diff --git a/native/cocos/renderer/pipeline/shadow/ShadowFlow.h b/native/cocos/renderer/pipeline/shadow/ShadowFlow.h index d2e7b58fa6..450aaa68fb 100644 --- a/native/cocos/renderer/pipeline/shadow/ShadowFlow.h +++ b/native/cocos/renderer/pipeline/shadow/ShadowFlow.h @@ -60,8 +60,8 @@ private: gfx::RenderPass *_renderPass = nullptr; - vector _validLights; - vector _usedTextures; + ccstd::vector _validLights; + ccstd::vector _usedTextures; static std::unordered_map renderPassHashMap; }; diff --git a/native/cocos/scene/Camera.cpp b/native/cocos/scene/Camera.cpp index 8ac943e140..97d6458ab3 100644 --- a/native/cocos/scene/Camera.cpp +++ b/native/cocos/scene/Camera.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "scene/Camera.h" -#include #include "core/Root.h" #include "core/scene-graph/Node.h" #include "core/platform/Debug.h" @@ -55,10 +54,10 @@ constexpr std::array, 4> PRE_TRANSFORMS = {{ } // namespace -const std::vector Camera::FSTOPS{1.8F, 2.0F, 2.2F, 2.5F, 2.8F, 3.2F, 3.5F, 4.0F, 4.5F, 5.0F, 5.6F, 6.3F, 7.1F, 8.0F, 9.0F, 10.0F, 11.0F, 13.0F, 14.0F, 16.0F, 18.0F, 20.0F, 22.0F}; -const std::vector Camera::SHUTTERS{1.0F, 1.0F / 2.0F, 1.0F / 4.0F, 1.0F / 8.0F, 1.0F / 15.0F, 1.0F / 30.0F, 1.0F / 60.0F, 1.0F / 125.0F, +const ccstd::vector Camera::FSTOPS{1.8F, 2.0F, 2.2F, 2.5F, 2.8F, 3.2F, 3.5F, 4.0F, 4.5F, 5.0F, 5.6F, 6.3F, 7.1F, 8.0F, 9.0F, 10.0F, 11.0F, 13.0F, 14.0F, 16.0F, 18.0F, 20.0F, 22.0F}; +const ccstd::vector Camera::SHUTTERS{1.0F, 1.0F / 2.0F, 1.0F / 4.0F, 1.0F / 8.0F, 1.0F / 15.0F, 1.0F / 30.0F, 1.0F / 60.0F, 1.0F / 125.0F, 1.0F / 250.0F, 1.0F / 500.0F, 1.0F / 1000.0F, 1.0F / 2000.0F, 1.0F / 4000.0F}; -const std::vector Camera::ISOS{100.0F, 200.0F, 400.0F, 800.0F}; +const ccstd::vector Camera::ISOS{100.0F, 200.0F, 400.0F, 800.0F}; Camera::Camera(gfx::Device *device) : _device(device) { diff --git a/native/cocos/scene/Camera.h b/native/cocos/scene/Camera.h index f3a12595b0..31ded14d4b 100644 --- a/native/cocos/scene/Camera.h +++ b/native/cocos/scene/Camera.h @@ -355,9 +355,9 @@ private: gfx::ClearFlagBit _clearFlag{gfx::ClearFlagBit::NONE}; float _clearDepth{1.0F}; - static const std::vector FSTOPS; - static const std::vector SHUTTERS; - static const std::vector ISOS; + static const ccstd::vector FSTOPS; + static const ccstd::vector SHUTTERS; + static const ccstd::vector ISOS; uint32_t _visibility = pipeline::CAMERA_DEFAULT_MASK; float _exposure{0.F}; diff --git a/native/cocos/scene/Define.h b/native/cocos/scene/Define.h index 3916bf1fb2..f4aae45a29 100644 --- a/native/cocos/scene/Define.h +++ b/native/cocos/scene/Define.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "renderer/core/PassUtils.h" namespace cc { diff --git a/native/cocos/scene/DrawBatch2D.h b/native/cocos/scene/DrawBatch2D.h index 5411830546..10466f028f 100644 --- a/native/cocos/scene/DrawBatch2D.h +++ b/native/cocos/scene/DrawBatch2D.h @@ -25,7 +25,6 @@ #pragma once -#include #include "renderer/gfx-base/GFXDef-common.h" namespace cc { @@ -37,8 +36,8 @@ struct DrawBatch2D final { uint32_t visFlags{0}; gfx::DescriptorSet * descriptorSet{nullptr}; gfx::InputAssembler * inputAssembler{nullptr}; - std::vector passes; - std::vector shaders; + ccstd::vector passes; + ccstd::vector shaders; }; } // namespace scene diff --git a/native/cocos/scene/Model.cpp b/native/cocos/scene/Model.cpp index e94f0e06e3..4dd1f1a236 100644 --- a/native/cocos/scene/Model.cpp +++ b/native/cocos/scene/Model.cpp @@ -104,7 +104,7 @@ const cc::gfx::SamplerInfo LIGHTMAP_SAMPLER_WITH_MIP_HASH{ cc::gfx::Address::CLAMP, }; -const std::vector SHADOW_MAP_PATCHES{{"CC_RECEIVE_SHADOW", true}}; +const ccstd::vector SHADOW_MAP_PATCHES{{"CC_RECEIVE_SHADOW", true}}; const std::string INST_MAT_WORLD = "a_matWorld0"; } // namespace @@ -234,7 +234,7 @@ void Model::updateUBOs(uint32_t stamp) { Mat4 mat4; int idx = _instMatWorldIdx; if (idx >= 0) { - std::vector &attrs = getInstancedAttributeBlock()->views; + ccstd::vector &attrs = getInstancedAttributeBlock()->views; uploadMat4AsVec4x3(worldMatrix, cc::get(attrs[idx]), cc::get(attrs[idx + 1]), cc::get(attrs[idx + 2])); } else if (_localBuffer) { mat4ToFloat32Array(worldMatrix, _localData, pipeline::UBOLocal::MAT_WORLD_OFFSET); @@ -356,7 +356,7 @@ void Model::updateLightingmap(Texture2D *texture, const Vec4 &uvParam) { } } -std::vector &Model::getMacroPatches(index_t subModelIndex) { +ccstd::vector &Model::getMacroPatches(index_t subModelIndex) { if (isModelImplementedInJS()) { if (!_isCalledFromJS) { _eventProcessor.emit(EventTypesToJS::MODEL_GET_MACRO_PATCHES, subModelIndex, &_macroPatches); @@ -399,7 +399,7 @@ index_t Model::getInstancedAttributeIndex(const std::string &name) const { return CC_INVALID_INDEX; } -void Model::updateInstancedAttributes(const std::vector &attributes, Pass *pass) { +void Model::updateInstancedAttributes(const ccstd::vector &attributes, Pass *pass) { if (isModelImplementedInJS()) { if (!_isCalledFromJS) { _eventProcessor.emit(EventTypesToJS::MODEL_UPDATE_INSTANCED_ATTRIBUTES, attributes, pass); diff --git a/native/cocos/scene/Model.h b/native/cocos/scene/Model.h index eafaa07fcd..587626f7f0 100644 --- a/native/cocos/scene/Model.h +++ b/native/cocos/scene/Model.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "base/Ptr.h" #include "base/RefCounted.h" #include "core/TypedArray.h" @@ -58,8 +57,8 @@ class Pass; struct IMacroPatch; struct InstancedAttributeBlock { Uint8Array buffer; - std::vector views; - std::vector attributes; + ccstd::vector views; + ccstd::vector attributes; }; class Model : public RefCounted { @@ -91,8 +90,8 @@ public: void onMacroPatchesStateChanged(); void onGeometryChanged(); void updateLightingmap(Texture2D *texture, const Vec4 &uvParam); - virtual std::vector &getMacroPatches(index_t subModelIndex); - virtual void updateInstancedAttributes(const std::vector &attributes, Pass *pass); + virtual ccstd::vector &getMacroPatches(index_t subModelIndex); + virtual void updateInstancedAttributes(const ccstd::vector &attributes, Pass *pass); virtual void updateTransform(uint32_t stamp); virtual void updateUBOs(uint32_t stamp); @@ -138,7 +137,7 @@ public: inline bool isEnabled() const { return _enabled; } inline bool isInstancingEnabled() const { return _instMatWorldIdx >= 0; }; inline int32_t getInstMatWorldIdx() const { return _instMatWorldIdx; } - inline const std::vector & getInstanceAttributes() const { return _instanceAttributeBlock.attributes; } + inline const ccstd::vector & getInstanceAttributes() const { return _instanceAttributeBlock.attributes; } inline InstancedAttributeBlock * getInstancedAttributeBlock() { return &_instanceAttributeBlock; } inline const uint8_t * getInstancedBuffer() const { return _instanceAttributeBlock.buffer.buffer()->getData(); } inline uint32_t getInstancedBufferSize() const { return _instanceAttributeBlock.buffer.length(); } @@ -148,7 +147,7 @@ public: inline geometry::AABB * getModelBounds() const { return _modelBounds; } inline Node * getNode() const { return _node.get(); } inline bool isReceiveShadow() const { return _receiveShadow; } - inline const std::vector> &getSubModels() const { return _subModels; } + inline const ccstd::vector> &getSubModels() const { return _subModels; } inline Node * getTransform() const { return _transform.get(); } inline bool isLocalDataUpdated() const { return _localDataUpdated; } inline uint32_t getUpdateStamp() const { return _updateStamp; } @@ -214,12 +213,12 @@ protected: IntrusivePtr _localBuffer; IntrusivePtr _worldBoundBuffer; InstancedAttributeBlock _instanceAttributeBlock{}; - std::vector> _subModels; + ccstd::vector> _subModels; IntrusivePtr _lightmap; Vec4 _lightmapUVParam; - std::vector _macroPatches; + ccstd::vector _macroPatches; // For JS CallbacksInvoker _eventProcessor; diff --git a/native/cocos/scene/Octree.cpp b/native/cocos/scene/Octree.cpp index cb7b9677d2..7d50c81be8 100644 --- a/native/cocos/scene/Octree.cpp +++ b/native/cocos/scene/Octree.cpp @@ -210,7 +210,7 @@ void OctreeNode::onRemoved() { // NOLINT(misc-no-recursion) } } -void OctreeNode::gatherModels(std::vector &results) const { // NOLINT(misc-no-recursion) +void OctreeNode::gatherModels(ccstd::vector &results) const { // NOLINT(misc-no-recursion) for (auto *model : _models) { results.push_back(model); } @@ -222,7 +222,7 @@ void OctreeNode::gatherModels(std::vector &results) const { // NOLINT(m } } -void OctreeNode::doQueryVisibility(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const { +void OctreeNode::doQueryVisibility(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const { const auto visibility = camera->getVisibility(); for (auto *model : _models) { if (!model->isEnabled()) { @@ -250,18 +250,18 @@ void OctreeNode::doQueryVisibility(const Camera *camera, const geometry::Frustum } } -void OctreeNode::queryVisibilityParallelly(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const { +void OctreeNode::queryVisibilityParallelly(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const { geometry::AABB box; geometry::AABB::fromPoints(_aabb.min, _aabb.max, &box); if (!box.aabbFrustum(frustum)) { return; } - std::array>, OCTREE_CHILDREN_NUM> futures{}; + std::array>, OCTREE_CHILDREN_NUM> futures{}; for (auto i = 0; i < OCTREE_CHILDREN_NUM; i++) { if (_children[i]) { futures[i] = std::async(std::launch::async, [=, &frustum] { - std::vector models; + ccstd::vector models; _children[i]->queryVisibilitySequentially(camera, frustum, isShadow, models); return models; }); @@ -278,7 +278,7 @@ void OctreeNode::queryVisibilityParallelly(const Camera *camera, const geometry: } } -void OctreeNode::queryVisibilitySequentially(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const { // NOLINT(misc-no-recursion) +void OctreeNode::queryVisibilitySequentially(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const { // NOLINT(misc-no-recursion) geometry::AABB box; geometry::AABB::fromPoints(_aabb.min, _aabb.max, &box); if (!box.aabbFrustum(frustum)) { @@ -343,7 +343,7 @@ void Octree::resize(const Vec3 &minPos, const Vec3 &maxPos, uint32_t maxDepth) { return; } - std::vector models; + ccstd::vector models; _root->gatherModels(models); delete _root; @@ -395,7 +395,7 @@ void Octree::update(Model *model) { insert(model); } -void Octree::queryVisibility(Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const { +void Octree::queryVisibility(Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const { if (_totalCount > USE_MULTI_THRESHOLD) { _root->queryVisibilityParallelly(camera, frustum, isShadow, results); } else { diff --git a/native/cocos/scene/Octree.h b/native/cocos/scene/Octree.h index 9f8813e2ae..03a5bc62ad 100644 --- a/native/cocos/scene/Octree.h +++ b/native/cocos/scene/Octree.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "base/Macros.h" #include "base/RefCounted.h" #include "core/geometry/AABB.h" @@ -145,15 +144,15 @@ private: void add(Model *model); void remove(Model *model); void onRemoved(); - void gatherModels(std::vector &results) const; - void doQueryVisibility(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const; - void queryVisibilityParallelly(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const; - void queryVisibilitySequentially(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const; + void gatherModels(ccstd::vector &results) const; + void doQueryVisibility(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const; + void queryVisibilityParallelly(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const; + void queryVisibilitySequentially(const Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const; Octree * _owner{nullptr}; OctreeNode * _parent{nullptr}; std::array _children{}; - std::vector _models; + ccstd::vector _models; BBox _aabb{}; uint32_t _depth{0}; uint32_t _index{0}; @@ -213,7 +212,7 @@ public: inline uint32_t getMaxDepth() const { return _maxDepth; } // view frustum culling - void queryVisibility(Camera *camera, const geometry::Frustum &frustum, bool isShadow, std::vector &results) const; + void queryVisibility(Camera *camera, const geometry::Frustum &frustum, bool isShadow, ccstd::vector &results) const; private: bool isInside(Model *model) const; diff --git a/native/cocos/scene/Pass.cpp b/native/cocos/scene/Pass.cpp index b04c17382c..ca51d05b23 100644 --- a/native/cocos/scene/Pass.cpp +++ b/native/cocos/scene/Pass.cpp @@ -303,8 +303,8 @@ void Pass::resetUniform(const std::string &name) { if (givenDefaultOpt.has_value()) { const auto &value = givenDefaultOpt.value(); - if (cc::holds_alternative>(value)) { - const auto &floatArr = cc::get>(value); + if (cc::holds_alternative>(value)) { + const auto &floatArr = cc::get>(value); auto iter = type2writer.find(type); if (iter != type2writer.end()) { iter->second(block.data, floatArr.data(), static_cast(ofs)); @@ -364,7 +364,7 @@ void Pass::resetUBOs() { const auto & block = _blocks[u.binding]; const auto & info = _properties[cur.name]; const auto & givenDefault = info.value; - const auto & value = (givenDefault.has_value() ? cc::get>(givenDefault.value()) : getDefaultFloatArrayFromType(cur.type)); + const auto & value = (givenDefault.has_value() ? cc::get>(givenDefault.value()) : getDefaultFloatArrayFromType(cur.type)); const uint32_t size = (gfx::getTypeSize(cur.type) >> 2) * cur.count; for (size_t k = 0; (k + value.size()) <= size; k += value.size()) { std::copy(value.begin(), value.end(), block.data + ofs + k); @@ -404,7 +404,7 @@ gfx::Shader *Pass::getShaderVariant() { return getShaderVariant({}); } -gfx::Shader *Pass::getShaderVariant(const std::vector &patches) { +gfx::Shader *Pass::getShaderVariant(const ccstd::vector &patches) { if (!_shader && !tryCompile()) { CC_LOG_WARNING("pass resources incomplete"); return nullptr; @@ -511,11 +511,11 @@ void Pass::doInit(const IPassInfoFull &info, bool /*copyDefines*/ /* = false */) // calculate total size required const auto & blocks = _shaderInfo->blocks; const auto * tmplInfo = programLib->getTemplateInfo(info.program); - const std::vector &blockSizes = tmplInfo->blockSizes; + const ccstd::vector &blockSizes = tmplInfo->blockSizes; const auto & handleMap = tmplInfo->handleMap; const auto alignment = device->getCapabilities().uboOffsetAlignment; - std::vector startOffsets; + ccstd::vector startOffsets; startOffsets.reserve(blocks.size()); uint32_t lastSize = 0; uint32_t lastOffset = 0; diff --git a/native/cocos/scene/Pass.h b/native/cocos/scene/Pass.h index df333781be..18a6df8331 100644 --- a/native/cocos/scene/Pass.h +++ b/native/cocos/scene/Pass.h @@ -27,7 +27,6 @@ #include #include -#include #include "base/Ptr.h" #include "base/RefCounted.h" #include "base/TypeDef.h" @@ -257,7 +256,7 @@ public: * @param patches The macro patches */ gfx::Shader *getShaderVariant(); - gfx::Shader *getShaderVariant(const std::vector &patches); + gfx::Shader *getShaderVariant(const ccstd::vector &patches); IPassInfoFull getPassInfoFull() const; @@ -274,7 +273,7 @@ public: inline index_t getPropertyIndex() const { return _propertyIndex; } // data inline const IPassDynamics & getDynamics() const { return _dynamics; } - inline const std::vector &getBlocks() const { return _blocks; } + inline const ccstd::vector &getBlocks() const { return _blocks; } inline ArrayBuffer * getRootBlock() { return _rootBlock; } inline bool isRootBufferDirty() const { return _rootBufferDirty; } //NOTE: _setRootBufferDirty must contain a _ prefix to make bindings-generator work correctly. @@ -314,7 +313,7 @@ protected: // internal resources IntrusivePtr _rootBuffer; - std::vector> _buffers; + ccstd::vector> _buffers; IntrusivePtr _descriptorSet; IntrusivePtr _pipelineLayout; // internal data @@ -324,7 +323,7 @@ protected: IPassDynamics _dynamics; Record _propertyHandleMap; IntrusivePtr _rootBlock; - std::vector _blocks; // Point to position in _rootBlock + ccstd::vector _blocks; // Point to position in _rootBlock IProgramInfo * _shaderInfo; // weakref to template of ProgramLib MacroRecord _defines; diff --git a/native/cocos/scene/RenderScene.h b/native/cocos/scene/RenderScene.h index 0de3fba754..47f9c0126c 100644 --- a/native/cocos/scene/RenderScene.h +++ b/native/cocos/scene/RenderScene.h @@ -26,7 +26,7 @@ #pragma once #include -#include +#include "base/std/container/vector.h" #include "base/Macros.h" #include "base/Ptr.h" #include "base/RefCounted.h" @@ -100,26 +100,26 @@ public: inline uint64_t generateModelId() { return _modelId++; } inline const std::string & getName() const { return _name; } - inline const std::vector> & getCameras() const { return _cameras; } - inline const std::vector> &getSphereLights() const { return _sphereLights; } - inline const std::vector> & getSpotLights() const { return _spotLights; } - inline const std::vector> & getModels() const { return _models; } + inline const ccstd::vector> & getCameras() const { return _cameras; } + inline const ccstd::vector> &getSphereLights() const { return _sphereLights; } + inline const ccstd::vector> & getSpotLights() const { return _spotLights; } + inline const ccstd::vector> & getModels() const { return _models; } inline Octree * getOctree() const { return _octree; } void updateOctree(Model *model); // FIXME: remove getDrawBatch2Ds - inline const std::vector &getBatches() const { return _batches; } - inline const std::vector &getDrawBatch2Ds() const { return _batches; } + inline const ccstd::vector &getBatches() const { return _batches; } + inline const ccstd::vector &getDrawBatch2Ds() const { return _batches; } private: std::string _name; uint64_t _modelId{0}; IntrusivePtr _mainLight; - std::vector> _models; - std::vector> _cameras; - std::vector> _directionalLights; - std::vector> _sphereLights; - std::vector> _spotLights; - std::vector _batches; + ccstd::vector> _models; + ccstd::vector> _cameras; + ccstd::vector> _directionalLights; + ccstd::vector> _sphereLights; + ccstd::vector> _spotLights; + ccstd::vector _batches; Octree * _octree{nullptr}; CC_DISALLOW_COPY_MOVE_ASSIGN(RenderScene); diff --git a/native/cocos/scene/RenderWindow.cpp b/native/cocos/scene/RenderWindow.cpp index d24182b0bd..aba6fbb790 100644 --- a/native/cocos/scene/RenderWindow.cpp +++ b/native/cocos/scene/RenderWindow.cpp @@ -136,7 +136,7 @@ void RenderWindow::resize(uint32_t width, uint32_t height) { } } -void RenderWindow::extractRenderCameras(std::vector &cameras) { +void RenderWindow::extractRenderCameras(ccstd::vector &cameras) { for (Camera *camera : _cameras) { if (camera->isEnabled()) { camera->update(); diff --git a/native/cocos/scene/RenderWindow.h b/native/cocos/scene/RenderWindow.h index f80e2c584e..2cd0fc37b2 100644 --- a/native/cocos/scene/RenderWindow.h +++ b/native/cocos/scene/RenderWindow.h @@ -62,7 +62,7 @@ public: */ void resize(uint32_t width, uint32_t height); - void extractRenderCameras(std::vector &cameras); + void extractRenderCameras(ccstd::vector &cameras); /** * @zh @@ -114,7 +114,7 @@ public: */ inline gfx::Framebuffer *getFramebuffer() const { return _frameBuffer.get(); } - inline const std::vector> &getCameras() const { return _cameras; } + inline const ccstd::vector> &getCameras() const { return _cameras; } private: uint32_t _width{1}; @@ -124,7 +124,7 @@ private: IntrusivePtr _renderPass; IntrusivePtr _depthStencilTexture; IntrusivePtr _frameBuffer; - std::vector> _cameras; + ccstd::vector> _cameras; RefVector _colorTextures; CC_DISALLOW_COPY_MOVE_ASSIGN(RenderWindow); diff --git a/native/cocos/scene/Shadow.cpp b/native/cocos/scene/Shadow.cpp index f886bf3b26..570f9f8cac 100644 --- a/native/cocos/scene/Shadow.cpp +++ b/native/cocos/scene/Shadow.cpp @@ -130,7 +130,7 @@ void Shadows::destroy() { } } -gfx::Shader *Shadows::getPlanarShader(const std::vector &patches) { +gfx::Shader *Shadows::getPlanarShader(const ccstd::vector &patches) { if (!_material) { createMaterial(); } @@ -139,7 +139,7 @@ gfx::Shader *Shadows::getPlanarShader(const std::vector &patches) { return passes[0]->getShaderVariant(patches); } -gfx::Shader *Shadows::getPlanarInstanceShader(const std::vector &patches) { +gfx::Shader *Shadows::getPlanarInstanceShader(const ccstd::vector &patches) { if (!_instancingMaterial) { createInstanceMaterial(); } diff --git a/native/cocos/scene/Shadow.h b/native/cocos/scene/Shadow.h index 6e0e4bd9b4..50a939e229 100644 --- a/native/cocos/scene/Shadow.h +++ b/native/cocos/scene/Shadow.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "core/assets/Material.h" #include "core/geometry/Sphere.h" #include "math/Color.h" @@ -239,8 +238,8 @@ public: void initialize(const ShadowsInfo &shadowsInfo); void destroy(); - gfx::Shader *getPlanarShader(const std::vector &patches); - gfx::Shader *getPlanarInstanceShader(const std::vector &patches); + gfx::Shader *getPlanarShader(const ccstd::vector &patches); + gfx::Shader *getPlanarInstanceShader(const ccstd::vector &patches); void activate(); /** diff --git a/native/cocos/scene/SubModel.cpp b/native/cocos/scene/SubModel.cpp index 727b82a34a..dc7e452c5f 100644 --- a/native/cocos/scene/SubModel.cpp +++ b/native/cocos/scene/SubModel.cpp @@ -53,7 +53,7 @@ void SubModel::update() { _worldBoundDescriptorSet->update(); } -void SubModel::setPasses(const std::shared_ptr>> &pPasses) { +void SubModel::setPasses(const std::shared_ptr>> &pPasses) { if (!pPasses || pPasses->size() > MAX_PASS_COUNT) { debug::errorID(12004, MAX_PASS_COUNT); return; @@ -91,7 +91,7 @@ Pass *SubModel::getPass(uint index) const { return passes[index]; } -void SubModel::initialize(RenderingSubMesh *subMesh, const std::shared_ptr>> &pPasses, const std::vector &patches) { +void SubModel::initialize(RenderingSubMesh *subMesh, const std::shared_ptr>> &pPasses, const ccstd::vector &patches) { _device = Root::getInstance()->getDevice(); if (!pPasses->empty()) { dsInfo.layout = (*pPasses)[0]->getLocalSetLayout(); @@ -205,7 +205,7 @@ void SubModel::onPipelineStateChanged() { flushPassInfo(); } -void SubModel::onMacroPatchesStateChanged(const std::vector &patches) { +void SubModel::onMacroPatchesStateChanged(const ccstd::vector &patches) { _patches = patches; const auto &passes = *_passes; if (passes.empty()) return; diff --git a/native/cocos/scene/SubModel.h b/native/cocos/scene/SubModel.h index 6b88defe1f..d2ca738dc3 100644 --- a/native/cocos/scene/SubModel.h +++ b/native/cocos/scene/SubModel.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include "base/RefCounted.h" #include "core/assets/RenderingSubMesh.h" #include "renderer/gfx-base/GFXDescriptorSet.h" @@ -51,8 +50,8 @@ public: inline void setWorldBoundDescriptorSet(gfx::DescriptorSet *descriptorSet) { _worldBoundDescriptorSet = descriptorSet; } inline void setDescriptorSet(gfx::DescriptorSet *descriptorSet) { _descriptorSet = descriptorSet; } inline void setInputAssembler(gfx::InputAssembler *ia) { _inputAssembler = ia; } - inline void setShaders(const std::vector> &shaders) { _shaders = shaders; } - void setPasses(const std::shared_ptr>> &passes); + inline void setShaders(const ccstd::vector> &shaders) { _shaders = shaders; } + void setPasses(const std::shared_ptr>> &passes); inline void setPlanarInstanceShader(gfx::Shader *shader) { _planarInstanceShader = shader; } inline void setPlanarShader(gfx::Shader *shader) { _planarShader = shader; } inline void setPriority(pipeline::RenderPriority priority) { _priority = priority; } @@ -62,9 +61,9 @@ public: inline gfx::DescriptorSet * getDescriptorSet() const { return _descriptorSet; } inline gfx::DescriptorSet * getWorldBoundDescriptorSet() const { return _worldBoundDescriptorSet; } inline gfx::InputAssembler * getInputAssembler() const { return _inputAssembler; } - inline const std::vector> &getShaders() const { return _shaders; } - inline const std::vector> & getPasses() const { return *_passes; } - inline const std::vector & getPatches() const { return _patches; } + inline const ccstd::vector> &getShaders() const { return _shaders; } + inline const ccstd::vector> & getPasses() const { return *_passes; } + inline const ccstd::vector & getPatches() const { return _patches; } inline gfx::Shader * getPlanarInstanceShader() const { return _planarInstanceShader; } inline gfx::Shader * getPlanarShader() const { return _planarShader; } inline pipeline::RenderPriority getPriority() const { return _priority; } @@ -72,19 +71,19 @@ public: inline Model * getOwner() const { return _owner; } inline uint32_t getId() const { return _id; } - void initialize(RenderingSubMesh *subMesh, const std::shared_ptr>> &passes, const std::vector &patches); + void initialize(RenderingSubMesh *subMesh, const std::shared_ptr>> &passes, const ccstd::vector &patches); void initPlanarShadowShader(); void initPlanarShadowInstanceShader(); void destroy(); void onPipelineStateChanged(); - void onMacroPatchesStateChanged(const std::vector &patches); + void onMacroPatchesStateChanged(const ccstd::vector &patches); void onGeometryChanged(); protected: void flushPassInfo(); gfx::Device * _device{nullptr}; - std::vector _patches; + ccstd::vector _patches; IntrusivePtr _inputAssembler; IntrusivePtr _descriptorSet; IntrusivePtr _worldBoundDescriptorSet; @@ -95,8 +94,8 @@ protected: IntrusivePtr _planarShader; IntrusivePtr _planarInstanceShader; IntrusivePtr _subMesh; - std::shared_ptr>> _passes; - std::vector> _shaders; + std::shared_ptr>> _passes; + ccstd::vector> _shaders; Model * _owner{nullptr}; int32_t _id{-1}; diff --git a/native/external-config.json b/native/external-config.json index 463c6738ee..c0a427cd26 100644 --- a/native/external-config.json +++ b/native/external-config.json @@ -1,9 +1,9 @@ { - "version": "v3d-gfx-101", + "version": "v3d-gfx-102", "from": { "type": "github", "owner": "cocos-creator", "name": "engine-native-external", - "checkout": "v3d-gfx-101" + "checkout": "v3d-gfx-102" } }