diff --git a/deps/SPIRV-Cross/spirv_glsl.cpp b/deps/SPIRV-Cross/spirv_glsl.cpp index 837135cb87..f27a2de698 100644 --- a/deps/SPIRV-Cross/spirv_glsl.cpp +++ b/deps/SPIRV-Cross/spirv_glsl.cpp @@ -28,6 +28,9 @@ #include #endif #include +#ifdef RARCH_INTERNAL +#include +#endif using namespace spv; using namespace SPIRV_CROSS_NAMESPACE; @@ -1087,7 +1090,11 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bits // In std140, struct alignment is rounded up to 16. if (packing_is_vec4_padded(packing)) - alignment = max(alignment, 16u); +#ifdef RARCH_INTERNAL + alignment = MAX(*alignment, 16u); +#else + alignment = max(*alignment, 16u); +#endif return alignment; } @@ -1311,7 +1318,11 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin uint32_t begin_word = offset / 16; uint32_t end_word = (offset + packed_size - 1) / 16; if (begin_word != end_word) +#ifdef RARCH_INTERNAL + packed_alignment = MAX(packed_alignment, 16u); +#else packed_alignment = max(packed_alignment, 16u); +#endif } uint32_t alignment = max(packed_alignment, pad_alignment); diff --git a/deps/SPIRV-Cross/spirv_msl.cpp b/deps/SPIRV-Cross/spirv_msl.cpp index eaee10a049..8524153c2c 100644 --- a/deps/SPIRV-Cross/spirv_msl.cpp +++ b/deps/SPIRV-Cross/spirv_msl.cpp @@ -21,6 +21,10 @@ #include #include +#ifdef RARCH_INTERNAL +#include +#endif + using namespace spv; using namespace SPIRV_CROSS_NAMESPACE; using namespace std; @@ -2552,7 +2556,11 @@ bool CompilerMSL::is_member_packable(SPIRType &ib_type, uint32_t index, uint32_t uint32_t md_elem_cnt = 1; size_t last_elem_idx = mbr_type.array.size() - 1; for (uint32_t i = 0; i < last_elem_idx; i++) +#ifdef RARCH_INTERNAL + md_elem_cnt *= MAX(to_array_size_literal(mbr_type, i), 1u); +#else md_elem_cnt *= max(to_array_size_literal(mbr_type, i), 1u); +#endif uint32_t unpacked_array_stride = unpacked_mbr_size * md_elem_cnt; uint32_t array_stride = type_struct_member_array_stride(ib_type, index); @@ -8486,7 +8494,11 @@ size_t CompilerMSL::get_declared_struct_member_size_msl(const SPIRType &struct_t if (!type.array.empty()) { uint32_t array_size = to_array_size_literal(type); +#ifdef RARCH_INTERNAL + return type_struct_member_array_stride(struct_type, index) * MAX(array_size, 1u); +#else return type_struct_member_array_stride(struct_type, index) * max(array_size, 1u); +#endif } if (type.basetype == SPIRType::Struct)