Issue introduced by 40f8f445a3f9b6bc24b58e45be46060cc36c0394
It is not clear what the change tries to fix, so this patch is most likely only solving a symptom and not solving the root cause.
When performing a weightpaint the depth-tex is NULL.
The cause is that no selection is performed so....
What should the fix be:
- Do selection depth testing when painting. (DRW_draw_depth_loop)
- Use old technique when doing painting.
- other....