diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index a0707042e0..b6b321b848 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -25,6 +25,8 @@ #include "GSRendererSW.h" #include "GSRendererNull.h" #include "GSDeviceNull.h" +#include "GSDeviceOGL.h" +#include "GSRendererOGL.h" #ifdef _WINDOWS @@ -41,8 +43,6 @@ static HRESULT s_hr = E_FAIL; #else -#include "GSDeviceOGL.h" -#include "GSRendererOGL.h" #include "GSWndOGL.h" #include @@ -234,10 +234,8 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1) case 0: dev = new GSDevice9(); break; case 1: dev = new GSDevice11(); break; #endif - #ifdef _LINUX - case 4: dev = new GSDeviceOGL(); break; - #endif case 3: dev = new GSDeviceNull(); break; + case 4: dev = new GSDeviceOGL(); break; } if(dev == NULL) @@ -249,20 +247,22 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1) { switch(renderer % 3) { - default: - case 0: -#ifdef _WINDOWS - s_gs = (renderer / 3) == 0 ? (GSRenderer*)new GSRendererDX9() : (GSRenderer*)new GSRendererDX11(); -#else - s_gs = (GSRenderer*)new GSRendererOGL(); -#endif - break; - case 1: - s_gs = new GSRendererSW(threads); - break; - case 2: - s_gs = new GSRendererNull(); - break; + default: + case 0: + switch(renderer) + { + default: + case 0: s_gs = (GSRenderer*)new GSRendererDX9(); break; + case 3: s_gs = (GSRenderer*)new GSRendererDX11(); break; + case 12: s_gs = (GSRenderer*)new GSRendererOGL(); break; + } + break; + case 1: + s_gs = new GSRendererSW(threads); + break; + case 2: + s_gs = new GSRendererNull(); + break; } s_renderer = renderer; diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 629330a4d3..5bf188e997 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -19,6 +19,7 @@ * */ +#include "stdafx.h" #include "GSDeviceOGL.h" // TODO performance cost to investigate @@ -64,19 +65,19 @@ GSDeviceOGL::~GSDeviceOGL() delete (m_vb_sr); // Clean m_merge_obj - for (uint i = 0; i < 2; i++) + for (uint32 i = 0; i < 2; i++) glDeleteProgram(m_merge_obj.ps[i]); delete (m_merge_obj.cb); delete (m_merge_obj.bs); // Clean m_interlace - for (uint i = 0; i < 2; i++) + for (uint32 i = 0; i < 2; i++) glDeleteProgram(m_interlace.ps[i]); delete (m_interlace.cb); // Clean m_convert glDeleteProgram(m_convert.vs); - for (uint i = 0; i < 2; i++) + for (uint32 i = 0; i < 2; i++) glDeleteProgram(m_convert.ps[i]); glDeleteSamplers(1, &m_convert.ln); glDeleteSamplers(1, &m_convert.pt); @@ -229,7 +230,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd) // **************************************************************** CompileShaderFromSource("convert.glsl", "vs_main", GL_VERTEX_SHADER, &m_convert.vs); CompileShaderFromSource("convert.glsl", "gs_main", GL_GEOMETRY_SHADER, &m_convert.gs); - for(uint i = 0; i < countof(m_convert.ps); i++) + for(uint32 i = 0; i < countof(m_convert.ps); i++) CompileShaderFromSource("convert.glsl", format("ps_main%d", i), GL_FRAGMENT_SHADER, &m_convert.ps[i]); // Note the following object are initialized to 0 so disabled. @@ -289,7 +290,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd) // **************************************************************** m_merge_obj.cb = new GSUniformBufferOGL(1, sizeof(MergeConstantBuffer)); - for(uint i = 0; i < countof(m_merge_obj.ps); i++) + for(uint32 i = 0; i < countof(m_merge_obj.ps); i++) CompileShaderFromSource("merge.glsl", format("ps_main%d", i), GL_FRAGMENT_SHADER, &m_merge_obj.ps[i]); m_merge_obj.bs = new GSBlendStateOGL(); @@ -301,7 +302,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd) // **************************************************************** m_interlace.cb = new GSUniformBufferOGL(2, sizeof(InterlaceConstantBuffer)); - for(uint i = 0; i < countof(m_interlace.ps); i++) + for(uint32 i = 0; i < countof(m_interlace.ps); i++) CompileShaderFromSource("interlace.glsl", format("ps_main%d", i), GL_FRAGMENT_SHADER, &m_interlace.ps[i]); // **************************************************************** // Shade boost @@ -784,8 +785,8 @@ void GSDeviceOGL::CopyRect(GSTexture* st, GSTexture* dt, const GSVector4i& r) // FIXME: the extension was integrated in opengl 4.3 (now we need driver that support OGL4.3) // FIXME check those function work as expected // void CopyImageSubDataNV( - // uint srcName, enum srcTarget, int srcLevel, int srcX, int srcY, int srcZ, - // uint dstName, enum dstTarget, int dstLevel, int dstX, int dstY, int dstZ, + // uint32 srcName, enum srcTarget, int srcLevel, int srcX, int srcY, int srcZ, + // uint32 dstName, enum dstTarget, int dstLevel, int dstX, int dstY, int dstZ, // sizei width, sizei height, sizei depth); glCopyImageSubDataNV( static_cast(st)->GetID(), static_cast(st)->GetTarget(), 0, r.x, r.y, 0, @@ -1148,7 +1149,7 @@ void GSDeviceOGL::PSSetShader(GLuint ps) // 4/ set the sampler state // glBindSampler(1 , sampler); if (m_srv_changed || m_ss_changed) { - for (uint i=0 ; i < 1; i++) { + for (uint32 i=0 ; i < 1; i++) { if (m_state.ps_srv[i] != NULL) { m_state.ps_srv[i]->EnableUnit(i); glBindSampler(i, m_state.ps_ss[i]); diff --git a/plugins/GSdx/GSDeviceOGL.h b/plugins/GSdx/GSDeviceOGL.h index 0de576a9d9..a1de636dc1 100644 --- a/plugins/GSdx/GSDeviceOGL.h +++ b/plugins/GSdx/GSDeviceOGL.h @@ -206,7 +206,7 @@ public: void SetupStencil(uint8 sref) { - uint ref = sref; + uint32 ref = sref; if (m_stencil_enable) { glEnable(GL_STENCIL_TEST); glStencilFunc(m_stencil_func, ref, m_stencil_mask); diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index e8ebcb303f..a3ec58065d 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -19,6 +19,7 @@ * */ +#include "stdafx.h" #include "GSRendererOGL.h" #include "GSRenderer.h" diff --git a/plugins/GSdx/GSTextureOGL.cpp b/plugins/GSdx/GSTextureOGL.cpp index d21055d697..275efc298b 100644 --- a/plugins/GSdx/GSTextureOGL.cpp +++ b/plugins/GSdx/GSTextureOGL.cpp @@ -21,6 +21,7 @@ #pragma once +#include "stdafx.h" #include #include "GSTextureOGL.h" static int g_state_texture_unit = -1; @@ -86,7 +87,7 @@ GSTextureOGL::GSTextureOGL(int type, int w, int h, bool msaa, int format, GLuint // Extra buffer to handle various pixel transfer glGenBuffers(1, &m_pbo_id); - uint msaa_level; + uint32 msaa_level; if (m_msaa) { // FIXME which level of MSAA msaa_level = 1; @@ -208,7 +209,7 @@ bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch) #endif } -void GSTextureOGL::EnableUnit(uint unit) +void GSTextureOGL::EnableUnit(uint32 unit) { if (!IsBackbuffer()) { // FIXME diff --git a/plugins/GSdx/GSTextureOGL.h b/plugins/GSdx/GSTextureOGL.h index 89ef0163d1..cf13dd60db 100644 --- a/plugins/GSdx/GSTextureOGL.h +++ b/plugins/GSdx/GSTextureOGL.h @@ -28,7 +28,7 @@ class GSTextureOGL : public GSTexture private: GLenum m_texture_target; // texture target: 2D, rectangle etc... GLuint m_texture_id; // the texture id - uint m_pbo_id; + uint32 m_pbo_id; int m_pbo_size; GLuint m_fbo_read; @@ -42,7 +42,7 @@ class GSTextureOGL : public GSTexture bool Save(const string& fn, bool dds = false); void Save(const string& fn, const void* image, uint32 pitch); - void EnableUnit(uint unit); + void EnableUnit(uint32 unit); void Attach(GLenum attachment); bool IsBackbuffer() { return (m_type == GSTexture::Backbuffer); } diff --git a/plugins/GSdx/GSUniformBufferOGL.h b/plugins/GSdx/GSUniformBufferOGL.h index 281b5aa1e6..133d775a17 100644 --- a/plugins/GSdx/GSUniformBufferOGL.h +++ b/plugins/GSdx/GSUniformBufferOGL.h @@ -24,11 +24,11 @@ class GSUniformBufferOGL { GLuint buffer; // data object GLuint index; // GLSL slot - uint size; // size of the data + uint32 size; // size of the data const GLenum target; public: - GSUniformBufferOGL(GLuint index, uint size) : index(index) + GSUniformBufferOGL(GLuint index, uint32 size) : index(index) , size(size) ,target(GL_UNIFORM_BUFFER) { diff --git a/plugins/GSdx/GSVertexArrayOGL.h b/plugins/GSdx/GSVertexArrayOGL.h index 5f24698ef6..0039a45602 100644 --- a/plugins/GSdx/GSVertexArrayOGL.h +++ b/plugins/GSdx/GSVertexArrayOGL.h @@ -187,7 +187,7 @@ public: void set_internal_format(GSInputLayoutOGL* layout, uint32 layout_nbr) { - for (uint i = 0; i < layout_nbr; i++) { + for (uint32 i = 0; i < layout_nbr; i++) { // Note this function need both a vertex array object and a GL_ARRAY_BUFFER buffer glEnableVertexAttribArray(layout[i].index); switch (layout[i].type) { diff --git a/plugins/GSdx/GSWndOGL.cpp b/plugins/GSdx/GSWndOGL.cpp index ccb634ba40..8cf33121d1 100644 --- a/plugins/GSdx/GSWndOGL.cpp +++ b/plugins/GSdx/GSWndOGL.cpp @@ -19,6 +19,7 @@ * */ +#include "stdafx.h" #include "GSWndOGL.h" #ifdef _LINUX diff --git a/plugins/GSdx/GSdx.vcxproj b/plugins/GSdx/GSdx.vcxproj index 660f9bb89f..6470496915 100644 --- a/plugins/GSdx/GSdx.vcxproj +++ b/plugins/GSdx/GSdx.vcxproj @@ -460,6 +460,7 @@ + @@ -536,6 +537,7 @@ + @@ -601,12 +603,15 @@ + + + @@ -1589,6 +1594,7 @@ + @@ -1609,6 +1615,7 @@ + @@ -1619,16 +1626,20 @@ + + + + diff --git a/plugins/GSdx/GSdx.vcxproj.filters b/plugins/GSdx/GSdx.vcxproj.filters index 6f44639ba1..4b578b192c 100644 --- a/plugins/GSdx/GSdx.vcxproj.filters +++ b/plugins/GSdx/GSdx.vcxproj.filters @@ -60,6 +60,9 @@ Source Files + + Source Files + Source Files @@ -108,6 +111,9 @@ Source Files + + Source Files + Source Files @@ -135,6 +141,9 @@ Source Files + + Source Files + Source Files @@ -144,6 +153,9 @@ Source Files + + Source Files + Source Files @@ -153,6 +165,9 @@ Source Files + + Source Files + Source Files @@ -359,6 +374,9 @@ Header Files + + Header Files + Header Files @@ -413,6 +431,9 @@ Header Files + + Header Files + Header Files @@ -443,6 +464,9 @@ Header Files + + Header Files + Header Files @@ -452,6 +476,9 @@ Header Files + + Header Files + Header Files @@ -461,6 +488,9 @@ Header Files + + Header Files + Header Files @@ -470,6 +500,9 @@ Header Files + + Header Files + Header Files diff --git a/plugins/GSdx/GSdx_vs11.vcxproj b/plugins/GSdx/GSdx_vs11.vcxproj index c633071662..0d6041a416 100644 --- a/plugins/GSdx/GSdx_vs11.vcxproj +++ b/plugins/GSdx/GSdx_vs11.vcxproj @@ -476,6 +476,7 @@ + @@ -552,6 +553,7 @@ + @@ -617,12 +619,15 @@ + + + @@ -1605,6 +1610,7 @@ + @@ -1625,6 +1631,7 @@ + @@ -1635,16 +1642,20 @@ + + + + diff --git a/plugins/GSdx/GSdx_vs11.vcxproj.filters b/plugins/GSdx/GSdx_vs11.vcxproj.filters index 6f44639ba1..4b578b192c 100644 --- a/plugins/GSdx/GSdx_vs11.vcxproj.filters +++ b/plugins/GSdx/GSdx_vs11.vcxproj.filters @@ -60,6 +60,9 @@ Source Files + + Source Files + Source Files @@ -108,6 +111,9 @@ Source Files + + Source Files + Source Files @@ -135,6 +141,9 @@ Source Files + + Source Files + Source Files @@ -144,6 +153,9 @@ Source Files + + Source Files + Source Files @@ -153,6 +165,9 @@ Source Files + + Source Files + Source Files @@ -359,6 +374,9 @@ Header Files + + Header Files + Header Files @@ -413,6 +431,9 @@ Header Files + + Header Files + Header Files @@ -443,6 +464,9 @@ Header Files + + Header Files + Header Files @@ -452,6 +476,9 @@ Header Files + + Header Files + Header Files @@ -461,6 +488,9 @@ Header Files + + Header Files + Header Files @@ -470,6 +500,9 @@ Header Files + + Header Files + Header Files diff --git a/plugins/GSdx/GSdx_vs2008.vcproj b/plugins/GSdx/GSdx_vs2008.vcproj index d307a14a72..49ca1e3820 100644 --- a/plugins/GSdx/GSdx_vs2008.vcproj +++ b/plugins/GSdx/GSdx_vs2008.vcproj @@ -861,6 +861,10 @@ RelativePath=".\GSDeviceNull.cpp" > + + @@ -1037,6 +1041,10 @@ RelativePath=".\GSRendererNull.cpp" > + + @@ -1177,6 +1185,10 @@ RelativePath=".\GSTexture9.cpp" > + + @@ -1189,6 +1201,10 @@ RelativePath=".\GSTextureCache9.cpp" > + + @@ -1201,6 +1217,10 @@ RelativePath=".\GSTextureFX9.cpp" > + + @@ -1467,6 +1487,10 @@ RelativePath=".\GSDeviceNull.h" > + + @@ -1547,6 +1571,10 @@ RelativePath=".\GSRendererNull.h" > + + @@ -1587,6 +1615,10 @@ RelativePath=".\GSTexture9.h" > + + @@ -1599,6 +1631,10 @@ RelativePath=".\GSTextureCache9.h" > + + @@ -1619,6 +1655,10 @@ RelativePath=".\GSThread.h" > + + @@ -1631,6 +1671,10 @@ RelativePath=".\GSVertex.h" > + +