Respect program settings for depth/stencil tests

* This means we don't e.g. enable the depth test when it was originally
  disabled, and show incorrect 'failure' of the draw to pass the depth test