wined3d: Remove SFLAG_USERPTR.

oldstable
Stefan Dösinger 2014-01-09 13:43:20 +01:00 committed by Alexandre Julliard
parent d1463cc44b
commit db6d3c500c
2 changed files with 15 additions and 21 deletions

View File

@ -604,7 +604,8 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
static void surface_evict_sysmem(struct wined3d_surface *surface)
{
if (surface->resource.map_count || (surface->flags & SFLAG_DONOTFREE))
if (surface->resource.map_count || (surface->flags & SFLAG_DONOTFREE)
|| surface->user_memory)
return;
wined3d_resource_free_sysmem(&surface->resource);
@ -2715,7 +2716,7 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
create_dib = TRUE;
}
surface->flags &= ~(SFLAG_LOCATIONS | SFLAG_USERPTR);
surface->flags &= ~SFLAG_LOCATIONS;
surface->resource.allocatedMemory = NULL;
wined3d_resource_free_sysmem(&surface->resource);
@ -2741,13 +2742,8 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
else
surface->flags &= ~SFLAG_NONPOW2;
if (mem)
{
surface->user_memory = mem;
surface->flags |= SFLAG_USERPTR;
}
surface->user_memory = mem;
surface->pitch = pitch;
surface->resource.format = format;
surface->resource.multisample_type = multisample_type;
surface->resource.multisample_quality = multisample_quality;
@ -3220,7 +3216,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
return WINED3DERR_INVALIDCALL;
/* Use the DIB section from now on if we are not using a PBO or user memory. */
if (!(surface->flags & (SFLAG_PBO | SFLAG_PIN_SYSMEM | SFLAG_USERPTR)))
if (!(surface->flags & (SFLAG_PBO | SFLAG_PIN_SYSMEM) || surface->user_memory))
{
wined3d_resource_free_sysmem(&surface->resource);
surface->resource.allocatedMemory = surface->dib.bitmap_data;

View File

@ -2294,17 +2294,16 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#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_DIBSECTION 0x00000400 /* Has a DIB section attached for GetDC. */
#define SFLAG_USERPTR 0x00000800 /* The application allocated the memory for this surface. */
#define SFLAG_ALLOCATED 0x00001000 /* A GL texture is allocated for this surface. */
#define SFLAG_SRGBALLOCATED 0x00002000 /* A sRGB GL texture is allocated for this surface. */
#define SFLAG_PBO 0x00004000 /* The surface has a PBO. */
#define SFLAG_INSYSMEM 0x00008000 /* The system memory copy is current. */
#define SFLAG_INTEXTURE 0x00010000 /* The GL texture is current. */
#define SFLAG_INSRGBTEX 0x00020000 /* The GL sRGB texture is current. */
#define SFLAG_INDRAWABLE 0x00040000 /* The GL drawable is current. */
#define SFLAG_INRB_MULTISAMPLE 0x00080000 /* The multisample renderbuffer is current. */
#define SFLAG_INRB_RESOLVED 0x00100000 /* The resolved renderbuffer is current. */
#define SFLAG_DISCARDED 0x00200000 /* Surface was discarded, allocating new location is enough. */
#define SFLAG_ALLOCATED 0x00000800 /* A GL texture is allocated for this surface. */
#define SFLAG_SRGBALLOCATED 0x00001000 /* A sRGB GL texture is allocated for this surface. */
#define SFLAG_PBO 0x00002000 /* The surface has a PBO. */
#define SFLAG_INSYSMEM 0x00004000 /* The system memory copy is current. */
#define SFLAG_INTEXTURE 0x00008000 /* The GL texture is current. */
#define SFLAG_INSRGBTEX 0x00010000 /* The GL sRGB texture is current. */
#define SFLAG_INDRAWABLE 0x00020000 /* The GL drawable is current. */
#define SFLAG_INRB_MULTISAMPLE 0x00040000 /* The multisample renderbuffer is current. */
#define SFLAG_INRB_RESOLVED 0x00080000 /* The resolved renderbuffer is current. */
#define SFLAG_DISCARDED 0x00100000 /* 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
@ -2317,7 +2316,6 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
SFLAG_DYNLOCK | \
SFLAG_CLIENT | \
SFLAG_DIBSECTION | \
SFLAG_USERPTR | \
SFLAG_PBO | \
SFLAG_PIN_SYSMEM)