You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closesllvm#99135.
Tasks completed:
- Wrote implementation in `hlsl_intrinsics.h`/`hlsl_intrinsic_helpers.h`
- Added codegen tests to `clang/test/CodeGenHLSL/builtins/lit.hlsl`
var-const
pushed a commit
to ldionne/llvm-project
that referenced
this issue
Apr 17, 2025
Closesllvm#99135.
Tasks completed:
- Wrote implementation in `hlsl_intrinsics.h`/`hlsl_intrinsic_helpers.h`
- Added codegen tests to `clang/test/CodeGenHLSL/builtins/lit.hlsl`
hlsl_intrinsics.h
headerclang/test/CodeGenHLSL/builtins/lit.hlsl
clang/test/SemaHLSL/BuiltIns/lit-errors.hlsl
Example HLSL header code
https://godbolt.org/z/YYEGrbh1a
Rough Translation:
DirectX
SPIR-V
FMax:
Description:
FMax
Result is y if x < y; otherwise result is x. Which operand is
the result is undefined if one of the operands is a NaN.
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.
40
<id>
x
<id>
y
Test Case(s)
Example 1
HLSL:
Returns a lighting coefficient vector.
This function returns a lighting coefficient vector (ambient, diffuse, specular, 1) where:
Where the vector n is the normal vector, l is the direction to light and h is the half vector.
Parameters
Return Value
The lighting coefficient vector.
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: