Skip to content

Commit 5c10f18

Browse files
committed
revert HLSLHalf_t constructor diff
1 parent 76a4b57 commit 5c10f18

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tools/clang/unittests/HLSLExec/HlslTestDataTypes.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,16 @@ struct HLSLHalf_t {
113113
Val = DirectX::PackedVector::XMConvertFloatToHalf(F);
114114
}
115115
HLSLHalf_t(const double D) {
116-
float F = 0.5;
117-
if (D >= std::numeric_limits<float>::max())
116+
float F;
117+
if (D >= std::numeric_limits<double>::max())
118118
F = std::numeric_limits<float>::max();
119-
else if (D <= std::numeric_limits<float>::lowest())
119+
else if (D <= std::numeric_limits<double>::lowest())
120120
F = std::numeric_limits<float>::lowest();
121121
else
122122
F = static_cast<float>(D);
123123

124124
Val = DirectX::PackedVector::XMConvertFloatToHalf(F);
125125
}
126-
127126
HLSLHalf_t(const uint32_t U) {
128127
float F = static_cast<float>(U);
129128
Val = DirectX::PackedVector::XMConvertFloatToHalf(F);

0 commit comments

Comments
 (0)