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

Henri Verbeet hverbeet at codeweavers.com
Thu Mar 12 03:53:14 CDT 2009


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.
---
 dlls/wined3d/resource.c        |    1 +
 dlls/wined3d/wined3d_private.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index b4e49b1..34015f8 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -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;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d04164a..8ed82fc 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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 */
-- 
1.6.0.6



--------------000606040603000502080208--



More information about the wine-patches mailing list