mirror of https://github.com/PCSX2/pcsx2.git
GSdx: fixed shared_ptr for GCC, but it does not seem to be thread-safe in 4.4.5.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4995 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
b7a70c9541
commit
2f401da58c
|
@ -69,28 +69,6 @@ GSTexture* GPURendererSW::GetOutput()
|
|||
|
||||
void GPURendererSW::Draw()
|
||||
{
|
||||
class GPURasterizerData : public GSRasterizerData
|
||||
{
|
||||
public:
|
||||
GPURasterizerData()
|
||||
{
|
||||
GPUScanlineGlobalData* gd = (GPUScanlineGlobalData*)_aligned_malloc(sizeof(GPUScanlineGlobalData), 32);
|
||||
|
||||
gd->clut = NULL;
|
||||
|
||||
param = gd;
|
||||
}
|
||||
|
||||
virtual ~GPURasterizerData()
|
||||
{
|
||||
GPUScanlineGlobalData* gd = (GPUScanlineGlobalData*)param;
|
||||
|
||||
if(gd->clut) _aligned_free(gd->clut);
|
||||
|
||||
_aligned_free(gd);
|
||||
}
|
||||
};
|
||||
|
||||
shared_ptr<GSRasterizerData> data(new GPURasterizerData());
|
||||
|
||||
GPUScanlineGlobalData& gd = *(GPUScanlineGlobalData*)data->param;
|
||||
|
|
|
@ -26,6 +26,28 @@
|
|||
|
||||
class GPURendererSW : public GPURendererT<GSVertexSW>
|
||||
{
|
||||
class GPURasterizerData : public GSRasterizerData
|
||||
{
|
||||
public:
|
||||
GPURasterizerData()
|
||||
{
|
||||
GPUScanlineGlobalData* gd = (GPUScanlineGlobalData*)_aligned_malloc(sizeof(GPUScanlineGlobalData), 32);
|
||||
|
||||
gd->clut = NULL;
|
||||
|
||||
param = gd;
|
||||
}
|
||||
|
||||
virtual ~GPURasterizerData()
|
||||
{
|
||||
GPUScanlineGlobalData* gd = (GPUScanlineGlobalData*)param;
|
||||
|
||||
if(gd->clut) _aligned_free(gd->clut);
|
||||
|
||||
_aligned_free(gd);
|
||||
}
|
||||
};
|
||||
|
||||
protected:
|
||||
GSRasterizerList* m_rl;
|
||||
GSTexture* m_texture;
|
||||
|
|
|
@ -820,7 +820,14 @@ void GSRasterizerMT::ThreadProc()
|
|||
{
|
||||
GSAutoLock l(&m_lock);
|
||||
|
||||
queue.swap(m_queue);
|
||||
// TODO: queue.swap(m_queue); // GCC
|
||||
|
||||
while(!m_queue.empty())
|
||||
{
|
||||
queue.push(m_queue.front());
|
||||
|
||||
m_queue.pop();
|
||||
}
|
||||
}
|
||||
|
||||
while(!queue.empty())
|
||||
|
|
|
@ -147,7 +147,7 @@ void GSRendererSW::Draw()
|
|||
Sync();
|
||||
}
|
||||
|
||||
shared_ptr<GSRasterizerData> data(new GSRasterizerData2(this));
|
||||
shared_ptr<GSRasterizerData> data(new GSRasterizerData2());
|
||||
|
||||
GSScanlineGlobalData* gd = (GSScanlineGlobalData*)data->param;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class GSRendererSW : public GSRendererT<GSVertexSW>
|
|||
class GSRasterizerData2 : public GSRasterizerData
|
||||
{
|
||||
public:
|
||||
GSRasterizerData2(GSRenderer* r)
|
||||
GSRasterizerData2()
|
||||
{
|
||||
GSScanlineGlobalData* gd = (GSScanlineGlobalData*)_aligned_malloc(sizeof(GSScanlineGlobalData), 32);
|
||||
|
||||
|
|
|
@ -118,6 +118,8 @@
|
|||
<Unit filename="GSRasterizer.h" />
|
||||
<Unit filename="GSRenderer.cpp" />
|
||||
<Unit filename="GSRenderer.h" />
|
||||
<Unit filename="GSRendererHW.cpp" />
|
||||
<Unit filename="GSRendererHW.h" />
|
||||
<Unit filename="GSRendererNull.cpp" />
|
||||
<Unit filename="GSRendererNull.h" />
|
||||
<Unit filename="GSRendererSW.cpp" />
|
||||
|
|
|
@ -92,6 +92,14 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#include <tr1/memory>
|
||||
|
||||
using namespace std::tr1;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
#include <hash_map>
|
||||
|
|
Loading…
Reference in New Issue