]> git.pld-linux.org Git - packages/ClanLib.git/blame - really-disable-sse2.patch
- more sse
[packages/ClanLib.git] / really-disable-sse2.patch
CommitLineData
345f9290
JR
1--- ClanLib-3.0.0/configure.ac~ 2013-11-05 19:52:09.000000000 +0100
2+++ ClanLib-3.0.0/configure.ac 2013-11-05 20:42:25.891716845 +0100
3@@ -222,6 +222,7 @@
4 AC_MSG_RESULT([enabled])
5 use_sse2=yes
6 else
7+ AC_DEFINE(DISABLE_SSE2)
8 AC_DEFINE(CL_DISABLE_SSE2)
9 AC_MSG_RESULT([disabled])
10 fi
11@@ -234,6 +235,7 @@
12 use_sse2=yes
13 else
14 AC_MSG_WARN( [ *** Compliler does not support SSE2 ])
15+ AC_DEFINE(DISABLE_SSE2)
16 AC_DEFINE(CL_DISABLE_SSE2)
17 AC_MSG_RESULT([disabled])
18 fi
19@@ -248,7 +250,7 @@
20
21 extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -msse2"
22 else
23- extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -DCL_DISABLE_SSE2"
24+ extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -DCL_DISABLE_SSE2 -DDISABLE_SSE2"
25 fi
26 extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -pthread -std=c++0x"
27
28e0ce6b
JR
28--- ClanLib-3.0.0/Sources/Display/Image/pixel_converter.cpp~ 2013-09-24 13:53:31.000000000 +0200
29+++ ClanLib-3.0.0/Sources/Display/Image/pixel_converter.cpp 2013-11-05 20:57:39.298376899 +0100
30@@ -36,12 +36,16 @@
31 #include "pixel_reader_half_float.h"
32 #include "pixel_reader_norm.h"
33 #include "pixel_reader_special.h"
34+#ifndef DISABLE_SSE2
35 #include "pixel_reader_sse.h"
36+#endif
37 #include "pixel_writer_cast.h"
38 #include "pixel_writer_half_float.h"
39 #include "pixel_writer_norm.h"
40 #include "pixel_writer_special.h"
41+#ifndef DISABLE_SSE2
42 #include "pixel_writer_sse.h"
43+#endif
44 #include "pixel_filter_gamma.h"
45 #include "pixel_filter_premultiply_alpha.h"
46 #include "pixel_filter_swizzle.h"
47@@ -126,8 +130,13 @@
48
49 void PixelConverter::convert(void *output, int output_pitch, TextureFormat output_format, const void *input, int input_pitch, TextureFormat input_format, int width, int height)
50 {
51+#ifndef DISABLE_SSE2
52 bool sse2 = System::detect_cpu_extension(System::sse2);
53 bool sse4 = System::detect_cpu_extension(System::sse4_1);
54+#else
55+ bool sse2 = false;
56+ bool sse4 = false;
57+#endif
58
59 std::unique_ptr<PixelReader> reader = impl->create_reader(input_format, sse2);
60 std::unique_ptr<PixelWriter> writer = impl->create_writer(output_format, sse2, sse4);
4a7795d5
JR
61@@ -162,9 +162,11 @@
62 switch (format)
63 {
64 case tf_bgra8:
65+#ifndef DISABLE_SSE2
66 if (sse2)
67 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_bgra8());
68 else
69+#endif
70 return std::unique_ptr<PixelReader>(new PixelReader_bgra8());
71 case tf_bgr8:
72 return std::unique_ptr<PixelReader>(new PixelReader_bgr8());
73@@ -216,9 +218,11 @@
74 case tf_rgb5_a1:
75 return std::unique_ptr<PixelReader>(new PixelReader_rgb5_a1());
76 case tf_rgba8:
77+#ifndef DISABLE_SSE2
78 if (sse2)
79 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba8());
80 else
81+#endif
82 return std::unique_ptr<PixelReader>(new PixelReader_4norm<unsigned char>());
83 case tf_rgba8_snorm:
84 return std::unique_ptr<PixelReader>(new PixelReader_4norm<char>());
85@@ -227,18 +231,22 @@
86 case tf_rgba12:
87 break;
88 case tf_rgba16:
89+#ifndef DISABLE_SSE2
90 if (sse2)
91 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba16());
92 else
93+#endif
94 return std::unique_ptr<PixelReader>(new PixelReader_4norm<unsigned short>());
95 case tf_rgba16_snorm:
96 return std::unique_ptr<PixelReader>(new PixelReader_4norm<short>());
97 case tf_srgb8:
98 return std::unique_ptr<PixelReader>(new PixelReader_3norm<unsigned char>()); // TBD: should we add a 2.2 gamma filter?
99 case tf_srgb8_alpha8:
100+#ifndef DISABLE_SSE2
101 if (sse2)
102 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba8());
103 else
104+#endif
105 return std::unique_ptr<PixelReader>(new PixelReader_4norm<char>()); // TBD: should we add a 2.2 gamma filter?
106 case tf_r16f:
107 return std::unique_ptr<PixelReader>(new PixelReader_1hf());
108@@ -341,9 +349,11 @@
109 switch (format)
110 {
111 case tf_bgra8:
112+#ifndef DISABLE_SSE2
113 if (sse2)
114 return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_bgra8());
115 else
116+#endif
117 return std::unique_ptr<PixelWriter>(new PixelWriter_bgra8());
118 case tf_bgr8:
119 return std::unique_ptr<PixelWriter>(new PixelWriter_bgr8());
120@@ -395,9 +405,11 @@
121 case tf_rgb5_a1:
122 return std::unique_ptr<PixelWriter>(new PixelWriter_rgb5_a1());
123 case tf_rgba8:
124+#ifndef DISABLE_SSE2
125 if (sse2)
126 return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_rgba8());
127 else
128+#endif
129 return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<unsigned char>());
130 case tf_rgba8_snorm:
131 return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<char>());
132@@ -419,9 +431,11 @@
133 case tf_srgb8:
134 return std::unique_ptr<PixelWriter>(new PixelWriter_3norm<unsigned char>()); // TBD: should we add a 2.2 gamma filter?
135 case tf_srgb8_alpha8:
136+#ifndef DISABLE_SSE2
137 if (sse2)
138 return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_rgba8());
139 else
140+#endif
141 return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<char>()); // TBD: should we add a 2.2 gamma filter?
142 case tf_r16f:
143 return std::unique_ptr<PixelWriter>(new PixelWriter_1hf());
144@@ -525,41 +539,51 @@
145
146 if (input_is_ycrcb)
147 {
148+#ifndef DISABLE_SSE2
149 if (sse2)
150 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSSE2_YCrCbToRGB()));
151 else
152+#endif
153 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterYCrCbToRGB()));
154 }
155
156 if (premultiply_alpha)
157 {
158+#ifndef DISABLE_SSE2
159 if (sse2)
160 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterPremultiplyAlphaSSE2()));
161 else
162+#endif
163 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterPremultiplyAlpha()));
164 }
165
166 if (gamma != 1.0f)
167 {
168+#ifndef DISABLE_SSE2
169 if (sse2)
170 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterGammaSSE2(gamma)));
171 else
172+#endif
173 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterGamma(gamma)));
174 }
175
176 if (swizzle != Vec4i(0,1,2,3))
177 {
178+#ifndef DISABLE_SSE2
179 if (sse2)
180 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSwizzleSSE2(swizzle)));
181 else
182+#endif
183 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSwizzle(swizzle)));
184 }
185
186 if (output_is_ycrcb)
187 {
188+#ifndef DISABLE_SSE2
189 if (sse2)
190 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSSE2_RGBToYCrCb()));
191 else
192+#endif
193 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterRGBToYCrCb()));
194 }
195
28e0ce6b
JR
196--- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_gamma.h~ 2013-09-24 13:53:31.000000000 +0200
197+++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_gamma.h 2013-11-05 21:00:27.261709016 +0100
198@@ -50,6 +50,7 @@
199 float gamma;
200 };
201
202+#ifndef DISABLE_SSE2
203 class PixelFilterGammaSSE2 : public PixelFilter
204 {
205 public:
206@@ -170,5 +171,6 @@
207 private:
208 float gamma;
209 };
210+#endif
211
212 }
213--- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_premultiply_alpha.h~ 2013-09-24 13:53:31.000000000 +0200
214+++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_premultiply_alpha.h 2013-11-05 21:01:03.885042084 +0100
215@@ -46,6 +46,7 @@
216 }
217 };
218
219+#ifndef DISABLE_SSE2
220 class PixelFilterPremultiplyAlphaSSE2 : public PixelFilter
221 {
222 public:
223@@ -63,5 +64,6 @@
224 }
225 }
226 };
227+#endif
228
229 }
230--- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_swizzle.h~ 2013-09-24 13:53:31.000000000 +0200
231+++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_swizzle.h 2013-11-05 21:01:17.849463650 +0100
232@@ -76,6 +76,7 @@
233 Vec4f red, green, blue, alpha;
234 };
235
236+#ifndef DISABLE_SSE2
237 class PixelFilterSwizzleSSE2 : public PixelFilter
238 {
239 public:
240@@ -126,5 +127,6 @@
241 private:
242 __m128 red_mask, green_mask, blue_mask, alpha_mask;
243 };
244+#endif
245
246 }
247--- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_rgb_to_ycrcb.h~ 2013-09-24 13:53:31.000000000 +0200
248+++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_rgb_to_ycrcb.h 2013-11-05 21:01:44.896313454 +0100
249@@ -67,6 +67,7 @@
250 };
251
252
253+#ifndef DISABLE_SSE2
254 class PixelFilterSSE2_RGBToYCrCb : public PixelFilter
255 {
256 public:
257@@ -156,5 +157,6 @@
258 }
259 }
260 };
261+#endif
262
263 }
This page took 0.117131 seconds and 4 git commands to generate.