using IBAccess=IndexBufferAccess
This commit is contained in:
parent
6dba761a80
commit
bbf94767fe
@ -8,11 +8,7 @@ namespace hgl
|
||||
namespace graph
|
||||
{
|
||||
class Renderable;
|
||||
class Material;
|
||||
class MaterialInstance;
|
||||
class GPUDevice;
|
||||
struct VertexInputData;
|
||||
struct IndexBufferAccess;
|
||||
|
||||
struct RenderNode
|
||||
{
|
||||
|
@ -67,6 +67,8 @@ struct IndexBufferAccess
|
||||
VkDeviceSize offset=0;
|
||||
};
|
||||
|
||||
using IBAccess=IndexBufferAccess;
|
||||
|
||||
class GPUCmdBuffer;
|
||||
class RenderCmdBuffer;
|
||||
class TextureCmdBuffer;
|
||||
|
@ -170,7 +170,7 @@ public:
|
||||
return(true);
|
||||
}
|
||||
|
||||
void BindIBO(const IndexBufferAccess *);
|
||||
void BindIBO(const IBAccess *);
|
||||
|
||||
bool BindVBO(Renderable *);
|
||||
|
||||
|
@ -20,7 +20,7 @@ protected:
|
||||
|
||||
VABAccessMap buffer_list;
|
||||
|
||||
IndexBufferAccess ib_access;
|
||||
IBAccess ib_access;
|
||||
|
||||
AABB BoundingBox;
|
||||
|
||||
@ -53,7 +53,7 @@ public:
|
||||
bool GetVABAccess (const AnsiString &,VABAccess *);
|
||||
const int GetBufferCount ()const {return buffer_list.GetCount();}
|
||||
|
||||
const IndexBufferAccess * GetIndexBufferAccess()const {return &ib_access;}
|
||||
const IBAccess * GetIBAccess ()const {return &ib_access;}
|
||||
};//class Primitive
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_VULKAN_PRIMITIVE_INCLUDE
|
||||
|
@ -14,9 +14,9 @@ struct PrimitiveData
|
||||
|
||||
VABAccess *vab_list;
|
||||
|
||||
IndexBufferAccess ib_access;
|
||||
IBAccess ib_access;
|
||||
|
||||
AABB BoundingBox;
|
||||
};
|
||||
};//struct PrimitiveData
|
||||
|
||||
VK_NAMESPACE_END
|
||||
|
@ -17,11 +17,11 @@ struct VertexInputData
|
||||
|
||||
uint32_t vertex_count;
|
||||
|
||||
const IndexBufferAccess *ib_access;
|
||||
const IBAccess *ib_access;
|
||||
|
||||
public:
|
||||
|
||||
VertexInputData(const uint32_t,const uint32_t,const IndexBufferAccess *);
|
||||
VertexInputData(const uint32_t,const uint32_t,const IBAccess *);
|
||||
~VertexInputData();
|
||||
|
||||
const bool Comp(const VertexInputData *vid)const
|
||||
|
@ -256,13 +256,13 @@ void MaterialRenderList::Render(RenderItem *ri)
|
||||
last_vid=ri->vid;
|
||||
}
|
||||
|
||||
const IndexBufferAccess *ibd=last_vid->ib_access;
|
||||
const IBAccess *iba=last_vid->ib_access;
|
||||
|
||||
if(ibd->buffer)
|
||||
if(iba->buffer)
|
||||
{
|
||||
cmd_buf->BindIBO(ibd);
|
||||
cmd_buf->BindIBO(iba);
|
||||
|
||||
cmd_buf->DrawIndexed(ibd->buffer->GetCount(),ri->count);
|
||||
cmd_buf->DrawIndexed(iba->buffer->GetCount(),ri->count);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -129,12 +129,12 @@ bool RenderCmdBuffer::BindDescriptorSets(Material *mtl)
|
||||
return(true);
|
||||
}
|
||||
|
||||
void RenderCmdBuffer::BindIBO(const IndexBufferAccess *ibd)
|
||||
void RenderCmdBuffer::BindIBO(const IBAccess *iba)
|
||||
{
|
||||
vkCmdBindIndexBuffer( cmd_buf,
|
||||
ibd->buffer->GetBuffer(),
|
||||
ibd->offset,
|
||||
VkIndexType(ibd->buffer->GetType()));
|
||||
iba->buffer->GetBuffer(),
|
||||
iba->offset,
|
||||
VkIndexType(iba->buffer->GetType()));
|
||||
}
|
||||
|
||||
bool RenderCmdBuffer::BindVBO(Renderable *ri)
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include<hgl/log/LogInfo.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
VertexInputData::VertexInputData(const uint32_t c,const uint32_t vc,const IndexBufferAccess *iba)
|
||||
VertexInputData::VertexInputData(const uint32_t c,const uint32_t vc,const IBAccess *iba)
|
||||
{
|
||||
binding_count=c;
|
||||
|
||||
@ -57,7 +57,7 @@ Renderable *CreateRenderable(Primitive *prim,MaterialInstance *mi,Pipeline *p)
|
||||
|
||||
VAB *vab;
|
||||
|
||||
VertexInputData *vid=new VertexInputData(input_count,prim->GetVertexCount(),prim->GetIndexBufferAccess());
|
||||
VertexInputData *vid=new VertexInputData(input_count,prim->GetVertexCount(),prim->GetIBAccess());
|
||||
|
||||
const VertexInputFormat *vif=vil->GetVIFList(VertexInputGroup::Basic);
|
||||
VABAccess vad;
|
||||
|
Loading…
x
Reference in New Issue
Block a user