Merge change I8bb41dd6

* changes:
  Add argument checking to sampler builder to disallow illegal modes.