d3d_dynamic_shader: tighten the number of textures needed per shader