wined3d: Get rid of SFLAG_LOCKABLE.

This commit is contained in:
Stefan Dösinger 2013-10-08 00:27:07 +02:00 committed by Alexandre Julliard
parent bff422f340
commit e4a0767e2d
2 changed files with 22 additions and 22 deletions

View File

@ -3476,7 +3476,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
++surface->resource.map_count;
if (!(surface->flags & SFLAG_LOCKABLE))
if (!(surface->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
WARN("Trying to lock unlockable surface.\n");
/* Performance optimization: Count how often a surface is mapped, if it is
@ -6876,7 +6876,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, UINT alignment, UIN
if (flags & WINED3D_SURFACE_PIN_SYSMEM)
surface->flags |= SFLAG_PIN_SYSMEM;
if (lockable || format_id == WINED3DFMT_D16_LOCKABLE)
surface->flags |= SFLAG_LOCKABLE;
surface->resource.access_flags |= WINED3D_RESOURCE_ACCESS_CPU;
/* I'm not sure if this qualifies as a hack or as an optimization. It
* seems reasonable to assume that lockable render targets will get
* locked, so we might as well set SFLAG_DYNLOCK right at surface

View File

@ -2298,26 +2298,25 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#define SFLAG_DISCARD 0x00000002 /* ??? */
#define SFLAG_NONPOW2 0x00000004 /* Surface sizes are not a power of 2 */
#define SFLAG_NORMCOORD 0x00000008 /* Set if GL texture coordinates are normalized (non-texture rectangle). */
#define SFLAG_LOCKABLE 0x00000010 /* Surface can be locked. */
#define SFLAG_DYNLOCK 0x00000020 /* Surface is often locked by the application. */
#define SFLAG_PIN_SYSMEM 0x00000040 /* Keep the surface in sysmem, at the same address. */
#define SFLAG_DCINUSE 0x00000080 /* Set between GetDC and ReleaseDC calls. */
#define SFLAG_LOST 0x00000100 /* Surface lost flag for ddraw. */
#define SFLAG_GLCKEY 0x00000200 /* The GL texture was created with a color key. */
#define SFLAG_CLIENT 0x00000400 /* GL_APPLE_client_storage is used with this surface. */
#define SFLAG_INOVERLAYDRAW 0x00000800 /* Overlay drawing is in progress. Recursion prevention. */
#define SFLAG_DIBSECTION 0x00001000 /* Has a DIB section attached for GetDC. */
#define SFLAG_USERPTR 0x00002000 /* The application allocated the memory for this surface. */
#define SFLAG_ALLOCATED 0x00004000 /* A GL texture is allocated for this surface. */
#define SFLAG_SRGBALLOCATED 0x00008000 /* A sRGB GL texture is allocated for this surface. */
#define SFLAG_PBO 0x00010000 /* The surface has a PBO. */
#define SFLAG_INSYSMEM 0x00020000 /* The system memory copy is current. */
#define SFLAG_INTEXTURE 0x00040000 /* The GL texture is current. */
#define SFLAG_INSRGBTEX 0x00080000 /* The GL sRGB texture is current. */
#define SFLAG_INDRAWABLE 0x00100000 /* The GL drawable is current. */
#define SFLAG_INRB_MULTISAMPLE 0x00200000 /* The multisample renderbuffer is current. */
#define SFLAG_INRB_RESOLVED 0x00400000 /* The resolved renderbuffer is current. */
#define SFLAG_DISCARDED 0x00800000 /* Surface was discarded, allocating new location is enough. */
#define SFLAG_DYNLOCK 0x00000010 /* Surface is often locked by the application. */
#define SFLAG_PIN_SYSMEM 0x00000020 /* Keep the surface in sysmem, at the same address. */
#define SFLAG_DCINUSE 0x00000040 /* Set between GetDC and ReleaseDC calls. */
#define SFLAG_LOST 0x00000080 /* Surface lost flag for ddraw. */
#define SFLAG_GLCKEY 0x00000100 /* The GL texture was created with a color key. */
#define SFLAG_CLIENT 0x00000200 /* GL_APPLE_client_storage is used with this surface. */
#define SFLAG_INOVERLAYDRAW 0x00000400 /* Overlay drawing is in progress. Recursion prevention. */
#define SFLAG_DIBSECTION 0x00000800 /* Has a DIB section attached for GetDC. */
#define SFLAG_USERPTR 0x00001000 /* The application allocated the memory for this surface. */
#define SFLAG_ALLOCATED 0x00002000 /* A GL texture is allocated for this surface. */
#define SFLAG_SRGBALLOCATED 0x00004000 /* A sRGB GL texture is allocated for this surface. */
#define SFLAG_PBO 0x00008000 /* The surface has a PBO. */
#define SFLAG_INSYSMEM 0x00010000 /* The system memory copy is current. */
#define SFLAG_INTEXTURE 0x00020000 /* The GL texture is current. */
#define SFLAG_INSRGBTEX 0x00040000 /* The GL sRGB texture is current. */
#define SFLAG_INDRAWABLE 0x00080000 /* The GL drawable is current. */
#define SFLAG_INRB_MULTISAMPLE 0x00100000 /* The multisample renderbuffer is current. */
#define SFLAG_INRB_RESOLVED 0x00200000 /* The resolved renderbuffer is current. */
#define SFLAG_DISCARDED 0x00400000 /* Surface was discarded, allocating new location is enough. */
/* In some conditions the surface memory must not be freed:
* SFLAG_CONVERTED: Converting the data back would take too long