Commit ebd6bf7f authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Remove old surface flipping hacks.

They're non-functional these days anyway.
parent 2936e4ac
......@@ -2881,83 +2881,6 @@ void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl
}
}
void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
{
if (front->container->level_count != 1 || front->container->layer_count != 1
|| back->container->level_count != 1 || back->container->layer_count != 1)
ERR("Flip between surfaces %p and %p not supported.\n", front, back);
/* Flip the surface contents */
/* Flip the DC */
{
HDC tmp;
tmp = front->hDC;
front->hDC = back->hDC;
back->hDC = tmp;
}
/* Flip the DIBsection */
{
HBITMAP tmp = front->dib.DIBsection;
front->dib.DIBsection = back->dib.DIBsection;
back->dib.DIBsection = tmp;
}
/* Flip the surface data */
{
void* tmp;
tmp = front->dib.bitmap_data;
front->dib.bitmap_data = back->dib.bitmap_data;
back->dib.bitmap_data = tmp;
tmp = front->resource.heap_memory;
front->resource.heap_memory = back->resource.heap_memory;
back->resource.heap_memory = tmp;
}
/* Flip the PBO */
{
GLuint tmp_pbo = front->pbo;
front->pbo = back->pbo;
back->pbo = tmp_pbo;
}
/* Flip the opengl texture */
{
GLuint tmp;
tmp = back->container->texture_rgb.name;
back->container->texture_rgb.name = front->container->texture_rgb.name;
front->container->texture_rgb.name = tmp;
tmp = back->container->texture_srgb.name;
back->container->texture_srgb.name = front->container->texture_srgb.name;
front->container->texture_srgb.name = tmp;
tmp = back->rb_multisample;
back->rb_multisample = front->rb_multisample;
front->rb_multisample = tmp;
tmp = back->rb_resolved;
back->rb_resolved = front->rb_resolved;
front->rb_resolved = tmp;
resource_unload(&back->resource);
resource_unload(&front->resource);
}
{
DWORD tmp_flags = back->flags;
back->flags = front->flags;
front->flags = tmp_flags;
tmp_flags = back->locations;
back->locations = front->locations;
front->locations = tmp_flags;
}
}
/* Does a direct frame buffer -> texture copy. Stretching is done with single
* pixel copy calls. */
static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface,
......
......@@ -555,45 +555,16 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM)
|| (back_buffer->locations & WINED3D_LOCATION_SYSMEM)))
{
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
*/
if (front->resource.size == back_buffer->resource.size)
{
flip_surface(front, back_buffer);
/* Tell the front buffer surface that is has been modified. However,
* the other locations were preserved during that, so keep the flags.
* This serves to update the emulated overlay, if any. */
surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
}
else
{
surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
}
}
else
{
surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same. If it is FLIP however,
* the texture / sysmem copy needs to be reloaded from the drawable
*/
if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
{
surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding);
surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
}
}
surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same.
*
* The FLIP swap effect is not implemented yet. We could mark WINED3D_LOCATION_DRAWABLE
* up to date and hope WGL flipped front and back buffers and read this data into
* the FBO. Don't bother about this for now. */
if (fb->depth_stencil)
{
......
......@@ -2456,7 +2456,6 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN;
/* Surface flags: */
#define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment