mesa/main: Add generic bits of ARB_clear_texture implementation