wined3d: Merge common code between texture3d_load_location() and surface_load_location().