diff options
| author | Stenzek <stenzek@gmail.com> | 2017-09-08 19:42:56 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-02-22 22:02:34 +1000 |
| commit | fec6bb4d5676de8834c90d93127c1459f46f8dcb (patch) | |
| tree | f484dbc96cc5bdc49282a63b973c98e93ec2bfad /Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | |
| parent | 31111ef1432bc5d6d653fbef175e8ca3ac2c152d (diff) | |
VideoBackends: Add AbstractShader and AbstractPipeline classes
Diffstat (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | 26 |
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 |
