summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/D3DTexture.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2016-02-16 01:21:22 -0500
committerLioncash <mathew1800@gmail.com>2016-02-16 02:09:06 -0500
commit6b08194728fe024b6064abd5a5d244f88304ae86 (patch)
tree045d2e9646f343e95ce175dc66ede9b74a03ba93 /Source/Core/VideoBackends/D3D12/D3DTexture.cpp
parent626fcf4c1526a2ae9995b100aa95e3bd41d7cb9b (diff)
D3D12: Get rid of safe deletion macros
Anything these macros provided can be obsoleted by using the correct standard library types.
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/D3DTexture.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/D3DTexture.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/D3D12/D3DTexture.cpp b/Source/Core/VideoBackends/D3D12/D3DTexture.cpp
index 9b56fa5e4a..6ad5da8d59 100644
--- a/Source/Core/VideoBackends/D3D12/D3DTexture.cpp
+++ b/Source/Core/VideoBackends/D3D12/D3DTexture.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
+#include <memory>
+
#include "Common/CommonTypes.h"
#include "Common/MsgHandler.h"
#include "VideoBackends/D3D12/D3DBase.h"
@@ -19,11 +21,11 @@ namespace DX12
namespace D3D
{
-static D3DStreamBuffer* s_texture_upload_stream_buffer = nullptr;
+static std::unique_ptr<D3DStreamBuffer> s_texture_upload_stream_buffer;
void CleanupPersistentD3DTextureResources()
{
- SAFE_DELETE(s_texture_upload_stream_buffer);
+ s_texture_upload_stream_buffer.reset();
}
void ReplaceRGBATexture2D(ID3D12Resource* texture12, const u8* buffer, unsigned int width, unsigned int height, unsigned int src_pitch, unsigned int level, D3D12_RESOURCE_STATES current_resource_state)
@@ -32,7 +34,7 @@ void ReplaceRGBATexture2D(ID3D12Resource* texture12, const u8* buffer, unsigned
if (!s_texture_upload_stream_buffer)
{
- s_texture_upload_stream_buffer = new D3DStreamBuffer(4 * 1024 * 1024, 64 * 1024 * 1024, nullptr);
+ s_texture_upload_stream_buffer = std::make_unique<D3DStreamBuffer>(4 * 1024 * 1024, 64 * 1024 * 1024, nullptr);
}
bool current_command_list_executed = s_texture_upload_stream_buffer->AllocateSpaceInBuffer(upload_size, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);