use GetVBOAccessData instead of GetVBO in Primitive.
This commit is contained in:
parent
af8f62ddb4
commit
f4493b09e5
@ -6,6 +6,7 @@
|
||||
#include<hgl/type/String.h>
|
||||
#include<hgl/math/Math.h>
|
||||
#include<hgl/graph/AABB.h>
|
||||
#include<hgl/graph/VKVertexAttribBuffer.h>
|
||||
VK_NAMESPACE_BEGIN
|
||||
/**
|
||||
* 单一图元数据
|
||||
@ -60,7 +61,7 @@ public:
|
||||
|
||||
const uint32_t GetVertexCount ()const {return vertex_count;}
|
||||
|
||||
VBO * GetVBO (const AnsiString &,VkDeviceSize *);
|
||||
bool GetVBOAccessData (const AnsiString &,VBOAccessData *);
|
||||
const int GetBufferCount ()const {return buffer_list.GetCount();}
|
||||
|
||||
const IndexBufferData * GetIndexBufferData ()const {return &index_buffer_data;}
|
||||
|
@ -32,12 +32,13 @@ bool Primitive::Set(const AnsiString &name,VBO *vbo,VkDeviceSize offset)
|
||||
if(!vbo)return(false);
|
||||
if(buffer_list.KeyExist(name))return(false);
|
||||
|
||||
VBOAccessData bd;
|
||||
|
||||
bd.buf=vbo;
|
||||
bd.offset=offset;
|
||||
VBOAccessData vad;
|
||||
|
||||
buffer_list.Add(name,bd);
|
||||
vad.vbo=vbo;
|
||||
vad.offset=offset;
|
||||
vad.size=vbo->GetBytes();
|
||||
|
||||
buffer_list.Add(name,vad);
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
@ -52,20 +53,12 @@ bool Primitive::Set(const AnsiString &name,VBO *vbo,VkDeviceSize offset)
|
||||
return(true);
|
||||
}
|
||||
|
||||
VBO *Primitive::GetVBO(const AnsiString &name,VkDeviceSize *offset)
|
||||
bool Primitive::GetVBOAccessData(const AnsiString &name,VBOAccessData *vad)
|
||||
{
|
||||
if(!offset)return(nullptr);
|
||||
if(name.IsEmpty())return(nullptr);
|
||||
if(name.IsEmpty())return(false);
|
||||
if(!vad)return(false);
|
||||
|
||||
VBOAccessData bd;
|
||||
|
||||
if(buffer_list.Get(name,bd))
|
||||
{
|
||||
*offset=bd.offset;
|
||||
return bd.buf;
|
||||
}
|
||||
|
||||
return(nullptr);
|
||||
return buffer_list.Get(name,*vad);
|
||||
}
|
||||
|
||||
bool Primitive::Set(IndexBuffer *ib,VkDeviceSize offset)
|
||||
|
Loading…
x
Reference in New Issue
Block a user