]> git.pld-linux.org Git - packages/ClanLib.git/blob - really-disable-sse2.patch
- update non-sse swrender to current api
[packages/ClanLib.git] / really-disable-sse2.patch
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  
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);
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  
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 @@ -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  {
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  }
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
302 --- ClanLib-3.0.0/Sources/SWRender/X11/Stub/setup_swrender.cpp~ 2013-09-24 13:53:31.000000000 +0200
303 +++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/setup_swrender.cpp  2013-11-05 21:47:15.449955252 +0100
304 @@ -34,22 +34,22 @@
305  // NON-SSE2 STUB
306  
307  /////////////////////////////////////////////////////////////////////////////
308 -// CL_SetupSWRender Construction:
309 +// SetupSWRender Construction:
310  
311 -CL_SetupSWRender::CL_SetupSWRender()
312 +SetupSWRender::SetupSWRender()
313  {
314 -       if (CL_System::detect_cpu_extension(CL_System::sse2))
315 +       if (System::detect_cpu_extension(System::sse2))
316         {
317 -               throw CL_Exception("Sorry, this compiled clanSWRender does not support SSE2, but your CPU does support SSE2. (Update clanSWRender to contain SSE2)");
318 +               throw Exception("Sorry, this compiled clanSWRender does not support SSE2, but your CPU does support SSE2. (Update clanSWRender to contain SSE2)");
319         }
320 -       throw CL_Exception("Sorry, clanSWRender requires a processor capable of SSE2 instructions. (Update your CPU)");
321 +       throw Exception("Sorry, clanSWRender requires a processor capable of SSE2 instructions. (Update your CPU)");
322  }
323  
324 -CL_SetupSWRender::~CL_SetupSWRender()
325 +SetupSWRender::~SetupSWRender()
326  {
327  }
328  
329 -void CL_SetupSWRender::set_current()
330 +void SetupSWRender::set_current()
331  {
332  }
333  
334 --- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_graphic_context.cpp~    2013-09-24 13:53:31.000000000 +0200
335 +++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_graphic_context.cpp     2013-11-05 21:47:35.776621770 +0100
336 @@ -33,57 +33,57 @@
337  // NON-SSE2 stub
338  
339  /////////////////////////////////////////////////////////////////////////////
340 -// CL_GraphicContext_SWRender_Impl Class:
341 +// GraphicContext_SWRender_Impl Class:
342  
343 -class CL_GraphicContext_SWRender_Impl
344 +class GraphicContext_SWRender_Impl
345  {
346  public:
347 -       CL_GraphicContext_SWRender_Impl()
348 +       GraphicContext_SWRender_Impl()
349         {
350         }
351  
352 -       ~CL_GraphicContext_SWRender_Impl()
353 +       ~GraphicContext_SWRender_Impl()
354         {
355         }
356  };
357  
358  /////////////////////////////////////////////////////////////////////////////
359 -// CL_GraphicContext_SWRender Construction:
360 +// GraphicContext_SWRender Construction:
361  
362 -CL_GraphicContext_SWRender::CL_GraphicContext_SWRender(CL_GraphicContext &gc) : CL_GraphicContext(gc),
363 - impl(new CL_GraphicContext_SWRender_Impl)
364 +GraphicContext_SWRender::GraphicContext_SWRender(GraphicContext &gc) : GraphicContext(gc),
365 + impl(new GraphicContext_SWRender_Impl)
366  {
367  }
368  
369 -CL_GraphicContext_SWRender::~CL_GraphicContext_SWRender()
370 +GraphicContext_SWRender::~GraphicContext_SWRender()
371  {
372  }
373  
374  /////////////////////////////////////////////////////////////////////////////
375 -// CL_GraphicContext_SWRender Attributes:
376 +// GraphicContext_SWRender Attributes:
377  
378 -void CL_GraphicContext_SWRender::throw_if_null() const
379 +void GraphicContext_SWRender::throw_if_null() const
380  {
381         if (!impl)
382 -               throw CL_Exception("CL_GraphicContext_SWRender is null");
383 +               throw Exception("GraphicContext_SWRender is null");
384  }
385  
386 -CL_PixelPipeline *CL_GraphicContext_SWRender::get_pipeline() const
387 +PixelPipeline *GraphicContext_SWRender::get_pipeline() const
388  {
389         return NULL;
390  }
391  
392  /////////////////////////////////////////////////////////////////////////////
393 -// CL_GraphicContext_SWRender Operations:
394 +// GraphicContext_SWRender Operations:
395  
396 -void CL_GraphicContext_SWRender::draw_pixels_bicubic(int x, int y, int zoom_number, int zoom_denominator, const CL_PixelBuffer &pixels)
397 +void GraphicContext_SWRender::draw_pixels_bicubic(int x, int y, int zoom_number, int zoom_denominator, const PixelBuffer &pixels)
398  {
399  }
400  
401 -void CL_GraphicContext_SWRender::queue_command(CL_UniquePtr<CL_PixelCommand> &command)
402 +void GraphicContext_SWRender::queue_command(UniquePtr<PixelCommand> &command)
403  {
404  }
405  
406  /////////////////////////////////////////////////////////////////////////////
407 -// CL_GraphicContext_SWRender Implementation:
408 +// GraphicContext_SWRender Implementation:
409  
410 --- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_program_object.cpp~     2013-09-24 13:53:31.000000000 +0200
411 +++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_program_object.cpp      2013-11-05 21:47:48.349955014 +0100
412 @@ -33,41 +33,41 @@
413  // NON-SSE2 stub
414  
415  /////////////////////////////////////////////////////////////////////////////
416 -// CL_ProgramObject_SWRender Construction:
417 +// ProgramObject_SWRender Construction:
418  
419 -CL_ProgramObject_SWRender::CL_ProgramObject_SWRender(CL_SoftwareProgram *program, bool is_sprite_program)
420 +ProgramObject_SWRender::ProgramObject_SWRender(SoftwareProgram *program, bool is_sprite_program)
421  {
422  }
423  
424 -CL_ProgramObject_SWRender::CL_ProgramObject_SWRender(const CL_ProgramObject &program_object) : CL_ProgramObject(program_object)
425 +ProgramObject_SWRender::ProgramObject_SWRender(const ProgramObject &program_object) : ProgramObject(program_object)
426  {
427  }
428  
429 -CL_ProgramObject_SWRender::~CL_ProgramObject_SWRender()
430 +ProgramObject_SWRender::~ProgramObject_SWRender()
431  {
432  }
433  
434  /////////////////////////////////////////////////////////////////////////////
435 -// CL_ProgramObject_SWRender Attributes:
436 +// ProgramObject_SWRender Attributes:
437  
438 -CL_SoftwareProgram *CL_ProgramObject_SWRender::get_program() const
439 +SoftwareProgram *ProgramObject_SWRender::get_program() const
440  {
441         return NULL;
442  }
443  
444 -bool CL_ProgramObject_SWRender::is_sprite_program() const
445 +bool ProgramObject_SWRender::is_sprite_program() const
446  {
447         return false;
448  }
449  
450 -CL_SWRenderProgramObjectProvider *CL_ProgramObject_SWRender::get_provider() const
451 +SWRenderProgramObjectProvider *ProgramObject_SWRender::get_provider() const
452  {
453         return NULL;
454  }
455  
456  /////////////////////////////////////////////////////////////////////////////
457 -// CL_ProgramObject_SWRender Operations:
458 +// ProgramObject_SWRender Operations:
459  
460  /////////////////////////////////////////////////////////////////////////////
461 -// CL_ProgramObject_SWRender Implementation:
462 +// ProgramObject_SWRender Implementation:
463  
464 --- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_target.cpp~     2013-09-24 13:53:31.000000000 +0200
465 +++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_target.cpp      2013-11-05 21:47:58.379954940 +0100
466 @@ -32,21 +32,21 @@
467  // NON-SSE2 stub
468  
469  /////////////////////////////////////////////////////////////////////////////
470 -// CL_SWRenderTarget Construction:
471 +// SWRenderTarget Construction:
472  
473 -CL_SWRenderTarget::CL_SWRenderTarget()
474 +SWRenderTarget::SWRenderTarget()
475  {
476  }
477  
478 -CL_SWRenderTarget::~CL_SWRenderTarget()
479 +SWRenderTarget::~SWRenderTarget()
480  {
481  }
482  
483  /////////////////////////////////////////////////////////////////////////////
484 -// CL_SWRenderTarget Attributes:
485 +// SWRenderTarget Attributes:
486  
487  /////////////////////////////////////////////////////////////////////////////
488 -// CL_SWRenderTarget Operations:
489 +// SWRenderTarget Operations:
490  
491  /////////////////////////////////////////////////////////////////////////////
492 -// CL_SWRenderTarget Implementation:
493 +// SWRenderTarget Implementation:
This page took 0.110569 seconds and 4 git commands to generate.