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 @@ -114,6 +114,7 @@ class RootSignatureParser {
114
114
std::optional<float > MipLODBias;
115
115
std::optional<uint32_t > MaxAnisotropy;
116
116
std::optional<float > MinLOD;
117
+ std::optional<float > MaxLOD;
117
118
};
118
119
std::optional<ParsedStaticSamplerParams> parseStaticSamplerParams ();
119
120
Original file line number Diff line number Diff line change @@ -390,6 +390,9 @@ std::optional<StaticSampler> RootSignatureParser::parseStaticSampler() {
390
390
if (Params->MinLOD .has_value ())
391
391
Sampler.MinLOD = Params->MinLOD .value ();
392
392
393
+ if (Params->MaxLOD .has_value ())
394
+ Sampler.MaxLOD = Params->MaxLOD .value ();
395
+
393
396
if (consumeExpectedToken (TokenKind::pu_r_paren,
394
397
diag::err_hlsl_unexpected_end_of_params,
395
398
/* param of=*/ TokenKind::kw_StaticSampler))
@@ -726,6 +729,23 @@ RootSignatureParser::parseStaticSamplerParams() {
726
729
return std::nullopt;
727
730
Params.MinLOD = MinLOD;
728
731
}
732
+
733
+ // `maxLOD` `=` NUMBER
734
+ if (tryConsumeExpectedToken (TokenKind::kw_maxLOD)) {
735
+ if (Params.MaxLOD .has_value ()) {
736
+ getDiags ().Report (CurToken.TokLoc , diag::err_hlsl_rootsig_repeat_param)
737
+ << CurToken.TokKind ;
738
+ return std::nullopt;
739
+ }
740
+
741
+ if (consumeExpectedToken (TokenKind::pu_equal))
742
+ return std::nullopt;
743
+
744
+ auto MaxLOD= parseFloatParam ();
745
+ if (!MaxLOD.has_value ())
746
+ return std::nullopt;
747
+ Params.MaxLOD = MaxLOD;
748
+ }
729
749
} while (tryConsumeExpectedToken (TokenKind::pu_comma));
730
750
731
751
return Params;
Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ struct StaticSampler {
163
163
float MipLODBias = 0 .f;
164
164
uint32_t MaxAnisotropy = 16 ;
165
165
float MinLOD = 0 .f;
166
+ float MaxLOD = 3 .402823466e+38f ;
166
167
};
167
168
168
169
// / Models RootElement : RootFlags | RootConstants | RootParam
You can’t perform that action at this time.
0 commit comments