File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
llvm/include/llvm/Frontend/HLSL Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ class RootSignatureParser {
113
113
std::optional<llvm::hlsl::rootsig::Register> Reg;
114
114
std::optional<float > MipLODBias;
115
115
std::optional<uint32_t > MaxAnisotropy;
116
+ std::optional<float > MinLOD;
116
117
};
117
118
std::optional<ParsedStaticSamplerParams> parseStaticSamplerParams ();
118
119
Original file line number Diff line number Diff line change @@ -383,6 +383,9 @@ std::optional<StaticSampler> RootSignatureParser::parseStaticSampler() {
383
383
if (Params->MaxAnisotropy .has_value ())
384
384
Sampler.MaxAnisotropy = Params->MaxAnisotropy .value ();
385
385
386
+ if (Params->MinLOD .has_value ())
387
+ Sampler.MinLOD = Params->MinLOD .value ();
388
+
386
389
if (consumeExpectedToken (TokenKind::pu_r_paren,
387
390
diag::err_hlsl_unexpected_end_of_params,
388
391
/* param of=*/ TokenKind::kw_StaticSampler))
@@ -702,6 +705,23 @@ RootSignatureParser::parseStaticSamplerParams() {
702
705
return std::nullopt;
703
706
Params.MaxAnisotropy = MaxAnisotropy;
704
707
}
708
+
709
+ // `minLOD` `=` NUMBER
710
+ if (tryConsumeExpectedToken (TokenKind::kw_minLOD)) {
711
+ if (Params.MinLOD .has_value ()) {
712
+ getDiags ().Report (CurToken.TokLoc , diag::err_hlsl_rootsig_repeat_param)
713
+ << CurToken.TokKind ;
714
+ return std::nullopt;
715
+ }
716
+
717
+ if (consumeExpectedToken (TokenKind::pu_equal))
718
+ return std::nullopt;
719
+
720
+ auto MinLOD= parseFloatParam ();
721
+ if (!MinLOD.has_value ())
722
+ return std::nullopt;
723
+ Params.MinLOD = MinLOD;
724
+ }
705
725
} while (tryConsumeExpectedToken (TokenKind::pu_comma));
706
726
707
727
return Params;
Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ struct StaticSampler {
163
163
Register Reg;
164
164
float MipLODBias = 0 .f;
165
165
uint32_t MaxAnisotropy = 16 ;
166
+ float MinLOD = 0 .f;
166
167
};
167
168
168
169
// / Models RootElement : RootFlags | RootConstants | RootParam
You can’t perform that action at this time.
0 commit comments