[PATCH 4/6] vkd3d-shader: Refactor common code for vkd3d_shader_scan().