wined3d: Check if the depth/stencil surface has any valid location at the start of surface_load_ds_location().

This commit is contained in:
Henri Verbeet 2010-04-28 00:08:52 +02:00 committed by Alexandre Julliard
parent 7b80c7d8c0
commit 83cf1ce8e1
1 changed files with 81 additions and 84 deletions

View File

@ -4146,9 +4146,14 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
return; return;
} }
if (location == SFLAG_DS_OFFSCREEN) if (!(surface->Flags & SFLAG_LOCATIONS))
{ {
if (surface->Flags & SFLAG_DS_ONSCREEN) FIXME("No up to date depth stencil location.\n");
surface->Flags |= location;
return;
}
if (location == SFLAG_DS_OFFSCREEN)
{ {
GLint old_binding = 0; GLint old_binding = 0;
GLenum bind_target; GLenum bind_target;
@ -4157,7 +4162,8 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
ENTER_GL(); ENTER_GL();
if (!device->depth_blt_texture) { if (!device->depth_blt_texture)
{
glGenTextures(1, &device->depth_blt_texture); glGenTextures(1, &device->depth_blt_texture);
} }
@ -4168,7 +4174,9 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
{ {
glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding); glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding);
bind_target = GL_TEXTURE_RECTANGLE_ARB; bind_target = GL_TEXTURE_RECTANGLE_ARB;
} else { }
else
{
glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
bind_target = GL_TEXTURE_2D; bind_target = GL_TEXTURE_2D;
} }
@ -4184,7 +4192,8 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
glBindTexture(bind_target, old_binding); glBindTexture(bind_target, old_binding);
/* Setup the destination */ /* Setup the destination */
if (!device->depth_blt_rb) { if (!device->depth_blt_rb)
{
gl_info->fbo_ops.glGenRenderbuffers(1, &device->depth_blt_rb); gl_info->fbo_ops.glGenRenderbuffers(1, &device->depth_blt_rb);
checkGLcall("glGenRenderbuffersEXT"); checkGLcall("glGenRenderbuffersEXT");
} }
@ -4218,14 +4227,7 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
if (wined3d_settings.strict_draw_ordering) wglFlush(); /* Flush to ensure ordering across contexts. */ if (wined3d_settings.strict_draw_ordering) wglFlush(); /* Flush to ensure ordering across contexts. */
} }
else
{
FIXME("No up to date depth stencil location\n");
}
}
else if (location == SFLAG_DS_ONSCREEN) else if (location == SFLAG_DS_ONSCREEN)
{
if (surface->Flags & SFLAG_DS_OFFSCREEN)
{ {
TRACE("Copying depth texture to onscreen depth buffer.\n"); TRACE("Copying depth texture to onscreen depth buffer.\n");
@ -4243,11 +4245,6 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
if (wined3d_settings.strict_draw_ordering) wglFlush(); /* Flush to ensure ordering across contexts. */ if (wined3d_settings.strict_draw_ordering) wglFlush(); /* Flush to ensure ordering across contexts. */
} }
else else
{
FIXME("No up to date depth stencil location\n");
}
}
else
{ {
ERR("Invalid location (%#x) specified.\n", location); ERR("Invalid location (%#x) specified.\n", location);
} }