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 @@ -112,6 +112,7 @@ class RootSignatureParser {
112
112
struct ParsedStaticSamplerParams {
113
113
std::optional<llvm::hlsl::rootsig::Register> Reg;
114
114
std::optional<float > MipLODBias;
115
+ std::optional<uint32_t > MaxAnisotropy;
115
116
};
116
117
std::optional<ParsedStaticSamplerParams> parseStaticSamplerParams ();
117
118
Original file line number Diff line number Diff line change @@ -384,6 +384,9 @@ std::optional<StaticSampler> RootSignatureParser::parseStaticSampler() {
384
384
if (Params->MipLODBias .has_value ())
385
385
Sampler.MipLODBias = Params->MipLODBias .value ();
386
386
387
+ if (Params->MaxAnisotropy .has_value ())
388
+ Sampler.MaxAnisotropy = Params->MaxAnisotropy .value ();
389
+
387
390
if (consumeExpectedToken (TokenKind::pu_r_paren,
388
391
diag::err_hlsl_unexpected_end_of_params,
389
392
/* param of=*/ TokenKind::kw_StaticSampler))
@@ -686,6 +689,23 @@ RootSignatureParser::parseStaticSamplerParams() {
686
689
return std::nullopt;
687
690
Params.MipLODBias = (float )*MipLODBias;
688
691
}
692
+
693
+ // `maxAnisotropy` `=` POS_INT
694
+ if (tryConsumeExpectedToken (TokenKind::kw_maxAnisotropy)) {
695
+ if (Params.MaxAnisotropy .has_value ()) {
696
+ getDiags ().Report (CurToken.TokLoc , diag::err_hlsl_rootsig_repeat_param)
697
+ << CurToken.TokKind ;
698
+ return std::nullopt;
699
+ }
700
+
701
+ if (consumeExpectedToken (TokenKind::pu_equal))
702
+ return std::nullopt;
703
+
704
+ auto MaxAnisotropy = parseUIntParam ();
705
+ if (!MaxAnisotropy.has_value ())
706
+ return std::nullopt;
707
+ Params.MaxAnisotropy = MaxAnisotropy;
708
+ }
689
709
} while (tryConsumeExpectedToken (TokenKind::pu_comma));
690
710
691
711
return Params;
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ struct DescriptorTableClause {
161
161
struct StaticSampler {
162
162
Register Reg;
163
163
float MipLODBias = 0 .f;
164
+ uint32_t MaxAnisotropy = 16 ;
164
165
};
165
166
166
167
// / Models RootElement : RootFlags | RootConstants | RootParam
You can’t perform that action at this time.
0 commit comments