| Issue |
184490
|
| Summary |
[Matrix] Implement matrix support for the `step` HLSL Function
|
| Labels |
HLSL,
bot:HLSL
|
| Assignees |
|
| Reporter |
kmpeng
|
> Note: This issue tracks matrix support for `step`. The original implementation issue is [here](https://github.com/llvm/llvm-project/issues/99157).
Matrix requirements:
- [ ] https://github.com/llvm/wg-hlsl/issues/387
## HLSL:
Compares two values, returning 0 or 1 based on which value is greater.
| *ret* step(*y*, *x*) |
|----------------------|
## Parameters
| Item | Description |
|--------------------------------------------------------|---------------------------------------------------------------|
| <span id="y"></span><span id="Y"></span>*y*<br/> | \[in\] The first floating-point value to compare.<br/> |
| <span id="x"></span><span id="X"></span>*x*<br/> | \[in\] The second floating-point value to compare.<br/> |
## 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**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/dx-graphics-hlsl-smoothstep.md) HLSL intrinsic function.
## Type Description
| Name | [**Template Type**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/dx-graphics-hlsl-intrinsic-functions.md) | [**Component Type**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/dx-graphics-hlsl-intrinsic-functions.md) | Size |
|-------|----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|--------------------------------|
| *y* | [**scalar**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/dx-graphics-hlsl-intrinsic-functions.md), **vector**, or **matrix** | [**float**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/WinProg/windows-data-types.md) | any |
| *x* | same as input *y* | [**float**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/WinProg/windows-data-types.md) | same dimension(s) as input *y* |
| *ret* | same as input *y* | [**float**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/WinProg/windows-data-types.md) | same dimension(s) as input *y* |
## Minimum Shader Model
This function is supported in the following shader models.
| Shader Model | Supported |
|------------------------------------------------------------------------------------|-----------------------------|
| [Shader Model 2 (DirectX HLSL)](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/dx-graphics-hlsl-sm2.md) and higher shader models | yes |
| [Shader Model 1 (DirectX HLSL)](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/dx-graphics-hlsl-sm1.md) | yes (vs\_1\_1 and ps\_1\_4) |
## See also
<dl> <dt>
[**Intrinsic Functions (DirectX HLSL)**](https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src//direct3dhlsl/dx-graphics-hlsl-intrinsic-functions.md)
</dt> </dl>
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs