When clamping height to 512, try region/scissor.