compiler/types: fix size of padded OpenCL Structs
authorKarol Herbst <git@karolherbst.de>
Sat, 17 Jun 2023 06:50:12 +0000 (08:50 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 20 Jun 2023 01:55:38 +0000 (01:55 +0000)
commit4431e5a222a6921ed26885d505d0b51fa391aa42
treeab45844bf6b60c7bb56a4a4ef23f164df4c8803d
parent8e452e385b5adb7fe49bd97da96393d6697989c5
compiler/types: fix size of padded OpenCL Structs

In C the size of a struct { uin32_t a; uint8_t b; } is 8, not 5, so we have
to account for the biggest alignment across all struct members.

Funny that the OpenCL CTS doesn't catch that.

Fixes: 44d32e62fb8 ("glsl: add cl_size and cl_alignment")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23701>
src/compiler/glsl_types.cpp