From 1276a3db041786d47f99c5c651b053d4cdbb8354 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 4 Jun 2013 09:57:06 +0200 Subject: [PATCH] wined3d: Properly set resource dimensions in wined3d_texture_init(). --- dlls/wined3d/texture.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index a2119766cfe..2cf125f4191 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -28,13 +28,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_texture_ops *texture_ops, UINT layer_count, UINT level_count, enum wined3d_resource_type resource_type, struct wined3d_device *device, - DWORD usage, const struct wined3d_format *format, enum wined3d_pool pool, void *parent, - const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) + DWORD usage, const struct wined3d_format *format, enum wined3d_pool pool, UINT width, UINT height, UINT depth, + void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) { HRESULT hr; hr = resource_init(&texture->resource, device, resource_type, format, - WINED3D_MULTISAMPLE_NONE, 0, usage, pool, 0, 0, 0, 0, + WINED3D_MULTISAMPLE_NONE, 0, usage, pool, width, height, depth, 0, parent, parent_ops, resource_ops); if (FAILED(hr)) { @@ -822,10 +822,8 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_lengt } } - hr = wined3d_texture_init(texture, &texture2d_ops, 6, levels, - WINED3D_RTYPE_CUBE_TEXTURE, device, usage, format, pool, - parent, parent_ops, &texture2d_resource_ops); - if (FAILED(hr)) + if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, 6, levels, WINED3D_RTYPE_CUBE_TEXTURE, device, + usage, format, pool, edge_length, edge_length, 1, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x\n", hr); return hr; @@ -948,10 +946,8 @@ static HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT he TRACE("Calculated levels = %u.\n", levels); } - hr = wined3d_texture_init(texture, &texture2d_ops, 1, levels, - WINED3D_RTYPE_TEXTURE, device, usage, format, pool, - parent, parent_ops, &texture2d_resource_ops); - if (FAILED(hr)) + if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, 1, levels, WINED3D_RTYPE_TEXTURE, device, + usage, format, pool, width, height, 1, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); return hr; @@ -1221,10 +1217,8 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, U } } - hr = wined3d_texture_init(texture, &texture3d_ops, 1, levels, - WINED3D_RTYPE_VOLUME_TEXTURE, device, usage, format, pool, - parent, parent_ops, &texture3d_resource_ops); - if (FAILED(hr)) + if (FAILED(hr = wined3d_texture_init(texture, &texture3d_ops, 1, levels, WINED3D_RTYPE_VOLUME_TEXTURE, device, + usage, format, pool, width, height, depth, parent, parent_ops, &texture3d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); return hr; -- 2.11.4.GIT