#pragma once #include "dxc/Support/WinIncludes.h" namespace dxil_debug_info { template T *Initialize(T *Obj) { if (Obj != nullptr) { Obj->AddRef(); } return Obj; } template HRESULT NewDxcPixDxilDebugInfoObjectOrThrow(O **pOut, A... args) { if ((*pOut = Initialize(T::Alloc(args...))) == nullptr) { throw std::bad_alloc(); } return S_OK; } } // namespace dxil_debug_info