Sample shader cleanup and optimizations.