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