From 94b906ae44adb5fb76c121f34f9fc62cf8a871dd Mon Sep 17 00:00:00 2001 From: Bo Hu Date: Fri, 8 Nov 2024 14:31:19 -0800 Subject: [PATCH] gfxstream: snapshot: avoid double boxing dispatchable handle For dispatchable handle, such as commandBuffer, it is always left as boxed by decoder; consequently snapshoter should not box it again. Reviewed-by: Marcin Radomski Part-of: --- src/gfxstream/codegen/scripts/cereal/decodersnapshot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py b/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py index 0c0e9af13d0..911053a0cb6 100644 --- a/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py +++ b/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py @@ -356,7 +356,8 @@ def emit_impl(typeInfo, api, cgen): if p.isNonDispatchableHandleType(): cgen.stmt("%s boxed = unboxed_to_boxed_non_dispatchable_%s(%s[i])" % (p.typeName, p.typeName, access)) else: - cgen.stmt("%s boxed = unboxed_to_boxed_%s(%s[i])" % (p.typeName, p.typeName, access)) + cgen.line("// %s is already boxed, no need to box again" % p.paramName) + cgen.stmt("%s boxed = %s(%s[i])" % (p.typeName, p.typeName, access)) if is_modify_operation(api, p): cgen.stmt("mReconstruction.forEachHandleAddModifyApi((const uint64_t*)(&boxed), 1, apiHandle)") else: # is clear modifier operation