Skip to content

Commit

Permalink
Better sampler heap checks in D3D12.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRichards-Code committed Oct 29, 2024
1 parent 8bd33dd commit 08d5fae
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions DirectX12/RenderPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3119,13 +3119,12 @@ bool RenderPlatform::ApplyContextState(crossplatform::DeviceContext &deviceConte

// Set the frame descriptor heaps
Heap *currentSamplerHeap = dx12Effect->GetEffectSamplerHeap();
ID3D12DescriptorHeap *currentHeaps[2] = {mFrameHeap[frameHeapIndex].GetHeap(), currentSamplerHeap->GetHeap()};
// If we are overriding samplers, use the override heap instead:
if (cs->samplerStateOverrides.size() > 0)
if (cs->samplerStateOverrides.size() > 0 || !currentSamplerHeap)
{
currentSamplerHeap = &mFrameOverrideSamplerHeap[frameHeapIndex];
currentHeaps[1] = currentSamplerHeap->GetHeap();
}
ID3D12DescriptorHeap *currentHeaps[2] = {mFrameHeap[frameHeapIndex].GetHeap(), currentSamplerHeap->GetHeap()};
cmdList->SetDescriptorHeaps(2, currentHeaps);

// Apply the RootDescriptor tables:
Expand Down

0 comments on commit 08d5fae

Please sign in to comment.