wined3d: Introduce wined3d_resource_get_desc() to retrieve the resource desc.
This commit is contained in:
parent
77fdee8a2e
commit
4be256a47c
|
@ -1399,16 +1399,7 @@ void CDECL wined3d_buffer_get_desc(const struct wined3d_buffer *buffer, struct w
|
|||
{
|
||||
TRACE("buffer %p, desc %p.\n", buffer, desc);
|
||||
|
||||
desc->format = buffer->resource.format->id;
|
||||
desc->resource_type = buffer->resource.resourceType;
|
||||
desc->usage = buffer->resource.usage;
|
||||
desc->pool = buffer->resource.pool;
|
||||
desc->size = buffer->resource.size;
|
||||
desc->multisample_type = WINED3DMULTISAMPLE_NONE;
|
||||
desc->multisample_quality = 0;
|
||||
desc->width = buffer->resource.size;
|
||||
desc->height = 1;
|
||||
desc->depth = 1;
|
||||
wined3d_resource_get_desc(&buffer->resource, desc);
|
||||
}
|
||||
|
||||
static const struct wined3d_resource_ops buffer_resource_ops =
|
||||
|
|
|
@ -340,7 +340,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_GetSubResourceDesc(IWineD3DCubeTex
|
|||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
IWineD3DSurface_GetDesc((IWineD3DSurface *)surface_from_resource(sub_resource), desc);
|
||||
wined3d_resource_get_desc(sub_resource, desc);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -282,3 +282,17 @@ void * CDECL wined3d_resource_get_parent(const struct wined3d_resource *resource
|
|||
{
|
||||
return resource->parent;
|
||||
}
|
||||
|
||||
void wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
|
||||
{
|
||||
desc->resource_type = resource->resourceType;
|
||||
desc->format = resource->format->id;
|
||||
desc->multisample_type = resource->multisample_type;
|
||||
desc->multisample_quality = resource->multisample_quality;
|
||||
desc->usage = resource->usage;
|
||||
desc->pool = resource->pool;
|
||||
desc->width = resource->width;
|
||||
desc->height = resource->height;
|
||||
desc->depth = resource->depth;
|
||||
desc->size = resource->size;
|
||||
}
|
||||
|
|
|
@ -163,16 +163,7 @@ void WINAPI IWineD3DBaseSurfaceImpl_GetDesc(IWineD3DSurface *iface, struct wined
|
|||
|
||||
TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
|
||||
desc->format = surface->resource.format->id;
|
||||
desc->resource_type = surface->resource.resourceType;
|
||||
desc->usage = surface->resource.usage;
|
||||
desc->pool = surface->resource.pool;
|
||||
desc->size = surface->resource.size; /* dx8 only */
|
||||
desc->multisample_type = surface->resource.multisample_type;
|
||||
desc->multisample_quality = surface->resource.multisample_quality;
|
||||
desc->width = surface->resource.width;
|
||||
desc->height = surface->resource.height;
|
||||
desc->depth = surface->resource.depth;
|
||||
wined3d_resource_get_desc(&surface->resource, desc);
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWORD flags)
|
||||
|
|
|
@ -365,7 +365,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetSubResourceDesc(IWineD3DTexture *if
|
|||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
IWineD3DSurface_GetDesc((IWineD3DSurface *)surface_from_resource(sub_resource), desc);
|
||||
wined3d_resource_get_desc(sub_resource, desc);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -226,16 +226,7 @@ static void WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, struct wine
|
|||
|
||||
TRACE("iface %p, desc %p.\n", iface, desc);
|
||||
|
||||
desc->format = volume->resource.format->id;
|
||||
desc->resource_type = volume->resource.resourceType;
|
||||
desc->usage = volume->resource.usage;
|
||||
desc->pool = volume->resource.pool;
|
||||
desc->size = volume->resource.size; /* dx8 only */
|
||||
desc->multisample_type = WINED3DMULTISAMPLE_NONE;
|
||||
desc->multisample_quality = 0;
|
||||
desc->width = volume->resource.width;
|
||||
desc->height = volume->resource.height;
|
||||
desc->depth = volume->resource.depth;
|
||||
wined3d_resource_get_desc(&volume->resource, desc);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface,
|
||||
|
|
|
@ -277,7 +277,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetSubResourceDesc(IWineD3DVolum
|
|||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
IWineD3DVolume_GetDesc((IWineD3DVolume *)volume_from_resource(sub_resource), desc);
|
||||
wined3d_resource_get_desc(sub_resource, desc);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
|
|
@ -1824,6 +1824,8 @@ struct wined3d_resource
|
|||
|
||||
void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
HRESULT resource_free_private_data(struct wined3d_resource *resource, REFGUID guid) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_get_desc(const struct wined3d_resource *resource,
|
||||
struct wined3d_resource_desc *desc) DECLSPEC_HIDDEN;
|
||||
DWORD resource_get_priority(const struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
HRESULT resource_get_private_data(const struct wined3d_resource *resource, REFGUID guid,
|
||||
void *data, DWORD *data_size) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue