update codes...but can't compile
This commit is contained in:
@@ -6,6 +6,27 @@
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
namespace graph
|
||||
{
|
||||
GPUArrayBuffer *GPUDevice::CreateUBO(const VkDeviceSize &item_length)
|
||||
{
|
||||
const uint unit_size=hgl_align<VkDeviceSize>(item_length,GetUBOAlign());
|
||||
|
||||
auto vk_ma=new VKMemoryAllocator(this,VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,unit_size);
|
||||
|
||||
return(new GPUArrayBuffer(vk_ma,unit_size));
|
||||
}
|
||||
|
||||
GPUArrayBuffer *GPUDevice::CreateSSBO(const VkDeviceSize &item_length)
|
||||
{
|
||||
const uint unit_size=hgl_align<VkDeviceSize>(item_length,GetSSBOAlign());
|
||||
|
||||
auto vk_ma=new VKMemoryAllocator(this,VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,unit_size);
|
||||
|
||||
return(new GPUArrayBuffer(vk_ma,unit_size));
|
||||
}
|
||||
}//namespace graph
|
||||
|
||||
namespace graph
|
||||
{
|
||||
GPUArrayBuffer::GPUArrayBuffer(VKMemoryAllocator *va,const uint us)
|
||||
@@ -50,23 +71,5 @@ namespace hgl
|
||||
{
|
||||
vk_ma->Flush(count*unit_size);
|
||||
}
|
||||
|
||||
GPUArrayBuffer *GPUDevice::CreateUBO(const VkDeviceSize &item_length)
|
||||
{
|
||||
const uint unit_size=hgl_align<VkDeviceSize>(item_length,GetUBOAlign());
|
||||
|
||||
auto vk_ma=new VKMemoryAllocator(this,VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,unit_size);
|
||||
|
||||
return(new GPUArrayBuffer(vk_ma,unit_size));
|
||||
}
|
||||
|
||||
GPUArrayBuffer *GPUDevice::CreateSSBO(const VkDeviceSize &item_length)
|
||||
{
|
||||
const uint unit_size=hgl_align<VkDeviceSize>(item_length,GetSSBOAlign());
|
||||
|
||||
auto vk_ma=new VKMemoryAllocator(this,VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,unit_size);
|
||||
|
||||
return(new GPUArrayBuffer(vk_ma,unit_size));
|
||||
}
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
|
@@ -32,10 +32,10 @@ bool DescriptorBinding::Bind(MaterialInstance *mi)
|
||||
|
||||
for(uint i=0;i<count;i++)
|
||||
{
|
||||
buf=GetUBO((*dp)->left);
|
||||
buf=GetUBO((*dp)->key);
|
||||
|
||||
if(buf)
|
||||
mp->BindUBO((*dp)->right,buf,false);
|
||||
mp->BindUBO((*dp)->value,buf,false);
|
||||
|
||||
++dp;
|
||||
}
|
||||
@@ -48,10 +48,10 @@ bool DescriptorBinding::Bind(MaterialInstance *mi)
|
||||
|
||||
for(uint i=0;i<count;i++)
|
||||
{
|
||||
buf=GetUBO((*dp)->left);
|
||||
buf=GetUBO((*dp)->key);
|
||||
|
||||
if(buf)
|
||||
mp->BindUBO((*dp)->right,buf,true);
|
||||
mp->BindUBO((*dp)->value,buf,true);
|
||||
|
||||
++dp;
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ void CreateShaderStageList(List<VkPipelineShaderStageCreateInfo> &shader_stage_l
|
||||
auto **itp=shader_maps->GetDataList();
|
||||
for(int i=0;i<shader_count;i++)
|
||||
{
|
||||
sm=(*itp)->right;
|
||||
sm=(*itp)->value;
|
||||
hgl_cpy(p,sm->GetCreateInfo(),1);
|
||||
|
||||
++p;
|
||||
|
@@ -202,7 +202,7 @@ DeviceRenderPassManage::~DeviceRenderPassManage()
|
||||
|
||||
for(int i=0;i<count;i++)
|
||||
{
|
||||
delete (*obj)->right;
|
||||
delete (*obj)->value;
|
||||
|
||||
++obj;
|
||||
}
|
||||
|
@@ -107,7 +107,7 @@ MaterialDescriptorManager::MaterialDescriptorManager(const UTF8String &name,cons
|
||||
|
||||
for(int j=0;j<sds_array[i].count;j++)
|
||||
{
|
||||
sd=(*sp)->right;
|
||||
sd=(*sp)->value;
|
||||
|
||||
binding_map[size_t(sd->set_type)][size_t(sd->desc_type)].Add(sd->name,sd->binding);
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include<hgl/graph/VKDevice.h>
|
||||
#include<hgl/graph/VKDevice.h>
|
||||
#include<hgl/graph/VKMaterialInstance.h>
|
||||
#include<hgl/graph/VKMaterialParameters.h>
|
||||
#include<hgl/graph/VKShaderModule.h>
|
||||
@@ -21,10 +21,13 @@ MaterialInstance::MaterialInstance(Material *mtl,VIL *v)
|
||||
|
||||
vil=v;
|
||||
|
||||
mp_per_mi=
|
||||
device->CreateMP(desc_manager,pld,(DescriptorSetType)dst);
|
||||
PerMaterial<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD>MaterialInstance<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD>MP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
||||
mtl->GetMP(DescriptorSetType::PerMaterial);
|
||||
mp_per_mi=mtl->GetMP(DescriptorSetType::PerMaterial);
|
||||
|
||||
/*
|
||||
由于PerMaterial的属性每个MaterialInstance不一样,
|
||||
所以理论上需要在这里分配属于它自己的MP做绑定记录
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
bool MaterialInstance::BindUBO(const DescriptorSetType &type,const AnsiString &name,DeviceBuffer *ubo,bool dynamic)
|
||||
|
Reference in New Issue
Block a user