Skip to content

d3d12: only clear D3D12_DIRTY_INDEX_BUFFER when valid

Erik Faye-Lund requested to merge d3d12-fix_ib_validation into msclc-d3d12

If the first draw to a batch is non-indexed, we shouldn't clear D3D12_DIRTY_INDEX_BUFFER. This will lead to the next draw missing state-updates, which in turn leads to incorrect rendering.

We only need this conditional treatment for the index-buffer state, because it's the only state that is conditionally validated. This code could probably need some cleanup to make this stuff more obvious, but let's leave that for another day.

This fixes rendering-glitches in Variform by Kewlers, and probably also in Blender 2.83.

Edited by Erik Faye-Lund

Merge request reports