wined3d: Track SFLAG_DISCARD per-texture.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-04-14 19:32:47 +02:00 committed by Alexandre Julliard
parent 82a7f1ebf2
commit 4896cda6c5
5 changed files with 5 additions and 10 deletions

View File

@ -421,7 +421,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev);
if (prev_surface && (device->swapchains[0]->desc.flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
|| prev_surface->flags & SFLAG_DISCARD))
|| prev_surface->container->flags & WINED3D_TEXTURE_DISCARD))
{
surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height);
if (prev_surface == device->onscreen_depth_stencil)

View File

@ -4533,9 +4533,6 @@ HRESULT wined3d_surface_init(struct wined3d_surface *surface, struct wined3d_tex
list_init(&surface->renderbuffers);
list_init(&surface->overlays);
/* Flags */
if (flags & WINED3D_TEXTURE_CREATE_DISCARD)
surface->flags |= SFLAG_DISCARD;
if (lockable || desc->format == WINED3DFMT_D16_LOCKABLE)
surface->resource.access_flags |= WINED3D_RESOURCE_ACCESS_CPU;

View File

@ -616,7 +616,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(fb->depth_stencil);
if (ds && (swapchain->desc.flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
|| ds->flags & SFLAG_DISCARD))
|| ds->container->flags & WINED3D_TEXTURE_DISCARD))
{
surface_modify_ds_location(ds, WINED3D_LOCATION_DISCARDED,
fb->depth_stencil->width, fb->depth_stencil->height);

View File

@ -223,6 +223,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture->flags |= WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS;
if (flags & WINED3D_TEXTURE_CREATE_GET_DC_LENIENT)
texture->flags |= WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_GET_DC_LENIENT;
if (flags & WINED3D_TEXTURE_CREATE_DISCARD)
texture->flags |= WINED3D_TEXTURE_DISCARD;
return WINED3D_OK;
}

View File

@ -2445,6 +2445,7 @@ struct wined3d_texture_ops
#define WINED3D_TEXTURE_NORMALIZED_COORDS 0x00000400
#define WINED3D_TEXTURE_GET_DC_LENIENT 0x00000800
#define WINED3D_TEXTURE_DC_IN_USE 0x00001000
#define WINED3D_TEXTURE_DISCARD 0x00002000
#define WINED3D_TEXTURE_ASYNC_COLOR_KEY 0x00000001
@ -2646,8 +2647,6 @@ struct wined3d_surface
struct wined3d_resource resource;
struct wined3d_texture *container;
DWORD flags;
UINT pow2Width;
UINT pow2Height;
GLuint rb_multisample;
@ -2734,9 +2733,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;
/* Surface flags: */
#define SFLAG_DISCARD 0x00000002 /* ??? */
struct wined3d_sampler
{
struct wine_rb_entry entry;