Skip to content

Commit 7173a48

Browse files
committed
[HLSL] Add 6.2 SM on half availability for length intrinsic
- attribute keeps getting deleted on bad rebases
1 parent a7323e9 commit 7173a48

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/Headers/hlsl/hlsl_intrinsics.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,13 @@ float4 lerp(float4, float4, float4);
12971297
///
12981298
/// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + ...).
12991299

1300+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
13001301
const inline half length(half X) { return __detail::length_impl(X); }
13011302
const inline float length(float X) { return __detail::length_impl(X); }
13021303

1303-
template <int N> const inline half length(vector<half, N> X) {
1304+
template <int N>
1305+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
1306+
const inline half length(vector<half, N> X) {
13041307
return __detail::length_vec_impl(X);
13051308
}
13061309

0 commit comments

Comments
 (0)