rusticl/mem: fix validation of packed image formats

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23714>
This commit is contained in:
Karol Herbst
2023-06-18 18:30:57 +02:00
parent 73f86c9b9d
commit 4999f9995e
+2 -2
View File
@@ -379,9 +379,9 @@ fn validate_image_format<'a>(
// special validation
let valid_combination = match format.image_channel_data_type {
CL_UNORM_SHORT_565 | CL_UNORM_SHORT_555 | CL_UNORM_INT_101010 => {
[CL_RGB, CL_RGBx].contains(&format.image_channel_data_type)
[CL_RGB, CL_RGBx].contains(&format.image_channel_order)
}
CL_UNORM_INT_101010_2 => format.image_channel_data_type == CL_RGBA,
CL_UNORM_INT_101010_2 => format.image_channel_order == CL_RGBA,
_ => true,
};
if !valid_combination {