wined3d: Move depth_blt to surface.c.
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 267bdf8..b3612bd 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -653,43 +653,6 @@
glEnd();
}
-void depth_blt(IWineD3DDevice *iface, GLuint texture, GLsizei w, GLsizei h) {
- IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- GLint old_binding = 0;
-
- glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_VIEWPORT_BIT);
-
- glDisable(GL_CULL_FACE);
- glEnable(GL_BLEND);
- glDisable(GL_ALPHA_TEST);
- glDisable(GL_SCISSOR_TEST);
- glDisable(GL_STENCIL_TEST);
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_ALWAYS);
- glDepthMask(GL_TRUE);
- glBlendFunc(GL_ZERO, GL_ONE);
- glViewport(0, 0, w, h);
-
- GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
- glBindTexture(GL_TEXTURE_2D, texture);
-
- This->shader_backend->shader_select_depth_blt(iface);
-
- glBegin(GL_TRIANGLE_STRIP);
- glVertex2f(-1.0f, -1.0f);
- glVertex2f(1.0f, -1.0f);
- glVertex2f(-1.0f, 1.0f);
- glVertex2f(1.0f, 1.0f);
- glEnd();
-
- glBindTexture(GL_TEXTURE_2D, old_binding);
-
- glPopAttrib();
-
- This->shader_backend->shader_deselect_depth_blt(iface);
-}
-
static inline void drawStridedInstanced(IWineD3DDevice *iface, WineDirect3DVertexStridedData *sd, UINT numberOfVertices,
GLenum glPrimitiveType, const void *idxData, short idxSize, ULONG minIndex,
ULONG startIdx, ULONG startVertex) {
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 953985b..a44131a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3954,6 +3954,44 @@
return WINED3D_OK;
}
+static void surface_depth_blt(IWineD3DSurfaceImpl *This, GLuint texture, GLsizei w, GLsizei h)
+{
+ IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
+ GLint old_binding = 0;
+
+ glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_VIEWPORT_BIT);
+
+ glDisable(GL_CULL_FACE);
+ glEnable(GL_BLEND);
+ glDisable(GL_ALPHA_TEST);
+ glDisable(GL_SCISSOR_TEST);
+ glDisable(GL_STENCIL_TEST);
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_ALWAYS);
+ glDepthMask(GL_TRUE);
+ glBlendFunc(GL_ZERO, GL_ONE);
+ glViewport(0, 0, w, h);
+
+ GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
+ glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
+ glBindTexture(GL_TEXTURE_2D, texture);
+
+ device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device);
+
+ glBegin(GL_TRIANGLE_STRIP);
+ glVertex2f(-1.0f, -1.0f);
+ glVertex2f(1.0f, -1.0f);
+ glVertex2f(-1.0f, 1.0f);
+ glVertex2f(1.0f, 1.0f);
+ glEnd();
+
+ glBindTexture(GL_TEXTURE_2D, old_binding);
+
+ glPopAttrib();
+
+ device->shader_backend->shader_deselect_depth_blt((IWineD3DDevice *)device);
+}
+
void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
@@ -4037,7 +4075,7 @@
context_attach_depth_stencil_fbo(device, GL_FRAMEBUFFER_EXT, iface, FALSE);
/* Do the actual blit */
- depth_blt((IWineD3DDevice *)device, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height);
+ surface_depth_blt(This, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height);
checkGLcall("depth_blt");
if (device->activeContext->current_fbo) {
@@ -4059,7 +4097,7 @@
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0));
checkGLcall("glBindFramebuffer()");
- depth_blt((IWineD3DDevice *)device, This->glDescription.textureName, This->currentDesc.Width, This->currentDesc.Height);
+ surface_depth_blt(This, This->glDescription.textureName, This->currentDesc.Width, This->currentDesc.Height);
checkGLcall("depth_blt");
if (device->activeContext->current_fbo) {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index bc6a1cb..428fedf 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2442,5 +2442,4 @@
void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED3DRECT *src_rect,
IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, const WINED3DTEXTUREFILTERTYPE filter, BOOL flip);
-void depth_blt(IWineD3DDevice *iface, GLuint texture, GLsizei w, GLsizei h);
#endif