diff --git a/plugins/GSdx/GPUDrawScanlineCodeGenerator.cpp b/plugins/GSdx/GPUDrawScanlineCodeGenerator.cpp index c53fa38fed..79a72318b8 100644 --- a/plugins/GSdx/GPUDrawScanlineCodeGenerator.cpp +++ b/plugins/GSdx/GPUDrawScanlineCodeGenerator.cpp @@ -1021,7 +1021,7 @@ const GSVector4i GPUDrawScanlineCodeGenerator::m_test[8] = GSVector4i::zero(), }; -__declspec(align(16)) const uint16 GPUDrawScanlineCodeGenerator::m_dither[4][16] = +__aligned(const uint16, 32) GPUDrawScanlineCodeGenerator::m_dither[4][16] = { {7, 0, 6, 1, 7, 0, 6, 1, 7, 0, 6, 1, 7, 0, 6, 1}, {2, 5, 3, 4, 2, 5, 3, 4, 2, 5, 3, 4, 2, 5, 3, 4}, diff --git a/plugins/GSdx/GSRasterizer.cpp b/plugins/GSdx/GSRasterizer.cpp index 5f4b224a72..39ea4d44a2 100644 --- a/plugins/GSdx/GSRasterizer.cpp +++ b/plugins/GSdx/GSRasterizer.cpp @@ -24,15 +24,6 @@ #include "stdafx.h" #include "GSRasterizer.h" -// Using a spinning finish on the main (MTGS) thread is apparently a big win still, over trying -// to wait out all the pending m_finished semaphores. It leaves one spinwait in the rasterizer, -// but that's still worlds better than 2-6 spinning threads like before. - -// NOTE: spinning: 100-500 ticks, waiting: 1000-5000 ticks - -// -#define UseSpinningFinish - // Set this to 1 to remove a lot of non-const div/modulus ops from the rasterization process. // Might likely be a measurable speedup but limits threading to 1, 2, 4, and 8 threads. // note by rama: Speedup is around 5% on average. @@ -46,8 +37,6 @@ static const int ThreadMaskConst = ThreadsConst - 1; #endif -// align threads to page height (1 << 5) - #define THREAD_HEIGHT 5 GSRasterizer::GSRasterizer(IDrawScanline* ds) @@ -62,7 +51,7 @@ GSRasterizer::~GSRasterizer() delete m_ds; } -__forceinline bool GSRasterizer::IsOneOfMyScanlines(int scanline) const +bool GSRasterizer::IsOneOfMyScanlines(int scanline) const { #ifdef UseConstThreadCount diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index b854e457a4..3453962520 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -26,7 +26,6 @@ #include "GSState.h" #include "GSVertexTrace.h" #include "GSVertexList.h" -//#include "GSSettingsDlg.h" #include "GSCapture.h" class GSRenderer : public GSState diff --git a/plugins/GSdx/GSState.h b/plugins/GSdx/GSState.h index 037039747b..aa02c9660e 100644 --- a/plugins/GSdx/GSState.h +++ b/plugins/GSdx/GSState.h @@ -136,7 +136,7 @@ protected: VertexKickPtr m_vkf; #define InitVertexKick3(T, P, N, M) \ - m_vk[P][N][M] = (VertexKickPtr)&T::VertexKick; + m_vk[P][N][M] = (VertexKickPtr)(void (T::*)(bool))&T::VertexKick; #define InitVertexKick2(T, P) \ InitVertexKick3(T, P, 0, 0) \ diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 492dda1ec5..2c327fc766 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -821,7 +821,7 @@ GSTextureCache::Surface::Surface(GSRenderer* r) , m_texture(NULL) , m_age(0) { - m_TEX0.TBP0 = (uint32)~0; + m_TEX0.TBP0 = 0x3fff; } GSTextureCache::Surface::~Surface() diff --git a/plugins/GSdx/GSTextureCacheSW.cpp b/plugins/GSdx/GSTextureCacheSW.cpp index acbca98b14..52af9e756e 100644 --- a/plugins/GSdx/GSTextureCacheSW.cpp +++ b/plugins/GSdx/GSTextureCacheSW.cpp @@ -114,7 +114,7 @@ const GSTextureCacheSW::GSTexture* GSTextureCacheSW::Lookup(const GIFRegTEX0& TE if(!t->Update(TEX0, TEXA, r)) { - printf("!@#$%\n"); // memory allocation may fail if the game is too hungry + printf("!@#$\n"); // memory allocation may fail if the game is too hungry RemoveAt(t); diff --git a/plugins/GSdx/GSUtil.cpp b/plugins/GSdx/GSUtil.cpp index 509eee254b..21d5114c0b 100644 --- a/plugins/GSdx/GSUtil.cpp +++ b/plugins/GSdx/GSUtil.cpp @@ -22,9 +22,12 @@ #include "stdafx.h" #include "GS.h" #include "GSUtil.h" -#include "svnrev.h" +//#include "svnrev.h" #include "xbyak/xbyak_util.h" +#define SVN_REV 0 +#define SVN_MODS 0 + char* GSUtil::GetLibName() { static string str; diff --git a/plugins/GSdx/GSdx.cbp b/plugins/GSdx/GSdx.icc.cbp similarity index 100% rename from plugins/GSdx/GSdx.cbp rename to plugins/GSdx/GSdx.icc.cbp diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index b1fa89fdd4..de4fac58f7 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -102,6 +102,14 @@ using namespace stdext; #define EXPORT_C_(type) extern "C" type #define EXPORT_C EXPORT_C_(void) + #ifdef __GNUC__ + + // #define __forceinline __attribute__((always_inline,unused)) + #define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__)) + #define __assume(c) ((void)0) + + #endif + #endif extern string format(const char* fmt, ...); @@ -279,6 +287,23 @@ __forceinline unsigned char _interlockedbittestandreset(volatile long* a, const return retval; } +#ifdef __GNUC__ + +__forceinline unsigned long long __rdtsc() +{ + #if defined(__amd64__) || defined(__x86_64__) + unsigned long long low, high; + __asm__ __volatile__("rdtsc" : "=a"(low), "=d"(high)); + return low | (high << 32); + #else + unsigned long long retval; + __asm__ __volatile__("rdtsc" : "=A"(retval)); + return retval; + #endif +} + +#endif + #endif extern void* vmalloc(size_t size, bool code);