moved AddBuffer to .h for RenderResource
This commit is contained in:
parent
240b6fb0e3
commit
a58589f01f
@ -16,6 +16,7 @@
|
||||
#include<hgl/type/ObjectManage.h>
|
||||
#include<hgl/shadergen/MaterialCreateInfo.h>
|
||||
#include<hgl/graph/VKDescriptorBindingManage.h>
|
||||
#include<hgl/graph/VKDevice.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
@ -61,7 +62,20 @@ class RenderResource
|
||||
|
||||
private:
|
||||
|
||||
void AddBuffer(const AnsiString &buf_name,DeviceBuffer *buf);
|
||||
void AddBuffer(const AnsiString &buf_name,DeviceBuffer *buf)
|
||||
{
|
||||
rm_buffers.Add(buf);
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(du)
|
||||
{
|
||||
du->SetBuffer(buf->GetBuffer(),buf_name+":Buffer");
|
||||
du->SetDeviceMemory(buf->GetVkMemory(),buf_name+":Memory");
|
||||
}
|
||||
#endif//_DEBUG
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
@ -17,23 +17,6 @@ VBO *RenderResource::CreateVBO(VkFormat format,uint32_t count,const void *data,S
|
||||
return vb;
|
||||
}
|
||||
|
||||
void RenderResource::AddBuffer(const AnsiString &buf_name,DeviceBuffer *buf)
|
||||
{
|
||||
if(!buf)return;
|
||||
|
||||
rm_buffers.Add(buf);
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(du)
|
||||
{
|
||||
du->SetBuffer(buf->GetBuffer(),buf_name+":Buffer");
|
||||
du->SetDeviceMemory(buf->GetVkMemory(),buf_name+":Memory");
|
||||
}
|
||||
#endif//_DEBUG
|
||||
}
|
||||
|
||||
#define SCENE_DB_CREATE_BUFFER(name) DeviceBuffer *RenderResource::Create##name(const AnsiString &buf_name,VkDeviceSize size,void *data,SharingMode sharing_mode) \
|
||||
{ \
|
||||
DeviceBuffer *buf=device->Create##name(size,data,sharing_mode); \
|
||||
|
Loading…
x
Reference in New Issue
Block a user