override Map/Flush/Write functions in IndexBuffer/VAB
This commit is contained in:
parent
cfd67e1a42
commit
419e0e2574
@ -42,11 +42,11 @@ public:
|
|||||||
void * Map () {return buf.memory->Map();}
|
void * Map () {return buf.memory->Map();}
|
||||||
virtual void * Map (VkDeviceSize start,VkDeviceSize size) {return buf.memory->Map(start,size);}
|
virtual void * Map (VkDeviceSize start,VkDeviceSize size) {return buf.memory->Map(start,size);}
|
||||||
void Unmap () {return buf.memory->Unmap();}
|
void Unmap () {return buf.memory->Unmap();}
|
||||||
void Flush (VkDeviceSize start,VkDeviceSize size) {return buf.memory->Flush(start,size);}
|
virtual void Flush (VkDeviceSize start,VkDeviceSize size) {return buf.memory->Flush(start,size);}
|
||||||
void Flush (VkDeviceSize size) {return buf.memory->Flush(size);}
|
virtual void Flush (VkDeviceSize size) {return buf.memory->Flush(size);}
|
||||||
|
|
||||||
bool Write (const void *ptr,uint32_t start,uint32_t size) {return buf.memory->Write(ptr,start,size);}
|
virtual bool Write (const void *ptr,uint32_t start,uint32_t size) {return buf.memory->Write(ptr,start,size);}
|
||||||
bool Write (const void *ptr,uint32_t size) {return buf.memory->Write(ptr,0,size);}
|
virtual bool Write (const void *ptr,uint32_t size) {return buf.memory->Write(ptr,0,size);}
|
||||||
bool Write (const void *ptr) {return buf.memory->Write(ptr);}
|
bool Write (const void *ptr) {return buf.memory->Write(ptr);}
|
||||||
};//class DeviceBuffer
|
};//class DeviceBuffer
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
|
@ -35,6 +35,15 @@ namespace hgl
|
|||||||
const IndexType GetType ()const{return index_type;}
|
const IndexType GetType ()const{return index_type;}
|
||||||
const uint GetStride ()const{return stride;}
|
const uint GetStride ()const{return stride;}
|
||||||
const uint32 GetCount ()const{return count;}
|
const uint32 GetCount ()const{return count;}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
void * Map (VkDeviceSize start,VkDeviceSize size) override {return DeviceBuffer::Map(start*stride,size*stride);}
|
||||||
|
void Flush (VkDeviceSize start,VkDeviceSize size) override {return DeviceBuffer::Flush(start*stride,size*stride); }
|
||||||
|
void Flush (VkDeviceSize size) override {return DeviceBuffer::Flush(size*stride);}
|
||||||
|
|
||||||
|
bool Write (const void *ptr,uint32_t start,uint32_t size) override {return DeviceBuffer::Write(ptr,start*stride,size*stride);}
|
||||||
|
bool Write (const void *ptr,uint32_t size) override {return DeviceBuffer::Write(ptr,0,size*stride);}
|
||||||
};//class IndexBuffer:public DeviceBuffer
|
};//class IndexBuffer:public DeviceBuffer
|
||||||
}//namespace graph
|
}//namespace graph
|
||||||
}//namespace hgl
|
}//namespace hgl
|
||||||
|
@ -33,6 +33,15 @@ namespace hgl
|
|||||||
const uint32_t GetCount ()const { return count; }
|
const uint32_t GetCount ()const { return count; }
|
||||||
|
|
||||||
const VkDeviceSize GetBytes()const { return stride*count; }
|
const VkDeviceSize GetBytes()const { return stride*count; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
void * Map (VkDeviceSize start,VkDeviceSize size) override {return DeviceBuffer::Map(start*stride,size*stride);}
|
||||||
|
void Flush (VkDeviceSize start,VkDeviceSize size) override {return DeviceBuffer::Flush(start*stride,size*stride); }
|
||||||
|
void Flush (VkDeviceSize size) override {return DeviceBuffer::Flush(size*stride);}
|
||||||
|
|
||||||
|
bool Write (const void *ptr,uint32_t start,uint32_t size) override {return DeviceBuffer::Write(ptr,start*stride,size*stride);}
|
||||||
|
bool Write (const void *ptr,uint32_t size) override {return DeviceBuffer::Write(ptr,0,size*stride);}
|
||||||
};//class VertexAttribBuffer:public DeviceBuffer
|
};//class VertexAttribBuffer:public DeviceBuffer
|
||||||
|
|
||||||
using VAB=VertexAttribBuffer;
|
using VAB=VertexAttribBuffer;
|
||||||
|
@ -84,7 +84,7 @@ void RenderL2WBuffer::WriteNode(RenderNode *render_node,const uint count)
|
|||||||
|
|
||||||
for(uint col=0;col<4;col++)
|
for(uint col=0;col<4;col++)
|
||||||
{
|
{
|
||||||
tp=(glm::vec4 *)(l2w_vbo[col]->Map());
|
tp=(glm::vec4 *)(l2w_vbo[col]->DeviceBuffer::Map());
|
||||||
|
|
||||||
rn=render_node;
|
rn=render_node;
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ void RenderMIBuffer::WriteNode(RenderNode *render_node,const uint count,const Ma
|
|||||||
|
|
||||||
mi_data_buffer->Unmap();
|
mi_data_buffer->Unmap();
|
||||||
|
|
||||||
uint16 *idp=(uint16 *)(mi_vab->Map());
|
uint16 *idp=(uint16 *)(mi_vab->DeviceBuffer::Map());
|
||||||
|
|
||||||
{
|
{
|
||||||
rn=render_node;
|
rn=render_node;
|
||||||
|
@ -51,7 +51,7 @@ void *DeviceMemory::Map()
|
|||||||
|
|
||||||
void *DeviceMemory::Map(const VkDeviceSize offset,const VkDeviceSize size)
|
void *DeviceMemory::Map(const VkDeviceSize offset,const VkDeviceSize size)
|
||||||
{
|
{
|
||||||
if(offset<0||offset+size>=req.size)
|
if(offset<0||offset+size>req.size)
|
||||||
return(nullptr);
|
return(nullptr);
|
||||||
|
|
||||||
void *result;
|
void *result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user