diff --git a/plugins/GSdx/Renderers/Common/GSDevice.h b/plugins/GSdx/Renderers/Common/GSDevice.h index 8b7d3be416..e299da88f6 100644 --- a/plugins/GSdx/Renderers/Common/GSDevice.h +++ b/plugins/GSdx/Renderers/Common/GSDevice.h @@ -175,10 +175,10 @@ public: virtual void ClearDepth(GSTexture* t) {} virtual void ClearStencil(GSTexture* t, uint8 c) {} - virtual GSTexture* CreateRenderTarget(int w, int h, int format = 0); - virtual GSTexture* CreateDepthStencil(int w, int h, int format = 0); - virtual GSTexture* CreateTexture(int w, int h, int format = 0); - virtual GSTexture* CreateOffscreen(int w, int h, int format = 0); + GSTexture* CreateRenderTarget(int w, int h, int format = 0); + GSTexture* CreateDepthStencil(int w, int h, int format = 0); + GSTexture* CreateTexture(int w, int h, int format = 0); + GSTexture* CreateOffscreen(int w, int h, int format = 0); virtual GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0) {return NULL;} diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp index 9f5e997355..41d21fcc1b 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp @@ -712,29 +712,12 @@ GSTexture* GSDevice11::CreateSurface(int type, int w, int h, int format) GSTexture* GSDevice11::FetchSurface(int type, int w, int h, int format) { + if (format == 0) + format = (type == GSTexture::DepthStencil) ? DXGI_FORMAT_R32G8X24_TYPELESS : DXGI_FORMAT_R8G8B8A8_UNORM; + return __super::FetchSurface(type, w, h, format); } -GSTexture* GSDevice11::CreateRenderTarget(int w, int h, int format) -{ - return __super::CreateRenderTarget(w, h, format ? format : DXGI_FORMAT_R8G8B8A8_UNORM); -} - -GSTexture* GSDevice11::CreateDepthStencil(int w, int h, int format) -{ - return __super::CreateDepthStencil(w, h, format ? format : DXGI_FORMAT_R32G8X24_TYPELESS); -} - -GSTexture* GSDevice11::CreateTexture(int w, int h, int format) -{ - return __super::CreateTexture(w, h, format ? format : DXGI_FORMAT_R8G8B8A8_UNORM); -} - -GSTexture* GSDevice11::CreateOffscreen(int w, int h, int format) -{ - return __super::CreateOffscreen(w, h, format ? format : DXGI_FORMAT_R8G8B8A8_UNORM); -} - GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format, int ps_shader) { GSTexture* dst = NULL; diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.h b/plugins/GSdx/Renderers/DX11/GSDevice11.h index 7c69f43824..317731d95d 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.h +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.h @@ -483,11 +483,6 @@ public: void ClearDepth(GSTexture* t) final; void ClearStencil(GSTexture* t, uint8 c) final; - GSTexture* CreateRenderTarget(int w, int h, int format = 0) final; - GSTexture* CreateDepthStencil(int w, int h, int format = 0) final; - GSTexture* CreateTexture(int w, int h, int format = 0) final; - GSTexture* CreateOffscreen(int w, int h, int format = 0) final; - GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0) final; void CloneTexture(GSTexture* src, GSTexture** dest); diff --git a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp index 8419fb1984..4570af6e59 100644 --- a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp @@ -260,6 +260,9 @@ GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, int fmt) GSTexture* GSDeviceOGL::FetchSurface(int type, int w, int h, int format) { + if (format == 0) + format = (type == GSTexture::DepthStencil) ? GL_DEPTH32F_STENCIL8 : GL_RGBA8; + GSTexture* t = GSDevice::FetchSurface(type, w, h, format); @@ -1178,26 +1181,6 @@ void GSDeviceOGL::SelfShaderTest() SelfShaderTestPrint(test, nb_shader); } -GSTexture* GSDeviceOGL::CreateRenderTarget(int w, int h, int format) -{ - return GSDevice::CreateRenderTarget(w, h, format ? format : GL_RGBA8); -} - -GSTexture* GSDeviceOGL::CreateDepthStencil(int w, int h, int format) -{ - return GSDevice::CreateDepthStencil(w, h, format ? format : GL_DEPTH32F_STENCIL8); -} - -GSTexture* GSDeviceOGL::CreateTexture(int w, int h, int format) -{ - return GSDevice::CreateTexture(w, h, format ? format : GL_RGBA8); -} - -GSTexture* GSDeviceOGL::CreateOffscreen(int w, int h, int format) -{ - return GSDevice::CreateOffscreen(w, h, format ? format : GL_RGBA8); -} - // blit a texture into an offscreen buffer GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format, int ps_shader) { diff --git a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h index bf9c485a34..fa73bec39d 100644 --- a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h +++ b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.h @@ -534,10 +534,6 @@ public: void ClearDepth(GSTexture* t) final; void ClearStencil(GSTexture* t, uint8 c) final; - GSTexture* CreateRenderTarget(int w, int h, int format = 0) final; - GSTexture* CreateDepthStencil(int w, int h, int format = 0) final; - GSTexture* CreateTexture(int w, int h, int format = 0) final; - GSTexture* CreateOffscreen(int w, int h, int format = 0) final; void InitPrimDateTexture(GSTexture* rt, const GSVector4i& area); void RecycleDateTexture();