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