From e172adddb13d0c260691321a53cecd39056c228b Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Wed, 30 Apr 2025 08:34:49 +0200 Subject: [PATCH 1/9] Fix Emscripten build check workflow --- .github/workflows/build_emscripten.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_emscripten.yml b/.github/workflows/build_emscripten.yml index 2bc12135af..505aa1bfc8 100644 --- a/.github/workflows/build_emscripten.yml +++ b/.github/workflows/build_emscripten.yml @@ -22,7 +22,7 @@ jobs: submodules: 'recursive' - name: Setup emsdk - uses: mymindstorm/setup-emsdk@v13 + uses: mymindstorm/setup-emsdk@v14 with: # Make sure to set a version number! version: 3.1.53 From 0fe550467f5939b7d6ebbeb770461ce2284b99a3 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Tue, 28 Oct 2025 17:37:44 +0100 Subject: [PATCH 2/9] Fix playlist shuffle, index upper bound off-by-one This caused projectM to sometimes stop switching presets if the index chosen was the end of the given interval. Since the preset switch fails in this case, no additional switches will happen unless the user manually switches to a new preset. Signed-off-by: Kai Blaschke --- src/playlist/Playlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playlist/Playlist.cpp b/src/playlist/Playlist.cpp index 0eef28e22a..c9e97c1648 100644 --- a/src/playlist/Playlist.cpp +++ b/src/playlist/Playlist.cpp @@ -220,7 +220,7 @@ auto Playlist::NextPresetIndex() -> uint32_t if (m_shuffle) { - std::uniform_int_distribution randomDistribution(0, static_cast(m_items.size())); + std::uniform_int_distribution randomDistribution(0, static_cast(m_items.size() - 1)); m_currentPosition = randomDistribution(m_randomGenerator); } else @@ -247,7 +247,7 @@ auto Playlist::PreviousPresetIndex() -> uint32_t if (m_shuffle) { - std::uniform_int_distribution randomDistribution(0, static_cast(m_items.size())); + std::uniform_int_distribution randomDistribution(0, static_cast(m_items.size() - 1)); m_currentPosition = randomDistribution(m_randomGenerator); } else From 8759956b521a8fe156ba1dc698f68deb44751d45 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Tue, 28 Oct 2025 17:42:43 +0100 Subject: [PATCH 3/9] Update projectm-eval to latest master Signed-off-by: Kai Blaschke --- vendor/projectm-eval | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/projectm-eval b/vendor/projectm-eval index ee180a2473..02900174d9 160000 --- a/vendor/projectm-eval +++ b/vendor/projectm-eval @@ -1 +1 @@ -Subproject commit ee180a2473c12856fd25dc754bafdab7e843cc7a +Subproject commit 02900174d9d346c38307937b710e901881bc40ea From 0a1a71fbd946b7d557910ec1500aa2a45636ec27 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Tue, 21 Oct 2025 17:16:46 +0200 Subject: [PATCH 4/9] Add missing "distance" intrinsic to HLSLparser Signed-off-by: Kai Blaschke --- vendor/hlslparser/src/HLSLParser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vendor/hlslparser/src/HLSLParser.cpp b/vendor/hlslparser/src/HLSLParser.cpp index b769b48023..358df27703 100644 --- a/vendor/hlslparser/src/HLSLParser.cpp +++ b/vendor/hlslparser/src/HLSLParser.cpp @@ -478,6 +478,11 @@ const Intrinsic _intrinsic[] = Intrinsic( "length", HLSLBaseType_Float, HLSLBaseType_Float3 ), Intrinsic( "length", HLSLBaseType_Float, HLSLBaseType_Float4 ), + Intrinsic( "distance", HLSLBaseType_Float, HLSLBaseType_Float , HLSLBaseType_Float ), + Intrinsic( "distance", HLSLBaseType_Float, HLSLBaseType_Float2, HLSLBaseType_Float2 ), + Intrinsic( "distance", HLSLBaseType_Float, HLSLBaseType_Float3, HLSLBaseType_Float3 ), + Intrinsic( "distance", HLSLBaseType_Float, HLSLBaseType_Float4, HLSLBaseType_Float4 ), + INTRINSIC_FLOAT2_FUNCTION( "max" ), INTRINSIC_FLOAT2_FUNCTION( "min" ), From 5912f742736dd6e74440d5e6ae36aec5924dc11c Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Thu, 11 Sep 2025 10:56:36 +0200 Subject: [PATCH 5/9] Convert HLSL array subscript operator operand to int --- vendor/hlslparser/src/GLSLGenerator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vendor/hlslparser/src/GLSLGenerator.cpp b/vendor/hlslparser/src/GLSLGenerator.cpp index f836f381a7..47a0838864 100644 --- a/vendor/hlslparser/src/GLSLGenerator.cpp +++ b/vendor/hlslparser/src/GLSLGenerator.cpp @@ -887,9 +887,11 @@ void GLSLGenerator::OutputExpression(HLSLExpression* expression, const HLSLType* } else { + // Array subscript operator in GLSL requires an explicit int parameter + const HLSLType& intType = HLSLType(HLSLBaseType_Int); OutputExpression(arrayAccess->array); m_writer.Write("["); - OutputExpression(arrayAccess->index); + OutputExpression(arrayAccess->index, &intType); m_writer.Write("]"); } From 0f026e073402d4eaddfccb39f7ab5f6a354905b1 Mon Sep 17 00:00:00 2001 From: yoyofr Date: Sun, 2 Nov 2025 15:04:41 +0100 Subject: [PATCH 6/9] Add additional alternates for the mult() function with int as arguments Required to propagate NaNs as SM3/DX9 does. Signed-off-by: Kai Blaschke --- vendor/hlslparser/src/GLSLGenerator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor/hlslparser/src/GLSLGenerator.cpp b/vendor/hlslparser/src/GLSLGenerator.cpp index 47a0838864..c8afbd797d 100644 --- a/vendor/hlslparser/src/GLSLGenerator.cpp +++ b/vendor/hlslparser/src/GLSLGenerator.cpp @@ -426,6 +426,9 @@ bool GLSLGenerator::Generate(HLSLTree* tree, Target target, Version version, con if (m_options.flags & Flag_AlternateNanPropagation) { /* Implement alternate functions that propagate NaNs like shader model 3 and DX9. */ + m_writer.WriteLine(0, "float %s(int i_x, int i_y) { float x=float(i_x); float y=float(i_y); if (x == 0.0 || y == 0.0) { return 0.0; } else { return (x * y); } }", m_altMultFunction); + m_writer.WriteLine(0, "float %s(int i_x, float y) { float x=float(i_x); if (x == 0.0 || y == 0.0) { return 0.0; } else { return (x * y); } }", m_altMultFunction); + m_writer.WriteLine(0, "float %s(float x, int i_y) { float y=float(i_y); if (x == 0.0 || y == 0.0) { return 0.0; } else { return (x * y); } }", m_altMultFunction); m_writer.WriteLine(0, "float %s(float x, float y) { if (x == 0.0 || y == 0.0) { return 0.0; } else { return (x * y); } }", m_altMultFunction); m_writer.WriteLine(0, "vec2 %s(vec2 x, vec2 y) { return vec2(%s(x.x, y.x), %s(x.y, y.y)); }", m_altMultFunction, m_altMultFunction, m_altMultFunction); m_writer.WriteLine(0, "vec3 %s(vec3 x, vec3 y) { return vec3(%s(x.x, y.x), %s(x.y, y.y), %s(x.z, y.z)); }", m_altMultFunction, m_altMultFunction, m_altMultFunction, m_altMultFunction); From 5a36fcaaa1017062bce2194cfb7121dc6909e93d Mon Sep 17 00:00:00 2001 From: yoyofr Date: Sun, 2 Nov 2025 14:56:25 +0100 Subject: [PATCH 7/9] Fix values for bass/middle/treble/volume params for shaders Since earlier projectM versions had values in these args which were way higher than they should've been, they were divided by 100. Since the audio processing refactor, this is no longer required, but these divisions were overlooked and thus shaders got only 1% of the actual magnitude expected. Signed-off-by: Kai Blaschke --- .../MilkdropPreset/MilkdropShader.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libprojectM/MilkdropPreset/MilkdropShader.cpp b/src/libprojectM/MilkdropPreset/MilkdropShader.cpp index 1dadec3405..345ef69ff9 100644 --- a/src/libprojectM/MilkdropPreset/MilkdropShader.cpp +++ b/src/libprojectM/MilkdropPreset/MilkdropShader.cpp @@ -186,14 +186,14 @@ void MilkdropShader::LoadVariables(const PresetState& presetState, const PerFram presetState.renderContext.fps, presetState.renderContext.frame, presetState.renderContext.progress}); - m_shader.SetUniformFloat4("_c3", {presetState.audioData.bass / 100, - presetState.audioData.mid / 100, - presetState.audioData.treb / 100, - presetState.audioData.vol / 100}); - m_shader.SetUniformFloat4("_c4", {presetState.audioData.bassAtt / 100, - presetState.audioData.midAtt / 100, - presetState.audioData.trebAtt / 100, - presetState.audioData.volAtt / 100}); + m_shader.SetUniformFloat4("_c3", {presetState.audioData.bass, + presetState.audioData.mid, + presetState.audioData.treb, + presetState.audioData.vol}); + m_shader.SetUniformFloat4("_c4", {presetState.audioData.bassAtt, + presetState.audioData.midAtt, + presetState.audioData.trebAtt, + presetState.audioData.volAtt}); m_shader.SetUniformFloat4("_c5", {blurMax[0] - blurMin[0], blurMin[0], blurMax[1] - blurMin[1], From e2b9cbc1bab640fbdc807a504a42e8a0d61d63a7 Mon Sep 17 00:00:00 2001 From: yoyofr Date: Sun, 2 Nov 2025 15:41:45 +0100 Subject: [PATCH 8/9] Update projectm-eval submodule to release 1.0.4 Fixes a small memory leak. Signed-off-by: Kai Blaschke --- vendor/projectm-eval | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/projectm-eval b/vendor/projectm-eval index 02900174d9..612afc49a4 160000 --- a/vendor/projectm-eval +++ b/vendor/projectm-eval @@ -1 +1 @@ -Subproject commit 02900174d9d346c38307937b710e901881bc40ea +Subproject commit 612afc49a4ee05dcfd68548a5c9bf1aaa031d17d From 976c70be1074b0fe9ee1768ecd380a80e42085b7 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Tue, 28 Oct 2025 17:42:54 +0100 Subject: [PATCH 9/9] Bump libprojectM version to 4.1.5 Signed-off-by: Kai Blaschke --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b9415a5df..e9c01fb2df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ endif() project(libprojectM LANGUAGES C CXX - VERSION 4.1.4 + VERSION 4.1.5 ) # The API (SO) version for the shared library. Should be incremented whenever the binary interface changes