fixed VABMap
This commit is contained in:
@@ -138,7 +138,10 @@ public:
|
||||
buf_map=pc->MapVAB(name,T::GetVulkanFormat());
|
||||
|
||||
if(buf_map)
|
||||
map_ptr=(T *)(buf_map->Map());
|
||||
{
|
||||
map_ptr=T::Create(buf_map->GetSize(),buf_map->Map());
|
||||
map_ptr->Begin();
|
||||
}
|
||||
else
|
||||
map_ptr=nullptr;
|
||||
}
|
||||
@@ -146,12 +149,20 @@ public:
|
||||
~VABMap()
|
||||
{
|
||||
if(map_ptr)
|
||||
{
|
||||
buf_map->Unmap();
|
||||
delete map_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
const bool IsValid()const{ return buf_map?buf_map->IsValid():false; }
|
||||
const bool IsValid()const{ return map_ptr?map_ptr:false; }
|
||||
|
||||
void Restart()
|
||||
{
|
||||
if(map_ptr)
|
||||
map_ptr->Begin();
|
||||
}
|
||||
|
||||
operator T *(){ return map_ptr; }
|
||||
T *operator->(){ return map_ptr; }
|
||||
};//template<typename T> class VABMap
|
||||
|
||||
|
@@ -22,6 +22,7 @@ public:
|
||||
|
||||
void Set(DeviceBuffer *buf_ptr,VkDeviceSize off,VkDeviceSize s);
|
||||
|
||||
const VkDeviceSize GetSize()const{ return size; }
|
||||
const bool IsValid()const{ return buffer; }
|
||||
void Clear();
|
||||
|
||||
|
Reference in New Issue
Block a user