@@ -147,6 +147,12 @@ void SPIRVSupportDocsEmitter::accumulatePlatformTokens(const Record *Support, st
147147 Tokens.insert (Token);
148148 return ;
149149 }
150+ case PlatformSupportKind::ProductChildOf: {
151+ const Record *BasePlatform = Support->getValueAsDef (" BasePlatform" );
152+ std::string Token = (BasePlatform->getValueAsString (" ProductFamily" ) + StringRef (" and newer" )).str ();
153+ Tokens.insert (Token);
154+ return ;
155+ }
150156 case PlatformSupportKind::ExactPlatform: {
151157 const Record *Plat = Support->getValueAsDef (" TargetPlatform" );
152158 std::string Token = Plat->getValueAsString (" ProductFamily" ).str ();
@@ -219,6 +225,10 @@ void SPIRVSupportQueriesEmitter::emitSPIRVExtensionStructures(raw_ostream &OS) {
219225 OS << " inline bool isCoreChildOf(PLATFORM Platform, GFXCORE_FAMILY Core) {\n " ;
220226 OS << " return Platform.eRenderCoreFamily >= Core;\n " ;
221227 OS << " }\n\n " ;
228+ OS << " // Helper function for product family hierarchy checks\n " ;
229+ OS << " inline bool isProductChildOf(PLATFORM Platform, PRODUCT_FAMILY Product) {\n " ;
230+ OS << " return Platform.eProductFamily >= Product;\n " ;
231+ OS << " }\n\n " ;
222232 OS << " // SPIR-V Extension and Capability structures\n " ;
223233 OS << " struct SPIRVCapability {\n " ;
224234 OS << " std::string Name;\n " ;
@@ -360,6 +370,11 @@ std::string SPIRVSupportQueriesEmitter::buildPredicate(const Record *Support, St
360370 StringRef BaseRenderCoreFamily = BaseCore->getValueAsString (" RenderCoreFamily" );
361371 return (Twine (" isCoreChildOf(" + PlatformVar + " , " ) + BaseRenderCoreFamily + " )" ).str ();
362372 }
373+ case PlatformSupportKind::ProductChildOf: {
374+ const Record *BasePlatform = Support->getValueAsDef (" BasePlatform" );
375+ StringRef BaseProductFamily = BasePlatform->getValueAsString (" ProductFamily" );
376+ return (Twine (" isProductChildOf(" + PlatformVar + " , " ) + BaseProductFamily + " )" ).str ();
377+ }
363378 case PlatformSupportKind::ExactPlatform: {
364379 const Record *Platform = Support->getValueAsDef (" TargetPlatform" );
365380 StringRef ProductFamily = Platform->getValueAsString (" ProductFamily" );
0 commit comments