--- layout: stdlib-reference --- # ddy ## Description Take the partial derivative of p with respect to y in screen space. ## Signature
T ddy<T>(T p)
    where T : __BuiltinFloatingPointType;

vector<T, N> ddy<T, N:int>(vector<T, N> p)
    where T : __BuiltinFloatingPointType;

matrix<T, N, M> ddy<T, N:int, M:int>(matrix<T, N, M> p)
    where T : __BuiltinFloatingPointType;

## Generic Parameters #### T: [\_\_BuiltinFloatingPointType](../interfaces/0_builtinfloatingpointtype-029hm/index.html) #### N : int #### M : int ## Parameters #### p : [T](ddy.html#typeparam-T) The value to take partial derivative for. #### p : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> The value to take partial derivative for. #### p : [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)\> The value to take partial derivative for. ## Return value The partial derivative of p. ## Remarks For SPIR-V, this function maps to OpDPdy. ## Availability and Requirements Defined for the following targets: #### hlsl Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`. #### glsl Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`. #### cpp Available in `fragment` stage only. #### cuda Available in `fragment` stage only. #### metal Available in `fragment` stage only. #### wgsl Available in `fragment` stage only. #### spirv Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`. Requires capabilities: `SPV_KHR_compute_shader_derivatives`, `spvMeshShadingEXT`.