renamed many values and function's name.
This commit is contained in:
@@ -129,13 +129,13 @@ bool RenderCmdBuffer::BindDescriptorSets(Material *mtl)
|
||||
return(true);
|
||||
}
|
||||
|
||||
void RenderCmdBuffer::BindIBO(const IBAccess *iba)
|
||||
{
|
||||
vkCmdBindIndexBuffer( cmd_buf,
|
||||
iba->buffer->GetBuffer(),
|
||||
iba->offset,
|
||||
VkIndexType(iba->buffer->GetType()));
|
||||
}
|
||||
//void RenderCmdBuffer::BindIBO(const IBAccess *iba)
|
||||
//{
|
||||
// vkCmdBindIndexBuffer( cmd_buf,
|
||||
// iba->buffer->GetBuffer(),
|
||||
// iba->start,
|
||||
// VkIndexType(iba->buffer->GetType()));
|
||||
//}
|
||||
|
||||
bool RenderCmdBuffer::BindVBO(Renderable *ri)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ bool RenderCmdBuffer::BindVBO(Renderable *ri)
|
||||
if(indices_buffer)
|
||||
vkCmdBindIndexBuffer(cmd_buf,
|
||||
indices_buffer->GetBuffer(),
|
||||
vid->ib_access->offset,
|
||||
vid->ib_access->start,
|
||||
VkIndexType(indices_buffer->GetType()));
|
||||
|
||||
return(true);
|
||||
@@ -187,8 +187,20 @@ void RenderCmdBuffer::DrawIndexedIndirect( VkBuffer buffer,
|
||||
void RenderCmdBuffer::Draw(const VertexInputData *vid)
|
||||
{
|
||||
if (vid->ib_access->buffer)
|
||||
DrawIndexed(vid->ib_access->buffer->GetCount());
|
||||
DrawIndexed(vid->ib_access->count);
|
||||
else
|
||||
Draw(vid->vertex_count);
|
||||
}
|
||||
|
||||
void RenderCmdBuffer::DrawIndexed(const IBAccess *iba,const uint32_t instance_count)
|
||||
{
|
||||
if(!iba||instance_count<=0)return;
|
||||
|
||||
vkCmdBindIndexBuffer(cmd_buf,
|
||||
iba->buffer->GetBuffer(),
|
||||
iba->start,
|
||||
VkIndexType(iba->buffer->GetType()));
|
||||
|
||||
vkCmdDrawIndexed(cmd_buf,iba->count,instance_count,0,0,0);
|
||||
}
|
||||
VK_NAMESPACE_END
|
||||
|
@@ -27,7 +27,7 @@ VK_NAMESPACE_BEGIN
|
||||
// return(true);
|
||||
//}
|
||||
|
||||
bool Primitive::Set(const AnsiString &name,VAB *vab,VkDeviceSize offset)
|
||||
bool Primitive::SetVAB(const AnsiString &name,VAB *vab,VkDeviceSize start)
|
||||
{
|
||||
if(!vab)return(false);
|
||||
if(buffer_list.KeyExist(name))return(false);
|
||||
@@ -35,8 +35,7 @@ bool Primitive::Set(const AnsiString &name,VAB *vab,VkDeviceSize offset)
|
||||
VABAccess vad;
|
||||
|
||||
vad.vab=vab;
|
||||
vad.offset=offset;
|
||||
vad.size=vab->GetBytes();
|
||||
vad.start=start;
|
||||
|
||||
buffer_list.Add(name,vad);
|
||||
|
||||
@@ -61,12 +60,13 @@ bool Primitive::GetVABAccess(const AnsiString &name,VABAccess *vad)
|
||||
return buffer_list.Get(name,*vad);
|
||||
}
|
||||
|
||||
bool Primitive::Set(IndexBuffer *ib,VkDeviceSize offset)
|
||||
bool Primitive::SetIndex(IndexBuffer *ib,VkDeviceSize start,const VkDeviceSize index_count)
|
||||
{
|
||||
if(!ib)return(false);
|
||||
|
||||
ib_access.buffer=ib;
|
||||
ib_access.offset=offset;
|
||||
ib_access.start=start;
|
||||
ib_access.count=index_count;
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
@@ -95,7 +95,7 @@ Renderable *CreateRenderable(Primitive *prim,MaterialInstance *mi,Pipeline *p)
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
vid->buffer_offset[i]=vad.offset;
|
||||
vid->buffer_offset[i]=vad.start;
|
||||
vid->buffer_list[i]=vab->GetBuffer();
|
||||
++vif;
|
||||
}
|
||||
|
Reference in New Issue
Block a user