renamed to MaterialDescriptorManager from MaterialDescriptorSets
This commit is contained in:
parent
81e2aac321
commit
85530e6d57
@ -76,7 +76,7 @@ struct ShaderAttribute;
|
|||||||
class ShaderResource;
|
class ShaderResource;
|
||||||
class ShaderModule;
|
class ShaderModule;
|
||||||
class ShaderModuleMap;
|
class ShaderModuleMap;
|
||||||
class MaterialDescriptorSets;
|
class MaterialDescriptorManager;
|
||||||
|
|
||||||
class Material;
|
class Material;
|
||||||
class MaterialParameters;
|
class MaterialParameters;
|
||||||
|
@ -217,16 +217,16 @@ public: //
|
|||||||
|
|
||||||
public: //shader & material
|
public: //shader & material
|
||||||
|
|
||||||
PipelineLayoutData *CreatePipelineLayoutData(const MaterialDescriptorSets *);
|
PipelineLayoutData *CreatePipelineLayoutData(const MaterialDescriptorManager *);
|
||||||
void Destroy(PipelineLayoutData *);
|
void Destroy(PipelineLayoutData *);
|
||||||
|
|
||||||
DescriptorSet * CreateDS(const PipelineLayoutData *,const DescriptorSetType &type)const;
|
DescriptorSet * CreateDS(const PipelineLayoutData *,const DescriptorSetType &type)const;
|
||||||
MaterialParameters *CreateMP(const MaterialDescriptorSets *,const PipelineLayoutData *,const DescriptorSetType &);
|
MaterialParameters *CreateMP(const MaterialDescriptorManager *,const PipelineLayoutData *,const DescriptorSetType &);
|
||||||
MaterialParameters *CreateMP(Material *,const DescriptorSetType &);
|
MaterialParameters *CreateMP(Material *,const DescriptorSetType &);
|
||||||
|
|
||||||
ShaderModule *CreateShaderModule(VkShaderStageFlagBits,const uint32_t *,const size_t);
|
ShaderModule *CreateShaderModule(VkShaderStageFlagBits,const uint32_t *,const size_t);
|
||||||
|
|
||||||
Material *CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *shader_maps,MaterialDescriptorSets *,VertexInput *);
|
Material *CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *shader_maps,MaterialDescriptorManager *,VertexInput *);
|
||||||
|
|
||||||
MaterialInstance *CreateMI(Material *,const VILConfig *vil_cfg=nullptr);
|
MaterialInstance *CreateMI(Material *,const VILConfig *vil_cfg=nullptr);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ struct MaterialData
|
|||||||
|
|
||||||
ShaderModuleMap *shader_maps;
|
ShaderModuleMap *shader_maps;
|
||||||
|
|
||||||
MaterialDescriptorSets *mds;
|
MaterialDescriptorManager *mds;
|
||||||
|
|
||||||
ShaderStageCreateInfoList shader_stage_list;
|
ShaderStageCreateInfoList shader_stage_list;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ public:
|
|||||||
|
|
||||||
const ShaderStageCreateInfoList & GetStageList ()const{return data->shader_stage_list;}
|
const ShaderStageCreateInfoList & GetStageList ()const{return data->shader_stage_list;}
|
||||||
|
|
||||||
const MaterialDescriptorSets * GetDescriptorSets ()const{return data->mds;}
|
const MaterialDescriptorManager * GetDescriptorSets ()const{return data->mds;}
|
||||||
const VkPipelineLayout GetPipelineLayout ()const;
|
const VkPipelineLayout GetPipelineLayout ()const;
|
||||||
const PipelineLayoutData * GetPipelineLayoutData ()const{return data->pipeline_layout_data;}
|
const PipelineLayoutData * GetPipelineLayoutData ()const{return data->pipeline_layout_data;}
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#ifndef HGL_GRAPH_VULKAN_MATERIAL_DESCRIPTOR_SETS_INCLUDE
|
#ifndef HGL_GRAPH_VULKAN_MATERIAL_DESCRIPTOR_MANAGER_INCLUDE
|
||||||
#define HGL_GRAPH_VULKAN_MATERIAL_DESCRIPTOR_SETS_INCLUDE
|
#define HGL_GRAPH_VULKAN_MATERIAL_DESCRIPTOR_MANAGER_INCLUDE
|
||||||
|
|
||||||
#include<hgl/graph/VK.h>
|
#include<hgl/graph/VK.h>
|
||||||
#include<hgl/graph/VKShaderDescriptor.h>
|
#include<hgl/graph/VKShaderDescriptor.h>
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
class MaterialDescriptorSets
|
class MaterialDescriptorManager
|
||||||
{
|
{
|
||||||
UTF8String mtl_name;
|
UTF8String mtl_name;
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MaterialDescriptorSets(const UTF8String &,ShaderDescriptor *,const uint);
|
MaterialDescriptorManager(const UTF8String &,ShaderDescriptor *,const uint);
|
||||||
~MaterialDescriptorSets();
|
~MaterialDescriptorManager();
|
||||||
|
|
||||||
const UTF8String &GetMaterialName()const{return mtl_name;}
|
const UTF8String &GetMaterialName()const{return mtl_name;}
|
||||||
|
|
||||||
@ -39,6 +39,6 @@ public:
|
|||||||
|
|
||||||
const bool hasSet(const DescriptorSetType &type)const{return set_has_desc[size_t(type)];}
|
const bool hasSet(const DescriptorSetType &type)const{return set_has_desc[size_t(type)];}
|
||||||
//!sd_list_by_set_type[size_t(type)].IsEmpty();}
|
//!sd_list_by_set_type[size_t(type)].IsEmpty();}
|
||||||
};//class MaterialDescriptorSets
|
};//class MaterialDescriptorManager
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
#endif//HGL_GRAPH_VULKAN_MATERIAL_DESCRIPTOR_SETS_INCLUDE
|
#endif//HGL_GRAPH_VULKAN_MATERIAL_DESCRIPTOR_MANAGER_INCLUDE
|
@ -8,7 +8,7 @@
|
|||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
class MaterialParameters
|
class MaterialParameters
|
||||||
{
|
{
|
||||||
const MaterialDescriptorSets *mds;
|
const MaterialDescriptorManager *mds;
|
||||||
|
|
||||||
DescriptorSetType set_type;
|
DescriptorSetType set_type;
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ private:
|
|||||||
|
|
||||||
friend class GPUDevice;
|
friend class GPUDevice;
|
||||||
|
|
||||||
MaterialParameters(const MaterialDescriptorSets *,const DescriptorSetType &type,DescriptorSet *);
|
MaterialParameters(const MaterialDescriptorManager *,const DescriptorSetType &type,DescriptorSet *);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -94,8 +94,8 @@ SET(VK_RR_SHADER_FILES ${SG_INCLUDE_PATH}/VKShaderResource.h
|
|||||||
|
|
||||||
SOURCE_GROUP("Vulkan\\RenderResource\\Shader" FILES ${VK_RR_SHADER_FILES})
|
SOURCE_GROUP("Vulkan\\RenderResource\\Shader" FILES ${VK_RR_SHADER_FILES})
|
||||||
|
|
||||||
SET(VK_RR_MATERIAL_FILES ${SG_INCLUDE_PATH}/VKMaterialDescriptorSets.h
|
SET(VK_RR_MATERIAL_FILES ${SG_INCLUDE_PATH}/VKMaterialDescriptorManager.h
|
||||||
Vulkan/VKMaterialDescriptorSets.cpp)
|
Vulkan/VKMaterialDescriptorManager.cpp)
|
||||||
|
|
||||||
SOURCE_GROUP("Vulkan\\RenderResource\\Material" FILES ${VK_RR_MATERIAL_FILES})
|
SOURCE_GROUP("Vulkan\\RenderResource\\Material" FILES ${VK_RR_MATERIAL_FILES})
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include<hgl/graph/VKDevice.h>
|
#include<hgl/graph/VKDevice.h>
|
||||||
#include<hgl/graph/VKMaterial.h>
|
#include<hgl/graph/VKMaterial.h>
|
||||||
#include<hgl/graph/VKMaterialDescriptorSets.h>
|
#include<hgl/graph/VKMaterialDescriptorManager.h>
|
||||||
#include<hgl/graph/VKMaterialParameters.h>
|
#include<hgl/graph/VKMaterialParameters.h>
|
||||||
#include<hgl/graph/VKDescriptorSet.h>
|
#include<hgl/graph/VKDescriptorSet.h>
|
||||||
#include<hgl/graph/VKShaderModuleMap.h>
|
#include<hgl/graph/VKShaderModuleMap.h>
|
||||||
@ -31,7 +31,7 @@ DescriptorSet *GPUDevice::CreateDS(const PipelineLayoutData *pld,const Descripto
|
|||||||
return(new DescriptorSet(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 DescriptorSetType &desc_set_type)
|
MaterialParameters *GPUDevice::CreateMP(const MaterialDescriptorManager *mds,const PipelineLayoutData *pld,const DescriptorSetType &desc_set_type)
|
||||||
{
|
{
|
||||||
if(!mds||!pld)return(nullptr);
|
if(!mds||!pld)return(nullptr);
|
||||||
if(!RangeCheck<DescriptorSetType>(desc_set_type))
|
if(!RangeCheck<DescriptorSetType>(desc_set_type))
|
||||||
@ -77,7 +77,7 @@ void CreateShaderStageList(List<VkPipelineShaderStageCreateInfo> &shader_stage_l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Material *GPUDevice::CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *shader_maps,MaterialDescriptorSets *mds,VertexInput *vi)
|
Material *GPUDevice::CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *shader_maps,MaterialDescriptorManager *mds,VertexInput *vi)
|
||||||
{
|
{
|
||||||
const int shader_count=shader_maps->GetCount();
|
const int shader_count=shader_maps->GetCount();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include<hgl/graph/VKMaterial.h>
|
#include<hgl/graph/VKMaterial.h>
|
||||||
#include<hgl/graph/VKMaterialParameters.h>
|
#include<hgl/graph/VKMaterialParameters.h>
|
||||||
#include<hgl/graph/VKMaterialDescriptorSets.h>
|
#include<hgl/graph/VKMaterialDescriptorManager.h>
|
||||||
#include<hgl/graph/VKVertexInput.h>
|
#include<hgl/graph/VKVertexInput.h>
|
||||||
#include"VKPipelineLayoutData.h"
|
#include"VKPipelineLayoutData.h"
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include<hgl/graph/VKMaterialDescriptorSets.h>
|
#include<hgl/graph/VKMaterialDescriptorManager.h>
|
||||||
#include<hgl/graph/VKDescriptorSetType.h>
|
#include<hgl/graph/VKDescriptorSetType.h>
|
||||||
#include<hgl/TypeFunc.h>
|
#include<hgl/TypeFunc.h>
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ void WriteDescriptorSetLayoutBinding(VkDescriptorSetLayoutBinding *dslb,ShaderDe
|
|||||||
dslb->pImmutableSamplers=nullptr;
|
dslb->pImmutableSamplers=nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialDescriptorSets::MaterialDescriptorSets(const UTF8String &name,ShaderDescriptor *sd_list,const uint sd_count)
|
MaterialDescriptorManager::MaterialDescriptorManager(const UTF8String &name,ShaderDescriptor *sd_list,const uint sd_count)
|
||||||
{
|
{
|
||||||
mtl_name=name;
|
mtl_name=name;
|
||||||
|
|
||||||
@ -82,12 +82,12 @@ MaterialDescriptorSets::MaterialDescriptorSets(const UTF8String &name,ShaderDesc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialDescriptorSets::~MaterialDescriptorSets()
|
MaterialDescriptorManager::~MaterialDescriptorManager()
|
||||||
{
|
{
|
||||||
delete[] all_dslb;
|
delete[] all_dslb;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int MaterialDescriptorSets::GetBinding(const VkDescriptorType &desc_type,const AnsiString &name)const
|
const int MaterialDescriptorManager::GetBinding(const VkDescriptorType &desc_type,const AnsiString &name)const
|
||||||
{
|
{
|
||||||
if(desc_type<VK_DESCRIPTOR_TYPE_BEGIN_RANGE
|
if(desc_type<VK_DESCRIPTOR_TYPE_BEGIN_RANGE
|
||||||
||desc_type>VK_DESCRIPTOR_TYPE_END_RANGE)
|
||desc_type>VK_DESCRIPTOR_TYPE_END_RANGE)
|
@ -1,10 +1,10 @@
|
|||||||
#include<hgl/graph/VKMaterialParameters.h>
|
#include<hgl/graph/VKMaterialParameters.h>
|
||||||
#include<hgl/graph/VKMaterialDescriptorSets.h>
|
#include<hgl/graph/VKMaterialDescriptorManager.h>
|
||||||
#include<hgl/graph/VKMaterial.h>
|
#include<hgl/graph/VKMaterial.h>
|
||||||
#include<hgl/graph/VKDescriptorSet.h>
|
#include<hgl/graph/VKDescriptorSet.h>
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
MaterialParameters::MaterialParameters(const MaterialDescriptorSets *_mds,const DescriptorSetType &type,DescriptorSet *ds)
|
MaterialParameters::MaterialParameters(const MaterialDescriptorManager *_mds,const DescriptorSetType &type,DescriptorSet *ds)
|
||||||
{
|
{
|
||||||
mds=_mds;
|
mds=_mds;
|
||||||
set_type=type;
|
set_type=type;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include"VKPipelineLayoutData.h"
|
#include"VKPipelineLayoutData.h"
|
||||||
#include<hgl/graph/VKDescriptorSet.h>
|
#include<hgl/graph/VKDescriptorSet.h>
|
||||||
#include<hgl/graph/VKDevice.h>
|
#include<hgl/graph/VKDevice.h>
|
||||||
#include<hgl/graph/VKMaterialDescriptorSets.h>
|
#include<hgl/graph/VKMaterialDescriptorManager.h>
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
PipelineLayoutData *GPUDevice::CreatePipelineLayoutData(const MaterialDescriptorSets *mds)
|
PipelineLayoutData *GPUDevice::CreatePipelineLayoutData(const MaterialDescriptorManager *mds)
|
||||||
{
|
{
|
||||||
PipelineLayoutData *pld=hgl_zero_new<PipelineLayoutData>();
|
PipelineLayoutData *pld=hgl_zero_new<PipelineLayoutData>();
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include<hgl/graph/VKDevice.h>
|
#include<hgl/graph/VKDevice.h>
|
||||||
#include<hgl/graph/VKShaderModuleMap.h>
|
#include<hgl/graph/VKShaderModuleMap.h>
|
||||||
#include<hgl/graph/VKShaderResource.h>
|
#include<hgl/graph/VKShaderResource.h>
|
||||||
#include<hgl/graph/VKMaterialDescriptorSets.h>
|
#include<hgl/graph/VKMaterialDescriptorManager.h>
|
||||||
#include<hgl/graph/VKVertexInput.h>
|
#include<hgl/graph/VKVertexInput.h>
|
||||||
#include<hgl/filesystem/FileSystem.h>
|
#include<hgl/filesystem/FileSystem.h>
|
||||||
#include<hgl/graph/VKRenderResource.h>
|
#include<hgl/graph/VKRenderResource.h>
|
||||||
@ -165,7 +165,7 @@ Material *RenderResource::CreateMaterial(const OSString &filename)
|
|||||||
|
|
||||||
const UTF8String mtl_name=ToUTF8String(filename);
|
const UTF8String mtl_name=ToUTF8String(filename);
|
||||||
|
|
||||||
MaterialDescriptorSets *mds=nullptr;
|
MaterialDescriptorManager *mds=nullptr;
|
||||||
{
|
{
|
||||||
uint8 count;
|
uint8 count;
|
||||||
cbr.Read(count);
|
cbr.Read(count);
|
||||||
@ -176,7 +176,7 @@ Material *RenderResource::CreateMaterial(const OSString &filename)
|
|||||||
|
|
||||||
LoadShaderDescriptor(cbr,sd_list,count,ver);
|
LoadShaderDescriptor(cbr,sd_list,count,ver);
|
||||||
|
|
||||||
mds=new MaterialDescriptorSets(mtl_name,sd_list,count);
|
mds=new MaterialDescriptorManager(mtl_name,sd_list,count);
|
||||||
|
|
||||||
delete[] sd_list;
|
delete[] sd_list;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user