Fix binding missing vertex buffer slots to zero data on D3D11 and D3D12

This commit is contained in:
Wojtek Figat
2025-03-26 22:54:00 +01:00
parent f94543aac8
commit fa1469514b
8 changed files with 39 additions and 3 deletions

View File

@@ -87,8 +87,9 @@ ID3D12PipelineState* GPUPipelineStateDX12::GetState(GPUTextureViewDX12* depth, i
vertexLayout = VertexBufferLayout; // Fallback to shader-specified layout (if using old APIs)
if (vertexLayout)
{
int32 missingSlotOverride = GPU_MAX_VB_BINDED; // Use additional slot with empty VB
if (VertexInputLayout)
vertexLayout = (GPUVertexLayoutDX12*)GPUVertexLayout::Merge(vertexLayout, VertexInputLayout);
vertexLayout = (GPUVertexLayoutDX12*)GPUVertexLayout::Merge(vertexLayout, VertexInputLayout, false, true, missingSlotOverride);
_desc.InputLayout.pInputElementDescs = vertexLayout->InputElements;
_desc.InputLayout.NumElements = vertexLayout->InputElementsCount;
}