renamed to DescriptorSetType instead of DescriptorSetsType
This commit is contained in:
@@ -39,7 +39,7 @@ namespace hgl
|
||||
MVPArrayBuffer *mvp_array;
|
||||
List<Renderable *> ri_list;
|
||||
|
||||
VkDescriptorSet ds_list[(size_t)DescriptorSetsType::RANGE_SIZE];
|
||||
VkDescriptorSet ds_list[(size_t)DescriptorSetType::RANGE_SIZE];
|
||||
DescriptorSet *renderable_desc_sets;
|
||||
|
||||
uint32_t ubo_offset;
|
||||
@@ -54,7 +54,7 @@ namespace hgl
|
||||
private:
|
||||
|
||||
Pipeline * last_pipeline;
|
||||
MaterialParameters *last_mp[(size_t)DescriptorSetsType::RANGE_SIZE];
|
||||
MaterialParameters *last_mp[(size_t)DescriptorSetType::RANGE_SIZE];
|
||||
uint32_t last_vbo;
|
||||
|
||||
void Render(Renderable *);
|
||||
|
@@ -70,7 +70,7 @@ class DeviceRenderPassManage;
|
||||
class Fence;
|
||||
class Semaphore;
|
||||
|
||||
enum class DescriptorSetsType
|
||||
enum class DescriptorSetType
|
||||
{
|
||||
//设计使其对应shader中的set
|
||||
|
||||
@@ -90,7 +90,7 @@ constexpr char *DescriptSetsTypeName[]=
|
||||
"Global","PerFrame","PerMaterial","PerObject","Instance","Skeleton"
|
||||
};
|
||||
|
||||
inline const char *GetDescriptorSetsTypeName(const enum class DescriptorSetsType &type)
|
||||
inline const char *GetDescriptorSetTypeName(const enum class DescriptorSetType &type)
|
||||
{
|
||||
RANGE_CHECK_RETURN_NULLPTR(type);
|
||||
|
||||
|
@@ -219,9 +219,9 @@ public: //shader & material
|
||||
PipelineLayoutData *CreatePipelineLayoutData(const MaterialDescriptorSets *);
|
||||
void Destroy(PipelineLayoutData *);
|
||||
|
||||
DescriptorSet * CreateDescriptorSets(const PipelineLayoutData *,const DescriptorSetsType &type)const;
|
||||
MaterialParameters *CreateMP(const MaterialDescriptorSets *,const PipelineLayoutData *,const DescriptorSetsType &);
|
||||
MaterialParameters *CreateMP(Material *,const DescriptorSetsType &);
|
||||
DescriptorSet * CreateDescriptorSets(const PipelineLayoutData *,const DescriptorSetType &type)const;
|
||||
MaterialParameters *CreateMP(const MaterialDescriptorSets *,const PipelineLayoutData *,const DescriptorSetType &);
|
||||
MaterialParameters *CreateMP(Material *,const DescriptorSetType &);
|
||||
|
||||
ShaderModule *CreateShaderModule(ShaderResource *);
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
VK_NAMESPACE_BEGIN
|
||||
using ShaderStageCreateInfoList=List<VkPipelineShaderStageCreateInfo>;
|
||||
|
||||
using MaterialParameterArray=MaterialParameters *[size_t(DescriptorSetsType::RANGE_SIZE)];
|
||||
using MaterialParameterArray=MaterialParameters *[size_t(DescriptorSetType::RANGE_SIZE)];
|
||||
|
||||
struct MaterialData
|
||||
{
|
||||
@@ -63,14 +63,14 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
MaterialParameters * GetMP (const DescriptorSetsType &type)
|
||||
MaterialParameters * GetMP (const DescriptorSetType &type)
|
||||
{
|
||||
RANGE_CHECK_RETURN_NULLPTR(type)
|
||||
|
||||
return data->mp_array[size_t(type)];
|
||||
}
|
||||
|
||||
const bool hasSet (const DescriptorSetsType &type)const;
|
||||
const bool hasSet (const DescriptorSetType &type)const;
|
||||
};//class Material
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_VULKAN_MATERIAL_INCLUDE
|
||||
|
@@ -10,7 +10,7 @@ struct ShaderDescriptor
|
||||
char name[128];
|
||||
|
||||
VkDescriptorType desc_type;
|
||||
DescriptorSetsType set_type;
|
||||
DescriptorSetType set_type;
|
||||
uint32_t set;
|
||||
uint32_t binding;
|
||||
uint32_t stage_flag;
|
||||
@@ -26,7 +26,7 @@ class MaterialDescriptorSets
|
||||
uint sd_count;
|
||||
|
||||
ShaderDescriptorList descriptor_list[VK_DESCRIPTOR_TYPE_RANGE_SIZE];
|
||||
ShaderDescriptorList descriptor_list_by_set_type[size_t(DescriptorSetsType::RANGE_SIZE)];
|
||||
ShaderDescriptorList descriptor_list_by_set_type[size_t(DescriptorSetType::RANGE_SIZE)];
|
||||
|
||||
Map<AnsiString,ShaderDescriptor *> sd_by_name;
|
||||
Map<AnsiString,int> binding_map[VK_DESCRIPTOR_TYPE_RANGE_SIZE];
|
||||
@@ -35,7 +35,7 @@ class MaterialDescriptorSets
|
||||
|
||||
private:
|
||||
|
||||
DescriptorSetLayoutCreateInfo dsl_ci[size_t(DescriptorSetsType::RANGE_SIZE)];
|
||||
DescriptorSetLayoutCreateInfo dsl_ci[size_t(DescriptorSetType::RANGE_SIZE)];
|
||||
|
||||
public:
|
||||
|
||||
@@ -51,11 +51,11 @@ public:
|
||||
const int GetSampler (const AnsiString &name )const{return GetBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,name);}
|
||||
const int GetAttachment (const AnsiString &name )const{return GetBinding(VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,name);}
|
||||
|
||||
const DescriptorSetLayoutCreateInfo *GetDSLCI(const DescriptorSetsType &type)const{return dsl_ci+size_t(type);}
|
||||
const DescriptorSetLayoutCreateInfo *GetDSLCI(const DescriptorSetType &type)const{return dsl_ci+size_t(type);}
|
||||
|
||||
const ShaderDescriptorList &GetDescriptorList(const DescriptorSetsType &type)const{return descriptor_list_by_set_type[size_t(type)];}
|
||||
const ShaderDescriptorList &GetDescriptorList(const DescriptorSetType &type)const{return descriptor_list_by_set_type[size_t(type)];}
|
||||
|
||||
const bool hasSet(const DescriptorSetsType &type)const{return !descriptor_list_by_set_type[size_t(type)].IsEmpty();}
|
||||
const bool hasSet(const DescriptorSetType &type)const{return !descriptor_list_by_set_type[size_t(type)].IsEmpty();}
|
||||
};//class MaterialDescriptorSets
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_VULKAN_MATERIAL_DESCRIPTOR_SETS_INCLUDE
|
||||
|
@@ -26,11 +26,11 @@ public:
|
||||
|
||||
const VIL *GetVIL()const{return vil;}
|
||||
MaterialParameters *GetMP(){return mp_per_mi;}
|
||||
MaterialParameters *GetMP(const DescriptorSetsType &type){return material->GetMP(type);}
|
||||
MaterialParameters *GetMP(const DescriptorSetType &type){return material->GetMP(type);}
|
||||
|
||||
bool BindUBO(const DescriptorSetsType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
||||
bool BindSSBO(const DescriptorSetsType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
||||
bool BindSampler(const DescriptorSetsType &type,const AnsiString &name,Texture *tex,Sampler *sampler);
|
||||
bool BindUBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
||||
bool BindSSBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic=false);
|
||||
bool BindSampler(const DescriptorSetType &type,const AnsiString &name,Texture *tex,Sampler *sampler);
|
||||
};//class MaterialInstance
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_VULKAN_MATERIAL_INSTANCE_INCLUDE
|
||||
|
@@ -9,7 +9,7 @@ class MaterialParameters
|
||||
{
|
||||
const MaterialDescriptorSets *mds;
|
||||
|
||||
DescriptorSetsType ds_type;
|
||||
DescriptorSetType ds_type;
|
||||
|
||||
DescriptorSet *descriptor_sets;
|
||||
|
||||
@@ -17,11 +17,11 @@ private:
|
||||
|
||||
friend class GPUDevice;
|
||||
|
||||
MaterialParameters(const MaterialDescriptorSets *,const DescriptorSetsType &type,DescriptorSet *);
|
||||
MaterialParameters(const MaterialDescriptorSets *,const DescriptorSetType &type,DescriptorSet *);
|
||||
|
||||
public:
|
||||
|
||||
const DescriptorSetsType GetType (){return ds_type;}
|
||||
const DescriptorSetType GetType (){return ds_type;}
|
||||
DescriptorSet * GetDescriptorSet (){return descriptor_sets;}
|
||||
const VkDescriptorSet GetVkDescriptorSet ()const{return descriptor_sets->GetDescriptorSet();}
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
#define MP_TYPE_IS(name) const bool is##name()const{return ds_type==DescriptorSetsType::name;}
|
||||
#define MP_TYPE_IS(name) const bool is##name()const{return ds_type==DescriptorSetType::name;}
|
||||
MP_TYPE_IS(Skeleton)
|
||||
MP_TYPE_IS(Instance)
|
||||
MP_TYPE_IS(PerObject)
|
||||
|
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
const uint32_t GetBufferHash ()const{return buffer_hash;}
|
||||
|
||||
MaterialParameters *GetMP (const DescriptorSetsType &type){return mat_inst->GetMP(type);}
|
||||
MaterialParameters *GetMP (const DescriptorSetType &type){return mat_inst->GetMP(type);}
|
||||
|
||||
public: //instance support
|
||||
|
||||
|
Reference in New Issue
Block a user