From 4a7795d55067cf6735a2a8e92779d8e1ff807167 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Tue, 5 Nov 2013 21:12:28 +0100 Subject: [PATCH] - more sse --- really-disable-sse2.patch | 135 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/really-disable-sse2.patch b/really-disable-sse2.patch index 19330f3..9c5c359 100644 --- a/really-disable-sse2.patch +++ b/really-disable-sse2.patch @@ -58,6 +58,141 @@ std::unique_ptr reader = impl->create_reader(input_format, sse2); std::unique_ptr writer = impl->create_writer(output_format, sse2, sse4); +@@ -162,9 +162,11 @@ + switch (format) + { + case tf_bgra8: ++#ifndef DISABLE_SSE2 + if (sse2) + return std::unique_ptr(new PixelReaderSSE2_bgra8()); + else ++#endif + return std::unique_ptr(new PixelReader_bgra8()); + case tf_bgr8: + return std::unique_ptr(new PixelReader_bgr8()); +@@ -216,9 +218,11 @@ + case tf_rgb5_a1: + return std::unique_ptr(new PixelReader_rgb5_a1()); + case tf_rgba8: ++#ifndef DISABLE_SSE2 + if (sse2) + return std::unique_ptr(new PixelReaderSSE2_rgba8()); + else ++#endif + return std::unique_ptr(new PixelReader_4norm()); + case tf_rgba8_snorm: + return std::unique_ptr(new PixelReader_4norm()); +@@ -227,18 +231,22 @@ + case tf_rgba12: + break; + case tf_rgba16: ++#ifndef DISABLE_SSE2 + if (sse2) + return std::unique_ptr(new PixelReaderSSE2_rgba16()); + else ++#endif + return std::unique_ptr(new PixelReader_4norm()); + case tf_rgba16_snorm: + return std::unique_ptr(new PixelReader_4norm()); + case tf_srgb8: + return std::unique_ptr(new PixelReader_3norm()); // TBD: should we add a 2.2 gamma filter? + case tf_srgb8_alpha8: ++#ifndef DISABLE_SSE2 + if (sse2) + return std::unique_ptr(new PixelReaderSSE2_rgba8()); + else ++#endif + return std::unique_ptr(new PixelReader_4norm()); // TBD: should we add a 2.2 gamma filter? + case tf_r16f: + return std::unique_ptr(new PixelReader_1hf()); +@@ -341,9 +349,11 @@ + switch (format) + { + case tf_bgra8: ++#ifndef DISABLE_SSE2 + if (sse2) + return std::unique_ptr(new PixelWriterSSE2_bgra8()); + else ++#endif + return std::unique_ptr(new PixelWriter_bgra8()); + case tf_bgr8: + return std::unique_ptr(new PixelWriter_bgr8()); +@@ -395,9 +405,11 @@ + case tf_rgb5_a1: + return std::unique_ptr(new PixelWriter_rgb5_a1()); + case tf_rgba8: ++#ifndef DISABLE_SSE2 + if (sse2) + return std::unique_ptr(new PixelWriterSSE2_rgba8()); + else ++#endif + return std::unique_ptr(new PixelWriter_4norm()); + case tf_rgba8_snorm: + return std::unique_ptr(new PixelWriter_4norm()); +@@ -419,9 +431,11 @@ + case tf_srgb8: + return std::unique_ptr(new PixelWriter_3norm()); // TBD: should we add a 2.2 gamma filter? + case tf_srgb8_alpha8: ++#ifndef DISABLE_SSE2 + if (sse2) + return std::unique_ptr(new PixelWriterSSE2_rgba8()); + else ++#endif + return std::unique_ptr(new PixelWriter_4norm()); // TBD: should we add a 2.2 gamma filter? + case tf_r16f: + return std::unique_ptr(new PixelWriter_1hf()); +@@ -525,41 +539,51 @@ + + if (input_is_ycrcb) + { ++#ifndef DISABLE_SSE2 + if (sse2) + filters.push_back(std::shared_ptr(new PixelFilterSSE2_YCrCbToRGB())); + else ++#endif + filters.push_back(std::shared_ptr(new PixelFilterYCrCbToRGB())); + } + + if (premultiply_alpha) + { ++#ifndef DISABLE_SSE2 + if (sse2) + filters.push_back(std::shared_ptr(new PixelFilterPremultiplyAlphaSSE2())); + else ++#endif + filters.push_back(std::shared_ptr(new PixelFilterPremultiplyAlpha())); + } + + if (gamma != 1.0f) + { ++#ifndef DISABLE_SSE2 + if (sse2) + filters.push_back(std::shared_ptr(new PixelFilterGammaSSE2(gamma))); + else ++#endif + filters.push_back(std::shared_ptr(new PixelFilterGamma(gamma))); + } + + if (swizzle != Vec4i(0,1,2,3)) + { ++#ifndef DISABLE_SSE2 + if (sse2) + filters.push_back(std::shared_ptr(new PixelFilterSwizzleSSE2(swizzle))); + else ++#endif + filters.push_back(std::shared_ptr(new PixelFilterSwizzle(swizzle))); + } + + if (output_is_ycrcb) + { ++#ifndef DISABLE_SSE2 + if (sse2) + filters.push_back(std::shared_ptr(new PixelFilterSSE2_RGBToYCrCb())); + else ++#endif + filters.push_back(std::shared_ptr(new PixelFilterRGBToYCrCb())); + } + --- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_gamma.h~ 2013-09-24 13:53:31.000000000 +0200 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_gamma.h 2013-11-05 21:00:27.261709016 +0100 @@ -50,6 +50,7 @@ -- 2.43.0