From 3d8014beb565d0c18d511438957cbed668da8fb2 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 9 Mar 2019 23:31:36 +1000 Subject: D3D11: Use D3DCommon where appropriate --- Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp') diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp index 4d3407ed04..05da306a2b 100644 --- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp @@ -160,9 +160,7 @@ ID3D11InputLayout* D3DVertexFormat::GetInputLayout(const void* vs_bytecode, size HRESULT hr = D3D::device->CreateInputLayout(m_elems.data(), m_num_elems, vs_bytecode, vs_bytecode_size, &layout); - if (FAILED(hr)) - PanicAlert("Failed to create input layout, %s %d\n", __FILE__, __LINE__); - DX11::D3D::SetDebugObjectName(m_layout, "input layout used to emulate the GX pipeline"); + CHECK(SUCCEEDED(hr), "Failed to create input layout"); // This method can be called from multiple threads, so ensure that only one thread sets the // cached input layout pointer. If another thread beats this thread, use the existing layout. -- cgit v1.2.3 From 1151a1238f805d5d0d6b149d12344beb661ba853 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 9 Mar 2019 23:31:37 +1000 Subject: D3D11: Use ComPtr smart pointer where possible --- Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp') diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp index 05da306a2b..4611d9945d 100644 --- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp @@ -147,7 +147,8 @@ D3DVertexFormat::D3DVertexFormat(const PortableVertexDeclaration& vtx_decl) D3DVertexFormat::~D3DVertexFormat() { ID3D11InputLayout* layout = m_layout.load(); - SAFE_RELEASE(layout); + if (layout) + layout->Release(); } ID3D11InputLayout* D3DVertexFormat::GetInputLayout(const void* vs_bytecode, size_t vs_bytecode_size) @@ -167,7 +168,9 @@ ID3D11InputLayout* D3DVertexFormat::GetInputLayout(const void* vs_bytecode, size ID3D11InputLayout* expected = nullptr; if (!m_layout.compare_exchange_strong(expected, layout)) { - SAFE_RELEASE(layout); + if (layout) + layout->Release(); + layout = expected; } -- cgit v1.2.3