List模板改名为ArrayList

This commit is contained in:
hyzboy 2025-04-23 00:27:43 +08:00
parent 10d0c2c473
commit aed57437f9
36 changed files with 66 additions and 63 deletions

2
CMCore

@ -1 +1 @@
Subproject commit d09fe4326ea3629434adcd034a99ebbdb8fa6c22
Subproject commit a7b0cb6112c1dfad65523e619d88917398ca7c9a

@ -1 +1 @@
Subproject commit 67e8e956658cb9abbb94cd01f0a465e8275b44dd
Subproject commit 0948b3a6257fdcc1e33eeb61bf42d0e93b32d326

@ -1 +1 @@
Subproject commit f74d7045fa0d143b94103e49093fe18a1d5a884c
Subproject commit e3680c477d25d2b4d93ff4da2d84725524f047b2

View File

@ -10,7 +10,7 @@
set_property(TARGET ${name} PROPERTY FOLDER "ULRE/Example/Basic")
endmacro()
CreateProject(00_RenderFrameworkTest rf_test.cpp)
CreateProject(00_RenderFrameworkTest rf_test.cpp AssetData.h)
CreateProject(01_draw_triangle_in_NDC draw_triangle_in_NDC.cpp)
CreateProject(02_draw_triangle_use_UBO draw_triangle_use_UBO.cpp)
CreateProject(03_auto_instance auto_instance.cpp)

View File

@ -3,6 +3,7 @@
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/mtl/Material2DCreateConfig.h>
#include<hgl/graph/VKMaterialInstance.h>
#include"AssetData.h"
using namespace hgl;
using namespace hgl::graph;

View File

@ -109,12 +109,12 @@ public:
ComponentSet & GetComponents(){return component_set;}
int GetComponents(List<Component *> &comp_list,SceneNode *);
int GetComponents(ArrayList<Component *> &comp_list,SceneNode *);
virtual void UpdateComponents(const double delta_time);
virtual void JoinComponent(Component *c){if(!c)return;component_set.Add(c);}
virtual void UnjonComponent(Component *c){if(!c)return;component_set.Delete(c);}
virtual void AttachComponent(Component *c){if(!c)return;component_set.Add(c);}
virtual void DetachComponent(Component *c){if(!c)return;component_set.Delete(c);}
public: //事件

View File

@ -29,8 +29,8 @@ namespace hgl
const int compare(const RenderNode &)const override;
};
using RenderNodeList=List<RenderNode>;
using RenderNodePointerList=List<RenderNode *>;
using RenderNodeList=ArrayList<RenderNode>;
using RenderNodePointerList=ArrayList<RenderNode *>;
using MaterialInstanceSets=SortedSet<MaterialInstance *>; ///<材质实例集合
}//namespace graph

View File

@ -119,7 +119,7 @@ namespace hgl
bool Contains (Component *comp) {return ComponentList.Contains(comp);} ///<是否包含指定组件
bool HasComponent (const ComponentManager *); ///<是否有指定组件管理器的组件
virtual int GetComponents (List<Component *> &comp_list,const ComponentManager *); ///<取得所有组件
virtual int GetComponents (ArrayList<Component *> &comp_list,const ComponentManager *); ///<取得所有组件
};//class SceneNode

View File

@ -37,7 +37,7 @@ namespace hgl
DeviceBuffer *tile_buffer; ///<Tile暂存缓冲区
List<Image2DRegion> commit_list;
ArrayList<Image2DRegion> commit_list;
uint8 *commit_ptr;
bool CommitTile(TileObject *,const void *,const uint,const int,const int); ///<提交一个Tile数据

View File

@ -18,7 +18,7 @@ class DescriptorSet
ObjectList<VkDescriptorBufferInfo> vab_list;
ObjectList<VkDescriptorImageInfo> image_list;
List<VkWriteDescriptorSet> wds_list;
ArrayList<VkWriteDescriptorSet> wds_list;
SortedSet<uint32_t> binded_sets;

View File

@ -34,7 +34,7 @@ struct GPUDeviceAttribute
VkQueue present_queue =VK_NULL_HANDLE;
VkSurfaceFormatKHR surface_format;
List<VkPresentModeKHR> present_modes;
ArrayList<VkPresentModeKHR> present_modes;
VkSurfaceTransformFlagBitsKHR preTransform;
VkCompositeAlphaFlagBitsKHR compositeAlpha =VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;

View File

@ -101,8 +101,8 @@ VK_NAMESPACE_BEGIN
};//class VulkanInstance
void InitVulkanInstanceProperties();
const List<VkLayerProperties> & GetInstanceLayerProperties();
const List<VkExtensionProperties> & GetInstanceExtensionProperties();
const ArrayList<VkLayerProperties> & GetInstanceLayerProperties();
const ArrayList<VkExtensionProperties> & GetInstanceExtensionProperties();
const bool CheckInstanceLayerSupport(const AnsiString &);
const bool GetInstanceLayerVersion(const AnsiString &,uint32_t &spec,uint32_t &impl);
const bool CheckInstanceExtensionSupport(const AnsiString &);

View File

@ -11,8 +11,10 @@ namespace hgl
{
class ActiveMemoryBlockManager;
}
VK_NAMESPACE_BEGIN
using ShaderStageCreateInfoList=List<VkPipelineShaderStageCreateInfo>;
using ShaderStageCreateInfoList=ArrayList<VkPipelineShaderStageCreateInfo>;
/**
* <br>

View File

@ -23,9 +23,9 @@ class GPUPhysicalDevice
VkPhysicalDeviceVulkan14Properties properties14;
VkPhysicalDeviceMemoryProperties memory_properties;
List<VkLayerProperties> layer_properties;
List<VkExtensionProperties> extension_properties;
List<VkQueueFamilyProperties> queue_family_properties;
ArrayList<VkLayerProperties> layer_properties;
ArrayList<VkExtensionProperties> extension_properties;
ArrayList<VkQueueFamilyProperties> queue_family_properties;
private:

View File

@ -16,7 +16,7 @@ class RenderPass
VkPipelineCache pipeline_cache;
VkRenderPass render_pass;
List<VkFormat> color_formats;
ArrayList<VkFormat> color_formats;
VkFormat depth_format;
VkExtent2D granularity;
@ -31,7 +31,7 @@ private:
friend class RenderPassManager;
RenderPass(VkDevice d,VkPipelineCache pc,VkRenderPass rp,const List<VkFormat> &cf,VkFormat df);
RenderPass(VkDevice d,VkPipelineCache pc,VkRenderPass rp,const ArrayList<VkFormat> &cf,VkFormat df);
public:
@ -43,7 +43,7 @@ public:
const VkPipelineCache GetPipelineCache()const{return pipeline_cache;}
const uint GetColorCount()const{return color_formats.GetCount();}
const List<VkFormat> & GetColorFormat()const{return color_formats;}
const ArrayList<VkFormat> & GetColorFormat()const{return color_formats;}
const VkFormat GetColorFormat(int index)const
{
if(index<0||index>=color_formats.GetCount())return VK_FORMAT_UNDEFINED;

View File

@ -38,7 +38,7 @@ namespace hgl
virtual ~TileFont();
bool Registry(TileUVFloatMap &,SortedSet<u32char> &chars_sets); ///<注册要使用的字符
void Unregistry(const List<u32char> &); ///<注销要使用的字符
void Unregistry(const ArrayList<u32char> &); ///<注销要使用的字符
};//class TileFont
}//namespace graph
}//namespace hgl

View File

@ -11,7 +11,7 @@ class GraphModuleManager
protected:
List<GraphModule *> module_list;
ArrayList<GraphModule *> module_list;
Map<size_t,GraphModule *> module_map;
public:

View File

@ -28,9 +28,9 @@ private:
private:
RenderPass * CreateRenderPass( const List<VkAttachmentDescription> &desc_list,
const List<VkSubpassDescription> &subpass,
const List<VkSubpassDependency> &dependency,
RenderPass * CreateRenderPass( const ArrayList<VkAttachmentDescription> &desc_list,
const ArrayList<VkSubpassDescription> &subpass,
const ArrayList<VkSubpassDependency> &dependency,
const RenderbufferInfo *);
public:

View File

@ -20,7 +20,7 @@ public:
public: //FrameBuffer相关
Framebuffer *CreateFBO(RenderPass *rp,ImageView **color_list,const uint image_count,ImageView *depth);
// Framebuffer *CreateFBO(RenderPass *,List<ImageView *> &color,ImageView *depth);
// Framebuffer *CreateFBO(RenderPass *,ArrayList<ImageView *> &color,ImageView *depth);
Framebuffer *CreateFBO(RenderPass *,ImageView *color,ImageView *depth);
Framebuffer *CreateFBO(RenderPass *,ImageView *);

View File

@ -91,11 +91,11 @@ public: //Create/Chagne
void Clear(TextureCreateInfo *);
bool ChangeTexture2D(Texture2D *,DeviceBuffer *buf, const List<Image2DRegion> &,VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
bool ChangeTexture2D(Texture2D *,DeviceBuffer *buf, const ArrayList<Image2DRegion> &,VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
bool ChangeTexture2D(Texture2D *,DeviceBuffer *buf, const RectScope2ui &, VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
bool ChangeTexture2D(Texture2D *,const void *data,const VkDeviceSize size, const RectScope2ui &, VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
// bool ChangeTexture2DArray(Texture2DArray *,DeviceBuffer *buf, const List<Image2DRegion> &, const uint32_t base_layer,const uint32_t layer_count,VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
// bool ChangeTexture2DArray(Texture2DArray *,DeviceBuffer *buf, const ArrayList<Image2DRegion> &, const uint32_t base_layer,const uint32_t layer_count,VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
bool ChangeTexture2DArray(Texture2DArray *,DeviceBuffer *buf, const RectScope2ui &, const uint32_t base_layer,const uint32_t layer_count,VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
bool ChangeTexture2DArray(Texture2DArray *,const void *data,const VkDeviceSize size,const RectScope2ui &, const uint32_t base_layer,const uint32_t layer_count,VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);

View File

@ -274,7 +274,7 @@ struct ShaderVariable
Interpolation interpolation; //插值方式
};
using SVList=List<ShaderVariable>;
using SVList=ArrayList<ShaderVariable>;
struct ShaderVariableArray:public Comparator<ShaderVariableArray>
{

View File

@ -37,7 +37,7 @@ protected:
AnsiString mi_codes;
List<const char *> function_list;
ArrayList<const char *> function_list;
AnsiString main_function;
AnsiString final_shader;

View File

@ -9,8 +9,8 @@
namespace hgl{namespace graph
{
using UBODescriptorList=List<const UBODescriptor *>;
using SamplerDescriptorList=List<const SamplerDescriptor *>;
using UBODescriptorList=ArrayList<const UBODescriptor *>;
using SamplerDescriptorList=ArrayList<const SamplerDescriptor *>;
using ConstValueDescriptorList=ObjectList<ConstValueDescriptor>;
using SubpassInputDescriptorList=ObjectList<SubpassInputDescriptor>;

View File

@ -11,7 +11,7 @@ inline void debug_out_vk_version(const uint32_t version)
<<VK_VERSION_PATCH(version);
}
inline void debug_out(const char *front,const hgl::List<VkLayerProperties> &layer_properties)
inline void debug_out(const char *front,const hgl::ArrayList<VkLayerProperties> &layer_properties)
{
const int property_count=layer_properties.GetCount();
@ -32,7 +32,7 @@ inline void debug_out(const char *front,const hgl::List<VkLayerProperties> &laye
}
}
inline void debug_out(const char *front,const hgl::List<VkExtensionProperties> &extension_properties)
inline void debug_out(const char *front,const hgl::ArrayList<VkExtensionProperties> &extension_properties)
{
const int extension_count=extension_properties.GetCount();

View File

@ -160,7 +160,7 @@ bool TextureManager::CommitTexture2DMipmaps(Texture2D *tex,DeviceBuffer *buf,con
return CopyBufferToImage2D(tex,buf,buffer_image_copy,miplevel,VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
}
bool TextureManager::ChangeTexture2D(Texture2D *tex,DeviceBuffer *buf,const List<Image2DRegion> &ir_list,VkPipelineStageFlags destinationStage)
bool TextureManager::ChangeTexture2D(Texture2D *tex,DeviceBuffer *buf,const ArrayList<Image2DRegion> &ir_list,VkPipelineStageFlags destinationStage)
{
if(!tex||!buf||ir_list.GetCount()<=0)
return(false);

View File

@ -169,7 +169,7 @@ Texture2DArray *TextureManager::CreateTexture2DArray(const uint32_t w,const uint
// return CopyBufferToImageArray(tex,buf,buffer_image_copy,miplevel,VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
//}
//
//bool GPUDevice::ChangeTexture2DArray(Texture2DArray *tex,DeviceBuffer *buf,const List<Image2DRegion> &ir_list,const uint32_t base_layer,const uint32_t layer_count,VkPipelineStageFlags destinationStage)
//bool GPUDevice::ChangeTexture2DArray(Texture2DArray *tex,DeviceBuffer *buf,const ArrayList<Image2DRegion> &ir_list,const uint32_t base_layer,const uint32_t layer_count,VkPipelineStageFlags destinationStage)
//{
// if(!tex||!buf||ir_list.GetCount()<=0)
// return(false);

View File

@ -148,7 +148,7 @@ bool TextureManager::CommitTextureCubeMipmaps(TextureCube *tex,DeviceBuffer *buf
return CopyBufferToImageCube(tex,buf,buffer_image_copy,miplevel,VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
}
//bool GPUDevice::ChangeTexture2D(Texture2D *tex,DeviceBuffer *buf,const List<Image2DRegion> &ir_list,VkPipelineStageFlags destinationStage)
//bool GPUDevice::ChangeTexture2D(Texture2D *tex,DeviceBuffer *buf,const ArrayList<Image2DRegion> &ir_list,VkPipelineStageFlags destinationStage)
//{
// if(!tex||!buf||ir_list.GetCount()<=0)
// return(false);

View File

@ -34,7 +34,7 @@ Framebuffer *RenderTargetManager::CreateFBO(RenderPass *rp,ImageView **color_lis
if(color_count)
{
const List<VkFormat> &cf_list=rp->GetColorFormat();
const ArrayList<VkFormat> &cf_list=rp->GetColorFormat();
const VkFormat *cf=cf_list.GetData();
ImageView **iv=color_list;
@ -81,7 +81,7 @@ Framebuffer *RenderTargetManager::CreateFBO(RenderPass *rp,ImageView **color_lis
return(new Framebuffer(GetVkDevice(),fbo,extent,rp,color_count,depth));
}
//
//Framebuffer *RenderTargetManager::CreateFBO(RenderPass *rp,List<ImageView *> &color,ImageView *depth)
//Framebuffer *RenderTargetManager::CreateFBO(RenderPass *rp,ArrayList<ImageView *> &color,ImageView *depth)
//{
// if(!rp)return(nullptr);
//

View File

@ -5,7 +5,7 @@
VK_NAMESPACE_BEGIN
namespace
{
void debug_queue_family_properties_out(const char *front,const List<VkQueueFamilyProperties> &qfp_list)
void debug_queue_family_properties_out(const char *front,const ArrayList<VkQueueFamilyProperties> &qfp_list)
{
constexpr const char *queue_bit_name[]=
{

View File

@ -6,12 +6,12 @@ VK_NAMESPACE_BEGIN
namespace
{
static List<VkLayerProperties> layer_properties;
static List<VkExtensionProperties> extension_properties;
static ArrayList<VkLayerProperties> layer_properties;
static ArrayList<VkExtensionProperties> extension_properties;
}//namespace
const List<VkLayerProperties> &GetLayerProperties(){return layer_properties;}
const List<VkExtensionProperties> &GetExtensionProperties(){return extension_properties;}
const ArrayList<VkLayerProperties> &GetLayerProperties(){return layer_properties;}
const ArrayList<VkExtensionProperties> &GetExtensionProperties(){return extension_properties;}
void InitVulkanInstanceProperties()
{

View File

@ -5,7 +5,7 @@
#include<hgl/graph/VKMaterial.h>
#include<hgl/graph/VKMaterialInstance.h>
VK_NAMESPACE_BEGIN
RenderPass::RenderPass(VkDevice d,VkPipelineCache pc,VkRenderPass rp,const List<VkFormat> &cf,VkFormat df)
RenderPass::RenderPass(VkDevice d,VkPipelineCache pc,VkRenderPass rp,const ArrayList<VkFormat> &cf,VkFormat df)
{
device=d;
pipeline_cache=pc;

View File

@ -18,7 +18,7 @@
VK_NAMESPACE_BEGIN
namespace
{
void CreateShaderStageList(List<VkPipelineShaderStageCreateInfo> &shader_stage_list,ShaderModuleMap *shader_maps)
void CreateShaderStageList(ArrayList<VkPipelineShaderStageCreateInfo> &shader_stage_list,ShaderModuleMap *shader_maps)
{
const ShaderModule *sm;

View File

@ -31,7 +31,7 @@ namespace hgl::graph
return component_manager_map.at(hash_code);
}
int ComponentManager::GetComponents(List<Component *> &comp_list,SceneNode *node)
int ComponentManager::GetComponents(ArrayList<Component *> &comp_list,SceneNode *node)
{
if(!node)return(-1);

View File

@ -3,7 +3,7 @@
#include<hgl/graph/VKPhysicalDevice.h>
VK_NAMESPACE_BEGIN
void CreateSubpassDependency(List<VkSubpassDependency> &subpass_dependency_list,const uint32_t count)
void CreateSubpassDependency(ArrayList<VkSubpassDependency> &subpass_dependency_list,const uint32_t count)
{
if(count<=0)return;
@ -73,7 +73,7 @@ inline void CreateColorAttachmentReference(VkAttachmentReference *ref_list, uint
inline void CreateDepthAttachmentReference(VkAttachmentReference *depth_ref,uint index) {CreateAttachmentReference(depth_ref, index,1 ,VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);}
inline void CreateInputAttachmentReference(VkAttachmentReference *ref_list, uint start,uint count) {CreateAttachmentReference(ref_list, start,count,VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);}
bool CreateAttachmentDescription(List<VkAttachmentDescription> &desc_list,const RenderbufferInfo *rbi)
bool CreateAttachmentDescription(ArrayList<VkAttachmentDescription> &desc_list,const RenderbufferInfo *rbi)
{
const uint image_count=rbi->GetColorCount();
@ -117,7 +117,7 @@ bool CreateAttachmentDescription(List<VkAttachmentDescription> &desc_list,const
return(true);
}
bool CreateColorAttachment( List<VkAttachmentReference> &ref_list,List<VkAttachmentDescription> &desc_list,const List<VkFormat> &color_format,const VkImageLayout color_final_layout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
bool CreateColorAttachment( ArrayList<VkAttachmentReference> &ref_list,ArrayList<VkAttachmentDescription> &desc_list,const ArrayList<VkFormat> &color_format,const VkImageLayout color_final_layout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
{
//const VkFormat *cf=color_format_list.GetData();
@ -155,7 +155,7 @@ bool CreateColorAttachment( List<VkAttachmentReference> &ref_list,List<VkAttachm
return(true);
}
bool CreateDepthAttachment( List<VkAttachmentReference> &ref_list,List<VkAttachmentDescription> &desc_list,const VkFormat &depth_format,const VkImageLayout depth_final_layout=VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL)
bool CreateDepthAttachment( ArrayList<VkAttachmentReference> &ref_list,ArrayList<VkAttachmentDescription> &desc_list,const VkFormat &depth_format,const VkImageLayout depth_final_layout=VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL)
{
//if(!attr->physical_device->IsDepthAttachmentOptimal(depth_format))
// return(false);
@ -263,9 +263,9 @@ namespace
}
}
RenderPass *RenderPassManager::CreateRenderPass(const List<VkAttachmentDescription> &desc_list,
const List<VkSubpassDescription> &subpass,
const List<VkSubpassDependency> &dependency,
RenderPass *RenderPassManager::CreateRenderPass(const ArrayList<VkAttachmentDescription> &desc_list,
const ArrayList<VkSubpassDescription> &subpass,
const ArrayList<VkSubpassDependency> &dependency,
const RenderbufferInfo *rbi)
{
const VkFormat depth_format=rbi->GetDepthFormat();
@ -311,11 +311,11 @@ RenderPass *RenderPassManager::AcquireRenderPass(const RenderbufferInfo *rbi,con
if(RenderPassList.Get(hash,rp))
return rp;
List<VkAttachmentReference> color_ref_list;
ArrayList<VkAttachmentReference> color_ref_list;
VkAttachmentReference depth_ref;
List<VkAttachmentDescription> atta_desc_list;
List<VkSubpassDescription> subpass_desc_list;
List<VkSubpassDependency> subpass_dependency_list;
ArrayList<VkAttachmentDescription> atta_desc_list;
ArrayList<VkSubpassDescription> subpass_desc_list;
ArrayList<VkSubpassDependency> subpass_dependency_list;
color_ref_list.SetCount(rbi->GetColorCount());
CreateColorAttachmentReference(color_ref_list.GetData(),0,rbi->GetColorCount());

View File

@ -89,7 +89,7 @@ namespace hgl
LocalBoundingBox=local;
}
int SceneNode::GetComponents(List<Component *> &comp_list,const ComponentManager *mgr)
int SceneNode::GetComponents(ArrayList<Component *> &comp_list,const ComponentManager *mgr)
{
if(!mgr)return(-1);
if(ComponentIsEmpty())return(0);

View File

@ -47,7 +47,7 @@ namespace material_file
AccumMemoryManager::Block *block;
};
using UBODataList=List<UBOData>;
using UBODataList=ArrayList<UBOData>;
struct ShaderData
{
@ -56,7 +56,7 @@ namespace material_file
const char * code;
uint code_length;
List<SamplerData> sampler;
ArrayList<SamplerData> sampler;
public: