Only set depth update flag when depth write is enabled
Merge pull request #5992 from raven02/patch-35

Set depth update flag when depth write is enabled in non-clear mode only