diff --git a/Source/Core/Common/Src/Thread.h b/Source/Core/Common/Src/Thread.h index 0a1aae1de8..6516615932 100644 --- a/Source/Core/Common/Src/Thread.h +++ b/Source/Core/Common/Src/Thread.h @@ -133,14 +133,13 @@ void SetCurrentThreadAffinity(u32 mask); void SleepCurrentThread(int ms); void SwitchCurrentThread(); // On Linux, this is equal to sleep 1ms - // YieldCPU: This function is only effective on HyperThreading CPU // Use this function during a spin-wait to make the current thread // relax while another thread is working. This may be more efficient // than using events because event functions use kernel calls. inline void YieldCPU() { #ifdef _WIN32 - YieldProcessor(); + Sleep(0); #elif defined(_M_IX86) || defined(_M_X64) usleep(1); #endif diff --git a/Source/Core/VideoCommon/Src/DLCache.cpp b/Source/Core/VideoCommon/Src/DLCache.cpp index 06a7753fb1..2a49d37458 100644 --- a/Source/Core/VideoCommon/Src/DLCache.cpp +++ b/Source/Core/VideoCommon/Src/DLCache.cpp @@ -213,27 +213,20 @@ inline u64 CreateMapId(u32 address, u32 size) inline u64 CreateVMapId(u32 VATUSED) { - u64 vmap_id = 0; + u64 vmap_id = 0x9368e53c2f6af274 ^ g_VtxDesc.Hex; for(int i = 0; i < 8 ; i++) { if(VATUSED & (1 << i)) { - if(vmap_id != 0) - { - vmap_id ^= (((u64)g_VtxAttr[i].g0.Hex) | (((u64)g_VtxAttr[i].g1.Hex) << 32)) ^ (((u64)g_VtxAttr[i].g2.Hex) << 16); - } - else - { - vmap_id = (((u64)g_VtxAttr[i].g0.Hex) | (((u64)g_VtxAttr[i].g1.Hex) << 32)) ^ (((u64)g_VtxAttr[i].g2.Hex) << 16); - } + vmap_id ^= (((u64)g_VtxAttr[i].g0.Hex) | (((u64)g_VtxAttr[i].g1.Hex) << 32)) ^ (((u64)g_VtxAttr[i].g2.Hex) << i); } } for(int i = 0; i < 12; i++) { if(VATUSED & (1 << (i + 16))) - vmap_id = vmap_id ^ ((u64)cached_arraybases[i]) ^ (((u64)arraystrides[i]) << 16); + vmap_id ^= (((u64)cached_arraybases[i]) ^ (((u64)arraystrides[i]) << i)); } - return vmap_id ^ g_VtxDesc.Hex; + return vmap_id; } typedef std::map DLMap;