Properly set primitive count in the debug renderer