fwidth
Description
Texture filter width. Calculates the sum abs(ddx(p)) + abs(ddy(p)).
Signature
/// Requires Capability Set 1: T fwidth<T>(T p) where T : __BuiltinFloatingPointType; /// Requires Capability Set 2: vector<T, N> fwidth<T, N:int>(vector<T, N> x) where T : __BuiltinFloatingPointType; /// Requires Capability Set 3: matrix<T, N, M> fwidth<T, N:int, M:int>(matrix<T, N, M> x) where T : __BuiltinFloatingPointType;
Generic Parameters
T: __BuiltinFloatingPointType
N : int
M : int
Parameters
p : T
The value to sum x and y partial derivative magnitudes for.
x : vector<T, N>
x : matrix<T, N, M>
Return value
The sum of abs(ddx(p)) and abs(ddy(p)).
Remarks
For SPIR-V, this function maps to OpFwidth.
Availability and Requirements
Capability Set 1
Defined for the following targets:
hlsl
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
glsl
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
metal
Available in fragment
stage only.
wgsl
Available in fragment
stage only.
spirv
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
Requires capabilities: SPV_NV_compute_shader_derivatives
, spvMeshShadingEXT
.
Capability Set 2
Defined for the following targets:
hlsl
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
glsl
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
wgsl
Available in fragment
stage only.
spirv
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
Requires capabilities: SPV_NV_compute_shader_derivatives
, spvMeshShadingEXT
.
Capability Set 3
Defined for the following targets:
hlsl
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
glsl
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
spirv
Available in stages: amplification
, fragment
, compute
, mesh
, miss
, callable
, raygen
, intersection
, anyhit
, closesthit
.
Requires capabilities: SPV_NV_compute_shader_derivatives
, spvMeshShadingEXT
.