Skip to content

Commit 188cad5

Browse files
mizhendavidlunarg
authored andcommitted
vktrace: fix error for tracking image memory requirement in trim
Two functions missing support in the process of tracking image memory requirement in trim: vkGetImageMemoryRequirements2 and vkGetImageMemoryRequirements2KHR, the change fix the error. XCAP-952 Change-Id: Iedf59084a06f22588fda91d90a1c79cfd6e754a5
1 parent 773d7e2 commit 188cad5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

scripts/vktrace_file_generator.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,16 +1821,22 @@ def GenerateTrimStateTrackingInstructions(self, proto):
18211821
trim_instructions.append(' } else {')
18221822
trim_instructions.append(' vktrace_delete_trace_packet(&pHeader);')
18231823
trim_instructions.append(' }')
1824-
elif ('vkGetImageMemoryRequirements' == proto.name):
1825-
trim_instructions.append(" trim::ObjectInfo* pInfo = trim::get_Image_objectInfo(image);")
1826-
trim_instructions.append(" if (pInfo != NULL) {")
1827-
trim_instructions.append(" pInfo->ObjectInfo.Image.memorySize = pMemoryRequirements->size;")
1824+
elif ('vkGetImageMemoryRequirements' == proto.name) or ('vkGetImageMemoryRequirements2' == proto.name) or ('vkGetImageMemoryRequirements2KHR' == proto.name):
1825+
if ('vkGetImageMemoryRequirements' == proto.name):
1826+
trim_instructions.append(" trim::ObjectInfo* pTrimObjectInfo = trim::get_Image_objectInfo(image);")
1827+
else:
1828+
trim_instructions.append(" trim::ObjectInfo* pTrimObjectInfo = trim::get_Image_objectInfo(pInfo->image);")
1829+
trim_instructions.append(" if (pTrimObjectInfo != NULL) {")
1830+
if ('vkGetImageMemoryRequirements' == proto.name):
1831+
trim_instructions.append(" pTrimObjectInfo->ObjectInfo.Image.memorySize = pMemoryRequirements->size;")
1832+
else:
1833+
trim_instructions.append(" pTrimObjectInfo->ObjectInfo.Image.memorySize = pMemoryRequirements->memoryRequirements.size;")
18281834
trim_instructions.append(" }")
18291835
trim_instructions.append("#if TRIM_USE_ORDERED_IMAGE_CREATION")
18301836
trim_instructions.append(" trim::add_Image_call(trim::copy_packet(pHeader));")
18311837
trim_instructions.append("#else")
1832-
trim_instructions.append(" if (pInfo != NULL) {")
1833-
trim_instructions.append(" pInfo->ObjectInfo.Image.pGetImageMemoryRequirementsPacket = trim::copy_packet(pHeader);")
1838+
trim_instructions.append(" if (pTrimObjectInfo != NULL) {")
1839+
trim_instructions.append(" pTrimObjectInfo->ObjectInfo.Image.pGetImageMemoryRequirementsPacket = trim::copy_packet(pHeader);")
18341840
trim_instructions.append(" }")
18351841
trim_instructions.append("#endif //TRIM_USE_ORDERED_IMAGE_CREATION")
18361842
trim_instructions.append(' if (g_trimIsInTrim) {')

0 commit comments

Comments
 (0)