From 2f9a0945bfeee3296cec3d38d094e4c49f9cb65f Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 25 May 2024 20:22:59 -0400 Subject: wip Signed-off-by: Andrew Opalach --- .../packagefiles/libplacebo/fix_rotate.diff | 29 +++++++++++ .../packagefiles/libplacebo/no_dlltool.diff | 47 ------------------ .../libplacebo/no_dlltool_no_shaderc_version.diff | 58 ++++++++++++++++++++++ subprojects/packagefiles/libplacebo/stretch.diff | 15 ------ .../miniaudio/miniaudio_pulse_flush.diff | 36 +++++++++++++- subprojects/shaderc.wrap | 2 +- 6 files changed, 122 insertions(+), 65 deletions(-) create mode 100644 subprojects/packagefiles/libplacebo/fix_rotate.diff delete mode 100644 subprojects/packagefiles/libplacebo/no_dlltool.diff create mode 100644 subprojects/packagefiles/libplacebo/no_dlltool_no_shaderc_version.diff delete mode 100644 subprojects/packagefiles/libplacebo/stretch.diff (limited to 'subprojects') diff --git a/subprojects/packagefiles/libplacebo/fix_rotate.diff b/subprojects/packagefiles/libplacebo/fix_rotate.diff new file mode 100644 index 0000000..793a456 --- /dev/null +++ b/subprojects/packagefiles/libplacebo/fix_rotate.diff @@ -0,0 +1,29 @@ +diff --git a/src/renderer.c b/src/renderer.c +index 802480d..08eff17 100644 +--- a/src/renderer.c ++++ b/src/renderer.c +@@ -2801,6 +2801,9 @@ static void fix_refs_and_rects(struct pass_state *pass) + pl_rect2df_normalize(src); + pl_rect2df_normalize(dst); + ++ if (flipped_y) PL_SWAP(dst->y1, dst->y0); ++ if (flipped_x) PL_SWAP(dst->x1, dst->x0); ++ + // Round the output rect and clip it to the framebuffer dimensions + float rx0 = roundf(PL_CLAMP(dst->x0, 0.0, dst_w)), + ry0 = roundf(PL_CLAMP(dst->y0, 0.0, dst_h)), +@@ -2822,10 +2825,10 @@ static void fix_refs_and_rects(struct pass_state *pass) + // always do this in the `dst` rather than the `src`` because this allows + // e.g. polar sampling compute shaders to work. + *dst = (pl_rect2df) { +- .x0 = flipped_x ? rx1 : rx0, +- .y0 = flipped_y ? ry1 : ry0, +- .x1 = flipped_x ? rx0 : rx1, +- .y1 = flipped_y ? ry0 : ry1, ++ .x0 = rx0, ++ .y0 = ry0, ++ .x1 = rx1, ++ .y1 = ry1, + }; + + // Copies of the above, for convenience diff --git a/subprojects/packagefiles/libplacebo/no_dlltool.diff b/subprojects/packagefiles/libplacebo/no_dlltool.diff deleted file mode 100644 index e5c017c..0000000 --- a/subprojects/packagefiles/libplacebo/no_dlltool.diff +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/src/meson.build b/src/meson.build -index 5958254..ee33055 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -18,24 +18,24 @@ link_args = [] - link_depends = [] - - # Looks like meson in certain configuration returns ' ' instead of empty string --mingw32 = cc.get_define('__MINGW32__').strip() --if host_machine.system() == 'windows' and mingw32 != '' and host_machine.cpu() in ['aarch64', 'arm', 'x86_64'] -- # MinGW-w64 math functions are significantly slower than the UCRT ones. -- # In particular powf is over 7 times slower than UCRT counterpart. -- # MinGW-w64 explicitly excludes some math functions from their ucrtbase def -- # file and replaces with own versions. To workaround the issue, generate the -- # import library and link it with UCRT versions of math functions. -- dlltool = find_program('llvm-dlltool', 'dlltool') -- ucrt_math = custom_target('ucrt_math.lib', -- output : ['ucrt_math.lib'], -- input : 'ucrt_math.def', -- command : [dlltool, '-d', '@INPUT@', '-l', '@OUTPUT@']) -- link_args += ucrt_math.full_path() -- link_depends += ucrt_math -- # MinGW-w64 inlines functions like powf, rewriting them to pow. We want to use -- # the powf specialization from UCRT, so disable inlining. -- add_project_arguments(['-D__CRT__NO_INLINE'], language: ['c', 'cpp']) --endif -+#mingw32 = cc.get_define('__MINGW32__').strip() -+#if host_machine.system() == 'windows' and mingw32 != '' and host_machine.cpu() in ['aarch64', 'arm', 'x86_64'] -+# # MinGW-w64 math functions are significantly slower than the UCRT ones. -+# # In particular powf is over 7 times slower than UCRT counterpart. -+# # MinGW-w64 explicitly excludes some math functions from their ucrtbase def -+# # file and replaces with own versions. To workaround the issue, generate the -+# # import library and link it with UCRT versions of math functions. -+# dlltool = find_program('llvm-dlltool', 'dlltool') -+# ucrt_math = custom_target('ucrt_math.lib', -+# output : ['ucrt_math.lib'], -+# input : 'ucrt_math.def', -+# command : [dlltool, '-d', '@INPUT@', '-l', '@OUTPUT@']) -+# link_args += ucrt_math.full_path() -+# link_depends += ucrt_math -+# # MinGW-w64 inlines functions like powf, rewriting them to pow. We want to use -+# # the powf specialization from UCRT, so disable inlining. -+# add_project_arguments(['-D__CRT__NO_INLINE'], language: ['c', 'cpp']) -+#endif - - # Work around missing atomics on some (obscure) platforms - atomic_test = ''' diff --git a/subprojects/packagefiles/libplacebo/no_dlltool_no_shaderc_version.diff b/subprojects/packagefiles/libplacebo/no_dlltool_no_shaderc_version.diff new file mode 100644 index 0000000..a579431 --- /dev/null +++ b/subprojects/packagefiles/libplacebo/no_dlltool_no_shaderc_version.diff @@ -0,0 +1,58 @@ +diff --git a/src/glsl/meson.build b/src/glsl/meson.build +index 5a88196..d6bb430 100644 +--- a/src/glsl/meson.build ++++ b/src/glsl/meson.build +@@ -1,5 +1,5 @@ + # shaderc +-shaderc = dependency('shaderc', version: '>=2019.1', required: get_option('shaderc')) ++shaderc = dependency('shaderc', required: get_option('shaderc')) + components.set('shaderc', shaderc.found()) + if shaderc.found() + build_deps += shaderc +diff --git a/src/meson.build b/src/meson.build +index 6162f8f..f93eb4c 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -18,24 +18,24 @@ link_args = [] + link_depends = [] + + # Looks like meson in certain configuration returns ' ' instead of empty string +-mingw32 = cc.get_define('__MINGW32__').strip() +-if host_machine.system() == 'windows' and mingw32 != '' and host_machine.cpu() in ['aarch64', 'arm', 'x86_64'] +- # MinGW-w64 math functions are significantly slower than the UCRT ones. +- # In particular powf is over 7 times slower than UCRT counterpart. +- # MinGW-w64 explicitly excludes some math functions from their ucrtbase def +- # file and replaces with own versions. To workaround the issue, generate the +- # import library and link it with UCRT versions of math functions. +- dlltool = find_program('llvm-dlltool', 'dlltool') +- ucrt_math = custom_target('ucrt_math.lib', +- output : ['ucrt_math.lib'], +- input : 'ucrt_math.def', +- command : [dlltool, '-d', '@INPUT@', '-l', '@OUTPUT@']) +- link_args += ucrt_math.full_path() +- link_depends += ucrt_math +- # MinGW-w64 inlines functions like powf, rewriting them to pow. We want to use +- # the powf specialization from UCRT, so disable inlining. +- add_project_arguments(['-D__CRT__NO_INLINE'], language: ['c', 'cpp']) +-endif ++#mingw32 = cc.get_define('__MINGW32__').strip() ++#if host_machine.system() == 'windows' and mingw32 != '' and host_machine.cpu() in ['aarch64', 'arm', 'x86_64'] ++# # MinGW-w64 math functions are significantly slower than the UCRT ones. ++# # In particular powf is over 7 times slower than UCRT counterpart. ++# # MinGW-w64 explicitly excludes some math functions from their ucrtbase def ++# # file and replaces with own versions. To workaround the issue, generate the ++# # import library and link it with UCRT versions of math functions. ++# dlltool = find_program('llvm-dlltool', 'dlltool') ++# ucrt_math = custom_target('ucrt_math.lib', ++# output : ['ucrt_math.lib'], ++# input : 'ucrt_math.def', ++# command : [dlltool, '-d', '@INPUT@', '-l', '@OUTPUT@']) ++# link_args += ucrt_math.full_path() ++# link_depends += ucrt_math ++# # MinGW-w64 inlines functions like powf, rewriting them to pow. We want to use ++# # the powf specialization from UCRT, so disable inlining. ++# add_project_arguments(['-D__CRT__NO_INLINE'], language: ['c', 'cpp']) ++#endif + + # Work around missing atomics on some (obscure) platforms + atomic_test = ''' diff --git a/subprojects/packagefiles/libplacebo/stretch.diff b/subprojects/packagefiles/libplacebo/stretch.diff deleted file mode 100644 index 40544bc..0000000 --- a/subprojects/packagefiles/libplacebo/stretch.diff +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/renderer.c b/src/renderer.c -index a052bc5..639fbfd 100644 ---- a/src/renderer.c -+++ b/src/renderer.c -@@ -1845,8 +1845,8 @@ static bool pass_read_image(struct pass_state *pass) - .rect = { - off_x, - off_y, -- off_x + pl_rect_w(ref->img.rect), -- off_y + pl_rect_h(ref->img.rect), -+ off_x + pl_rect_w(ref->img.rect) / stretch_x, -+ off_y + pl_rect_h(ref->img.rect) / stretch_y, - }, - }; - diff --git a/subprojects/packagefiles/miniaudio/miniaudio_pulse_flush.diff b/subprojects/packagefiles/miniaudio/miniaudio_pulse_flush.diff index 83be63e..41ea436 100644 --- a/subprojects/packagefiles/miniaudio/miniaudio_pulse_flush.diff +++ b/subprojects/packagefiles/miniaudio/miniaudio_pulse_flush.diff @@ -1,8 +1,40 @@ diff --git a/extras/miniaudio_split/miniaudio.c b/extras/miniaudio_split/miniaudio.c -index 651843b..e0b6f6e 100644 +index bb97e1f..43bf4f1 100644 --- a/extras/miniaudio_split/miniaudio.c +++ b/extras/miniaudio_split/miniaudio.c -@@ -19362,7 +19362,8 @@ static ma_result ma_device_stop__pulse(ma_device* pDevice) +@@ -4763,7 +4763,7 @@ static void ma_thread_wait__posix(ma_thread* pThread) + static ma_result ma_mutex_init__posix(ma_mutex* pMutex) + { + int result; +- ++ + if (pMutex == NULL) { + return MA_INVALID_ARGS; + } +@@ -19374,7 +19374,8 @@ static ma_result ma_device_stop__pulse(ma_device* pDevice) + happens, draining never completes and we get stuck here. For now I'm disabling draining of + the device so we don't just freeze the application. + */ +- #if 0 ++ #if 1 ++ ma_bool32 wasSuccessful = MA_FALSE; + ma_pa_operation* pOP = ((ma_pa_stream_drain_proc)pDevice->pContext->pulse.pa_stream_drain)((ma_pa_stream*)pDevice->pulse.pStreamPlayback, ma_pulse_operation_complete_callback, &wasSuccessful); + ma_wait_for_operation_and_unref__pulse(pDevice->pContext, pDevice->pulse.pMainLoop, pOP); + #endif +diff --git a/miniaudio.h b/miniaudio.h +index a5673ac..cf73a54 100644 +--- a/miniaudio.h ++++ b/miniaudio.h +@@ -16243,7 +16243,7 @@ static void ma_thread_wait__posix(ma_thread* pThread) + static ma_result ma_mutex_init__posix(ma_mutex* pMutex) + { + int result; +- ++ + if (pMutex == NULL) { + return MA_INVALID_ARGS; + } +@@ -30906,7 +30906,8 @@ static ma_result ma_device_stop__pulse(ma_device* pDevice) happens, draining never completes and we get stuck here. For now I'm disabling draining of the device so we don't just freeze the application. */ diff --git a/subprojects/shaderc.wrap b/subprojects/shaderc.wrap index 37d2e23..7b9c266 100644 --- a/subprojects/shaderc.wrap +++ b/subprojects/shaderc.wrap @@ -1,5 +1,5 @@ [wrap-git] url = https://github.com/google/shaderc.git -revision = e6edd6d48fa5bdd9d176794c6810fae7f8e938e1 +revision = f59f0d11b80fd622383199c867137ededf89d43b depth = 1 method = cmake -- cgit v1.2.3-101-g0448