]> git.pld-linux.org Git - packages/ClanLib.git/blame - really-disable-sse2.patch
- updated to 3.0.1
[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
434fc088
JR
249@@ -30,7 +30,9 @@
250 #pragma once
251
252 #include "pixel_converter_impl.h"
253+#ifndef DISABLE_SSE2
254 #include <emmintrin.h>
255+#endif
256
257 namespace clan
258 {
28e0ce6b
JR
259@@ -67,6 +67,7 @@
260 };
261
262
263+#ifndef DISABLE_SSE2
264 class PixelFilterSSE2_RGBToYCrCb : public PixelFilter
265 {
266 public:
267@@ -156,5 +157,6 @@
268 }
269 }
270 };
271+#endif
272
273 }
434fc088
JR
274--- ClanLib-3.0.0/Sources/Display/Image/pixel_buffer_impl.cpp~ 2013-09-24 13:53:31.000000000 +0200
275+++ ClanLib-3.0.0/Sources/Display/Image/pixel_buffer_impl.cpp 2013-11-05 21:22:05.346632850 +0100
276@@ -36,7 +36,9 @@
277 #include "API/Display/TargetProviders/graphic_context_provider.h"
278 #include "API/Display/TargetProviders/pixel_buffer_provider.h"
279 #include "API/Display/Image/pixel_converter.h"
280+#ifndef DISABLE_SSE2
281 #include <emmintrin.h>
282+#endif
283
284 #ifndef WIN32
285 #include <cstdlib>
286--- ClanLib-3.0.0/Sources/Display/Image/pixel_writer_sse.h~ 2013-09-24 13:53:31.000000000 +0200
287+++ ClanLib-3.0.0/Sources/Display/Image/pixel_writer_sse.h 2013-11-05 21:23:32.719965551 +0100
288@@ -31,11 +31,13 @@
289
290 #include "pixel_converter_impl.h"
291
292+#ifndef DISABLE_SSE2
293 #if defined(__SSE4_1__)
294 #include <smmintrin.h>
295 #else
296 #include <emmintrin.h>
297 #endif
298+#endif
299
300
301 namespace clan
09ceb046
JR
302--- ClanLib-3.0.0/Sources/API/Display/display_target.h.orig 2013-09-24 13:53:31.000000000 +0200
303+++ ClanLib-3.0.0/Sources/API/Display/display_target.h 2013-11-05 22:46:46.000000000 +0100
304@@ -80,11 +80,12 @@
305 /// \name Implementation
306 /// \{
307
308-private:
309-
310+public:
311 /// \brief Constructs a null DisplayTarget
312 DisplayTarget();
313
314+private:
315+
316 /// \brief Constructs a DisplayTarget
317 ///
318 /// \param DisplayTarget_Impl = Weak Ptr
9fe0dc21
JR
319--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/setup_swrender.cpp~ 2013-09-24 13:53:31.000000000 +0200
320+++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/setup_swrender.cpp 2013-11-05 21:47:15.449955252 +0100
09ceb046
JR
321@@ -33,23 +33,23 @@
322
9fe0dc21
JR
323 // NON-SSE2 STUB
324
09ceb046
JR
325+namespace clan
326+{
327+
9fe0dc21
JR
328 /////////////////////////////////////////////////////////////////////////////
329-// CL_SetupSWRender Construction:
330+// SetupSWRender Construction:
331
332-CL_SetupSWRender::CL_SetupSWRender()
333+SetupSWRender::SetupSWRender()
334 {
335- if (CL_System::detect_cpu_extension(CL_System::sse2))
336+ if (System::detect_cpu_extension(System::sse2))
337 {
338- throw CL_Exception("Sorry, this compiled clanSWRender does not support SSE2, but your CPU does support SSE2. (Update clanSWRender to contain SSE2)");
339+ throw Exception("Sorry, this compiled clanSWRender does not support SSE2, but your CPU does support SSE2. (Update clanSWRender to contain SSE2)");
340 }
341- throw CL_Exception("Sorry, clanSWRender requires a processor capable of SSE2 instructions. (Update your CPU)");
342+ throw Exception("Sorry, clanSWRender requires a processor capable of SSE2 instructions. (Update your CPU)");
343 }
344
345-CL_SetupSWRender::~CL_SetupSWRender()
346+SetupSWRender::~SetupSWRender()
347 {
348 }
349
350-void CL_SetupSWRender::set_current()
09ceb046 351-{
9fe0dc21 352 }
09ceb046 353-
9fe0dc21
JR
354--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_graphic_context.cpp~ 2013-09-24 13:53:31.000000000 +0200
355+++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_graphic_context.cpp 2013-11-05 21:47:35.776621770 +0100
09ceb046
JR
356@@ -32,58 +32,61 @@
357
9fe0dc21
JR
358 // NON-SSE2 stub
359
09ceb046
JR
360+namespace clan
361+{
362+
9fe0dc21
JR
363 /////////////////////////////////////////////////////////////////////////////
364-// CL_GraphicContext_SWRender_Impl Class:
365+// GraphicContext_SWRender_Impl Class:
366
367-class CL_GraphicContext_SWRender_Impl
368+class GraphicContext_SWRender_Impl
369 {
370 public:
371- CL_GraphicContext_SWRender_Impl()
372+ GraphicContext_SWRender_Impl()
373 {
374 }
375
376- ~CL_GraphicContext_SWRender_Impl()
377+ ~GraphicContext_SWRender_Impl()
378 {
379 }
380 };
381
382 /////////////////////////////////////////////////////////////////////////////
383-// CL_GraphicContext_SWRender Construction:
384+// GraphicContext_SWRender Construction:
385
386-CL_GraphicContext_SWRender::CL_GraphicContext_SWRender(CL_GraphicContext &gc) : CL_GraphicContext(gc),
387- impl(new CL_GraphicContext_SWRender_Impl)
388+GraphicContext_SWRender::GraphicContext_SWRender(GraphicContext &gc) : GraphicContext(gc),
389+ impl(new GraphicContext_SWRender_Impl)
390 {
391 }
392
393-CL_GraphicContext_SWRender::~CL_GraphicContext_SWRender()
394+GraphicContext_SWRender::~GraphicContext_SWRender()
395 {
396 }
397
398 /////////////////////////////////////////////////////////////////////////////
399-// CL_GraphicContext_SWRender Attributes:
400+// GraphicContext_SWRender Attributes:
401
402-void CL_GraphicContext_SWRender::throw_if_null() const
403+void GraphicContext_SWRender::throw_if_null() const
404 {
405 if (!impl)
406- throw CL_Exception("CL_GraphicContext_SWRender is null");
407+ throw Exception("GraphicContext_SWRender is null");
408 }
409
410-CL_PixelPipeline *CL_GraphicContext_SWRender::get_pipeline() const
411+PixelPipeline *GraphicContext_SWRender::get_pipeline() const
412 {
413 return NULL;
414 }
415
416 /////////////////////////////////////////////////////////////////////////////
417-// CL_GraphicContext_SWRender Operations:
418+// GraphicContext_SWRender Operations:
419
420-void CL_GraphicContext_SWRender::draw_pixels_bicubic(int x, int y, int zoom_number, int zoom_denominator, const CL_PixelBuffer &pixels)
421+void GraphicContext_SWRender::draw_pixels_bicubic(int x, int y, int zoom_number, int zoom_denominator, const PixelBuffer &pixels)
422 {
423 }
424
425-void CL_GraphicContext_SWRender::queue_command(CL_UniquePtr<CL_PixelCommand> &command)
09ceb046 426+void GraphicContext_SWRender::queue_command(std::unique_ptr<PixelCommand> &command)
9fe0dc21
JR
427 {
428 }
429
430 /////////////////////////////////////////////////////////////////////////////
431-// CL_GraphicContext_SWRender Implementation:
09ceb046 432-
9fe0dc21 433+// GraphicContext_SWRender Implementation:
09ceb046 434+}
9fe0dc21
JR
435--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_program_object.cpp~ 2013-09-24 13:53:31.000000000 +0200
436+++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_program_object.cpp 2013-11-05 21:47:48.349955014 +0100
09ceb046
JR
437@@ -32,42 +32,45 @@
438
9fe0dc21
JR
439 // NON-SSE2 stub
440
09ceb046
JR
441+namespace clan
442+{
443+
9fe0dc21
JR
444 /////////////////////////////////////////////////////////////////////////////
445-// CL_ProgramObject_SWRender Construction:
446+// ProgramObject_SWRender Construction:
447
448-CL_ProgramObject_SWRender::CL_ProgramObject_SWRender(CL_SoftwareProgram *program, bool is_sprite_program)
449+ProgramObject_SWRender::ProgramObject_SWRender(SoftwareProgram *program, bool is_sprite_program)
450 {
451 }
452
453-CL_ProgramObject_SWRender::CL_ProgramObject_SWRender(const CL_ProgramObject &program_object) : CL_ProgramObject(program_object)
454+ProgramObject_SWRender::ProgramObject_SWRender(const ProgramObject &program_object) : ProgramObject(program_object)
455 {
456 }
457
458-CL_ProgramObject_SWRender::~CL_ProgramObject_SWRender()
459+ProgramObject_SWRender::~ProgramObject_SWRender()
460 {
461 }
462
463 /////////////////////////////////////////////////////////////////////////////
464-// CL_ProgramObject_SWRender Attributes:
465+// ProgramObject_SWRender Attributes:
466
467-CL_SoftwareProgram *CL_ProgramObject_SWRender::get_program() const
468+SoftwareProgram *ProgramObject_SWRender::get_program() const
469 {
470 return NULL;
471 }
472
473-bool CL_ProgramObject_SWRender::is_sprite_program() const
474+bool ProgramObject_SWRender::is_sprite_program() const
475 {
476 return false;
477 }
478
479-CL_SWRenderProgramObjectProvider *CL_ProgramObject_SWRender::get_provider() const
480+SWRenderProgramObjectProvider *ProgramObject_SWRender::get_provider() const
481 {
482 return NULL;
483 }
484
485 /////////////////////////////////////////////////////////////////////////////
486-// CL_ProgramObject_SWRender Operations:
487+// ProgramObject_SWRender Operations:
488
489 /////////////////////////////////////////////////////////////////////////////
490-// CL_ProgramObject_SWRender Implementation:
09ceb046 491-
9fe0dc21 492+// ProgramObject_SWRender Implementation:
09ceb046 493+}
9fe0dc21
JR
494--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_target.cpp~ 2013-09-24 13:53:31.000000000 +0200
495+++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_target.cpp 2013-11-05 21:47:58.379954940 +0100
09ceb046
JR
496@@ -31,22 +31,33 @@
497
9fe0dc21
JR
498 // NON-SSE2 stub
499
09ceb046
JR
500+namespace clan
501+{
502+
9fe0dc21
JR
503 /////////////////////////////////////////////////////////////////////////////
504-// CL_SWRenderTarget Construction:
505+// SWRenderTarget Construction:
506
507-CL_SWRenderTarget::CL_SWRenderTarget()
508+SWRenderTarget::SWRenderTarget()
509 {
510 }
511
512-CL_SWRenderTarget::~CL_SWRenderTarget()
513+SWRenderTarget::~SWRenderTarget()
514 {
515 }
516
517 /////////////////////////////////////////////////////////////////////////////
518-// CL_SWRenderTarget Attributes:
519+// SWRenderTarget Attributes:
09ceb046
JR
520+bool SWRenderTarget::is_current()
521+{
522+ return false;
523+}
9fe0dc21
JR
524
525 /////////////////////////////////////////////////////////////////////////////
526-// CL_SWRenderTarget Operations:
527+// SWRenderTarget Operations:
09ceb046
JR
528+void SWRenderTarget::set_current()
529+{
530+}
9fe0dc21
JR
531
532 /////////////////////////////////////////////////////////////////////////////
533-// CL_SWRenderTarget Implementation:
534+// SWRenderTarget Implementation:
09ceb046 535+}
This page took 0.126815 seconds and 4 git commands to generate.