mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-27 12:21:11 +00:00
Add utility function for wrapping new resources
This commit is contained in:
@@ -376,6 +376,19 @@ private:
|
||||
void BeginCaptureFrame();
|
||||
void FinishCapture();
|
||||
void EndCaptureFrame(VkImage presentImage);
|
||||
|
||||
template<typename realtype>
|
||||
void WrapResource(realtype &obj)
|
||||
{
|
||||
RDCASSERT(obj != VK_NULL_HANDLE);
|
||||
|
||||
ResourceId id = ResourceIDGen::GetNewUniqueID();
|
||||
typename UnwrapHelper<realtype>::Outer *wrapped = new typename UnwrapHelper<realtype>::Outer(obj, id);
|
||||
|
||||
GetResourceManager()->AddCurrentResource(id, wrapped);
|
||||
|
||||
obj = UnwrapHelper<realtype>::ToHandle((uint64_t)(uintptr_t)wrapped);
|
||||
}
|
||||
|
||||
// replay
|
||||
|
||||
|
||||
Reference in New Issue
Block a user