Skip to content

Commit 3163d7e

Browse files
committed
add serialization of ComparisonFunc and StaticBorderColor
1 parent 7a34b48 commit 3163d7e

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,62 @@ static raw_ostream &operator<<(raw_ostream &OS,
211211
return OS;
212212
}
213213

214+
static raw_ostream &operator<<(raw_ostream &OS,
215+
const ComparisonFunc &CompFunc) {
216+
switch (CompFunc) {
217+
case ComparisonFunc::Never:
218+
OS << "Never";
219+
break;
220+
case ComparisonFunc::Less:
221+
OS << "Less";
222+
break;
223+
case ComparisonFunc::Equal:
224+
OS << "Equal";
225+
break;
226+
case ComparisonFunc::LessEqual:
227+
OS << "LessEqual";
228+
break;
229+
case ComparisonFunc::Greater:
230+
OS << "Greater";
231+
break;
232+
case ComparisonFunc::NotEqual:
233+
OS << "NotEqual";
234+
break;
235+
case ComparisonFunc::GreaterEqual:
236+
OS << "GreaterEqual";
237+
break;
238+
case ComparisonFunc::Always:
239+
OS << "Always";
240+
break;
241+
}
242+
243+
return OS;
244+
}
245+
246+
247+
static raw_ostream &operator<<(raw_ostream &OS,
248+
const StaticBorderColor &BorderColor) {
249+
switch (BorderColor) {
250+
case StaticBorderColor::TransparentBlack:
251+
OS << "TransparentBlack";
252+
break;
253+
case StaticBorderColor::OpaqueBlack:
254+
OS << "OpaqueBlack";
255+
break;
256+
case StaticBorderColor::OpaqueWhite:
257+
OS << "OpaqueWhite";
258+
break;
259+
case StaticBorderColor::OpaqueBlackUint:
260+
OS << "OpaqueBlackUint";
261+
break;
262+
case StaticBorderColor::OpaqueWhiteUint:
263+
OS << "OpaqueWhiteUint";
264+
break;
265+
}
266+
267+
return OS;
268+
}
269+
214270
static raw_ostream &operator<<(raw_ostream &OS, const ClauseType &Type) {
215271
switch (Type) {
216272
case ClauseType::CBuffer:
@@ -399,6 +455,8 @@ raw_ostream &operator<<(raw_ostream &OS, const StaticSampler &Sampler) {
399455
<< ", addressW = " << Sampler.AddressW
400456
<< ", mipLODBias = " << Sampler.MipLODBias
401457
<< ", maxAnisotropy = " << Sampler.MaxAnisotropy
458+
<< ", comparisonFunc = " << Sampler.CompFunc
459+
<< ", borderColor = " << Sampler.BorderColor
402460
<< ", minLOD = " << Sampler.MinLOD
403461
<< ", maxLOD = " << Sampler.MaxLOD
404462
<< ", space = " << Sampler.Space

0 commit comments

Comments
 (0)