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 @@ -387,6 +387,9 @@ std::optional<StaticSampler> RootSignatureParser::parseStaticSampler() {
387
387
if (Params->MaxAnisotropy .has_value ())
388
388
Sampler.MaxAnisotropy = Params->MaxAnisotropy .value ();
389
389
390
+ if (Params->MinLOD .has_value ())
391
+ Sampler.MinLOD = Params->MinLOD .value ();
392
+
390
393
if (consumeExpectedToken (TokenKind::pu_r_paren,
391
394
diag::err_hlsl_unexpected_end_of_params,
392
395
/* param of=*/ TokenKind::kw_StaticSampler))
@@ -706,6 +709,23 @@ RootSignatureParser::parseStaticSamplerParams() {
706
709
return std::nullopt;
707
710
Params.MaxAnisotropy = MaxAnisotropy;
708
711
}
712
+
713
+ // `minLOD` `=` NUMBER
714
+ if (tryConsumeExpectedToken (TokenKind::kw_minLOD)) {
715
+ if (Params.MinLOD .has_value ()) {
716
+ getDiags ().Report (CurToken.TokLoc , diag::err_hlsl_rootsig_repeat_param)
717
+ << CurToken.TokKind ;
718
+ return std::nullopt;
719
+ }
720
+
721
+ if (consumeExpectedToken (TokenKind::pu_equal))
722
+ return std::nullopt;
723
+
724
+ auto MinLOD= parseFloatParam ();
725
+ if (!MinLOD.has_value ())
726
+ return std::nullopt;
727
+ Params.MinLOD = MinLOD;
728
+ }
709
729
} while (tryConsumeExpectedToken (TokenKind::pu_comma));
710
730
711
731
return Params;
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ struct StaticSampler {
162
162
Register Reg;
163
163
float MipLODBias = 0 .f;
164
164
uint32_t MaxAnisotropy = 16 ;
165
+ float MinLOD = 0 .f;
165
166
};
166
167
167
168
// / Models RootElement : RootFlags | RootConstants | RootParam
You can’t perform that action at this time.
0 commit comments