--- layout: stdlib-reference --- # clip ## Description Clip (discard) fragment conditionally ## Signature
void clip<T>(T x) where T : __BuiltinFloatingPointType; void clip<T, N:int>(vector<T, N> x) where T : __BuiltinFloatingPointType; void clip<T, N:int, M:int>(matrix<T, N, M> x) where T : __BuiltinFloatingPointType;## Generic Parameters #### T: [\_\_BuiltinFloatingPointType](../interfaces/0_builtinfloatingpointtype-029hm/index.html) #### N : int #### M : int ## Parameters #### x : [T](clip.html#typeparam-T) #### x : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> #### x : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> ## Availability and Requirements Defined for the following targets: #### hlsl Available in `fragment` stage only. #### glsl Available in `fragment` stage only. #### cpp Available in `fragment` stage only. #### cuda Available in `fragment` stage only. #### spirv Available in `fragment` stage only.