renamed to VAB from VBO
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include<hgl/graph/RenderNode.h>
|
||||
#include<hgl/graph/VKVBOList.h>
|
||||
#include<hgl/graph/VKVABList.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
class RenderAssignBuffer;
|
||||
@@ -44,7 +44,7 @@ private:
|
||||
|
||||
protected:
|
||||
|
||||
VBOList * vbo_list;
|
||||
VABList * vbo_list;
|
||||
|
||||
Pipeline * last_pipeline;
|
||||
const VertexInputData * last_vid;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#define HGL_GRAPH_VULKAN_COMMAND_BUFFER_INCLUDE
|
||||
|
||||
#include<hgl/graph/VK.h>
|
||||
#include<hgl/graph/VKVBOList.h>
|
||||
#include<hgl/graph/VKVABList.h>
|
||||
#include<hgl/graph/VKPipeline.h>
|
||||
#include<hgl/graph/VKDescriptorSet.h>
|
||||
#include<hgl/color/Color4f.h>
|
||||
@@ -154,25 +154,25 @@ public:
|
||||
void PushConstants(const void *data,const uint32_t size) {vkCmdPushConstants(cmd_buf,pipeline_layout,VK_SHADER_STAGE_VERTEX_BIT,0, size,data);}
|
||||
void PushConstants(const void *data,const uint32_t offset,const uint32_t size) {vkCmdPushConstants(cmd_buf,pipeline_layout,VK_SHADER_STAGE_VERTEX_BIT,offset, size,data);}
|
||||
|
||||
void BindVBO(const uint32_t first,const uint32_t count,const VkBuffer *vab,const VkDeviceSize *offsets)
|
||||
void BindVAB(const uint32_t first,const uint32_t count,const VkBuffer *vab,const VkDeviceSize *offsets)
|
||||
{
|
||||
vkCmdBindVertexBuffers(cmd_buf,first,count,vab,offsets);
|
||||
}
|
||||
|
||||
bool BindVBO(VBOList *vbo_list)
|
||||
bool BindVAB(VABList *vab_list)
|
||||
{
|
||||
if(!vbo_list)return(false);
|
||||
if(!vab_list)return(false);
|
||||
|
||||
if(!vbo_list->IsFull())return(false);
|
||||
if(!vab_list->IsFull())return(false);
|
||||
|
||||
vkCmdBindVertexBuffers(cmd_buf,0,vbo_list->vab_count,vbo_list->vab_list,vbo_list->vab_offset);
|
||||
vkCmdBindVertexBuffers(cmd_buf,0,vab_list->vab_count,vab_list->vab_list,vab_list->vab_offset);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
void BindIBO(IndexBuffer *ibo,VkDeviceSize offset); ///<绑定IBO,注意offset意为索引偏移量,不是字节
|
||||
|
||||
bool BindVBO(Renderable *);
|
||||
bool BindVAB(Renderable *);
|
||||
|
||||
void SetViewport (uint32_t first,uint32_t count,const VkViewport *vp) {vkCmdSetViewport(cmd_buf,first,count,vp);}
|
||||
void SetScissor (uint32_t first,uint32_t count,const VkRect2D *sci) {vkCmdSetScissor(cmd_buf,first,count,sci);}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
class VBOList
|
||||
class VABList
|
||||
{
|
||||
uint32_t vab_count;
|
||||
VkBuffer *vab_list;
|
||||
@@ -13,7 +13,7 @@ class VBOList
|
||||
|
||||
public:
|
||||
|
||||
VBOList(const uint32 bc)
|
||||
VABList(const uint32 bc)
|
||||
{
|
||||
vab_count=bc;
|
||||
vab_list=new VkBuffer[vab_count];
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
write_count=0;
|
||||
}
|
||||
|
||||
~VBOList()
|
||||
~VABList()
|
||||
{
|
||||
delete[] vab_offset;
|
||||
delete[] vab_list;
|
||||
@@ -49,9 +49,13 @@ public:
|
||||
void Add(const VkBuffer *buf,const VkDeviceSize *offset,const uint32_t count)
|
||||
{
|
||||
hgl_cpy(vab_list +write_count,buf, count);
|
||||
|
||||
if(offset)
|
||||
hgl_cpy(vab_offset+write_count,offset,count);
|
||||
else
|
||||
hgl_set<VkDeviceSize>(vab_offset+write_count,VkDeviceSize(0),count);
|
||||
|
||||
write_count+=count;
|
||||
}
|
||||
};//class VBOList
|
||||
};//class VABList
|
||||
VK_NAMESPACE_END
|
Reference in New Issue
Block a user