mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-13 02:01:08 +00:00
Fix replay of ID3D11Device::CreateInputLayout with no input elements
* ID3D11Device::CreateInputLayout will fail if we pass a NULL descriptor array pointer, even though 0xdeadbeef will work so it doesn't actually use the pointer at all.
This commit is contained in:
@@ -1242,9 +1242,14 @@ bool WrappedID3D11Device::Serialise_CreateInputLayout(
|
||||
|
||||
if(IsReplayingAndReading())
|
||||
{
|
||||
// for no explicable reason, CreateInputLayout requires a descriptor pointer even if
|
||||
// NumElements==0.
|
||||
D3D11_INPUT_ELEMENT_DESC dummy = {};
|
||||
const D3D11_INPUT_ELEMENT_DESC *inputDescs = pInputElementDescs ? pInputElementDescs : &dummy;
|
||||
|
||||
ID3D11InputLayout *ret = NULL;
|
||||
HRESULT hr = m_pDevice->CreateInputLayout(
|
||||
pInputElementDescs, NumElements, pShaderBytecodeWithInputSignature, BytecodeLength, &ret);
|
||||
inputDescs, NumElements, pShaderBytecodeWithInputSignature, BytecodeLength, &ret);
|
||||
|
||||
if(FAILED(hr))
|
||||
{
|
||||
@@ -1260,8 +1265,9 @@ bool WrappedID3D11Device::Serialise_CreateInputLayout(
|
||||
|
||||
AddResource(pInputLayout, ResourceType::StateObject, "Input Layout");
|
||||
|
||||
m_LayoutDescs[ret] =
|
||||
std::vector<D3D11_INPUT_ELEMENT_DESC>(pInputElementDescs, pInputElementDescs + NumElements);
|
||||
if(NumElements > 0)
|
||||
m_LayoutDescs[ret] = std::vector<D3D11_INPUT_ELEMENT_DESC>(pInputElementDescs,
|
||||
pInputElementDescs + NumElements);
|
||||
|
||||
if(BytecodeLength > 0 && pShaderBytecodeWithInputSignature)
|
||||
m_LayoutShaders[ret] =
|
||||
|
||||
Reference in New Issue
Block a user