added comments at VKDeviceMaterial.cpp

This commit is contained in:
2023-05-10 02:32:03 +08:00
parent 7c3d9ecf91
commit 004504e027
4 changed files with 19 additions and 9 deletions

View File

@@ -62,7 +62,7 @@ namespace
// FEATURE_COPY(imageCubeArray);
// FEATURE_COPY(fullDrawIndexUint32);
// FEATURE_COPY(wideLines)
FEATURE_COPY(wideLines)
// FEATURE_COPY(largePoints)
#undef FEATURE_COPY

View File

@@ -1,4 +1,4 @@
#include<hgl/graph/VKDevice.h>
#include<hgl/graph/VKDevice.h>
#include<hgl/graph/VKMaterial.h>
#include<hgl/graph/VKMaterialDescriptorManager.h>
#include<hgl/graph/VKMaterialParameters.h>
@@ -119,15 +119,20 @@ Material *GPUDevice::CreateMaterial(const UTF8String &mtl_name,ShaderModuleMap *
const VkDeviceSize ubo_range=this->GetUBORange();
//手机一般ubo_range为16k,PC独显一般为64k
//intel 核显随显存基本无限制
//我们使用uint8类型在vertex input中保存MaterialInstance ID表示范围0-255。
//所以MaterialInstance结构容量在手机上尽量不要超过64字节在PC上不要超过256字节当然intel核显无所谓
if(desc_manager->hasSet(DescriptorSetType::PerMaterial))
{
data->mi_data=new uint8[ubo_range];
data->mi_size
data->mi_data=new uint8[data->mi_size*256];
}
else
{
data->mi_data=nullptr;
data->mi_size=0;
data->mi_data=nullptr;
}
return(new Material(data));

View File

@@ -18,7 +18,6 @@ MaterialData::~MaterialData()
Material::Material(MaterialData *md):data(md)
{
mi_size=0;
mi_count=0;
}