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