Implement the smoothstep
HLSL Function
#99156
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
smoothstep
clang builtin,smoothstep
clang builtin withhlsl_intrinsics.h
smoothstep
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
smoothstep
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/smoothstep.hlsl
clang/test/SemaHLSL/BuiltIns/smoothstep-errors.hlsl
int_dx_smoothstep
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_smoothstep
to7
inDXIL.td
smoothstep.ll
andsmoothstep_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_smoothstep
intrinsic inIntrinsicsSPIRV.td
smoothstep
lowering and map it toint_spv_smoothstep
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/smoothstep.ll
DirectX
SPIR-V
SmoothStep:
Description:
SmoothStep
Result is 0.0 if x ≤ edge0 and 1.0 if x ≥ edge1 and performs
smooth Hermite interpolation between 0 and 1 when edge0 < x <
edge1. This is equivalent to:
t * t * (3 - 2 * t), where t = clamp ((x - edge0) /
(edge1 - edge0), 0, 1)
Result is undefined if edge0 ≥ edge1.
The operands must all be a scalar or vector whose component type is
floating-point.
Result Type and the type of all operands must be the same type.
Results are computed per component.
49
<id>
edge0
<id>
edge1
<id>
x
Test Case(s)
Example 1
HLSL:
Returns a smooth Hermite interpolation between 0 and 1, if x is in the range [min, max].
Parameters
Return Value
Returns 0 if x is less than min; 1 if x is greater than max; otherwise, a value between 0 and 1 if x is in the range [min, max].
Remarks
Use the smoothstep HLSL intrinsic function to create a smooth transition between two values. For example, you can use this function to blend two colors smoothly.
Type Description
Minimum Shader Model
This function is supported in the following shader models.
See also
Intrinsic Functions (DirectX HLSL)
The text was updated successfully, but these errors were encountered: