[Scummvm-git-logs] scummvm master -> db6b2a11ccfdaad8ba632afe8ac20dc911584d00

fracturehill noreply at scummvm.org
Tue Nov 14 10:06:07 UTC 2023


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

Summary:
654879f507 GRAPHICS: Fix Multiply blending in NEON path
226470434f GUI: Add CPU extension info to About dialog
0785fb6a73 BASE: Print CPU extension info to console on startup
db6b2a11cc GUI: Make sure About dialog can scroll to top


Commit: 654879f50732de432e772d5e73943bc84f961ed2
    https://github.com/scummvm/scummvm/commit/654879f50732de432e772d5e73943bc84f961ed2
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-11-14T12:05:27+02:00

Commit Message:
GRAPHICS: Fix Multiply blending in NEON path

This fixes the color bleeding issues that previously happened
when using Multiply blending (e.g. Out of Order intro)

Changed paths:
    graphics/blit/blit-neon.cpp


diff --git a/graphics/blit/blit-neon.cpp b/graphics/blit/blit-neon.cpp
index 85a38bddbb3..fcc4fd14f5d 100644
--- a/graphics/blit/blit-neon.cpp
+++ b/graphics/blit/blit-neon.cpp
@@ -82,36 +82,41 @@ struct AlphaBlend : public BlendBlitImpl_Base::AlphaBlend<doscale, rgbmod, alpha
 template<bool doscale, bool rgbmod, bool alphamod>
 struct MultiplyBlend : public BlendBlitImpl_Base::MultiplyBlend<doscale, rgbmod, alphamod> {
 	static inline uint32x4_t simd(uint32x4_t src, uint32x4_t dst, const bool flip, const byte ca, const byte cr, const byte cg, const byte cb) {
-		uint32x4_t ina;
-		if (alphamod)
+		uint32x4_t ina, alphaMask;
+		if (alphamod) {
 			ina = vshrq_n_u32(vmulq_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kAModMask)), vdupq_n_u32(ca)), 8);
-		else
+			alphaMask = vceqq_u32(ina, vmovq_n_u32(0));
+		} else {
 			ina = vandq_u32(src, vmovq_n_u32(BlendBlit::kAModMask));
-		uint32x4_t alphaMask = vceqq_u32(ina, vmovq_n_u32(0));
+			alphaMask = vdupq_n_u32(BlendBlit::kAModMask);
+		}
 
 		if (rgbmod) {
-			uint32x4_t srcb = vandq_u32(src, vmovq_n_u32(BlendBlit::kBModMask));
-			uint32x4_t srcg = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kGModMask)), BlendBlit::kGModShift);
-			uint32x4_t srcr = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kRModMask)), BlendBlit::kRModShift);
-			uint32x4_t dstb = vandq_u32(dst, vmovq_n_u32(BlendBlit::kBModMask));
-			uint32x4_t dstg = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kGModMask)), BlendBlit::kGModShift);
-			uint32x4_t dstr = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kRModMask)), BlendBlit::kRModShift);
+			uint32x4_t srcB = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kBModMask)), BlendBlit::kBModShift);
+			uint32x4_t srcG = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kGModMask)), BlendBlit::kGModShift);
+			uint32x4_t srcR = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kRModMask)), BlendBlit::kRModShift);
+			uint32x4_t dstB = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kBModMask)), BlendBlit::kBModShift);
+			uint32x4_t dstG = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kGModMask)), BlendBlit::kGModShift);
+			uint32x4_t dstR = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kRModMask)), BlendBlit::kRModShift);
 
-			srcb = vandq_u32(vshrq_n_u32(vmulq_u32(dstb, vshrq_n_u32(vmulq_u32(vmulq_u32(srcb, vmovq_n_u32(cb)), ina), 16)), 8), vmovq_n_u32(BlendBlit::kBModMask));
-			srcg = vandq_u32(vshlq_n_u32(vmulq_u32(dstg, vshrq_n_u32(vmulq_u32(vmulq_u32(srcg, vmovq_n_u32(cg)), ina), 16)), BlendBlit::kGModShift - 8), vmovq_n_u32(BlendBlit::kGModMask));
-			srcr = vandq_u32(vshlq_n_u32(vmulq_u32(dstr, vshrq_n_u32(vmulq_u32(vmulq_u32(srcr, vmovq_n_u32(cr)), ina), 16)), BlendBlit::kRModShift - 8), vmovq_n_u32(BlendBlit::kRModMask));
+			srcB = vandq_u32(vshlq_n_u32(vmulq_u32(dstB, vshrq_n_u32(vmulq_u32(vmulq_u32(srcB, vmovq_n_u32(cb)), ina), 16)), BlendBlit::kBModShift - 8), vmovq_n_u32(BlendBlit::kBModMask));
+			srcG = vandq_u32(vshlq_n_u32(vmulq_u32(dstG, vshrq_n_u32(vmulq_u32(vmulq_u32(srcG, vmovq_n_u32(cg)), ina), 16)), BlendBlit::kGModShift - 8), vmovq_n_u32(BlendBlit::kGModMask));
+			srcR = vandq_u32(vshlq_n_u32(vmulq_u32(dstR, vshrq_n_u32(vmulq_u32(vmulq_u32(srcR, vmovq_n_u32(cr)), ina), 16)), BlendBlit::kRModShift - 8), vmovq_n_u32(BlendBlit::kRModMask));
 
 			src = vandq_u32(src, vmovq_n_u32(BlendBlit::kAModMask));
-			src = vorrq_u32(src, vorrq_u32(srcb, vorrq_u32(srcg, srcr)));
+			src = vorrq_u32(src, vorrq_u32(srcB, vorrq_u32(srcG, srcR)));
 		} else {
-			uint32x4_t srcg = vandq_u32(src, vmovq_n_u32(BlendBlit::kGModMask));
-			uint32x4_t srcrb = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kRModMask | BlendBlit::kBModMask)), BlendBlit::kBModShift);
-			uint32x4_t dstg = vandq_u32(dst, vmovq_n_u32(BlendBlit::kGModMask));
-			uint32x4_t dstrb = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kRModMask | BlendBlit::kBModMask)), BlendBlit::kBModShift);
-			srcg = vandq_u32(vshrq_n_u32(vmulq_u32(dstg, vshrq_n_u32(vmulq_u32(srcg, ina), 8)), 8), vmovq_n_u32(BlendBlit::kGModMask));
-			srcrb = vandq_u32(vmulq_u32(dstrb, vshrq_n_u32(vmulq_u32(srcrb, ina), 8)), vmovq_n_u32(BlendBlit::kRModMask | BlendBlit::kBModMask));
+			constexpr uint32 rbMask = BlendBlit::kRModMask | BlendBlit::kBModMask;
+			uint32x4_t srcG = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kGModMask)), BlendBlit::kGModShift);
+			uint32x4_t srcRB = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(rbMask)), BlendBlit::kBModShift);
+			uint32x4_t dstG = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kGModMask)), BlendBlit::kGModShift);
+			uint32x4_t dstRB = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(rbMask)), BlendBlit::kBModShift);
+
+			srcG = vandq_u32(vshlq_n_u32(vmulq_u32(dstG, vshrq_n_u32(vmulq_u32(srcG, ina), 8)), 8), vmovq_n_u32(BlendBlit::kGModMask));
+			srcRB = vandq_u32(vreinterpretq_u32_u16(vmulq_u16(vreinterpretq_u16_u32(dstRB), vreinterpretq_u16_u32(vshrq_n_u32(vandq_u32(vmulq_u32(srcRB, ina), vmovq_n_u32(rbMask)), 8)))), vmovq_n_u32(rbMask));
+
 			src = vandq_u32(src, vmovq_n_u32(BlendBlit::kAModMask));
-			src = vorrq_u32(src, vorrq_u32(srcrb, srcg));
+			src = vorrq_u32(src, vorrq_u32(srcRB, srcG));
 		}
 
 		dst = vandq_u32(alphaMask, dst);


Commit: 226470434f2adf83f952f408eba3771dc0307bc6
    https://github.com/scummvm/scummvm/commit/226470434f2adf83f952f408eba3771dc0307bc6
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-11-14T12:05:27+02:00

Commit Message:
GUI: Add CPU extension info to About dialog

Changed paths:
    gui/about.cpp


diff --git a/gui/about.cpp b/gui/about.cpp
index 0af3e31c4a3..cca761ba543 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -115,6 +115,42 @@ AboutDialog::AboutDialog()
 
 	_lines.push_back(Common::U32String());
 
+	Common::U32String extensionSupportString[3] = { _("not supported"), _("disabled"), _("enabled") };
+
+	byte sse2Support = 0;
+	byte avx2Support = 0;
+	byte neonSupport = 0;
+
+#ifdef SCUMMVM_SSE2
+	++sse2Support;
+	if (g_system->hasFeature(OSystem::kFeatureCpuSSE2))
+		++sse2Support;
+#endif
+#ifdef SCUMMVM_AVX2
+	++avx2Support;
+	if (g_system->hasFeature(OSystem::kFeatureCpuAVX2))
+		++avx2Support;
+#endif
+#ifdef SCUMMVM_NEON
+	++neonSupport;
+	if (g_system->hasFeature(OSystem::kFeatureCpuNEON))
+		++neonSupport;
+#endif
+
+	Common::U32String extensionsInfo("C1");
+	// I18N: CPU extensions are sets of extra processor instructions used to speed up operations. See Intel AVX2, ARM NEON, etc.
+	extensionsInfo += _("CPU extensions support:");
+	addLine(extensionsInfo);
+	Common::U32String compiledExtensionsList("C0");
+	compiledExtensionsList += Common::U32String::format("SSE2(%S) AVX2(%S) NEON(%S)",
+		extensionSupportString[sse2Support].c_str(),
+		extensionSupportString[avx2Support].c_str(),
+		extensionSupportString[neonSupport].c_str());
+
+	addLine(compiledExtensionsList);
+
+	_lines.push_back(Common::U32String());
+
 	Common::U32String engines("C1");
 	engines += _("Available engines:");
 	addLine(engines);


Commit: 0785fb6a73d95d278ecfa1012626dfb3cd4c574d
    https://github.com/scummvm/scummvm/commit/0785fb6a73d95d278ecfa1012626dfb3cd4c574d
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-11-14T12:05:27+02:00

Commit Message:
BASE: Print CPU extension info to console on startup

Changed paths:
    base/main.cpp


diff --git a/base/main.cpp b/base/main.cpp
index 67ad8c4facc..563057628b6 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -714,6 +714,38 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
 	GUI::dumpAllDialogs();
 #endif
 
+// Print out CPU extension info
+// Separate block to keep the stack clean
+	{
+		Common::String extensionSupportString[3] = { "not supported", "disabled", "enabled" };
+
+		byte sse2Support = 0;
+		byte avx2Support = 0;
+		byte neonSupport = 0;
+
+#ifdef SCUMMVM_SSE2
+		++sse2Support;
+		if (g_system->hasFeature(OSystem::kFeatureCpuSSE2))
+			++sse2Support;
+#endif
+#ifdef SCUMMVM_AVX2
+		++avx2Support;
+		if (g_system->hasFeature(OSystem::kFeatureCpuAVX2))
+			++avx2Support;
+#endif
+#ifdef SCUMMVM_NEON
+		++neonSupport;
+		if (g_system->hasFeature(OSystem::kFeatureCpuNEON))
+			++neonSupport;
+#endif
+
+		debug(0, "CPU extensions:");
+		debug(0, "SSE2(%s) AVX2(%s) NEON(%s)",
+			extensionSupportString[sse2Support].c_str(),
+			extensionSupportString[avx2Support].c_str(),
+			extensionSupportString[neonSupport].c_str());
+	}
+
 	// Unless a game was specified, show the launcher dialog
 	if (nullptr == ConfMan.getActiveDomain())
 		launcherDialog();


Commit: db6b2a11ccfdaad8ba632afe8ac20dc911584d00
    https://github.com/scummvm/scummvm/commit/db6b2a11ccfdaad8ba632afe8ac20dc911584d00
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-11-14T12:05:27+02:00

Commit Message:
GUI: Make sure About dialog can scroll to top

Fixed an issue where scrolling up in the About dialog would
stop before the top of the text, sometimes cropping
parts of it.

Changed paths:
    gui/about.cpp


diff --git a/gui/about.cpp b/gui/about.cpp
index cca761ba543..c6cae225404 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -330,7 +330,7 @@ void AboutDialog::handleMouseWheel(int x, int y, int direction) {
 
 	int newScrollPos = _scrollPos + stepping;
 
-	if (_scrollPos < 0) {
+	if (newScrollPos < 0) {
 		_scrollPos = 0;
 	} else if ((uint32)newScrollPos < _lines.size() * _lineHeight) {
 		_scrollPos = newScrollPos;




More information about the Scummvm-git-logs mailing list