]> git.pld-linux.org Git - packages/ClanLib.git/blobdiff - really-disable-sse2.patch
- updated to 3.0.1
[packages/ClanLib.git] / really-disable-sse2.patch
index 33b89cfa3e8f469aa5a20c302c3d7ff9077e2d03..36eb7b1f1c43e9e935202e4f95fc7bd7834f130b 100644 (file)
  fi
  extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -pthread -std=c++0x"
  
+--- ClanLib-3.0.0/Sources/Display/Image/pixel_converter.cpp~   2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/Display/Image/pixel_converter.cpp    2013-11-05 20:57:39.298376899 +0100
+@@ -36,12 +36,16 @@
+ #include "pixel_reader_half_float.h"
+ #include "pixel_reader_norm.h"
+ #include "pixel_reader_special.h"
++#ifndef DISABLE_SSE2
+ #include "pixel_reader_sse.h"
++#endif
+ #include "pixel_writer_cast.h"
+ #include "pixel_writer_half_float.h"
+ #include "pixel_writer_norm.h"
+ #include "pixel_writer_special.h"
++#ifndef DISABLE_SSE2
+ #include "pixel_writer_sse.h"
++#endif
+ #include "pixel_filter_gamma.h"
+ #include "pixel_filter_premultiply_alpha.h"
+ #include "pixel_filter_swizzle.h"
+@@ -126,8 +130,13 @@
+ void PixelConverter::convert(void *output, int output_pitch, TextureFormat output_format, const void *input, int input_pitch, TextureFormat input_format, int width, int height)
+ {
++#ifndef DISABLE_SSE2
+       bool sse2 = System::detect_cpu_extension(System::sse2);
+       bool sse4 = System::detect_cpu_extension(System::sse4_1);
++#else
++      bool sse2 = false;
++      bool sse4 = false;
++#endif
+       std::unique_ptr<PixelReader> reader = impl->create_reader(input_format, sse2);
+       std::unique_ptr<PixelWriter> 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<PixelReader>(new PixelReaderSSE2_bgra8());
+               else
++#endif
+                       return std::unique_ptr<PixelReader>(new PixelReader_bgra8());
+       case tf_bgr8:
+               return std::unique_ptr<PixelReader>(new PixelReader_bgr8());
+@@ -216,9 +218,11 @@
+       case tf_rgb5_a1:
+               return std::unique_ptr<PixelReader>(new PixelReader_rgb5_a1());
+       case tf_rgba8:
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba8());
+               else
++#endif
+                       return std::unique_ptr<PixelReader>(new PixelReader_4norm<unsigned char>());
+       case tf_rgba8_snorm:
+               return std::unique_ptr<PixelReader>(new PixelReader_4norm<char>());
+@@ -227,18 +231,22 @@
+       case tf_rgba12:
+               break;
+       case tf_rgba16:
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba16());
+               else
++#endif
+                       return std::unique_ptr<PixelReader>(new PixelReader_4norm<unsigned short>());
+       case tf_rgba16_snorm:
+               return std::unique_ptr<PixelReader>(new PixelReader_4norm<short>());
+       case tf_srgb8:
+               return std::unique_ptr<PixelReader>(new PixelReader_3norm<unsigned char>()); // TBD: should we add a 2.2 gamma filter?
+       case tf_srgb8_alpha8:
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba8());
+               else
++#endif
+                       return std::unique_ptr<PixelReader>(new PixelReader_4norm<char>()); // TBD: should we add a 2.2 gamma filter?
+       case tf_r16f:
+               return std::unique_ptr<PixelReader>(new PixelReader_1hf());
+@@ -341,9 +349,11 @@
+       switch (format)
+       {
+       case tf_bgra8:
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_bgra8());
+               else
++#endif
+                       return std::unique_ptr<PixelWriter>(new PixelWriter_bgra8());
+       case tf_bgr8:
+               return std::unique_ptr<PixelWriter>(new PixelWriter_bgr8());
+@@ -395,9 +405,11 @@
+       case tf_rgb5_a1:
+               return std::unique_ptr<PixelWriter>(new PixelWriter_rgb5_a1());
+       case tf_rgba8:
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_rgba8());
+               else
++#endif
+                       return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<unsigned char>());
+       case tf_rgba8_snorm:
+               return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<char>());
+@@ -419,9 +431,11 @@
+       case tf_srgb8:
+               return std::unique_ptr<PixelWriter>(new PixelWriter_3norm<unsigned char>()); // TBD: should we add a 2.2 gamma filter?
+       case tf_srgb8_alpha8:
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_rgba8());
+               else
++#endif
+                       return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<char>()); // TBD: should we add a 2.2 gamma filter?
+       case tf_r16f:
+               return std::unique_ptr<PixelWriter>(new PixelWriter_1hf());
+@@ -525,41 +539,51 @@
+       if (input_is_ycrcb)
+       {
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSSE2_YCrCbToRGB()));
+               else
++#endif
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterYCrCbToRGB()));
+       }
+       if (premultiply_alpha)
+       {
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterPremultiplyAlphaSSE2()));
+               else
++#endif
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterPremultiplyAlpha()));
+       }
+       if (gamma != 1.0f)
+       {
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterGammaSSE2(gamma)));
+               else
++#endif
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterGamma(gamma)));
+       }
+       if (swizzle != Vec4i(0,1,2,3))
+       {
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSwizzleSSE2(swizzle)));
+               else
++#endif
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSwizzle(swizzle)));
+       }
+       if (output_is_ycrcb)
+       {
++#ifndef DISABLE_SSE2
+               if (sse2)
+                       filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSSE2_RGBToYCrCb()));
+               else
++#endif
+                       filters.push_back(std::shared_ptr<PixelFilter>(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 @@
+       float gamma;
+ };
++#ifndef DISABLE_SSE2
+ class PixelFilterGammaSSE2 : public PixelFilter
+ {
+ public:
+@@ -170,5 +171,6 @@
+ private:
+       float gamma;
+ };
++#endif
+ }
+--- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_premultiply_alpha.h~      2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_premultiply_alpha.h       2013-11-05 21:01:03.885042084 +0100
+@@ -46,6 +46,7 @@
+       }
+ };
++#ifndef DISABLE_SSE2
+ class PixelFilterPremultiplyAlphaSSE2 : public PixelFilter
+ {
+ public:
+@@ -63,5 +64,6 @@
+               }
+       }
+ };
++#endif
+ }
+--- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_swizzle.h~        2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_swizzle.h 2013-11-05 21:01:17.849463650 +0100
+@@ -76,6 +76,7 @@
+       Vec4f red, green, blue, alpha;
+ };
++#ifndef DISABLE_SSE2
+ class PixelFilterSwizzleSSE2 : public PixelFilter
+ {
+ public:
+@@ -126,5 +127,6 @@
+ private:
+       __m128 red_mask, green_mask, blue_mask, alpha_mask;
+ };
++#endif
+ }
+--- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_rgb_to_ycrcb.h~   2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_rgb_to_ycrcb.h    2013-11-05 21:01:44.896313454 +0100
+@@ -30,7 +30,9 @@
+ #pragma once
+ #include "pixel_converter_impl.h"
++#ifndef DISABLE_SSE2
+ #include <emmintrin.h>
++#endif
+ namespace clan
+ {
+@@ -67,6 +67,7 @@
+ };
++#ifndef DISABLE_SSE2
+ class PixelFilterSSE2_RGBToYCrCb : public PixelFilter
+ {
+ public:
+@@ -156,5 +157,6 @@
+               }
+       }
+ };
++#endif
+ }
+--- ClanLib-3.0.0/Sources/Display/Image/pixel_buffer_impl.cpp~ 2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/Display/Image/pixel_buffer_impl.cpp  2013-11-05 21:22:05.346632850 +0100
+@@ -36,7 +36,9 @@
+ #include "API/Display/TargetProviders/graphic_context_provider.h"
+ #include "API/Display/TargetProviders/pixel_buffer_provider.h"
+ #include "API/Display/Image/pixel_converter.h"
++#ifndef DISABLE_SSE2
+ #include <emmintrin.h>
++#endif
+ #ifndef WIN32
+ #include <cstdlib>
+--- ClanLib-3.0.0/Sources/Display/Image/pixel_writer_sse.h~    2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/Display/Image/pixel_writer_sse.h     2013-11-05 21:23:32.719965551 +0100
+@@ -31,11 +31,13 @@
+ #include "pixel_converter_impl.h"
++#ifndef DISABLE_SSE2
+ #if defined(__SSE4_1__)
+ #include <smmintrin.h>
+ #else
+ #include <emmintrin.h>
+ #endif
++#endif
+ namespace clan
+--- ClanLib-3.0.0/Sources/API/Display/display_target.h.orig    2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/API/Display/display_target.h 2013-11-05 22:46:46.000000000 +0100
+@@ -80,11 +80,12 @@
+ /// \name Implementation
+ /// \{
+-private:
+-
++public:
+       /// \brief Constructs a null DisplayTarget
+       DisplayTarget();
++private:
++
+       /// \brief Constructs a DisplayTarget
+       ///
+       /// \param DisplayTarget_Impl = Weak Ptr
+--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/setup_swrender.cpp~        2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/setup_swrender.cpp 2013-11-05 21:47:15.449955252 +0100
+@@ -33,23 +33,23 @@
+ // NON-SSE2 STUB
++namespace clan
++{
++
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_SetupSWRender Construction:
++// SetupSWRender Construction:
+-CL_SetupSWRender::CL_SetupSWRender()
++SetupSWRender::SetupSWRender()
+ {
+-      if (CL_System::detect_cpu_extension(CL_System::sse2))
++      if (System::detect_cpu_extension(System::sse2))
+       {
+-              throw CL_Exception("Sorry, this compiled clanSWRender does not support SSE2, but your CPU does support SSE2. (Update clanSWRender to contain SSE2)");
++              throw Exception("Sorry, this compiled clanSWRender does not support SSE2, but your CPU does support SSE2. (Update clanSWRender to contain SSE2)");
+       }
+-      throw CL_Exception("Sorry, clanSWRender requires a processor capable of SSE2 instructions. (Update your CPU)");
++      throw Exception("Sorry, clanSWRender requires a processor capable of SSE2 instructions. (Update your CPU)");
+ }
+-CL_SetupSWRender::~CL_SetupSWRender()
++SetupSWRender::~SetupSWRender()
+ {
+ }
+-void CL_SetupSWRender::set_current()
+-{
+ }
+-
+--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_graphic_context.cpp~   2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_graphic_context.cpp    2013-11-05 21:47:35.776621770 +0100
+@@ -32,58 +32,61 @@
+ // NON-SSE2 stub
++namespace clan
++{
++
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_GraphicContext_SWRender_Impl Class:
++// GraphicContext_SWRender_Impl Class:
+-class CL_GraphicContext_SWRender_Impl
++class GraphicContext_SWRender_Impl
+ {
+ public:
+-      CL_GraphicContext_SWRender_Impl()
++      GraphicContext_SWRender_Impl()
+       {
+       }
+-      ~CL_GraphicContext_SWRender_Impl()
++      ~GraphicContext_SWRender_Impl()
+       {
+       }
+ };
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_GraphicContext_SWRender Construction:
++// GraphicContext_SWRender Construction:
+-CL_GraphicContext_SWRender::CL_GraphicContext_SWRender(CL_GraphicContext &gc) : CL_GraphicContext(gc),
+- impl(new CL_GraphicContext_SWRender_Impl)
++GraphicContext_SWRender::GraphicContext_SWRender(GraphicContext &gc) : GraphicContext(gc),
++ impl(new GraphicContext_SWRender_Impl)
+ {
+ }
+-CL_GraphicContext_SWRender::~CL_GraphicContext_SWRender()
++GraphicContext_SWRender::~GraphicContext_SWRender()
+ {
+ }
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_GraphicContext_SWRender Attributes:
++// GraphicContext_SWRender Attributes:
+-void CL_GraphicContext_SWRender::throw_if_null() const
++void GraphicContext_SWRender::throw_if_null() const
+ {
+       if (!impl)
+-              throw CL_Exception("CL_GraphicContext_SWRender is null");
++              throw Exception("GraphicContext_SWRender is null");
+ }
+-CL_PixelPipeline *CL_GraphicContext_SWRender::get_pipeline() const
++PixelPipeline *GraphicContext_SWRender::get_pipeline() const
+ {
+       return NULL;
+ }
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_GraphicContext_SWRender Operations:
++// GraphicContext_SWRender Operations:
+-void CL_GraphicContext_SWRender::draw_pixels_bicubic(int x, int y, int zoom_number, int zoom_denominator, const CL_PixelBuffer &pixels)
++void GraphicContext_SWRender::draw_pixels_bicubic(int x, int y, int zoom_number, int zoom_denominator, const PixelBuffer &pixels)
+ {
+ }
+-void CL_GraphicContext_SWRender::queue_command(CL_UniquePtr<CL_PixelCommand> &command)
++void GraphicContext_SWRender::queue_command(std::unique_ptr<PixelCommand> &command)
+ {
+ }
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_GraphicContext_SWRender Implementation:
+-
++// GraphicContext_SWRender Implementation:
++}
+--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_program_object.cpp~    2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_program_object.cpp     2013-11-05 21:47:48.349955014 +0100
+@@ -32,42 +32,45 @@
+ // NON-SSE2 stub
++namespace clan
++{
++
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_ProgramObject_SWRender Construction:
++// ProgramObject_SWRender Construction:
+-CL_ProgramObject_SWRender::CL_ProgramObject_SWRender(CL_SoftwareProgram *program, bool is_sprite_program)
++ProgramObject_SWRender::ProgramObject_SWRender(SoftwareProgram *program, bool is_sprite_program)
+ {
+ }
+-CL_ProgramObject_SWRender::CL_ProgramObject_SWRender(const CL_ProgramObject &program_object) : CL_ProgramObject(program_object)
++ProgramObject_SWRender::ProgramObject_SWRender(const ProgramObject &program_object) : ProgramObject(program_object)
+ {
+ }
+-CL_ProgramObject_SWRender::~CL_ProgramObject_SWRender()
++ProgramObject_SWRender::~ProgramObject_SWRender()
+ {
+ }
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_ProgramObject_SWRender Attributes:
++// ProgramObject_SWRender Attributes:
+-CL_SoftwareProgram *CL_ProgramObject_SWRender::get_program() const
++SoftwareProgram *ProgramObject_SWRender::get_program() const
+ {
+       return NULL;
+ }
+-bool CL_ProgramObject_SWRender::is_sprite_program() const
++bool ProgramObject_SWRender::is_sprite_program() const
+ {
+       return false;
+ }
+-CL_SWRenderProgramObjectProvider *CL_ProgramObject_SWRender::get_provider() const
++SWRenderProgramObjectProvider *ProgramObject_SWRender::get_provider() const
+ {
+       return NULL;
+ }
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_ProgramObject_SWRender Operations:
++// ProgramObject_SWRender Operations:
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_ProgramObject_SWRender Implementation:
+-
++// ProgramObject_SWRender Implementation:
++}
+--- ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_target.cpp~    2013-09-24 13:53:31.000000000 +0200
++++ ClanLib-3.0.0/Sources/SWRender/X11/Stub/swr_target.cpp     2013-11-05 21:47:58.379954940 +0100
+@@ -31,22 +31,33 @@
+ // NON-SSE2 stub
++namespace clan
++{
++
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_SWRenderTarget Construction:
++// SWRenderTarget Construction:
+-CL_SWRenderTarget::CL_SWRenderTarget()
++SWRenderTarget::SWRenderTarget()
+ {
+ }
+-CL_SWRenderTarget::~CL_SWRenderTarget()
++SWRenderTarget::~SWRenderTarget()
+ {
+ }
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_SWRenderTarget Attributes:
++// SWRenderTarget Attributes:
++bool SWRenderTarget::is_current()
++{
++      return false;
++}
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_SWRenderTarget Operations:
++// SWRenderTarget Operations:
++void SWRenderTarget::set_current()
++{
++}
+ /////////////////////////////////////////////////////////////////////////////
+-// CL_SWRenderTarget Implementation:
++// SWRenderTarget Implementation:
++}
This page took 0.059446 seconds and 4 git commands to generate.