From 4c510f6b823903928e6ed0134f79e44835840d8c Mon Sep 17 00:00:00 2001 From: Laura Hermanns Date: Tue, 4 Jul 2023 14:28:22 -0400 Subject: [PATCH] Fixed compile error of union declaration on Apple platforms. --- include/LLGL/Backend/Metal/NativeCommand.h | 21 ++++++++++--------- .../Metal/Command/MTDirectCommandBuffer.mm | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/LLGL/Backend/Metal/NativeCommand.h b/include/LLGL/Backend/Metal/NativeCommand.h index a404a640b0..adf1ef9342 100644 --- a/include/LLGL/Backend/Metal/NativeCommand.h +++ b/include/LLGL/Backend/Metal/NativeCommand.h @@ -47,18 +47,19 @@ struct NativeCommand { NativeCommandType type; + struct TessFactorBuffer + { + /** + \brief Specifies the buffer slot for the internal tessellation factor buffer. By default 30, which is the maximum buffer slot. + \remarks In the respective Metal tessellation kernel, + this must refer to a buffer of type \c MTLTriangleTessellationFactorsHalf or \c MTLQuadTessellationFactorsHalf. + */ + std::uint32_t slot; + }; + union { - struct TessFactorBuffer - { - /** - \brief Specifies the buffer slot for the internal tessellation factor buffer. By default 30, which is the maximum buffer slot. - \remarks In the respective Metal tessellation kernel, - this must refer to a buffer of type \c MTLTriangleTessellationFactorsHalf or \c MTLQuadTessellationFactorsHalf. - */ - std::uint32_t slot; - } - tessFactorBuffer; + TessFactorBuffer tessFactorBuffer; }; }; diff --git a/sources/Renderer/Metal/Command/MTDirectCommandBuffer.mm b/sources/Renderer/Metal/Command/MTDirectCommandBuffer.mm index 9daac9a4f8..8f32235c68 100644 --- a/sources/Renderer/Metal/Command/MTDirectCommandBuffer.mm +++ b/sources/Renderer/Metal/Command/MTDirectCommandBuffer.mm @@ -31,6 +31,7 @@ #include #include +#include namespace LLGL