mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
(SPIRV-Cross) Temporary buildfix for homebrew WiiU toolchain
This commit is contained in:
parent
6e14020e2d
commit
b4ec860bb3
13
deps/SPIRV-Cross/spirv_glsl.cpp
vendored
13
deps/SPIRV-Cross/spirv_glsl.cpp
vendored
@ -28,6 +28,9 @@
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
#include <locale.h>
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include <retro_miscellaneous.h>
|
||||
#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);
|
||||
|
12
deps/SPIRV-Cross/spirv_msl.cpp
vendored
12
deps/SPIRV-Cross/spirv_msl.cpp
vendored
@ -21,6 +21,10 @@
|
||||
#include <assert.h>
|
||||
#include <numeric>
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include <retro_miscellaneous.h>
|
||||
#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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user