D3D12: Get rid of safe deletion macros

Anything these macros provided can be obsoleted by using
the correct standard library types.
This commit is contained in:
Lioncash
2016-02-16 01:21:22 -05:00
parent 626fcf4c15
commit 6b08194728
9 changed files with 63 additions and 58 deletions

View File

@ -13,6 +13,7 @@
#include <d3d12.h>
#include <d3dcompiler.h>
#include <dxgi1_4.h>
#include <memory>
#include <vector>
#include "../../Externals/d3dx12/d3dx12.h"
@ -25,8 +26,6 @@ namespace DX12
{
#define SAFE_RELEASE(x) { if (x) (x)->Release(); (x) = nullptr; }
#define SAFE_DELETE(x) { delete (x); (x) = nullptr; }
#define SAFE_DELETE_ARRAY(x) { delete[] (x); (x) = nullptr; }
#define CHECK(cond, Message, ...) if (!(cond)) { __debugbreak(); PanicAlert(__FUNCTION__ " failed in %s at line %d: " Message, __FILE__, __LINE__, __VA_ARGS__); }
// DEBUGCHECK is for high-frequency functions that we only want to check on debug builds.
@ -80,17 +79,17 @@ extern ID3D12Device* device12;
extern unsigned int resource_descriptor_size;
extern unsigned int sampler_descriptor_size;
extern D3DDescriptorHeapManager* gpu_descriptor_heap_mgr;
extern D3DDescriptorHeapManager* sampler_descriptor_heap_mgr;
extern D3DDescriptorHeapManager* dsv_descriptor_heap_mgr;
extern D3DDescriptorHeapManager* rtv_descriptor_heap_mgr;
extern std::unique_ptr<D3DDescriptorHeapManager> gpu_descriptor_heap_mgr;
extern std::unique_ptr<D3DDescriptorHeapManager> sampler_descriptor_heap_mgr;
extern std::unique_ptr<D3DDescriptorHeapManager> dsv_descriptor_heap_mgr;
extern std::unique_ptr<D3DDescriptorHeapManager> rtv_descriptor_heap_mgr;
extern std::array<ID3D12DescriptorHeap*, 2> gpu_descriptor_heaps;
extern D3D12_CPU_DESCRIPTOR_HANDLE null_srv_cpu;
extern D3D12_CPU_DESCRIPTOR_HANDLE null_srv_cpu_shadow;
extern D3DCommandListManager* command_list_mgr;
extern std::unique_ptr<D3DCommandListManager> command_list_mgr;
extern ID3D12GraphicsCommandList* current_command_list;
extern ID3D12RootSignature* default_root_signature;