+ d3d9_resource_init(&texture->resource);
+ list_init(&texture->rtv_list);
+
+ desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
+ desc.format = wined3dformat_from_d3dformat(format);
+ desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
+ desc.multisample_quality = 0;
+ desc.usage = usage & WINED3DUSAGE_MASK;
+ desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE;
+ desc.pool = pool;
+ desc.width = edge_length;
+ desc.height = edge_length;
+ desc.depth = 1;
+ desc.size = 0;
+
+ if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC))
+ flags |= WINED3D_TEXTURE_CREATE_MAPPABLE;
+
+ if (is_gdi_compat_wined3dformat(desc.format))
+ flags |= WINED3D_TEXTURE_CREATE_GET_DC;
+
+ if (!levels)
+ {
+ if (usage & D3DUSAGE_AUTOGENMIPMAP)
+ levels = 1;
+ else
+ levels = wined3d_log2i(edge_length) + 1;
+ }