renamed to IndexBufferAccess from IndexBufferData

This commit is contained in:
2024-04-26 00:32:11 +08:00
parent 3bbbe18c40
commit 9c6c37c07a
11 changed files with 28 additions and 24 deletions

View File

@@ -129,7 +129,7 @@ bool RenderCmdBuffer::BindDescriptorSets(Material *mtl)
return(true);
}
void RenderCmdBuffer::BindIBO(const IndexBufferData *ibd)
void RenderCmdBuffer::BindIBO(const IndexBufferAccess *ibd)
{
vkCmdBindIndexBuffer( cmd_buf,
ibd->buffer->GetBuffer(),
@@ -149,10 +149,13 @@ bool RenderCmdBuffer::BindVBO(Renderable *ri)
vkCmdBindVertexBuffers(cmd_buf,0,vid->binding_count,vid->buffer_list,vid->buffer_offset);
IndexBuffer *indices_buffer=vid->index_buffer->buffer;
IndexBuffer *indices_buffer=vid->ib_access->buffer;
if(indices_buffer)
vkCmdBindIndexBuffer(cmd_buf,indices_buffer->GetBuffer(),vid->index_buffer->offset,VkIndexType(indices_buffer->GetType()));
vkCmdBindIndexBuffer(cmd_buf,
indices_buffer->GetBuffer(),
vid->ib_access->offset,
VkIndexType(indices_buffer->GetType()));
return(true);
}

View File

@@ -65,8 +65,8 @@ bool Primitive::Set(IndexBuffer *ib,VkDeviceSize offset)
{
if(!ib)return(false);
index_buffer_data.buffer=ib;
index_buffer_data.offset=offset;
ib_access.buffer=ib;
ib_access.offset=offset;
#ifdef _DEBUG
DebugUtils *du=device->GetDebugUtils();

View File

@@ -6,7 +6,7 @@
#include<hgl/log/LogInfo.h>
VK_NAMESPACE_BEGIN
VertexInputData::VertexInputData(const uint32_t c,const uint32_t vc,const IndexBufferData *ibd)
VertexInputData::VertexInputData(const uint32_t c,const uint32_t vc,const IndexBufferAccess *iba)
{
binding_count=c;
@@ -15,7 +15,7 @@ VertexInputData::VertexInputData(const uint32_t c,const uint32_t vc,const IndexB
vertex_count=vc;
index_buffer=ibd;
ib_access=iba;
}
VertexInputData::~VertexInputData()
@@ -57,7 +57,7 @@ Renderable *CreateRenderable(Primitive *prim,MaterialInstance *mi,Pipeline *p)
VAB *vab;
VertexInputData *vid=new VertexInputData(input_count,prim->GetVertexCount(),prim->GetIndexBufferData());
VertexInputData *vid=new VertexInputData(input_count,prim->GetVertexCount(),prim->GetIndexBufferAccess());
const VertexInputFormat *vif=vil->GetVIFList(VertexInputGroup::Basic);
VABAccess vad;