Closed farzonl closed 1 month ago
@damyanp Adding refinment priority. This is used in DirectML shader Lighting.fxh
@llvm/issue-subscribers-clang-codegen
Author: Farzon Lotfi (farzonl)
@llvm/issue-subscribers-clang-frontend
Author: Farzon Lotfi (farzonl)
step
clang builtin,step
clang builtin withhlsl_intrinsics.h
step
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
step
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/step.hlsl
clang/test/SemaHLSL/BuiltIns/step-errors.hlsl
int_spv_step
intrinsic inIntrinsicsSPIRV.td
step
lowering and map it toint_spv_step
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/step.ll
DirectX
There were no DXIL opcodes found for
step
.SPIR-V
Step:
Description:
Step
Result is 0.0 if x \< edge; otherwise result is 1.0.
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.
48
<id>
edge
<id>
x
Test Case(s)
Example 1
HLSL:
Compares two values, returning 0 or 1 based on which value is greater.
Parameters
Return Value
1 if the x parameter is greater than or equal to the y parameter; otherwise, 0.
Remarks
This function uses the following formula: (x >= y) ? 1 : 0. The function returns either 0 or 1 depending on whether the x parameter is greater than the y parameter. To compute a smooth interpolation between 0 and 1, use the smoothstep HLSL intrinsic function.
Type Description
Minimum Shader Model
This function is supported in the following shader models.
See also