wined3d: Store a pointer to the format description in the resource.

The goal is to eventually use a pointer to the format description in most
places where we currently use WINED3DFORMAT. IWineD3DSurfaceImpl for example
has copies of several fields from the format description, but also needs to
lookup the format description itself in several places.
This commit is contained in:
Henri Verbeet 2009-03-12 09:53:14 +01:00 committed by Alexandre Julliard
parent 81075d2db3
commit 38178541b0
2 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ HRESULT resource_init(struct IWineD3DResourceClass *resource, WINED3DRESOURCETYP
resource->ref = 1;
resource->pool = pool;
resource->format = format;
getFormatDescEntry(format, &device->adapter->gl_info, &resource->format_desc);
resource->usage = usage;
resource->size = size;
resource->priority = 0;

View File

@ -1236,6 +1236,7 @@ typedef struct IWineD3DResourceClass
UINT size;
DWORD usage;
WINED3DFORMAT format;
const struct GlPixelFormatDesc *format_desc;
DWORD priority;
BYTE *allocatedMemory; /* Pointer to the real data location */
BYTE *heapMemory; /* Pointer to the HeapAlloced block of memory */