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

wined3d: Separate surface locations and flags.

parent 00923cb5
...@@ -7454,7 +7454,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, ...@@ -7454,7 +7454,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
/* Now load the surface */ /* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& (src_surface->flags & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE)) == SFLAG_INDRAWABLE && (src_surface->locations & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE)) == SFLAG_INDRAWABLE
&& !surface_is_offscreen(src_surface)) && !surface_is_offscreen(src_surface))
{ {
/* Without FBO blits transferring from the drawable to the texture is /* Without FBO blits transferring from the drawable to the texture is
......
...@@ -234,7 +234,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context ...@@ -234,7 +234,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
{ {
RECT current_rect, r; RECT current_rect, r;
if (ds->flags & SFLAG_DISCARDED) if (ds->locations & SFLAG_DISCARDED)
{ {
/* Depth buffer was discarded, make it entirely current in its new location since /* Depth buffer was discarded, make it entirely current in its new location since
* there is no other place where we would get data anyway. */ * there is no other place where we would get data anyway. */
...@@ -242,7 +242,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context ...@@ -242,7 +242,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
return; return;
} }
if (ds->flags & location) if (ds->locations & location)
SetRect(&current_rect, 0, 0, SetRect(&current_rect, 0, 0,
ds->ds_current_size.cx, ds->ds_current_size.cx,
ds->ds_current_size.cy); ds->ds_current_size.cy);
......
...@@ -638,7 +638,8 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co ...@@ -638,7 +638,8 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
* Z-compare function into account, but we could skip loading the * Z-compare function into account, but we could skip loading the
* depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note * depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note
* that we never copy the stencil data.*/ * that we never copy the stencil data.*/
DWORD location = context->render_offscreen ? device->fb.depth_stencil->draw_binding : SFLAG_INDRAWABLE; DWORD location = context->render_offscreen ?
device->fb.depth_stencil->draw_binding : SFLAG_INDRAWABLE;
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE]) if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
{ {
struct wined3d_surface *ds = device->fb.depth_stencil; struct wined3d_surface *ds = device->fb.depth_stencil;
...@@ -647,7 +648,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co ...@@ -647,7 +648,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if (!context->render_offscreen && ds != device->onscreen_depth_stencil) if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
device_switch_onscreen_ds(device, context, ds); device_switch_onscreen_ds(device, context, ds);
if (ds->flags & location) if (ds->locations & location)
SetRect(&current_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); SetRect(&current_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy);
else else
SetRectEmpty(&current_rect); SetRectEmpty(&current_rect);
......
...@@ -541,8 +541,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT ...@@ -541,8 +541,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
} }
} }
if (!swapchain->render_to_fbo && ((swapchain->front_buffer->flags & SFLAG_INSYSMEM) if (!swapchain->render_to_fbo && ((swapchain->front_buffer->locations & SFLAG_INSYSMEM)
|| (back_buffer->flags & SFLAG_INSYSMEM))) || (back_buffer->locations & SFLAG_INSYSMEM)))
{ {
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying /* 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 * Doesn't work with render_to_fbo because we're not flipping
......
...@@ -2192,6 +2192,7 @@ struct wined3d_surface ...@@ -2192,6 +2192,7 @@ struct wined3d_surface
struct wined3d_palette *palette; /* D3D7 style palette handling */ struct wined3d_palette *palette; /* D3D7 style palette handling */
DWORD draw_binding, map_binding; DWORD draw_binding, map_binding;
void *user_memory; void *user_memory;
DWORD locations;
DWORD flags; DWORD flags;
...@@ -2315,16 +2316,6 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D ...@@ -2315,16 +2316,6 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
SFLAG_CLIENT | \ SFLAG_CLIENT | \
SFLAG_PIN_SYSMEM) SFLAG_PIN_SYSMEM)
#define SFLAG_LOCATIONS (SFLAG_INSYSMEM | \
SFLAG_INUSERMEM | \
SFLAG_INDIB | \
SFLAG_INBUFFER | \
SFLAG_INTEXTURE | \
SFLAG_INSRGBTEX | \
SFLAG_INDRAWABLE | \
SFLAG_INRB_MULTISAMPLE | \
SFLAG_INRB_RESOLVED)
enum wined3d_conversion_type enum wined3d_conversion_type
{ {
WINED3D_CT_NONE, WINED3D_CT_NONE,
......
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