d3dx9: Factor our check_texture_requirements() function.