Merge pull request #605 from billhollings/master

Clear attachments using layered rendering only if framebuffer is layered.