Commit 2bf46c60 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Replace the face and level parameters to…

wined3d: Replace the face and level parameters to device_parent_create_texture_surface() with the sub-resource index.
parent 191db92f
......@@ -1440,13 +1440,13 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
enum wined3d_pool pool, UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface)
enum wined3d_pool pool, UINT sub_resource_idx, struct wined3d_surface **surface)
{
struct d3d10_device *device = device_from_wined3d_device_parent(device_parent);
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,\n"
"\tpool %#x, level %u, face %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, level, face, surface);
"\tpool %#x, sub_resource_idx %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, sub_resource_idx, surface);
return wined3d_surface_create(device->wined3d_device, width, height, format, usage, pool,
WINED3D_MULTISAMPLE_NONE, 0, WINED3D_SURFACE_TYPE_OPENGL, 0, container_parent,
......
......@@ -2739,7 +2739,7 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
enum wined3d_pool pool, UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface)
enum wined3d_pool pool, UINT sub_resource_idx, struct wined3d_surface **surface)
{
struct d3d8_device *device = device_from_device_parent(device_parent);
struct d3d8_surface *d3d_surface;
......@@ -2747,8 +2747,8 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
HRESULT hr;
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,\n"
"\tpool %#x, level %u, face %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, level, face, surface);
"\tpool %#x, sub_resource_idx %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, sub_resource_idx, surface);
if (pool == WINED3D_POOL_DEFAULT && !(usage & WINED3DUSAGE_DYNAMIC))
......
......@@ -3106,7 +3106,7 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
enum wined3d_pool pool, UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface)
enum wined3d_pool pool, UINT sub_resource_idx, struct wined3d_surface **surface)
{
struct d3d9_device *device = device_from_device_parent(device_parent);
struct d3d9_surface *d3d_surface;
......@@ -3114,8 +3114,8 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
HRESULT hr;
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,\n"
"\tpool %#x, level %u, face %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, level, face, surface);
"\tpool %#x, sub_resource_idx %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, sub_resource_idx, surface);
if (pool == WINED3D_POOL_DEFAULT && !(usage & D3DUSAGE_DYNAMIC))
lockable = FALSE;
......
......@@ -5197,7 +5197,7 @@ static void CDECL device_parent_mode_changed(struct wined3d_device_parent *devic
static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, DWORD usage,
enum wined3d_pool pool, UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface)
enum wined3d_pool pool, UINT sub_resource_idx, struct wined3d_surface **surface)
{
struct ddraw *ddraw = ddraw_from_device_parent(device_parent);
struct ddraw_surface *tex_root = container_parent;
......@@ -5206,11 +5206,11 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
HRESULT hr;
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,\n"
"\tpool %#x, level %u, face %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, level, face, surface);
"\tpool %#x, sub_resource_idx %u, surface %p.\n",
device_parent, container_parent, width, height, format, usage, pool, sub_resource_idx, surface);
/* The ddraw root surface is created before the wined3d texture. */
if (!level && face == WINED3D_CUBEMAP_FACE_POSITIVE_X)
if (!sub_resource_idx)
{
ddraw_surface = tex_root;
goto done;
......
......@@ -859,8 +859,8 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_lengt
UINT idx = j * texture->level_count + i;
struct wined3d_surface *surface;
if (FAILED(hr = device->device_parent->ops->create_texture_surface(device->device_parent, parent,
tmp_w, tmp_w, format_id, usage, pool, i /* Level */, j, &surface)))
if (FAILED(hr = device->device_parent->ops->create_texture_surface(device->device_parent,
parent, tmp_w, tmp_w, format_id, usage, pool, idx, &surface)))
{
FIXME("(%p) Failed to create surface, hr %#x.\n", texture, hr);
wined3d_texture_cleanup(texture);
......@@ -1014,8 +1014,8 @@ static HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT he
struct wined3d_surface *surface;
/* Use the callback to create the texture surface. */
if (FAILED(hr = device->device_parent->ops->create_texture_surface(device->device_parent, parent,
tmp_w, tmp_h, format->id, usage, pool, i, 0, &surface)))
if (FAILED(hr = device->device_parent->ops->create_texture_surface(device->device_parent,
parent, tmp_w, tmp_h, format->id, usage, pool, i, &surface)))
{
FIXME("Failed to create surface %p, hr %#x\n", texture, hr);
wined3d_texture_cleanup(texture);
......
......@@ -2004,7 +2004,7 @@ struct wined3d_device_parent_ops
struct wined3d_surface **surface);
HRESULT (__cdecl *create_texture_surface)(struct wined3d_device_parent *device_parent, void *container_parent,
UINT width, UINT height, enum wined3d_format_id format_id, DWORD usage, enum wined3d_pool pool,
UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface);
UINT sub_resource_idx, struct wined3d_surface **surface);
HRESULT (__cdecl *create_volume)(struct wined3d_device_parent *device_parent, void *container_parent,
UINT width, UINT height, UINT depth, enum wined3d_format_id format_id, enum wined3d_pool pool, DWORD usage,
struct wined3d_volume **volume);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment