[Scummvm-git-logs] scummvm pr/shader-compatibility -> 783a8c5f25b7c95480aa129be356bc658f12e212

chkuendig noreply at scummvm.org
Thu Oct 30 22:05:30 UTC 2025


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
6f662b245d GUI: Disable shader update button on Emscripten
5a99367925 TESTBED: Add shader compatibility test to graphics subsystem tests
783a8c5f25 EMSCRIPTEN: Remove incompatible shaders from build target


Commit: 6f662b245dae1cbbdf6bb2dd085e4fb333df2a38
    https://github.com/scummvm/scummvm/commit/6f662b245dae1cbbdf6bb2dd085e4fb333df2a38
Author: Christian Kündig (christian at kuendig.info)
Date: 2025-10-29T16:16:31+01:00

Commit Message:
GUI: Disable shader update button on Emscripten

Changed paths:
    gui/options.cpp


diff --git a/gui/options.cpp b/gui/options.cpp
index 3c9cb49b83b..4ca63d09094 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1689,7 +1689,9 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
 	_shaderClearButton = addClearButton(boss, prefix + "grShaderClearButton", kClearShaderCmd);
 
 #ifdef USE_HTTP
+#ifndef EMSCRIPTEN // No shader updates on Emscripten, they are always loaded directly from server
 	_updateShadersButton = new ButtonWidget(boss, prefix + "UpdateShadersButton", _("Download Shaders"), _("Check on the scummvm.org website for updates of shader packs"), kUpdateShadersCmd);
+#endif
 #endif
 
 	enableShaderControls(g_system->hasFeature(OSystem::kFeatureShaders));


Commit: 5a993679256af7b6fbdd555ac47f5461d05f1eea
    https://github.com/scummvm/scummvm/commit/5a993679256af7b6fbdd555ac47f5461d05f1eea
Author: Christian Kündig (christian at kuendig.info)
Date: 2025-10-30T23:05:00+01:00

Commit Message:
TESTBED: Add shader compatibility test to graphics subsystem tests

Changed paths:
    engines/testbed/graphics.cpp
    engines/testbed/graphics.h


diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 146f5701828..694133301af 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -19,9 +19,12 @@
  *
  */
 
+#include "common/archive.h"
+#include "common/config-manager.h"
 #include "common/events.h"
 #include "common/list.h"
 #include "common/random.h"
+#include "common/zip-set.h"
 
 #include "engines/engine.h"
 
@@ -74,6 +77,9 @@ GFXTestSuite::GFXTestSuite() {
 	// Specific Tests:
 	addTest("PaletteRotation", &GFXtests::paletteRotation);
 	addTest("cursorTrailsInGUI", &GFXtests::cursorTrails);
+	
+	// Shader compatibility test
+	addTest("ShaderCompatibility", &GFXtests::shaderCompatibility, false);
 }
 
 void GFXTestSuite::prepare() {
@@ -1841,4 +1847,79 @@ void GFXtests::showPixelFormat(const Graphics::PixelFormat &pf, uint aLoss) {
 	g_system->updateScreen();
 }
 
+TestExitStatus GFXtests::shaderCompatibility() {
+	// Check if shaders are supported
+	if (!g_system->hasFeature(OSystem::kFeatureShaders)) {
+		Testsuite::logPrintf("Info! Shaders are not supported on this platform.\n");
+		return kTestSkipped;
+	}
+
+	Testsuite::logPrintf("Info! Testing all available shaders from shaders.dat\n");
+
+	// List all shader files
+	Common::ArchiveMemberList files;
+	Common::SearchSet shaderSet;
+	const char *kFileMask = "*.glslp";
+
+	// Get the shaders archive
+	Common::generateZipSet(shaderSet, "shaders.dat", "shaders*.dat");
+	shaderSet.listMatchingMembers(files, kFileMask, true);
+	Common::sort(files.begin(), files.end(), Common::ArchiveMemberListComparator());
+
+	Common::StringArray brokenShaders;
+	int totalShaders = 0;
+	int workingShaders = 0;
+
+	Testsuite::logPrintf("Testing %d shader(s)...\n", files.size());
+
+	// Test each shader
+	for (auto &file : files) {
+		totalShaders++;
+		g_system->beginGFXTransaction();
+		Common::Path filename = Common::Path(file->getPathInArchive().toString().decode());
+		Testsuite::logDetailedPrintf("Testing shader: '%s'\n", filename.toString().c_str());
+		g_system->setShader(filename);
+		OSystem::TransactionError gfxError = g_system->endGFXTransaction();
+		if (gfxError & OSystem::kTransactionShaderChangeFailed) {
+			Testsuite::logDetailedPrintf("  Failed: Shader '%s' is incompatible\n", filename.toString().c_str());
+			brokenShaders.push_back(file->getPathInArchive().toString().decode());
+		} else {
+			Testsuite::logDetailedPrintf("  Passed: Shader '%s' loaded successfully\n", filename.toString().c_str());
+			workingShaders++;
+		}
+	}
+
+	// Reset shader to configured value
+	g_system->beginGFXTransaction();
+	g_system->setShader(ConfMan.getPath("shader"));
+	g_system->endGFXTransaction();
+
+	// Report results
+	Testsuite::logPrintf("\nShader Test Results:\n");
+	Testsuite::logPrintf("  Total shaders tested: %d\n", totalShaders);
+	Testsuite::logPrintf("  Working shaders: %d\n", workingShaders);
+	Testsuite::logPrintf("  Broken shaders: %d\n", brokenShaders.size());
+
+	if (!brokenShaders.empty()) {
+		Common::String listStr = "";
+		for (Common::String &shader : brokenShaders) {
+			listStr += shader + " ";
+		}
+		Testsuite::logPrintf("\nBroken shaders in archive, remove with:\n");
+		Testsuite::logPrintf("  zip -d shaders.dat %s\n", listStr.c_str());
+
+		// Also print to warning for visibility
+		warning("Broken shaders in archive, remove with: zip -d shaders.dat %s", listStr.c_str());
+	}
+
+	// Test passes if all shaders work, fails if any are broken
+	if (brokenShaders.empty()) {
+		Testsuite::logPrintf("\nAll shaders are compatible!\n");
+		return kTestPassed;
+	} else {
+		Testsuite::logPrintf("\nSome shaders are incompatible.\n");
+		return kTestFailed;
+	}
+}
+
 } // End of namespace Testbed
diff --git a/engines/testbed/graphics.h b/engines/testbed/graphics.h
index 118ab47e936..c6ff58b948b 100644
--- a/engines/testbed/graphics.h
+++ b/engines/testbed/graphics.h
@@ -57,6 +57,7 @@ TestExitStatus overlayGraphics();
 TestExitStatus paletteRotation();
 TestExitStatus pixelFormatsSupported();
 TestExitStatus pixelFormatsRequired();
+TestExitStatus shaderCompatibility();
 // add more here
 
 } // End of namespace GFXtests


Commit: 783a8c5f25b7c95480aa129be356bc658f12e212
    https://github.com/scummvm/scummvm/commit/783a8c5f25b7c95480aa129be356bc658f12e212
Author: Christian Kündig (christian at kuendig.info)
Date: 2025-10-30T23:05:00+01:00

Commit Message:
EMSCRIPTEN: Remove incompatible shaders from build target

Changed paths:
    backends/platform/sdl/emscripten/emscripten.mk


diff --git a/backends/platform/sdl/emscripten/emscripten.mk b/backends/platform/sdl/emscripten/emscripten.mk
index bfad4e5f75b..2eeada5c5cc 100644
--- a/backends/platform/sdl/emscripten/emscripten.mk
+++ b/backends/platform/sdl/emscripten/emscripten.mk
@@ -15,6 +15,18 @@ dist-emscripten: $(EXECUTABLE) $(PLUGINS)
 	cp $(EXECUTABLE:html=js) ./build-emscripten/
 	cp $(DIST_FILES_DOCS) ./build-emscripten/doc
 	cp $(DIST_FILES_THEMES) ./build-emscripten/data
+	zip -d ./build-emscripten/data/shaders.dat anti-aliasing/aa-shader-4.0.glslp anti-aliasing/reverse-aa.glslp cel/MMJ_Cel_Shader_MP.glslp \
+		crt/crt-guest-dr-venom-fast.glslp crt/crt-guest-dr-venom.glslp crt/crt-hyllian-glow.glslp crt/crt-hyllian.glslp \
+		crt/crtsim.glslp crt/gtuv50.glslp crt/yee64.glslp crt/yeetron.glslp cubic/cubic-gamma-correct.glslp \
+		cubic/cubic.glslp denoisers/crt-fast-bilateral-super-xbr.glslp denoisers/fast-bilateral-super-xbr-4p.glslp \
+		denoisers/fast-bilateral-super-xbr-6p.glslp denoisers/fast-bilateral-super-xbr.glslp dithering/bayer-matrix-dithering.glslp \
+		dithering/gendither.glslp hqx/hq2x-halphon.glslp interpolation/bandlimit-pixel.glslp interpolation/controlled_sharpness.glslp \
+		sabr/sabr-hybrid-deposterize.glslp scalefx/scalefx+rAA.glslp scalefx/scalefx-hybrid.glslp scalefx/scalefx.glslp \
+		scalenx/scale2xSFX.glslp scalenx/scale3x.glslp sharpen/adaptive-sharpen-multipass.glslp sharpen/adaptive-sharpen.glslp \
+		sharpen/super-xbr-super-res.glslp xbr/2xBR-lv1-multipass.glslp xbr/super-xbr-2p.glslp  xbr/super-xbr-3p-smoother.glslp \
+		xbr/super-xbr-6p-adaptive.glslp xbr/super-xbr-6p-small-details.glslp xbr/super-xbr-6p.glslp xbr/super-xbr-deposterize.glslp \
+		xbr/xbr-hybrid.glslp xbr/xbr-lv2-3d.glslp xbr/xbr-lv2-noblend.glslp xbr/xbr-lv2.glslp xbr/xbr-lv3-multipass.glslp \
+		xbr/xbr-lv3.glslp xbr/xbr-mlv4-multipass.glslp 
 ifdef DIST_FILES_ENGINEDATA
 	cp $(DIST_FILES_ENGINEDATA) ./build-emscripten/data
 endif




More information about the Scummvm-git-logs mailing list