Lines Matching refs:self
36 def __init__(self, argument
52 self.cgen = cgen
53 self.direction = direction
54 self.processSimple = "write" if self.direction == "write" else "read"
55 self.forApiOutput = forApiOutput
57 self.checked = False
59 self.streamVarName = streamVarName
60 self.rootTypeVarName = rootTypeVarName
61 self.inputVarName = inputVarName
62 self.ptrVar = ptrVarName
63 self.marshalPrefix = marshalPrefix
64 self.handlemapPrefix = handlemapPrefix
66 …self.exprAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, asPtr …
67 …self.exprValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, a…
68 …self.exprPrimitiveValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputV…
69 … self.lenAccessor = lambda t: self.cgen.generalLengthAccess(t, parentVarName = self.inputVarName)
70 self.lenAccessorGuard = lambda t: self.cgen.generalLengthAccessGuard(
71 t, parentVarName=self.inputVarName)
72 … self.filterVarAccessor = lambda t: self.cgen.filterVarAccess(t, parentVarName = self.inputVarName)
74 self.dynAlloc = dynAlloc
75 self.mapHandles = mapHandles
76 self.handleMapOverwrites = handleMapOverwrites
77 self.doFiltering = doFiltering
79 self.stackVar = stackVar
80 self.stackArrSize = stackArrSize
82 def getTypeForStreaming(self, vulkanType): argument
91 if self.direction == "write":
96 def makeCastExpr(self, vulkanType): argument
98 self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
100 def genPtrIncr(self, sizeExpr): argument
101 self.cgen.stmt("*%s += %s" % (self.ptrVar, sizeExpr))
103 def genMemcpyAndIncr(self, varname, cast, toStreamExpr, sizeExpr, toBe = False, actualSize = 4): argument
104 if self.direction == "write":
105 self.cgen.stmt("memcpy(*%s, %s%s, %s)" % (varname, cast, toStreamExpr, sizeExpr))
107 self.cgen.stmt("memcpy(%s%s, *%s, %s)" % (cast, toStreamExpr, varname, sizeExpr))
111 if "read" == self.direction:
127 if self.direction == "write":
128 self.cgen.stmt("android::base::Stream::%s((uint8_t*)*%s)" % (streamMethod, varname))
130 … self.cgen.stmt("android::base::Stream::%s((uint8_t*)%s)" % (streamMethod, toStreamExpr))
132 self.genPtrIncr(sizeExpr)
134 def genStreamCall(self, vulkanType, toStreamExpr, sizeExpr): argument
135 varname = self.ptrVar
136 cast = self.makeCastExpr(self.getTypeForStreaming(vulkanType))
137 self.genMemcpyAndIncr(varname, cast, toStreamExpr, sizeExpr)
139 def genPrimitiveStreamCall(self, vulkanType, access): argument
140 varname = self.ptrVar
141 self.cgen.memcpyPrimitive(
142 self.typeInfo,
146 direction=self.direction)
147 self.genPtrIncr(str(self.cgen.countPrimitive(
148 self.typeInfo,
151 def genHandleMappingCall(self, vulkanType, access, lenAccess, lenAccessGuard): argument
159 handle64Var = self.cgen.var()
161 self.cgen.beginIf(lenAccess)
162 self.cgen.stmt("uint8_t* %s_ptr = (uint8_t*)(*%s)" % (handle64Var, self.ptrVar))
167 self.cgen.stmt("uint64_t %s" % handle64Var)
172 if "" == self.handlemapPrefix:
176 mapFunc = self.handlemapPrefix + vulkanType.typeName
179 if self.direction == "write":
180 if self.handleMapOverwrites:
181 self.cgen.stmt(
185 … self.cgen.stmt("*%s = (%s)%s(*%s)" % (access, vulkanType.typeName, mapFunc, access))
186 self.genStreamCall(vulkanType, access, "8 * %s" % lenAccess)
189 self.cgen.beginIf(lenAccessGuard)
190 self.cgen.beginFor("uint32_t k = 0", "k < %s" % lenAccess, "++k")
191 … self.cgen.stmt("%s[k] = (%s)%s(%s[k])" % (access, vulkanType.typeName, mapFunc, access))
192 self.cgen.endFor()
194 self.cgen.endIf()
195 self.genPtrIncr("8 * %s" % lenAccess)
198 self.cgen.stmt("*%s = %s((*%s))" % (handle64VarAccess, mapFunc64, access))
199 self.genStreamCall(handle64VarType, handle64VarAccess, handle64Bytes)
202 self.cgen.beginIf(lenAccessGuard)
203 self.cgen.beginFor("uint32_t k = 0", "k < %s" % lenAccess, "++k")
204 self.cgen.stmt("uint64_t tmpval = %s(%s[k])" % (mapFunc64, access))
205 … self.cgen.stmt("memcpy(%s_ptr + k * 8, &tmpval, sizeof(uint64_t))" % (handle64Var))
206 self.cgen.endFor()
208 self.cgen.endIf()
209 self.genPtrIncr("8 * %s" % lenAccess)
212 self.genStreamCall(handle64VarType, handle64VarAccess, handle64Bytes)
213 self.cgen.stmt("*%s%s = (%s)%s((%s)(*%s))" % (
214 self.makeCastExpr(vulkanType.getForNonConstAccess()), access,
217 self.genPtrIncr("8 * %s" % lenAccess)
219 self.cgen.beginIf(lenAccessGuard)
220 self.cgen.beginFor("uint32_t k = 0", "k < %s" % lenAccess, "++k")
221 … self.cgen.stmt("uint64_t tmpval; memcpy(&tmpval, %s_ptr + k * 8, sizeof(uint64_t))" % handle64Var)
222 self.cgen.stmt("*((%s%s) + k) = (%s)%s((%s)tmpval)" % (
223 self.makeCastExpr(vulkanType.getForNonConstAccess()), access,
226 self.cgen.endIf()
227 self.cgen.endFor()
230 self.cgen.endIf()
232 def doAllocSpace(self, vulkanType): argument
233 if self.dynAlloc and self.direction == "read":
234 access = self.exprAccessor(vulkanType)
235 lenAccess = self.lenAccessor(vulkanType)
236 sizeof = self.cgen.sizeofExpr( \
244 if self.stackVar:
245 if self.stackArrSize != lenAccess:
246 self.cgen.beginIf("%s <= %s" % (lenAccess, self.stackArrSize))
248 self.cgen.stmt( \
249 … "%s = %s%s" % (access, self.makeCastExpr(vulkanType.getForNonConstAccess()), self.stackVar))
251 if self.stackArrSize != lenAccess:
252 self.cgen.endIf()
253 self.cgen.beginElse()
255 if self.stackArrSize != lenAccess:
256 self.cgen.stmt( \
258 (self.streamVarName,
261 if self.stackArrSize != lenAccess:
262 self.cgen.endIf()
264 self.cgen.stmt( \
266 (self.streamVarName,
269 def getOptionalStringFeatureExpr(self, vulkanType): argument
273 featureExpr = "%s->getFeatureBits() & %s" % (self.streamVarName, splitted[1])
277 def onCheck(self, vulkanType): argument
279 if self.forApiOutput:
282 featureExpr = self.getOptionalStringFeatureExpr(vulkanType);
284 self.checked = True
286 access = self.exprAccessor(vulkanType)
290 self.cgen.line("// WARNING PTR CHECK")
291 if (self.dynAlloc and self.direction == "read") or self.direction == "write":
292 checkAccess = self.exprAccessor(vulkanType)
294 sizeExpr = self.cgen.sizeofExpr(vulkanType)
297 self.cgen.stmt("%s %s" % (
298 self.cgen.makeCTypeDecl(vulkanType, useParamName = False), checkName))
301 sizeExpr = self.cgen.sizeofExpr(vulkanType)
305 self.cgen.beginIf(featureExpr)
307 self.genPrimitiveStreamCall(
312 self.cgen.endIf()
315 self.cgen.beginIf("(!(%s) || %s)" % (featureExpr, access))
317 self.cgen.beginIf(access)
320 self.cgen.beginIf("!(%s)" % checkName)
321 self.cgen.stmt(
323 self.cgen.endIf()
325 def onCheckWithNullOptionalStringFeature(self, vulkanType): argument
326 …self.cgen.beginIf("%s->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT" % self.…
327 self.onCheck(vulkanType)
329 def endCheckWithNullOptionalStringFeature(self, vulkanType): argument
330 self.endCheck(vulkanType)
331 self.cgen.endIf()
332 self.cgen.beginElse()
334 def finalCheckWithNullOptionalStringFeature(self, vulkanType): argument
335 self.cgen.endElse()
337 def endCheck(self, vulkanType): argument
339 if self.checked:
340 self.cgen.endIf()
341 self.checked = False
343 def genFilterFunc(self, filterfunc, env): argument
374 return self.getEnvAccessExpr(atomname)
383 return self.getPointerIndirectionLevels(atomname)
417 def beginFilterGuard(self, vulkanType): argument
421 if self.doFiltering == False:
424 filterVarAccess = self.getEnvAccessExpr(vulkanType.filterVar)
430 …filterFeature = "%s->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % self.streamVa…
436 … filterFuncExpr = self.genFilterFunc(vulkanType.filterFunc, self.currentStructInfo.environment)
442 self.cgen.beginIf(filterVarAccess)
444 self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterValsExpr))
446 self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterFuncExpr))
448 def endFilterGuard(self, vulkanType, cleanupExpr=None): argument
452 if self.doFiltering == False:
456 self.cgen.endIf()
458 self.cgen.endIf()
459 self.cgen.beginElse()
460 self.cgen.stmt(cleanupExpr)
461 self.cgen.endElse()
463 def getEnvAccessExpr(self, varName): argument
464 parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
470 …envAccess = self.exprValueAccessor(list(filter(lambda member: member.paramName == varName, self.cu…
477 def getPointerIndirectionLevels(self, varName): argument
478 parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
484 …return list(filter(lambda member: member.paramName == varName, self.currentStructInfo.members))[0]…
492 def onCompoundType(self, vulkanType): argument
494 access = self.exprAccessor(vulkanType)
495 lenAccess = self.lenAccessor(vulkanType)
497 self.beginFilterGuard(vulkanType)
500 self.doAllocSpace(vulkanType)
508 self.cgen.beginFor(forInit, forCond, forIncr)
510 accessWithCast = "%s(%s)" % (self.makeCastExpr(
511 self.getTypeForStreaming(vulkanType)), access)
513 callParams = [self.streamVarName, self.rootTypeVarName, accessWithCast, self.ptrVar]
516 callParams.append(self.getEnvAccessExpr(localName))
518 self.cgen.funcCall(None, self.marshalPrefix + vulkanType.typeName,
522 self.cgen.endFor()
524 if self.direction == "read":
525 self.endFilterGuard(vulkanType, "%s = 0" % self.exprAccessor(vulkanType))
527 self.endFilterGuard(vulkanType)
529 def onString(self, vulkanType): argument
530 access = self.exprAccessor(vulkanType)
532 if self.direction == "write":
533 self.cgen.beginBlock()
534 self.cgen.stmt("uint32_t l = %s ? strlen(%s): 0" % (access, access))
535 …self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)" ,"&l", "sizeof(uint32_t)", toBe = True, actualSiz…
536 self.genMemcpyAndIncr(self.ptrVar, "(char*)", access, "l")
537 self.cgen.endBlock()
540 self.makeCastExpr( \
541 self.getTypeForStreaming( \
543 self.cgen.stmt( \
544 …"%s->loadStringInPlaceWithStreamPtr(%s&%s, %s)" % (self.streamVarName, castExpr, access, self.ptrV…
546 def onStringArray(self, vulkanType): argument
547 access = self.exprAccessor(vulkanType)
548 lenAccess = self.lenAccessor(vulkanType)
549 lenAccessGuard = self.lenAccessorGuard(vulkanType)
551 if self.direction == "write":
552 self.cgen.beginBlock()
554 self.cgen.stmt("uint32_t c = 0")
556 self.cgen.beginIf(lenAccessGuard)
557 self.cgen.stmt("c = %s" % (lenAccess))
559 self.cgen.endIf()
560 …self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)" ,"&c", "sizeof(uint32_t)", toBe = True, actualSiz…
562 self.cgen.beginFor("uint32_t i = 0", "i < c", "++i")
563 self.cgen.stmt("uint32_t l = %s ? strlen(%s[i]): 0" % (access, access))
564 …self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)" ,"&l", "sizeof(uint32_t)", toBe = True, actualSiz…
565 self.cgen.beginIf("l")
566 self.genMemcpyAndIncr(self.ptrVar, "(char*)", "(%s[i])" % access, "l")
567 self.cgen.endIf()
568 self.cgen.endFor()
570 self.cgen.endBlock()
573 self.makeCastExpr( \
574 self.getTypeForStreaming( \
577 …self.cgen.stmt("%s->loadStringArrayInPlaceWithStreamPtr(%s&%s, %s)" % (self.streamVarName, castExp…
579 def onStaticArr(self, vulkanType): argument
580 access = self.exprValueAccessor(vulkanType)
581 lenAccess = self.lenAccessor(vulkanType)
582 finalLenExpr = "%s * %s" % (lenAccess, self.cgen.sizeofExpr(vulkanType))
583 self.genStreamCall(vulkanType, access, finalLenExpr)
589 def overwriteSType(self, vulkanType): argument
590 if self.direction == "read":
593 sTypeAccess = self.exprAccessor(sTypeParam)
597 self.cgen.stmt("%s = %s" %
600 def onStructExtension(self, vulkanType): argument
601 self.overwriteSType(vulkanType)
606 access = self.exprAccessor(vulkanType)
609 if self.direction == "read":
614 sTypeAccess = self.exprAccessor(sTypeParam)
615 self.cgen.beginIf("%s == VK_STRUCTURE_TYPE_MAX_ENUM" % self.rootTypeVarName)
616 self.cgen.stmt("%s = %s" % (self.rootTypeVarName, sTypeAccess))
617 self.cgen.endIf()
619 if self.direction == "read" and self.dynAlloc:
620 self.cgen.stmt("uint32_t %s" % sizeVar)
622 …self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)", "&" + sizeVar, "sizeof(uint32_t)", toBe = True, …
624 self.cgen.stmt("%s = nullptr" % access)
625 self.cgen.beginIf(sizeVar)
626 self.cgen.stmt( \
628 (self.streamVarName, access))
630 self.genStreamCall(vulkanType, access, "sizeof(VkStructureType)")
631 self.cgen.stmt("VkStructureType extType = *(VkStructureType*)(%s)" % access)
632 self.cgen.stmt( \
634 …(self.streamVarName, access, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME, self.streamVarName, sel…
635 self.cgen.stmt("*(VkStructureType*)%s = extType" % access)
637 self.cgen.funcCall(None, self.marshalPrefix + "extension_struct",
638 [self.streamVarName, self.rootTypeVarName, castedAccessExpr, self.ptrVar])
639 self.cgen.endIf()
642 self.cgen.funcCall(None, self.marshalPrefix + "extension_struct",
643 [self.streamVarName, self.rootTypeVarName, castedAccessExpr, self.ptrVar])
645 def onPointer(self, vulkanType): argument
646 access = self.exprAccessor(vulkanType)
648 lenAccess = self.lenAccessor(vulkanType)
649 lenAccessGuard = self.lenAccessorGuard(vulkanType)
651 self.beginFilterGuard(vulkanType)
652 self.doAllocSpace(vulkanType)
657 if vulkanType.isHandleType() and self.mapHandles:
658 self.genHandleMappingCall(
661 if self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
664 self.cgen.beginIf(lenAccessGuard)
665 self.cgen.beginFor("uint32_t i = 0", "i < (uint32_t)%s" % lenAccess, "++i")
666 self.genPrimitiveStreamCall(vulkanType.getForValueAccess(), "%s[i]" % access)
667 self.cgen.endFor()
669 self.cgen.endIf()
671 self.genPrimitiveStreamCall(vulkanType.getForValueAccess(), "(*%s)" % access)
675 lenAccess, self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
678 self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
679 self.genStreamCall(vulkanType, access, finalLenExpr)
681 if self.direction == "read":
682 self.endFilterGuard(vulkanType, "%s = 0" % access)
684 self.endFilterGuard(vulkanType)
686 def onValue(self, vulkanType): argument
687 self.beginFilterGuard(vulkanType)
689 if vulkanType.isHandleType() and self.mapHandles:
690 access = self.exprAccessor(vulkanType)
693 self.genHandleMappingCall(
695 elif self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
696 access = self.exprPrimitiveValueAccessor(vulkanType)
697 self.genPrimitiveStreamCall(vulkanType, access)
699 access = self.exprAccessor(vulkanType)
700 self.genStreamCall(vulkanType, access, self.cgen.sizeofExpr(vulkanType))
702 self.endFilterGuard(vulkanType)
704 def streamLetParameter(self, structInfo, letParamInfo): argument
705 …filterFeature = "%s->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % self.streamVa…
706 self.cgen.stmt("%s %s = 1" % (letParamInfo.typeName, letParamInfo.paramName))
708 self.cgen.beginIf(filterFeature)
710 if self.direction == "write":
711 bodyExpr = self.currentStructInfo.environment[letParamInfo.paramName]["body"]
712 …self.cgen.stmt("%s = %s" % (letParamInfo.paramName, self.genFilterFunc(bodyExpr, self.currentStruc…
714 self.genPrimitiveStreamCall(letParamInfo, letParamInfo.paramName)
716 self.cgen.endIf()
720 def __init__(self, module, typeInfo, variant="host"): argument
721 VulkanWrapperGenerator.__init__(self, module, typeInfo)
723 self.cgenHeader = CodeGen()
724 self.cgenImpl = CodeGen()
726 self.variant = variant
728 self.currentFeature = None
729 self.apiOpcodes = {}
730 self.dynAlloc = self.variant != "guest"
731 self.ptrVarName = "ptr"
732 self.ptrVarType = makeVulkanTypeSimple(False, "uint8_t", 2, self.ptrVarName)
733 self.ptrVarTypeUnmarshal = makeVulkanTypeSimple(False, "uint8_t", 2, self.ptrVarName)
735 if self.variant == "guest":
736 self.marshalingParams = PARAMETERS_MARSHALING_GUEST
738 self.marshalingParams = PARAMETERS_MARSHALING
740 self.writeCodegen = \
746 self.ptrVarName,
748 "get_host_u64_" if "guest" == self.variant else "",
751 self.readCodegen = \
757 self.ptrVarName,
759 "unbox_" if "host" == self.variant else "",
761 dynAlloc=self.dynAlloc)
763 self.knownDefs = {}
765 self.extensionMarshalPrototype = \
768 self.marshalingParams +
769 [STRUCT_EXTENSION_PARAM, self.ptrVarType])
771 self.extensionUnmarshalPrototype = \
774 self.marshalingParams +
775 [STRUCT_EXTENSION_PARAM_FOR_WRITE, self.ptrVarTypeUnmarshal])
777 def onBegin(self,): argument
778 VulkanWrapperGenerator.onBegin(self)
779 self.module.appendImpl(self.cgenImpl.makeFuncDecl(self.extensionMarshalPrototype))
780 self.module.appendImpl(self.cgenImpl.makeFuncDecl(self.extensionUnmarshalPrototype))
782 def onBeginFeature(self, featureName): argument
783 VulkanWrapperGenerator.onBeginFeature(self, featureName)
784 self.currentFeature = featureName
786 def onGenType(self, typeXml, name, alias): argument
787 VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
789 if name in self.knownDefs:
792 category = self.typeInfo.categoryOf(name)
795 if self.variant != "host":
796 self.module.appendHeader(
797 self.cgenHeader.makeFuncAlias(API_PREFIX_RESERVEDMARSHAL + name,
799 if self.variant != "guest":
800 self.module.appendHeader(
801 self.cgenHeader.makeFuncAlias(API_PREFIX_RESERVEDUNMARSHAL + name,
806 structInfo = self.typeInfo.structs[name]
808 marshalParams = self.marshalingParams + \
810 self.ptrVarType]
833 self.writeCodegen.cgen = cgen
834 self.writeCodegen.currentStructInfo = structInfo
838 streamVarName=self.writeCodegen.streamVarName,
839 rootTypeVarName=self.writeCodegen.rootTypeVarName,
840 inputVarName=self.writeCodegen.inputVarName,
841 newInputVarName=self.writeCodegen.inputVarName + "_new")
846 self.writeCodegen.cgen = cgen
847 self.writeCodegen.currentStructInfo = structInfo
848 self.writeCodegen.cgen.stmt("(void)%s" % VULKAN_STREAM_VAR_NAME)
849 self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
854 self.writeCodegen.streamLetParameter(self.typeInfo, letp)
857 iterateVulkanType(self.typeInfo, member, self.writeCodegen)
859 iterateVulkanType(self.typeInfo, structInfo.members[0], self.writeCodegen)
862 self.writeCodegen.cgen = cgen
863 self.writeCodegen.currentStructInfo = structInfo
864 self.writeCodegen.doFiltering = False
865 self.writeCodegen.cgen.stmt("(void)%s" % VULKAN_STREAM_VAR_NAME)
866 self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
871 self.writeCodegen.streamLetParameter(self.typeInfo, letp)
874 iterateVulkanType(self.typeInfo, member, self.writeCodegen)
876 iterateVulkanType(self.typeInfo, structInfo.members[0], self.writeCodegen)
877 self.writeCodegen.doFiltering = True
879 if self.variant != "host":
880 self.module.appendHeader(
881 self.cgenHeader.makeFuncDecl(marshalPrototype))
884 self.module.appendImpl(
885 self.cgenImpl.makeFuncImpl(
888 self.module.appendImpl(
889 self.cgenImpl.makeFuncImpl(
893 self.module.appendHeader(
894 self.cgenHeader.makeFuncDecl(marshalPrototypeNoFilter))
895 self.module.appendImpl(
896 self.cgenImpl.makeFuncImpl(
902 …self.marshalingParams + [makeVulkanTypeSimple(False, name, 1, UNMARSHAL_INPUT_VAR_NAME), self.ptrV…
907 …self.marshalingParams + [makeVulkanTypeSimple(False, name, 1, UNMARSHAL_INPUT_VAR_NAME), self.ptrV…
910 self.readCodegen.cgen = cgen
911 self.readCodegen.currentStructInfo = structInfo
915 streamVarName=self.readCodegen.streamVarName,
916 rootTypeVarName=self.readCodegen.rootTypeVarName,
917 inputVarName=self.readCodegen.inputVarName,
918 newInputVarName=self.readCodegen.inputVarName + "_new")
923 self.readCodegen.cgen = cgen
924 self.readCodegen.currentStructInfo = structInfo
928 self.readCodegen.streamLetParameter(self.typeInfo, letp)
931 iterateVulkanType(self.typeInfo, member, self.readCodegen)
933 iterateVulkanType(self.typeInfo, structInfo.members[0], self.readCodegen)
936 self.readCodegen.cgen = cgen
937 self.readCodegen.currentStructInfo = structInfo
938 self.readCodegen.doFiltering = False
942 iterateVulkanType(self.typeInfo, letp, self.readCodegen)
944 iterateVulkanType(self.typeInfo, member, self.readCodegen)
946 iterateVulkanType(self.typeInfo, structInfo.members[0], self.readCodegen)
947 self.readCodegen.doFiltering = True
949 if self.variant != "guest":
950 self.module.appendHeader(
951 self.cgenHeader.makeFuncDecl(unmarshalPrototype))
954 self.module.appendImpl(
955 self.cgenImpl.makeFuncImpl(
958 self.module.appendImpl(
959 self.cgenImpl.makeFuncImpl(
963 self.module.appendHeader(
964 self.cgenHeader.makeFuncDecl(unmarshalPrototypeNoFilter))
965 self.module.appendImpl(
966 self.cgenImpl.makeFuncImpl(
969 def onGenCmd(self, cmdinfo, name, alias): argument
970 VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
972 …def doExtensionStructMarshalingCodegen(self, cgen, retType, extParam, forEach, funcproto, directio… argument
981 … funcproto.name, ["vkStream", ROOT_TYPE_VAR_NAME, "(void*)%s->pNext" % accessVar, self.ptrVarName])
990 cgen.stmt("memcpy(*%s, &%s, sizeof(uint32_t));" % (self.ptrVarName, sizeVar))
991 …:base::Stream::toBe32((uint8_t*)*%s); *%s += sizeof(uint32_t)" % (self.ptrVarName, self.ptrVarName…
992 elif not self.dynAlloc:
993 cgen.stmt("memcpy(&%s, *%s, sizeof(uint32_t));" % (sizeVar, self.ptrVarName))
994 …roid::base::Stream::fromBe32((uint8_t*)&%s); *%s += sizeof(uint32_t)" % (sizeVar, self.ptrVarName))
1005 …f(VkStructureType)); *%s += sizeof(VkStructureType)" % (self.ptrVarName, extParam.paramName, self.…
1006 elif not self.dynAlloc:
1009 …tureType)); *%s += sizeof(VkStructureType)" % (placeholderAccess, self.ptrVarName, self.ptrVarName…
1017 self.emitForEachStructExtension(
1025 def onEnd(self,): argument
1026 VulkanWrapperGenerator.onEnd(self)
1030 … [VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, castedAccess, self.ptrVarName])
1034 … [VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, castedAccess, self.ptrVarName])
1036 if self.variant != "host":
1037 self.module.appendImpl(
1038 self.cgenImpl.makeFuncImpl(
1039 self.extensionMarshalPrototype,
1040 lambda cgen: self.doExtensionStructMarshalingCodegen(
1045 self.extensionMarshalPrototype,
1048 if self.variant != "guest":
1049 self.module.appendImpl(
1050 self.cgenImpl.makeFuncImpl(
1051 self.extensionUnmarshalPrototype,
1052 lambda cgen: self.doExtensionStructMarshalingCodegen(
1057 self.extensionUnmarshalPrototype,