Fixed sobel shader. Added  method to ensure that gpu has finished.