update RenderAssignBuffer,but can't run.
This commit is contained in:
parent
4208e47534
commit
00d2677066
@ -76,6 +76,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
const bool HasMI ()const{return !mi_data_bytes;}
|
||||
const uint32_t GetMIDataBytes ()const{return mi_data_bytes;}
|
||||
const uint32_t GetMIMaxCount ()const{return mi_max_count;}
|
||||
|
||||
|
@ -91,7 +91,9 @@ void MaterialRenderList::End()
|
||||
|
||||
if(node_count<=0)return;
|
||||
|
||||
if(mtl->HasMI())
|
||||
StatMI();
|
||||
|
||||
Stat();
|
||||
|
||||
//写入LocalToWorld数据
|
||||
@ -116,6 +118,8 @@ void MaterialRenderList::StatMI()
|
||||
{
|
||||
//超出最大数量了怎么办???
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void MaterialRenderList::Stat()
|
||||
|
@ -8,6 +8,18 @@
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
RenderAssignBuffer::RenderAssignBuffer(GPUDevice *dev,const uint mi_total_bytes)
|
||||
{
|
||||
hgl_zero(*this);
|
||||
|
||||
device=dev;
|
||||
|
||||
if(mi_total_bytes>0)
|
||||
ubo_mi=device->CreateUBO(mi_total_bytes);
|
||||
else
|
||||
ubo_mi=nullptr;
|
||||
}
|
||||
|
||||
VkBuffer RenderAssignBuffer::GetAssignVBO()const
|
||||
{
|
||||
return vbo_assigns->GetBuffer();
|
||||
@ -44,13 +56,14 @@ void RenderAssignBuffer::Alloc(const uint nc,const uint mc)
|
||||
ubo_l2w=device->CreateUBO(node_count*sizeof(Matrix4f));
|
||||
}
|
||||
|
||||
{
|
||||
mi_count=power_to_2(mc);
|
||||
|
||||
ubo_mi=device->CreateUBO(mi_count*mi_data_bytes);
|
||||
vbo_assigns=device->CreateVBO(ASSIGN_VBO_FMT,node_count);
|
||||
}
|
||||
|
||||
vbo_assigns=device->CreateVBO(ASSIGN_VBO_FMT,node_count);
|
||||
bool RenderAssignBuffer::WriteMIData(void *mi_data,const uint bytes)
|
||||
{
|
||||
if(!mi_data||!bytes||!ubo_mi)return(false);
|
||||
|
||||
return ubo_mi->Write(mi_data,bytes);
|
||||
}
|
||||
|
||||
void RenderAssignBuffer::WriteNode(RenderNode *render_node,const uint count,const MaterialInstanceSets &mi_set)
|
||||
|
@ -37,8 +37,6 @@ private:
|
||||
uint node_count; ///<渲染节点数量
|
||||
DeviceBuffer *ubo_l2w; ///<Local2World数据
|
||||
|
||||
uint mi_count; ///<材质实例数量
|
||||
uint mi_data_bytes; ///<单个材质实例数据字节数
|
||||
DeviceBuffer *ubo_mi; ///<材质实例数据
|
||||
|
||||
//Assign VBO
|
||||
@ -58,17 +56,10 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
RenderAssignBuffer(GPUDevice *dev,const uint mi_bytes)
|
||||
{
|
||||
hgl_zero(*this);
|
||||
|
||||
device=dev;
|
||||
|
||||
mi_data_bytes=mi_bytes;
|
||||
}
|
||||
|
||||
RenderAssignBuffer(GPUDevice *dev,const uint mi_total_bytes);
|
||||
~RenderAssignBuffer(){Clear();}
|
||||
|
||||
bool WriteMIData(void *,const uint);
|
||||
void WriteNode(RenderNode *render_node,const uint count,const MaterialInstanceSets &mi_set);
|
||||
|
||||
};//struct RenderAssignBuffer
|
||||
|
Loading…
x
Reference in New Issue
Block a user