Skip to content

vkd3d-shader: Use iterators everywhere, part 9/M.

Here vsir_program_iterator_at() is introduced to move the iterator to a specific instruction in the program given its index.

While we can often avoid using this function by passing an iterator around, we have some places where our algorithms rely on instruction indexes, and storing iterators instead of indexes doesn't seem like a good idea since they can, in principle, be invalidated by other iterators.


The current array ADT can do this in O(1). Tree structures like rbseq can do this in O(log n), so it should not impact performance significatively unless we use it to reach every instruction.

Edited by Francisco Casas

Merge request reports

Loading