d3d8: Calculate texture levels in d3d8 instead of wined3d.