From 2a18bbbdbc4cb47bf2d6476a733bd4371c151e1b Mon Sep 17 00:00:00 2001 From: Alaska Date: Thu, 7 Mar 2024 11:41:37 +0100 Subject: [PATCH] Fix #119141: Cycles Metal compilation errors Correct order for alignment attribute. Pull Request: https://projects.blender.org/blender/blender/pulls/119148 --- intern/cycles/kernel/types.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h index da8ddc8d290..4974e7a1306 100644 --- a/intern/cycles/kernel/types.h +++ b/intern/cycles/kernel/types.h @@ -1217,7 +1217,9 @@ typedef enum KernelBVHLayout { } KernelBVHLayout; /* Specialized struct that can become constants in dynamic compilation. */ -#define KERNEL_STRUCT_BEGIN(name, parent) ccl_align(16) struct name { +#define KERNEL_STRUCT_BEGIN(name, parent) \ + struct ccl_align(16) name \ + { #define KERNEL_STRUCT_END(name) \ } \ ; \ @@ -1259,7 +1261,8 @@ typedef struct KernelLightLinkSet { uint light_tree_root; } KernelLightLinkSet; -typedef ccl_align(16) struct KernelData { +typedef struct ccl_align(16) KernelData +{ /* Features and limits. */ uint kernel_features; uint max_closures; @@ -1294,7 +1297,8 @@ typedef ccl_align(16) struct KernelData { # endif #endif int pad2, pad3; -} KernelData; +} +KernelData; static_assert_align(KernelData, 16); /* Kernel data structures. */