mesa/src/gfxstream
Vinson Lee e0eefe5999
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
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: 190ce8280f ("meson: Add Soong compatibility compiler flags to Vulkan drivers")
Assisted-by: Claude Code (Opus 4.7)
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41763>
2026-05-23 06:54:37 +00:00
..
aemu gfxstream: meson format -i {all meson files} 2025-11-12 16:05:12 +00:00
codegen gfxstream: codegen: drop const from let-param scalar cast 2026-05-23 06:54:37 +00:00
guest meson: Add Soong compatibility compiler flags to Vulkan drivers 2026-05-22 07:09:49 +00:00
.clang-format gfxstream: add clang-format 2024-10-09 22:53:05 +00:00
meson.build gfxstream: explicitly list Python dependencies for gfxstream codegen 2026-01-08 08:02:37 -08:00