mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-04 04:28:17 +02:00
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>
This commit is contained in:
parent
c88e30f0e4
commit
e0eefe5999
2 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue