From 251d851f6543071b5293895d45ef289933a5ab32 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Mon, 13 Feb 2023 11:48:53 +0800 Subject: [PATCH] upgraded codes based on newly CM... library. --- CMCore | 2 +- CMPlatform | 2 +- CMSceneGraph | 2 +- CMUtil | 2 +- example/2dVector/roundbox.cpp | 4 ++-- example/Vulkan/third_triangle.cpp | 7 +++++-- inc/hgl/graph/PrimitiveCreater.h | 2 +- inc/hgl/graph/RenderList.h | 2 +- inc/hgl/graph/VK.h | 4 ++-- inc/hgl/graph/VKCommandBuffer.h | 4 ++-- inc/hgl/graph/VKDescriptorSets.h | 8 ++++---- inc/hgl/graph/VKDevice.h | 14 +++++++------- inc/hgl/graph/VKMaterialParameters.h | 6 +++--- inc/hgl/graph/VKRenderResource.h | 14 +++++++------- inc/hgl/graph/VKShaderResource.h | 8 ++++---- inc/hgl/graph/font/FontManage.h | 4 ++-- inc/hgl/graph/font/FontSource.h | 4 ++-- inc/hgl/gui/ThemeEngine.h | 2 +- src/SceneGraph/InlineGeometry.cpp | 4 ++-- src/SceneGraph/Vulkan/VKDescriptorSets.cpp | 16 ++++++++-------- src/SceneGraph/Vulkan/VKDeviceCreater.cpp | 5 ++++- src/SceneGraph/Vulkan/VKDeviceMaterial.cpp | 8 ++++---- src/SceneGraph/Vulkan/VKMaterialParameters.cpp | 2 +- src/SceneGraph/Vulkan/VKPipelineLayoutData.cpp | 2 +- src/SceneGraph/Vulkan/VKShaderResource.cpp | 4 ++-- src/SceneGraph/font/FontSource.cpp | 2 +- src/SceneGraph/font/FontSourceManage.cpp | 2 +- 27 files changed, 71 insertions(+), 65 deletions(-) diff --git a/CMCore b/CMCore index 48abdf2a..68d0082e 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit 48abdf2a894ba87d609f9ea4b3c9464467cec797 +Subproject commit 68d0082e0e2dd2ec2d55fe0756aeb0bfb3c2be69 diff --git a/CMPlatform b/CMPlatform index eca08f0a..c91c3780 160000 --- a/CMPlatform +++ b/CMPlatform @@ -1 +1 @@ -Subproject commit eca08f0ae7aeaf81ab5818572b32051e16dd41a7 +Subproject commit c91c3780f42df182fdb752b8165ed41a03358949 diff --git a/CMSceneGraph b/CMSceneGraph index 96602530..c539ce80 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 966025309dba8921bd0ba1c198fbae38620b0aa3 +Subproject commit c539ce808b9a8a3acf451c3e26d47881631be954 diff --git a/CMUtil b/CMUtil index 13b5a734..b0ca13cf 160000 --- a/CMUtil +++ b/CMUtil @@ -1 +1 @@ -Subproject commit 13b5a7347ea6a2b44f728847c2ce131e844f6d7c +Subproject commit b0ca13cfb34175fd90c370ded64e8c0f3586b8ec diff --git a/example/2dVector/roundbox.cpp b/example/2dVector/roundbox.cpp index f3d8f14a..168c8c79 100644 --- a/example/2dVector/roundbox.cpp +++ b/example/2dVector/roundbox.cpp @@ -44,8 +44,8 @@ private: MaterialInstance * material_instance =nullptr; Renderable * render_obj =nullptr; - DeviceBuffer * ubo_camera_info =nullptr; - DeviceBuffer * ubo_rb_config =nullptr; + DeviceBuffer * ubo_camera_info =nullptr; + DeviceBuffer * ubo_rb_config =nullptr; Pipeline * pipeline =nullptr; diff --git a/example/Vulkan/third_triangle.cpp b/example/Vulkan/third_triangle.cpp index 82b1a9d0..d0988eb8 100644 --- a/example/Vulkan/third_triangle.cpp +++ b/example/Vulkan/third_triangle.cpp @@ -60,11 +60,14 @@ private: Primitive *primitive=db->CreatePrimitive(VERTEX_COUNT); if(!primitive)return(false); - if(!primitive->Set(VAN::Position, db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data )))return(false); - if(!primitive->Set(VAN::Color, db->CreateVBO(VF_V4F,VERTEX_COUNT,color_data )))return(false); + if(!primitive->Set(VAN::Position, db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data )))return(false); + if(!primitive->Set(VAN::Color, db->CreateVBO(VF_V4F,VERTEX_COUNT,color_data )))return(false); render_obj=db->CreateRenderable(primitive,material_instance,pipeline); + if(!render_obj) + return(false); + render_root.CreateSubNode(render_obj); render_root.RefreshMatrix(); diff --git a/inc/hgl/graph/PrimitiveCreater.h b/inc/hgl/graph/PrimitiveCreater.h index 3b3b9160..24f90ba2 100644 --- a/inc/hgl/graph/PrimitiveCreater.h +++ b/inc/hgl/graph/PrimitiveCreater.h @@ -23,7 +23,7 @@ namespace hgl } };//struct ShaderStageBind - using ShaderStageBindMap=MapObject; + using ShaderStageBindMap=ObjectMap; /** * 可绘制图元创建器 diff --git a/inc/hgl/graph/RenderList.h b/inc/hgl/graph/RenderList.h index aa348ac4..5db82929 100644 --- a/inc/hgl/graph/RenderList.h +++ b/inc/hgl/graph/RenderList.h @@ -40,7 +40,7 @@ namespace hgl List ri_list; VkDescriptorSet ds_list[(size_t)DescriptorSetsType::RANGE_SIZE]; - DescriptorSets *renderable_desc_sets; + DescriptorSet *renderable_desc_sets; uint32_t ubo_offset; uint32_t ubo_align; diff --git a/inc/hgl/graph/VK.h b/inc/hgl/graph/VK.h index 0c8ec122..6ce3e0a5 100644 --- a/inc/hgl/graph/VK.h +++ b/inc/hgl/graph/VK.h @@ -92,13 +92,13 @@ constexpr char *DescriptSetsTypeName[]= inline const char *GetDescriptorSetsTypeName(const enum class DescriptorSetsType &type) { - ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(type); + RANGE_CHECK_RETURN_NULLPTR(type); return DescriptSetsTypeName[(size_t)type]; } struct PipelineLayoutData; -class DescriptorSets; +class DescriptorSet; struct ShaderStage; diff --git a/inc/hgl/graph/VKCommandBuffer.h b/inc/hgl/graph/VKCommandBuffer.h index 1a62ca8e..5ec6ee0c 100644 --- a/inc/hgl/graph/VKCommandBuffer.h +++ b/inc/hgl/graph/VKCommandBuffer.h @@ -105,7 +105,7 @@ public: return(true); } - bool BindDescriptorSets(DescriptorSets *dsl) + bool BindDescriptorSets(DescriptorSet *dsl) { if(!dsl)return(false); @@ -118,7 +118,7 @@ public: return(true); } - bool BindDescriptorSets(DescriptorSets *dsl,const uint32_t offset) + bool BindDescriptorSets(DescriptorSet *dsl,const uint32_t offset) { if(!dsl)return(false); diff --git a/inc/hgl/graph/VKDescriptorSets.h b/inc/hgl/graph/VKDescriptorSets.h index 9177a468..d20adaa6 100644 --- a/inc/hgl/graph/VKDescriptorSets.h +++ b/inc/hgl/graph/VKDescriptorSets.h @@ -7,7 +7,7 @@ VK_NAMESPACE_BEGIN class DeviceBuffer; -class DescriptorSets +class DescriptorSet { VkDevice device; int binding_count; @@ -27,7 +27,7 @@ private: friend class GPUDevice; - DescriptorSets(VkDevice dev,const int bc,VkPipelineLayout pl,VkDescriptorSet ds) + DescriptorSet(VkDevice dev,const int bc,VkPipelineLayout pl,VkDescriptorSet ds) { device =dev; binding_count =bc; @@ -39,7 +39,7 @@ private: public: - ~DescriptorSets()=default; + ~DescriptorSet()=default; const uint32_t GetCount ()const{return binding_count;} const VkDescriptorSet GetDescriptorSet ()const{return desc_set;} @@ -57,6 +57,6 @@ public: bool BindSampler(const int binding,Texture *,Sampler *); bool BindInputAttachment(const int binding,ImageView *); void Update(); -};//class DescriptorSets +};//class DescriptorSet VK_NAMESPACE_END #endif//HGL_GRAPH_VULKAN_DESCRIPTOR_SETS_LAYOUT_INCLUDE diff --git a/inc/hgl/graph/VKDevice.h b/inc/hgl/graph/VKDevice.h index 24e4c607..14c9048b 100644 --- a/inc/hgl/graph/VKDevice.h +++ b/inc/hgl/graph/VKDevice.h @@ -120,11 +120,11 @@ private: //Buffer相关 public: //Buffer相关 - DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage,VkDeviceSize range,VkDeviceSize size,const void *data, SharingMode sm=SharingMode::Exclusive); - DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage,VkDeviceSize range,VkDeviceSize size, SharingMode sm=SharingMode::Exclusive){return CreateBuffer(buf_usage,range,size,nullptr,sm);} - - DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage, VkDeviceSize size,const void *data, SharingMode sm=SharingMode::Exclusive){return CreateBuffer(buf_usage,size,size,data,sm);} - DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage, VkDeviceSize size, SharingMode sm=SharingMode::Exclusive){return CreateBuffer(buf_usage,size,size,nullptr,sm);} + DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage,VkDeviceSize range,VkDeviceSize size,const void *data, SharingMode sm=SharingMode::Exclusive); + DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage,VkDeviceSize range,VkDeviceSize size, SharingMode sm=SharingMode::Exclusive){return CreateBuffer(buf_usage,range,size,nullptr,sm);} + + DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage, VkDeviceSize size,const void *data, SharingMode sm=SharingMode::Exclusive){return CreateBuffer(buf_usage,size,size,data,sm);} + DeviceBuffer * CreateBuffer(VkBufferUsageFlags buf_usage, VkDeviceSize size, SharingMode sm=SharingMode::Exclusive){return CreateBuffer(buf_usage,size,size,nullptr,sm);} VBO * CreateVBO (VkFormat format, uint32_t count,const void *data, SharingMode sm=SharingMode::Exclusive); VBO * CreateVBO (VkFormat format, uint32_t count, SharingMode sm=SharingMode::Exclusive){return CreateVBO(format,count,nullptr,sm);} @@ -219,7 +219,7 @@ public: //shader & material PipelineLayoutData *CreatePipelineLayoutData(const MaterialDescriptorSets *); void Destroy(PipelineLayoutData *); - DescriptorSets * CreateDescriptorSets(const PipelineLayoutData *,const DescriptorSetsType &type)const; + DescriptorSet * CreateDescriptorSets(const PipelineLayoutData *,const DescriptorSetsType &type)const; MaterialParameters *CreateMP(const MaterialDescriptorSets *,const PipelineLayoutData *,const DescriptorSetsType &); MaterialParameters *CreateMP(Material *,const DescriptorSetsType &); @@ -238,7 +238,7 @@ public: //Command Buffer 相关 public: - RenderPass * AcquireRenderPass( const RenderbufferInfo *,const uint subpass_count=2); + RenderPass * AcquireRenderPass( const RenderbufferInfo *,const uint subpass_count=2); Fence * CreateFence(bool); Semaphore * CreateGPUSemaphore(); diff --git a/inc/hgl/graph/VKMaterialParameters.h b/inc/hgl/graph/VKMaterialParameters.h index a8e74d48..42de23a5 100644 --- a/inc/hgl/graph/VKMaterialParameters.h +++ b/inc/hgl/graph/VKMaterialParameters.h @@ -11,18 +11,18 @@ class MaterialParameters DescriptorSetsType ds_type; - DescriptorSets *descriptor_sets; + DescriptorSet *descriptor_sets; private: friend class GPUDevice; - MaterialParameters(const MaterialDescriptorSets *,const DescriptorSetsType &type,DescriptorSets *); + MaterialParameters(const MaterialDescriptorSets *,const DescriptorSetsType &type,DescriptorSet *); public: const DescriptorSetsType GetType (){return ds_type;} - DescriptorSets * GetDescriptorSet (){return descriptor_sets;} + DescriptorSet * GetDescriptorSet (){return descriptor_sets;} const VkDescriptorSet GetVkDescriptorSet ()const{return descriptor_sets->GetDescriptorSet();} const uint32_t GetCount ()const{return descriptor_sets->GetCount();} diff --git a/inc/hgl/graph/VKRenderResource.h b/inc/hgl/graph/VKRenderResource.h index bc8a6bd1..bfed93a8 100644 --- a/inc/hgl/graph/VKRenderResource.h +++ b/inc/hgl/graph/VKRenderResource.h @@ -18,7 +18,7 @@ VK_NAMESPACE_BEGIN using MaterialID =int; using MaterialInstanceID =int; using BufferID =int; -using DescriptorSetsID =int; +using DescriptorSetID =int; using PrimitiveID =int; using RenderableID =int; using SamplerID =int; @@ -33,13 +33,13 @@ class RenderResource { GPUDevice *device; - MapObject shader_module_by_name; + ObjectMap shader_module_by_name; Map material_by_name; Map texture_by_name; IDResManage rm_material; ///<材质合集 IDResManage rm_material_instance; ///<材质实例合集 - IDResManage rm_desc_sets; ///<描述符合集 + IDResManage rm_desc_sets; ///<描述符合集 IDResManage rm_primitives; ///<图元合集 IDResManage rm_buffers; ///<顶点缓冲区合集 IDResManage rm_samplers; ///<采样器合集 @@ -55,9 +55,9 @@ public: //Add MaterialID Add(Material * mtl ){return rm_material.Add(mtl);} MaterialInstanceID Add(MaterialInstance * mi ){return rm_material_instance.Add(mi);} - DescriptorSetsID Add(DescriptorSets * ds ){return rm_desc_sets.Add(ds);} + DescriptorSetID Add(DescriptorSet * ds ){return rm_desc_sets.Add(ds);} PrimitiveID Add(Primitive * p ){return rm_primitives.Add(p);} - BufferID Add(DeviceBuffer * buf ){return rm_buffers.Add(buf);} + BufferID Add(DeviceBuffer * buf ){return rm_buffers.Add(buf);} SamplerID Add(Sampler * s ){return rm_samplers.Add(s);} TextureID Add(Texture * t ){return rm_textures.Add(t);} RenderableID Add(Renderable * r ){return rm_renderables.Add(r);} @@ -109,9 +109,9 @@ public: //Get Material * GetMaterial (const MaterialID &id){return rm_material.Get(id);} MaterialInstance * GetMaterialInstance (const MaterialInstanceID &id){return rm_material_instance.Get(id);} - DescriptorSets * GetDescSets (const DescriptorSetsID &id){return rm_desc_sets.Get(id);} + DescriptorSet * GetDescSets (const DescriptorSetID &id){return rm_desc_sets.Get(id);} Primitive * GetPrimitive (const PrimitiveID &id){return rm_primitives.Get(id);} - DeviceBuffer * GetBuffer (const BufferID &id){return rm_buffers.Get(id);} + DeviceBuffer * GetBuffer (const BufferID &id){return rm_buffers.Get(id);} Sampler * GetSampler (const SamplerID &id){return rm_samplers.Get(id);} Texture * GetTexture (const TextureID &id){return rm_textures.Get(id);} Renderable * GetRenderable (const RenderableID &id){return rm_renderables.Get(id);} diff --git a/inc/hgl/graph/VKShaderResource.h b/inc/hgl/graph/VKShaderResource.h index 8fc13342..1ae27a6e 100644 --- a/inc/hgl/graph/VKShaderResource.h +++ b/inc/hgl/graph/VKShaderResource.h @@ -16,7 +16,7 @@ struct ShaderStage VertexAttribType type; ///<成份数量(如vec4中的4) bool global; ///<是否全局数据 - bool dynamic; ///<是否动态数量 + bool dynamic; ///<是否动态数据 };//struct ShaderStage using ShaderStageList =ObjectList; @@ -29,7 +29,7 @@ class ShaderResource uint32 spv_size; ShaderStageList stage_inputs; - ShaderStageList stage_outputs; +// ShaderStageList stage_outputs; public: @@ -43,10 +43,10 @@ public: const uint32_t GetCodeSize ()const {return spv_size;} ShaderStageList & GetStageInputs () {return stage_inputs;} - ShaderStageList & GetStageOutputs () {return stage_outputs;} +// ShaderStageList & GetStageOutputs () {return stage_outputs;} const uint GetStageInputCount ()const {return stage_inputs.GetCount();} - const uint GetStageOutputCount ()const {return stage_outputs.GetCount();} +// const uint GetStageOutputCount ()const {return stage_outputs.GetCount();} const ShaderStage * GetStageInput (const AnsiString &)const; const int GetStageInputBinding(const AnsiString &)const; diff --git a/inc/hgl/graph/font/FontManage.h b/inc/hgl/graph/font/FontManage.h index 5aa68519..e5d50aa2 100644 --- a/inc/hgl/graph/font/FontManage.h +++ b/inc/hgl/graph/font/FontManage.h @@ -14,9 +14,9 @@ namespace hgl */ class FontManage { - MapObject sources; + ObjectMap sources; - MapObject tilefonts; + ObjectMap tilefonts; };//class FontManage }//namespace graph }//namespace hgl diff --git a/inc/hgl/graph/font/FontSource.h b/inc/hgl/graph/font/FontSource.h index e903ae94..f8d2ac01 100644 --- a/inc/hgl/graph/font/FontSource.h +++ b/inc/hgl/graph/font/FontSource.h @@ -73,7 +73,7 @@ namespace hgl SortedSets ref_object; - MapObject cla_cache; + ObjectMap cla_cache; public: @@ -98,7 +98,7 @@ namespace hgl Font fnt; - MapObject chars_bitmap; ///<字符位图 + ObjectMap chars_bitmap; ///<字符位图 protected: diff --git a/inc/hgl/gui/ThemeEngine.h b/inc/hgl/gui/ThemeEngine.h index 8a0c0cae..a4c2b3ab 100644 --- a/inc/hgl/gui/ThemeEngine.h +++ b/inc/hgl/gui/ThemeEngine.h @@ -21,7 +21,7 @@ namespace hgl GPUDevice *device; - MapObject
form_list; + ObjectMap form_list; RenderTarget *CreateRenderTarget(const uint32_t,const uint32_t,const VkFormat); diff --git a/src/SceneGraph/InlineGeometry.cpp b/src/SceneGraph/InlineGeometry.cpp index 93ce1768..461727bd 100644 --- a/src/SceneGraph/InlineGeometry.cpp +++ b/src/SceneGraph/InlineGeometry.cpp @@ -321,7 +321,7 @@ namespace hgl if(cci->color_type!=CubeCreateInfo::ColorType::NoColor) { - ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(cci->color_type); + RANGE_CHECK_RETURN_NULLPTR(cci->color_type); AutoDelete color=rc.CreateVADA(VAN::Color); @@ -1203,7 +1203,7 @@ namespace hgl if(cci->color_type!=BoundingBoxCreateInfo::ColorType::NoColor) { - ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(cci->color_type); + RANGE_CHECK_RETURN_NULLPTR(cci->color_type); AutoDelete color=rc.CreateVADA(VAN::Color); diff --git a/src/SceneGraph/Vulkan/VKDescriptorSets.cpp b/src/SceneGraph/Vulkan/VKDescriptorSets.cpp index 44fae69d..f0e582c5 100644 --- a/src/SceneGraph/Vulkan/VKDescriptorSets.cpp +++ b/src/SceneGraph/Vulkan/VKDescriptorSets.cpp @@ -67,7 +67,7 @@ namespace };//struct DescriptorImageInfo:public VkDescriptorImageInfo }//namespace -void DescriptorSets::Clear() +void DescriptorSet::Clear() { buffer_list.ClearData(); image_list.ClearData(); @@ -76,7 +76,7 @@ void DescriptorSets::Clear() is_dirty=true; } -bool DescriptorSets::BindUBO(const int binding,const DeviceBuffer *buf,bool dynamic) +bool DescriptorSet::BindUBO(const int binding,const DeviceBuffer *buf,bool dynamic) { if(binding<0||!buf) return(false); @@ -92,7 +92,7 @@ bool DescriptorSets::BindUBO(const int binding,const DeviceBuffer *buf,bool dyna return(true); } -bool DescriptorSets::BindUBO(const int binding,const DeviceBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic) +bool DescriptorSet::BindUBO(const int binding,const DeviceBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic) { if(binding<0||!buf) return(false); @@ -112,7 +112,7 @@ bool DescriptorSets::BindUBO(const int binding,const DeviceBuffer *buf,const VkD return(true); } -bool DescriptorSets::BindSSBO(const int binding,const DeviceBuffer *buf,bool dynamic) +bool DescriptorSet::BindSSBO(const int binding,const DeviceBuffer *buf,bool dynamic) { if(binding<0||!buf) return(false); @@ -128,7 +128,7 @@ bool DescriptorSets::BindSSBO(const int binding,const DeviceBuffer *buf,bool dyn return(true); } -bool DescriptorSets::BindSSBO(const int binding,const DeviceBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic) +bool DescriptorSet::BindSSBO(const int binding,const DeviceBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic) { if(binding<0||!buf) return(false); @@ -148,7 +148,7 @@ bool DescriptorSets::BindSSBO(const int binding,const DeviceBuffer *buf,const Vk return(true); } -bool DescriptorSets::BindSampler(const int binding,Texture *tex,Sampler *sampler) +bool DescriptorSet::BindSampler(const int binding,Texture *tex,Sampler *sampler) { if(binding<0||!tex||!sampler) return(false); @@ -166,7 +166,7 @@ bool DescriptorSets::BindSampler(const int binding,Texture *tex,Sampler *sampler return(true); } -bool DescriptorSets::BindInputAttachment(const int binding,ImageView *iv) +bool DescriptorSet::BindInputAttachment(const int binding,ImageView *iv) { if(binding<0||!iv) return(false); @@ -184,7 +184,7 @@ bool DescriptorSets::BindInputAttachment(const int binding,ImageView *iv) return(true); } -void DescriptorSets::Update() +void DescriptorSet::Update() { if(!is_dirty)return; diff --git a/src/SceneGraph/Vulkan/VKDeviceCreater.cpp b/src/SceneGraph/Vulkan/VKDeviceCreater.cpp index 1a3cbb88..fbf21165 100644 --- a/src/SceneGraph/Vulkan/VKDeviceCreater.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceCreater.cpp @@ -32,8 +32,11 @@ namespace VK_EXT_DEBUG_MARKER_EXTENSION_NAME, #endif//_DEBUG // VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, +// VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME, +// VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME, +// VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME, VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME, - VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, +// VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, // VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, // VK_EXT_HDR_METADATA_EXTENSION_NAME, // VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME, diff --git a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp index ab5d9879..083c3d76 100644 --- a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp @@ -8,9 +8,9 @@ #include"VKPipelineLayoutData.h" VK_NAMESPACE_BEGIN -DescriptorSets *GPUDevice::CreateDescriptorSets(const PipelineLayoutData *pld,const DescriptorSetsType &type)const +DescriptorSet *GPUDevice::CreateDescriptorSets(const PipelineLayoutData *pld,const DescriptorSetsType &type)const { - ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(type); + RANGE_CHECK_RETURN_NULLPTR(type); const uint32_t binding_count=pld->binding_count[size_t(type)]; @@ -28,7 +28,7 @@ DescriptorSets *GPUDevice::CreateDescriptorSets(const PipelineLayoutData *pld,co if(vkAllocateDescriptorSets(attr->device,&alloc_info,&desc_set)!=VK_SUCCESS) return(nullptr); - return(new DescriptorSets(attr->device,binding_count,pld->pipeline_layout,desc_set)); + return(new DescriptorSet(attr->device,binding_count,pld->pipeline_layout,desc_set)); } MaterialParameters *GPUDevice::CreateMP(const MaterialDescriptorSets *mds,const PipelineLayoutData *pld,const DescriptorSetsType &desc_set_type) @@ -37,7 +37,7 @@ MaterialParameters *GPUDevice::CreateMP(const MaterialDescriptorSets *mds,const if(!RangeCheck(desc_set_type)) return(nullptr); - DescriptorSets *ds=CreateDescriptorSets(pld,desc_set_type); + DescriptorSet *ds=CreateDescriptorSets(pld,desc_set_type); if(!ds)return(nullptr); diff --git a/src/SceneGraph/Vulkan/VKMaterialParameters.cpp b/src/SceneGraph/Vulkan/VKMaterialParameters.cpp index 345eaeec..cba28583 100644 --- a/src/SceneGraph/Vulkan/VKMaterialParameters.cpp +++ b/src/SceneGraph/Vulkan/VKMaterialParameters.cpp @@ -4,7 +4,7 @@ #include VK_NAMESPACE_BEGIN -MaterialParameters::MaterialParameters(const MaterialDescriptorSets *_mds,const DescriptorSetsType &type,DescriptorSets *ds) +MaterialParameters::MaterialParameters(const MaterialDescriptorSets *_mds,const DescriptorSetsType &type,DescriptorSet *ds) { mds=_mds; ds_type=type; diff --git a/src/SceneGraph/Vulkan/VKPipelineLayoutData.cpp b/src/SceneGraph/Vulkan/VKPipelineLayoutData.cpp index 0f4001f7..60cecab8 100644 --- a/src/SceneGraph/Vulkan/VKPipelineLayoutData.cpp +++ b/src/SceneGraph/Vulkan/VKPipelineLayoutData.cpp @@ -40,7 +40,7 @@ PipelineLayoutData *GPUDevice::CreatePipelineLayoutData(const MaterialDescriptor } else { - //没有任何DescriptorSets的情况也是存在的 + //没有任何DescriptorSet的情况也是存在的 } //VkPushConstantRange push_constant_range; diff --git a/src/SceneGraph/Vulkan/VKShaderResource.cpp b/src/SceneGraph/Vulkan/VKShaderResource.cpp index e6bc8f1d..b1f25e64 100644 --- a/src/SceneGraph/Vulkan/VKShaderResource.cpp +++ b/src/SceneGraph/Vulkan/VKShaderResource.cpp @@ -21,7 +21,7 @@ VK_NAMESPACE_BEGIN namespace { - MapObject shader_resource_by_filename; + ObjectMap shader_resource_by_filename; const uint8 *LoadShaderStages(ShaderStageList &ss_list,const uint8 *data) { @@ -138,7 +138,7 @@ VK_NAMESPACE_BEGIN filedata+=spv_size; filedata=LoadShaderStages(sr->GetStageInputs(),filedata); - filedata=LoadShaderStages(sr->GetStageOutputs(),filedata); + //filedata=LoadShaderStages(sr->GetStageOutputs(),filedata); return sr; } diff --git a/src/SceneGraph/font/FontSource.cpp b/src/SceneGraph/font/FontSource.cpp index c11063ab..44a78d4b 100644 --- a/src/SceneGraph/font/FontSource.cpp +++ b/src/SceneGraph/font/FontSource.cpp @@ -32,7 +32,7 @@ namespace hgl constexpr int CurrencySymbolsCount=(sizeof(CurrencySymbols)/sizeof(u32char))-1; constexpr int VRotateSymbolsCount =(sizeof(VRotateSymbols) /sizeof(u32char))-1; - MapObject all_char_attrs; + ObjectMap all_char_attrs; }//namespace const CLA *FontSource::GetCLA(const u32char &ch) diff --git a/src/SceneGraph/font/FontSourceManage.cpp b/src/SceneGraph/font/FontSourceManage.cpp index f2f3ca0c..ff261cfc 100644 --- a/src/SceneGraph/font/FontSourceManage.cpp +++ b/src/SceneGraph/font/FontSourceManage.cpp @@ -5,7 +5,7 @@ namespace hgl { FontSource *CreateFontSource(const Font &f); //各平台独立提供 - static MapObject FontStorage; + static ObjectMap FontStorage; FontSource *AcquireFontSource(const Font &f) {