wined3d: Check if the depth/stencil surface has any valid location at the start of surface_load_ds_location().
This commit is contained in:
parent
7b80c7d8c0
commit
83cf1ce8e1
|
@ -4146,9 +4146,14 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
|
|||
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;
|
||||
GLenum bind_target;
|
||||
|
@ -4157,7 +4162,8 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
|
|||
|
||||
ENTER_GL();
|
||||
|
||||
if (!device->depth_blt_texture) {
|
||||
if (!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);
|
||||
bind_target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
|
||||
bind_target = GL_TEXTURE_2D;
|
||||
}
|
||||
|
@ -4184,7 +4192,8 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
|
|||
glBindTexture(bind_target, old_binding);
|
||||
|
||||
/* Setup the destination */
|
||||
if (!device->depth_blt_rb) {
|
||||
if (!device->depth_blt_rb)
|
||||
{
|
||||
gl_info->fbo_ops.glGenRenderbuffers(1, &device->depth_blt_rb);
|
||||
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. */
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("No up to date depth stencil location\n");
|
||||
}
|
||||
}
|
||||
else if (location == SFLAG_DS_ONSCREEN)
|
||||
{
|
||||
if (surface->Flags & SFLAG_DS_OFFSCREEN)
|
||||
{
|
||||
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. */
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("No up to date depth stencil location\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("Invalid location (%#x) specified.\n", location);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue