From e0eefe5999929039480de8515c2fe26f4ad6402c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 22 May 2026 13:02:15 -0700 Subject: [PATCH] gfxstream: codegen: drop const from let-param scalar cast Let-parameters (e.g. hasRasterization, hasTessellation for VkGraphicsPipelineCreateInfo) are local variables initialized by reading a value from the stream. The codegen was creating them with isConst=True, which caused streamPrimitive() to emit a cast like: hasRasterization = (const uint32_t)vkStream->getBe32(); The const qualifier on a scalar rvalue cast result is discarded and triggers -Werror=ignored-qualifiers once that flag is enabled for Soong compatibility, breaking the build: src/gfxstream/guest/vulkan_enc/goldfish_vk_marshaling_guest.cpp: In function 'void gfxstream::vk::unmarshal_VkGraphicsPipelineCreateInfo( VulkanStreamGuest*, VkStructureType, VkGraphicsPipelineCreateInfo*)': goldfish_vk_marshaling_guest.cpp:4202:28: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] 4202 | hasRasterization = (const uint32_t)vkStream->getBe32(); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ goldfish_vk_marshaling_guest.cpp:4207:27: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] 4207 | hasTessellation = (const uint32_t)vkStream->getBe32(); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: some warnings being treated as errors Mark the let-param as non-const since it is a local that gets assigned. Fixes: 190ce8280f4 ("meson: Add Soong compatibility compiler flags to Vulkan drivers") Assisted-by: Claude Code (Opus 4.7) Signed-off-by: Vinson Lee Reviewed-by: Gurchetan Singh Part-of: --- src/gfxstream/codegen/scripts/cereal/marshaling.py | 2 +- src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gfxstream/codegen/scripts/cereal/marshaling.py b/src/gfxstream/codegen/scripts/cereal/marshaling.py index 6b385a3b6f8..9972f4cd7f6 100644 --- a/src/gfxstream/codegen/scripts/cereal/marshaling.py +++ b/src/gfxstream/codegen/scripts/cereal/marshaling.py @@ -703,7 +703,7 @@ class VulkanMarshaling(VulkanWrapperGenerator): freeParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname)) else: if not bindingInfo["structmember"]: - letParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname)) + letParams.append(makeVulkanTypeSimple(False, bindingInfo["type"], 0, envname)) marshalPrototype = \ VulkanAPI(API_PREFIX_MARSHAL + name, diff --git a/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py b/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py index 4c922d21d92..5ed1008c74b 100644 --- a/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py +++ b/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py @@ -813,7 +813,7 @@ class VulkanReservedMarshaling(VulkanWrapperGenerator): freeParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname)) else: if not bindingInfo["structmember"]: - letParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname)) + letParams.append(makeVulkanTypeSimple(False, bindingInfo["type"], 0, envname)) marshalPrototype = \ VulkanAPI(API_PREFIX_RESERVEDMARSHAL + name,