def METHOD_NAME(data):
    """Makes sure the dtype of the data is accetpable to vispy.
    Acceptable types are int8, uint8, int16, uint16, float32.
    Parameters
    ----------
    data : np.ndarray
        Data that will need to be of right type.
    Returns
    -------
    np.ndarray
        Data that is of right type and will be passed to vispy.
    """
    dtype = np.dtype(data.dtype)
    if dtype in texture_dtypes:
        return data
    try:
        dtype = {
            "i": np.float32,
            "f": np.float32,
            "u": np.uint16,
            "b": np.uint8,
        }[dtype.kind]
    except KeyError as e:  # not an int or float
        raise TypeError(
            trans._(
                'type {dtype} not allowed for texture; must be one of {textures}',
                deferred=True,
                dtype=dtype,
                textures=set(texture_dtypes),
            )
        ) from e
    return data.astype(dtype)