gallium/trace: consolidate sampler, sampler_view code