diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2019-03-29 20:40:06 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-29 20:40:06 +1000 |
| commit | f3fadd730218429a5f6472283d16d30d7e276f8d (patch) | |
| tree | d1d6577cd52b2d3b3d7872aef4fac80dbd0ce563 /Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | |
| parent | fbe57e8dbef17e583f0ba0208af7bf414a3716bf (diff) | |
| parent | d0d010f8549cc902829f567b3b5127d9a0556ca5 (diff) | |
Merge pull request #7869 from stenzek/d3dcommon
D3D: Move sharable D3D11/D3D12 code to common library
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; } |
