From f0fc91acffc0e2dfee1bcac63e484242779178ce Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Tue, 7 Nov 2023 09:38:12 -0700 Subject: [PATCH] gfxstream: vulkan-docs: add cereal generator This adds custom the cereal generator as an option to genvk.py gfxstream specific options like "-registryGfxstream" are also added. Reviewed-by: Aaron Ruby Acked-by: Yonggang Luo Acked-by: Adam Jackson Part-of: --- src/gfxstream/codegen/scripts/genvk.py | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/gfxstream/codegen/scripts/genvk.py b/src/gfxstream/codegen/scripts/genvk.py index 676c78c4f50..5a617cc17e8 100755 --- a/src/gfxstream/codegen/scripts/genvk.py +++ b/src/gfxstream/codegen/scripts/genvk.py @@ -40,6 +40,9 @@ from reg import Registry from validitygenerator import ValidityOutputGenerator from apiconventions import APIConventions +# gfxstream + cereal modules +from cerealgenerator import CerealGenerator + # Simple timer functions startTime = None @@ -949,6 +952,33 @@ def makeGenOpts(args): alignFuncParam = 36) ] + # Serializer for spec + genOpts['cereal'] = [ + CerealGenerator, + CGeneratorOptions( + conventions = conventions, + filename = "CMakeLists.txt", + directory = directory, + apiname = 'vulkan', + profile = None, + versions = featuresPat, + emitversions = featuresPat, + defaultExtensions = defaultExtensions, + addExtensions = None, + removeExtensions = None, + emitExtensions = emitExtensionsPat, + prefixText = prefixStrings + vkPrefixStrings, + genFuncPointers = True, + protectFile = protectFile, + protectFeature = False, + protectProto = '#ifndef', + protectProtoStr = 'VK_NO_PROTOTYPES', + apicall = 'VKAPI_ATTR ', + apientry = 'VKAPI_CALL ', + apientryp = 'VKAPI_PTR *', + alignFuncParam = 48) + ] + def genTarget(args): """Create an API generator and corresponding generator options based on