From 5ed8eb4731ecd51412fc19a9b43e608e810ab2b7 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 6 Jul 2022 15:17:27 +0100 Subject: [PATCH] More wasm things, high-dpi browser tests Signed-off-by: falkTX --- Makefile | 1 + carla | 2 +- deps/Makefile | 5 +---- dpf | 2 +- include/simd-compat/mmintrin.h | 1 - include/simd-compat/pmmintrin.h | 29 ---------------------------- plugins/Cardinal/src/SassyScope.cpp | 2 +- src/Makefile | 5 +---- src/Makefile.cardinal.mk | 9 +++------ src/emscripten/shell.html | 30 +++++++++++++++++++++++++---- src/override/MenuBar.cpp | 26 +++++++++++++++++++++++-- src/override/Scene.cpp | 2 ++ 12 files changed, 61 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index aefe6b1..b7916e9 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,7 @@ DGL_EXTRA_ARGS = \ NVG_DISABLE_SKIPPING_WHITESPACE=true \ NVG_FONT_TEXTURE_FLAGS=NVG_IMAGE_NEAREST \ USE_NANOVG_FBO=true \ + ASM_EXCEPTIONS=true \ WINDOWS_ICON_ID=401 # -------------------------------------------------------------- diff --git a/carla b/carla index ca15445..1ee091f 160000 --- a/carla +++ b/carla @@ -1 +1 @@ -Subproject commit ca15445429d7ff872fd40db23e24840cc6b90436 +Subproject commit 1ee091f4cc42fcf25d5064e6b9ebd569038684fe diff --git a/deps/Makefile b/deps/Makefile index 522e83d..5d58d7c 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -10,6 +10,7 @@ DISTRHO_NAMESPACE = CardinalDISTRHO DGL_NAMESPACE = CardinalDGL USE_NANOVG_FBO = true +WASM_EXCEPTIONS = true include ../dpf/Makefile.base.mk # -------------------------------------------------------------- @@ -62,10 +63,6 @@ BUILD_CXX_FLAGS += -fno-finite-math-only -fno-strict-aliasing # Rack code is not tested for this flag, unset it BUILD_CXX_FLAGS += -U_GLIBCXX_ASSERTIONS -Wp,-U_GLIBCXX_ASSERTIONS -ifeq ($(WASM),true) -BUILD_CXX_FLAGS += -fexceptions -endif - # -------------------------------------------------------------- # override VCV arch.mk stuff so we can build more architectures diff --git a/dpf b/dpf index c2938c0..b63db74 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit c2938c02994988bd5dde4c4cbba9951709789ee8 +Subproject commit b63db742200341b91358c14a7290104cb97d5613 diff --git a/include/simd-compat/mmintrin.h b/include/simd-compat/mmintrin.h index e0854bc..ce01980 100644 --- a/include/simd-compat/mmintrin.h +++ b/include/simd-compat/mmintrin.h @@ -21,7 +21,6 @@ # include_next #elif defined(__EMSCRIPTEN__) # include -// # include_next #else # include "../sse2neon/sse2neon.h" #endif diff --git a/include/simd-compat/pmmintrin.h b/include/simd-compat/pmmintrin.h index 6ed77fb..45fa3fb 100644 --- a/include/simd-compat/pmmintrin.h +++ b/include/simd-compat/pmmintrin.h @@ -23,16 +23,6 @@ #elif defined(__EMSCRIPTEN__) # include_next -// NOTE these have been verified to be unused (included for ValleyAudio builds) -// static inline -// __m64 _mm_and_si64(__m64 a, __m64 b) { return a; } -// -// static inline -// __m64 _mm_andnot_si64(__m64 a, __m64 b) { return a; } -// -// static inline -// __m64 _mm_or_si64(__m64 a, __m64 b) { return a; } - static inline __m64 _mm_set1_pi16(short w) { @@ -48,25 +38,6 @@ void __builtin_ia32_pause() __asm__ __volatile__("isb\n"); } -static inline -__m64 _mm_and_si64(__m64 a, __m64 b) -{ - return vreinterpret_s64_s32(vand_s32(vreinterpret_s32_m64(a), vreinterpret_s32_m64(b))); -} - -static inline -__m64 _mm_andnot_si64(__m64 a, __m64 b) -{ - // *NOTE* argument swap - return vreinterpret_s64_s32(vbic_s32(vreinterpret_s32_m64(b), vreinterpret_s32_m64(a))); -} - -static inline -__m64 _mm_or_si64(__m64 a, __m64 b) -{ - return vreinterpret_s64_s32(vorr_s32(vreinterpret_s32_m64(a), vreinterpret_s32_m64(b))); -} - static inline __m64 _mm_set1_pi16(short w) { diff --git a/plugins/Cardinal/src/SassyScope.cpp b/plugins/Cardinal/src/SassyScope.cpp index 4225a1f..df79cce 100644 --- a/plugins/Cardinal/src/SassyScope.cpp +++ b/plugins/Cardinal/src/SassyScope.cpp @@ -287,7 +287,7 @@ struct SassyScopeWidget : ImGuiWidget { do_show_scope_window(module != nullptr ? &module->scope : getFakeScopeInstance(), scaleFactor); } - void onButton(const ButtonEvent& e) + void onButton(const ButtonEvent& e) override { // if mouse press is over draggable areas, do nothing so event can go to Rack if (e.action == GLFW_PRESS) diff --git a/src/Makefile b/src/Makefile index 2308b05..0c1040f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,6 +10,7 @@ DISTRHO_NAMESPACE = CardinalDISTRHO DGL_NAMESPACE = CardinalDGL USE_NANOVG_FBO = true +WASM_EXCEPTIONS = true include ../dpf/Makefile.base.mk # -------------------------------------------------------------- @@ -114,10 +115,6 @@ BUILD_CXX_FLAGS += -DnsvgParseFromFile=nsvgParseFromFileCardinal # Rack code is not tested for this flag, unset it BUILD_CXX_FLAGS += -U_GLIBCXX_ASSERTIONS -Wp,-U_GLIBCXX_ASSERTIONS -ifeq ($(WASM),true) -BUILD_CXX_FLAGS += -fexceptions -endif - # -------------------------------------------------------------- # Rack files to build diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index b408cdd..a0d4fef 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -53,6 +53,7 @@ DGL_NAMESPACE = CardinalDGL NVG_DISABLE_SKIPPING_WHITESPACE = true NVG_FONT_TEXTURE_FLAGS = NVG_IMAGE_NEAREST USE_NANOVG_FBO = true +WASM_EXCEPTIONS = true include ../../dpf/Makefile.base.mk # -------------------------------------------------------------- @@ -194,10 +195,6 @@ endif # Rack code is not tested for this flag, unset it BUILD_CXX_FLAGS += -U_GLIBCXX_ASSERTIONS -Wp,-U_GLIBCXX_ASSERTIONS -ifeq ($(WASM),true) -BUILD_CXX_FLAGS += -fexceptions -endif - # -------------------------------------------------------------- # FIXME lots of warnings from VCV side @@ -210,9 +207,9 @@ BASE_FLAGS += -Wno-unused-variable ifeq ($(WASM),true) LINK_FLAGS += --preload-file=./resources LINK_FLAGS += -sALLOW_MEMORY_GROWTH -LINK_FLAGS += -sEXPORTED_RUNTIME_METHODS=FS,ccall +LINK_FLAGS += -sEXPORTED_RUNTIME_METHODS=FS,cwrap LINK_FLAGS += -sINITIAL_MEMORY=64Mb -LINK_FLAGS += -sLZ4=1 +# LINK_FLAGS += -sLZ4=1 LINK_FLAGS += --shell-file=../emscripten/shell.html else ifeq ($(HAIKU),true) LINK_FLAGS += -lpthread diff --git a/src/emscripten/shell.html b/src/emscripten/shell.html index ce061a3..55f887e 100644 --- a/src/emscripten/shell.html +++ b/src/emscripten/shell.html @@ -3,10 +3,13 @@ + + + Cardinal Synth