You could do this in shader, but it will still require binding two textures simultaneously, or putting both images on the same texture and adjusting texture coordinates. Why can't you integrate the mask as an alpha-channel in the same image?