wined3d: Implement IWineD3DResourceImpl_GetPriority and IWineD3DResourceImpl_SetPriority for resource management.
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b5bc82f..79c9f68 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -90,6 +90,7 @@
object->resource.format = Format; \
object->resource.usage = Usage; \
object->resource.size = _size; \
+ object->resource.priority = 0; \
list_init(&object->resource.privateData); \
/* Check that we have enough video ram left */ \
if (Pool == WINED3DPOOL_DEFAULT) { \
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 17e540b..c75e09d 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -217,16 +217,18 @@
return WINED3D_OK;
}
-/* Priority support is not implemented yet */
DWORD WINAPI IWineD3DResourceImpl_SetPriority(IWineD3DResource *iface, DWORD PriorityNew) {
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
- FIXME("(%p) : stub\n", This);
- return 0;
+ DWORD PriorityOld = This->resource.priority;
+ This->resource.priority = PriorityNew;
+ TRACE("(%p) : new priority %d, returning old priority %d\n", This, PriorityNew, PriorityOld );
+ return PriorityOld;
}
+
DWORD WINAPI IWineD3DResourceImpl_GetPriority(IWineD3DResource *iface) {
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
- FIXME("(%p) : stub\n", This);
- return 0;
+ TRACE("(%p) : returning %d\n", This, This->resource.priority );
+ return This->resource.priority;
}
/* Preloading of resources is not supported yet */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d4c6273..bc6a1cb 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1096,6 +1096,7 @@
UINT size;
DWORD usage;
WINED3DFORMAT format;
+ DWORD priority;
BYTE *allocatedMemory; /* Pointer to the real data location */
BYTE *heapMemory; /* Pointer to the HeapAlloced block of memory */
struct list privateData;