提交 1e2542ad 编写于 作者: J jpark37

libobs-d3d11: Fix null input layout rebuild

Don't build input layout without VS inputs. Matches creation logic.
上级 156e2f3a
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册