diff options
Diffstat (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp index 4d3407ed04..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) @@ -160,16 +161,16 @@ 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. ID3D11InputLayout* expected = nullptr; if (!m_layout.compare_exchange_strong(expected, layout)) { - SAFE_RELEASE(layout); + if (layout) + layout->Release(); + layout = expected; } |
