libobs-d3d11: Fix null input layout rebuild

Don't build input layout without VS inputs. Matches creation logic.
This commit is contained in:
jpark37
2019-10-17 09:24:13 -07:00
parent 156e2f3aec
commit 1e2542ad6f

View File

@@ -178,10 +178,13 @@ void gs_vertex_shader::Rebuild(ID3D11Device *dev)
if (FAILED(hr))
throw HRError("Failed to create vertex shader", hr);
hr = dev->CreateInputLayout(layoutData.data(), (UINT)layoutData.size(),
data.data(), data.size(), &layout);
if (FAILED(hr))
throw HRError("Failed to create input layout", hr);
const UINT layoutSize = (UINT)layoutData.size();
if (layoutSize > 0) {
hr = dev->CreateInputLayout(layoutData.data(), layoutSize,
data.data(), data.size(), &layout);
if (FAILED(hr))
throw HRError("Failed to create input layout", hr);
}
if (constantSize) {
hr = dev->CreateBuffer(&bd, NULL, &constants);