Skip to content

Commit 361a132

Browse files
committed
Fix RenderDoc warning
`5349 API High Execution 349 ID3D11DeviceContext::DrawIndexed: The Vertex Shader expects application provided input data (which is to say data other than hardware auto-generated values such as VertexID or InstanceID). Therefore an Input Assembler object is expected, but none is bound.`
1 parent d90fa90 commit 361a132

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

ogsr_engine/Layers/xrRenderDX10/dx10R_Backend_Runtime.h

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,13 @@ IC void CBackend::Render(D3DPRIMITIVETYPE T, u32 baseV, u32 startV, u32 countV,
313313

314314
SRVSManager.Apply(context_id);
315315
ApplyRTandZB();
316+
316317
ApplyVertexLayout();
318+
#ifndef TRACY_ENABLE // для билда в котором включен рендердок, эти ошибки должны быть видны
319+
if (vs && !m_pInputLayout)
320+
return;
321+
#endif
322+
317323
StateManager.Apply();
318324
constants.flush();
319325

@@ -342,7 +348,13 @@ IC void CBackend::Render(D3DPRIMITIVETYPE T, u32 startV, u32 PC)
342348

343349
SRVSManager.Apply(context_id);
344350
ApplyRTandZB();
351+
345352
ApplyVertexLayout();
353+
#ifndef TRACY_ENABLE // для билда в котором включен рендердок, эти ошибки должны быть видны
354+
if (vs && !m_pInputLayout)
355+
return;
356+
#endif
357+
346358
StateManager.Apply();
347359
constants.flush();
348360

@@ -470,23 +482,26 @@ IC void CBackend::ApplyVertexLayout()
470482
VERIFY(decl);
471483
VERIFY(m_pInputSignature);
472484

473-
auto it = decl->vs_to_layout.find(m_pInputSignature);
474-
if (it == decl->vs_to_layout.end())
475-
{
476-
ID3DInputLayout* pLayout;
485+
ID3DInputLayout* pLayout{};
477486

478-
CHK_DX(HW.pDevice->CreateInputLayout(&decl->dx10_dcl_code[0],
487+
if (auto it = decl->vs_to_layout.find(m_pInputSignature); it != decl->vs_to_layout.end())
488+
{
489+
pLayout = it->second;
490+
}
491+
else
492+
{
493+
CHK_DX(HW.pDevice->CreateInputLayout(&decl->dx10_dcl_code.front(),
479494
decl->dx10_dcl_code.size() - 1,
480495
m_pInputSignature->GetBufferPointer(),
481496
m_pInputSignature->GetBufferSize(),
482497
&pLayout));
483498

484-
it = decl->vs_to_layout.emplace(m_pInputSignature, pLayout).first;
499+
decl->vs_to_layout.emplace(m_pInputSignature, pLayout);
485500
}
486501

487-
if (m_pInputLayout != it->second)
502+
if (m_pInputLayout != pLayout)
488503
{
489-
m_pInputLayout = it->second;
504+
m_pInputLayout = pLayout;
490505
HW.get_context(context_id)->IASetInputLayout(m_pInputLayout);
491506
}
492507
}

0 commit comments

Comments
 (0)