From 0e589e8bcd88abeb0541bdacfa8926771e978d21 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Fri, 21 Apr 2023 20:27:28 +0800 Subject: [PATCH] removed PerObject of DescriptorSetType --- inc/hgl/graph/VKDescriptorSet.h | 6 +++--- inc/hgl/graph/VKMaterialParameters.h | 1 - src/SceneGraph/Vulkan/VKCommandBufferRender.cpp | 14 +------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/inc/hgl/graph/VKDescriptorSet.h b/inc/hgl/graph/VKDescriptorSet.h index 55d43f64..dca2db64 100644 --- a/inc/hgl/graph/VKDescriptorSet.h +++ b/inc/hgl/graph/VKDescriptorSet.h @@ -1,5 +1,5 @@ -#ifndef HGL_GRAPH_VULKAN_DESCRIPTOR_SETS_LAYOUT_INCLUDE -#define HGL_GRAPH_VULKAN_DESCRIPTOR_SETS_LAYOUT_INCLUDE +#ifndef HGL_GRAPH_VULKAN_DESCRIPTOR_SET_INCLUDE +#define HGL_GRAPH_VULKAN_DESCRIPTOR_SET_INCLUDE #include #include @@ -64,4 +64,4 @@ public: void Update(); };//class DescriptorSet VK_NAMESPACE_END -#endif//HGL_GRAPH_VULKAN_DESCRIPTOR_SETS_LAYOUT_INCLUDE +#endif//HGL_GRAPH_VULKAN_DESCRIPTOR_SET_INCLUDE diff --git a/inc/hgl/graph/VKMaterialParameters.h b/inc/hgl/graph/VKMaterialParameters.h index b7f4e841..4e2f8113 100644 --- a/inc/hgl/graph/VKMaterialParameters.h +++ b/inc/hgl/graph/VKMaterialParameters.h @@ -40,7 +40,6 @@ public: #define MP_TYPE_IS(name) const bool is##name()const{return set_type==DescriptorSetType::name;} MP_TYPE_IS(Instance) - MP_TYPE_IS(PerObject) MP_TYPE_IS(PerMaterial) MP_TYPE_IS(PerFrame) MP_TYPE_IS(Global) diff --git a/src/SceneGraph/Vulkan/VKCommandBufferRender.cpp b/src/SceneGraph/Vulkan/VKCommandBufferRender.cpp index dbec59ef..b6d82dcc 100644 --- a/src/SceneGraph/Vulkan/VKCommandBufferRender.cpp +++ b/src/SceneGraph/Vulkan/VKCommandBufferRender.cpp @@ -105,9 +105,6 @@ bool RenderCmdBuffer::BindDescriptorSets(Renderable *ri) { if(!ri)return(false); - uint32_t *dynamic_offset=nullptr; - uint32_t dynamic_count=0; - { uint32_t count=0; @@ -122,13 +119,6 @@ bool RenderCmdBuffer::BindDescriptorSets(Renderable *ri) { ds[count]=mp->GetVkDescriptorSet(); ++count; - - if((DescriptorSetType)i==DescriptorSetType::PerObject) - { - dynamic_count=mp->GetBoundCount(); - - dynamic_offset=hgl_zero_new(dynamic_count); - } } } @@ -136,9 +126,7 @@ bool RenderCmdBuffer::BindDescriptorSets(Renderable *ri) { pipeline_layout=ri->GetPipelineLayout(); - vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,pipeline_layout,0,count,ds,dynamic_count,dynamic_offset); - - SAFE_CLEAR_ARRAY(dynamic_offset); + vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,pipeline_layout,0,count,ds,0,0); } }