@@ -380,6 +380,15 @@ std::optional<StaticSampler> RootSignatureParser::parseStaticSampler() {
380380 if (Params->MipLODBias .has_value ())
381381 Sampler.MipLODBias = Params->MipLODBias .value ();
382382
383+ if (Params->MaxAnisotropy .has_value ())
384+ Sampler.MaxAnisotropy = Params->MaxAnisotropy .value ();
385+
386+ if (Params->MinLOD .has_value ())
387+ Sampler.MinLOD = Params->MinLOD .value ();
388+
389+ if (Params->MaxLOD .has_value ())
390+ Sampler.MaxLOD = Params->MaxLOD .value ();
391+
383392 if (consumeExpectedToken (TokenKind::pu_r_paren,
384393 diag::err_hlsl_unexpected_end_of_params,
385394 /* param of=*/ TokenKind::kw_StaticSampler))
@@ -682,6 +691,57 @@ RootSignatureParser::parseStaticSamplerParams() {
682691 return std::nullopt ;
683692 Params.MipLODBias = MipLODBias;
684693 }
694+
695+ // `maxAnisotropy` `=` POS_INT
696+ if (tryConsumeExpectedToken (TokenKind::kw_maxAnisotropy)) {
697+ if (Params.MaxAnisotropy .has_value ()) {
698+ getDiags ().Report (CurToken.TokLoc , diag::err_hlsl_rootsig_repeat_param)
699+ << CurToken.TokKind ;
700+ return std::nullopt ;
701+ }
702+
703+ if (consumeExpectedToken (TokenKind::pu_equal))
704+ return std::nullopt ;
705+
706+ auto MaxAnisotropy = parseUIntParam ();
707+ if (!MaxAnisotropy.has_value ())
708+ return std::nullopt ;
709+ Params.MaxAnisotropy = MaxAnisotropy;
710+ }
711+
712+ // `minLOD` `=` NUMBER
713+ if (tryConsumeExpectedToken (TokenKind::kw_minLOD)) {
714+ if (Params.MinLOD .has_value ()) {
715+ getDiags ().Report (CurToken.TokLoc , diag::err_hlsl_rootsig_repeat_param)
716+ << CurToken.TokKind ;
717+ return std::nullopt ;
718+ }
719+
720+ if (consumeExpectedToken (TokenKind::pu_equal))
721+ return std::nullopt ;
722+
723+ auto MinLOD = parseFloatParam ();
724+ if (!MinLOD.has_value ())
725+ return std::nullopt ;
726+ Params.MinLOD = MinLOD;
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+ }
685745 } while (tryConsumeExpectedToken (TokenKind::pu_comma));
686746
687747 return Params;
0 commit comments