summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2018-02-23 09:18:19 -0800
committerGitHub <noreply@github.com>2018-02-23 09:18:19 -0800
commitb66f96c617c87d0edbc4a9cb84c8c8e18ead915c (patch)
tree11876004e4d5c0536a2382a9d7fd380488d47fbe /Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
parenta62343bd4fe2ea425b8543d60922bb3d54d39ab2 (diff)
parentfec6bb4d5676de8834c90d93127c1459f46f8dcb (diff)
Merge pull request #6042 from stenzek/videocommon-pipelines
VideoCommon pipelines ("Abstract Pipeline")
Diffstat (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
index 94ef4ba516..525e2b33cb 100644
--- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
@@ -119,20 +119,20 @@ D3DVertexFormat::~D3DVertexFormat()
SAFE_RELEASE(m_layout);
}
-void D3DVertexFormat::SetInputLayout(D3DBlob* vs_bytecode)
+ID3D11InputLayout* D3DVertexFormat::GetInputLayout(D3DBlob* vs_bytecode)
{
- if (!m_layout)
- {
- // CreateInputLayout requires a shader input, but it only looks at the
- // signature of the shader, so we don't need to recompute it if the shader
- // changes.
- HRESULT hr = DX11::D3D::device->CreateInputLayout(
- m_elems.data(), m_num_elems, vs_bytecode->Data(), vs_bytecode->Size(), &m_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");
- }
- DX11::D3D::stateman->SetInputLayout(m_layout);
+ if (m_layout)
+ return m_layout;
+
+ // CreateInputLayout requires a shader input, but it only looks at the
+ // signature of the shader, so we don't need to recompute it if the shader
+ // changes.
+ HRESULT hr = DX11::D3D::device->CreateInputLayout(
+ m_elems.data(), m_num_elems, vs_bytecode->Data(), vs_bytecode->Size(), &m_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");
+ return m_layout;
}
} // namespace DX11