Skip to content

Commit df05a3d

Browse files
committed
remove compat overloads and corresponding tests, remove templates in hlsl_intrinsics.h
1 parent 321e54e commit df05a3d

File tree

6 files changed

+10
-199
lines changed

6 files changed

+10
-199
lines changed

clang/lib/Headers/hlsl/hlsl_compat_overloads.h

-11
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,6 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); }
280280
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
281281
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
282282

283-
//===----------------------------------------------------------------------===//
284-
// lit builtins overloads
285-
//===----------------------------------------------------------------------===//
286-
287-
template <typename T>
288-
const inline __detail::enable_if_t<__detail::is_arithmetic<T>::Value,
289-
vector<T, 4>>
290-
lit(T NDotL, T NDotH, T M) {
291-
return lit<float>((float)NDotL, (float)NDotH, (float)M);
292-
}
293-
294283
//===----------------------------------------------------------------------===//
295284
// log builtins overloads
296285
//===----------------------------------------------------------------------===//

clang/lib/Headers/hlsl/hlsl_intrinsics.h

+2-8
Original file line numberDiff line numberDiff line change
@@ -283,18 +283,12 @@ const inline float length(__detail::HLSL_FIXED_VECTOR<float, N> X) {
283283
/// This function returns a lighting coefficient vector (ambient, diffuse,
284284
/// specular, 1).
285285

286-
#if __HLSL_VERSION >= __HLSL_202y
287-
template <typename T> const inline vector<T, 4> lit(T, T, T) = delete;
288-
#endif
289-
290-
template <>
291286
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
292-
const inline vector<half, 4> lit<half>(half NDotL, half NDotH, half M) {
287+
const inline half4 lit(half NDotL, half NDotH, half M) {
293288
return __detail::lit_impl(NDotL, NDotH, M);
294289
}
295290

296-
template <>
297-
const inline vector<float, 4> lit<float>(float NDotL, float NDotH, float M) {
291+
const inline float4 lit(float NDotL, float NDotH, float M) {
298292
return __detail::lit_impl(NDotL, NDotH, M);
299293
}
300294

clang/test/CodeGenHLSL/builtins/lit-overloads.hlsl

-111
This file was deleted.

clang/test/SemaHLSL/BuiltIns/lit-errors-16bit.hlsl

-9
This file was deleted.

clang/test/SemaHLSL/BuiltIns/lit-errors-hlsl202y.hlsl

-37
This file was deleted.
+8-23
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
1-
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify
1+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected=note
22

3-
float4 test_no_second_arg(float p0) {
4-
return lit(p0);
5-
// expected-error@-1 {{no matching function for call to 'lit'}}
6-
// expected-note@hlsl/hlsl_compat_overloads.h:* {{candidate function template not viable: requires 3 arguments, but 1 was provided}}
7-
}
8-
9-
float4 test_no_third_arg(float p0) {
10-
return lit(p0, p0);
11-
// expected-error@-1 {{no matching function for call to 'lit'}}
12-
// expected-note@hlsl/hlsl_compat_overloads.h:* {{candidate function template not viable: requires 3 arguments, but 2 were provided}}
13-
}
14-
15-
float4 test_too_many_arg(float p0) {
16-
return lit(p0, p0, p0, p0);
17-
// expected-error@-1 {{no matching function for call to 'lit'}}
18-
// expected-note@hlsl/hlsl_compat_overloads.h:* {{candidate function template not viable: requires 3 arguments, but 4 were provided}}
3+
float4 test_double_inputs(double p0, double p1, double p2) {
4+
return lit(p0, p1, p2);
5+
// expected-error@-1 {{call to 'lit' is ambiguous}}
196
}
207

21-
float4 test_vec_inputs(float2 p0, float2 p1, float2 p2) {
8+
float4 test_int_inputs(int p0, int p1, int p2) {
229
return lit(p0, p1, p2);
23-
// expected-error@-1 {{no matching function for call to 'lit'}}
24-
// expected-note@hlsl/hlsl_compat_overloads.h:* {{candidate template ignored: substitution failure [with T = float2]: invalid vector element type 'vector<float, 2>' (vector of 2 'float' values)}}
10+
// expected-error@-1 {{call to 'lit' is ambiguous}}
2511
}
2612

27-
float4 test_vec1_inputs(float1 p0, float1 p1, float1 p2) {
13+
float4 test_bool_inputs(bool p0, bool p1, bool p2) {
2814
return lit(p0, p1, p2);
29-
// expected-error@-1 {{no matching function for call to 'lit'}}
30-
// expected-note@hlsl/hlsl_compat_overloads.h:* {{candidate template ignored: substitution failure [with T = float1]: invalid vector element type 'vector<float, 1>' (vector of 1 'float' value)}}
15+
// expected-error@-1 {{call to 'lit' is ambiguous}}
3116
}

0 commit comments

Comments
 (0)