add shape-specific flag filtering