Skip to content

Commit

Permalink
Get more compiling on MSVC
Browse files Browse the repository at this point in the history
Diffs=
1a271c437 Get more compiling on MSVC (#5547)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
  • Loading branch information
csmartdalton and csmartdalton committed Jul 11, 2023
1 parent 8015082 commit 06fa79b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5a18c89bdc51d7a1823aad4b3e0f2a383331afea
1a271c4378f1fe79235e0e930d8261cbc09ea1be
22 changes: 10 additions & 12 deletions build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ do

files {'../src/**.cpp'}

buildoptions {
'-Wall',
'-fno-exceptions',
'-fno-rtti',
'-Werror=format',
'-Wimplicit-int-conversion',
'-Werror=vla'
flags {
'FatalCompileWarnings',
}
exceptionhandling 'off'
rtti 'off'

filter {'system:macosx'}
do
Expand All @@ -48,6 +45,12 @@ do
}
end

filter {'toolset:not msc'}
do
buildoptions {
'-Wimplicit-int-conversion',
}
end
filter {'system:macosx', 'options:variant=runtime'}
do
buildoptions {
Expand All @@ -70,11 +73,6 @@ do
do
architecture 'x64'
defines {'_USE_MATH_DEFINES'}
flags {'FatalCompileWarnings'}
removebuildoptions {
'-fno-exceptions',
'-fno-rtti'
}
end

filter {'system:ios', 'options:variant=system'}
Expand Down
3 changes: 3 additions & 0 deletions include/rive/math/simd_gvec_polyfill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ template <typename T> struct gvec_data<T, 4>
// operator= is just a memcpy. So: "float.xz = float4.xz" would also assign y and w.
gvec<T, 4, PackSwizzle4(4, 1, 0, 3, 2)> yxwz;
gvec<T, 4, PackSwizzle4(4, 2, 3, 0, 1)> zwxy;
gvec<T, 4, PackSwizzle4(4, 2, 1, 0, 3)> zyxw;
gvec<T, 4, PackSwizzle4(4, 0, 3, 2, 1)> xwzy;
};
};

Expand Down Expand Up @@ -305,6 +307,7 @@ ENABLE_SWIZZLE2(min)
ENABLE_SWIZZLE2(max)
ENABLE_SWIZZLE3(clamp)
ENABLE_SWIZZLE3F(mix)
ENABLE_SWIZZLE3F(precise_mix)
ENABLE_SWIZZLE3IT(if_then_else)
template <typename T, int N, Swizzle Z> void store(void* dst, gvec<T, N, Z> vec)
{
Expand Down
8 changes: 6 additions & 2 deletions skia/renderer/build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ do
'../src/**.cpp'
}

buildoptions {'-Wall', '-fno-exceptions', '-fno-rtti', '-Werror=format'}
flags {
'FatalCompileWarnings',
}
exceptionhandling 'off'
rtti 'off'

filter "system:windows"
do
Expand Down Expand Up @@ -81,7 +85,7 @@ do
filter {'system:ios', 'options:variant=emulator'}
do
buildoptions {
'--target=arm64-apple-ios12.0.0-simulator -mios-version-min=10.0 -arch x86_64 -arch arm64 -isysroot ' ..
'--target=arm64-apple-ios12.0.0-simulator -mios-version-min=12.0 -arch x86_64 -arch arm64 -isysroot ' ..
(os.getenv('IOS_SYSROOT') or '')
}
targetdir '%{cfg.system}_sim/bin/%{cfg.buildcfg}'
Expand Down
4 changes: 4 additions & 0 deletions test/simd_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ TEST_CASE("swizzles", "[simd]")
CHECK_ALL((v4.yzw == vec<3>{-2, 3, -1}));
CHECK_ALL((v4.yxwz == float4{-2, 1, -1, 3}));
CHECK_ALL((v4.zwxy == float4{3, -1, 1, -2}));
CHECK_ALL((v4.zyxw == float4{3, -2, 1, -1}));
CHECK_ALL((v4.xwzy == float4{1, -1, 3, -2}));

v4.xy = v2.yx;
CHECK_ALL((v4 == float4{-2, 1, 3, -1}));
Expand Down Expand Up @@ -164,6 +166,8 @@ TEST_CASE("swizzles", "[simd]")
CHECK_ALL(
(simd::clamp(a.yxwz, float4(2), float4(10)) == simd::clamp(a_, float4(2), float4(10))));
CHECK_ALL((simd::mix(a.yxwz, b.yxwz, float4(.5f)) == simd::mix(a_, b_, float4(.5f))));
CHECK_ALL(
(simd::precise_mix(a.yxwz, b.yxwz, float4(.5f)) == simd::precise_mix(a_, b_, float4(.5f))));
CHECK_ALL(
(simd::if_then_else(int4{~0}, a.yxwz, b.yxwz) == simd::if_then_else(int4{~0}, a_, b_)));
CHECK_ALL((simd::if_then_else(int4{~0}, a.yxwz, b.yxwz) == float4{a.y, b.x, b.w, b.z}));
Expand Down

0 comments on commit 06fa79b

Please sign in to comment.