st/mesa: optimize sampler state translation code