Henri Verbeet : d3d8: Calculate texture levels in d3d8 instead of wined3d.
Module: wine Branch: master Commit: 1a28c7c5cc2e4bc4719e3bcc28ba0a5b25c5b61e URL: http://source.winehq.org/git/wine.git/?a=commit;h=1a28c7c5cc2e4bc4719e3bcc28... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Dec 10 13:26:36 2014 +0100 d3d8: Calculate texture levels in d3d8 instead of wined3d. --- dlls/d3d8/texture.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index 54944ac..24c0b28 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -1172,6 +1172,9 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) surface_flags |= WINED3D_SURFACE_MAPPABLE; + if (!levels) + levels = wined3d_log2i(max(width, height)) + 1; + wined3d_mutex_lock(); hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture); @@ -1214,6 +1217,9 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic if (pool != D3DPOOL_DEFAULT || (usage & D3DUSAGE_DYNAMIC)) surface_flags |= WINED3D_SURFACE_MAPPABLE; + if (!levels) + levels = wined3d_log2i(edge_length) + 1; + wined3d_mutex_lock(); hr = wined3d_texture_create(device->wined3d_device, &desc, levels, surface_flags, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture); @@ -1252,6 +1258,9 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev desc.depth = depth; desc.size = 0; + if (!levels) + levels = wined3d_log2i(max(max(width, height), depth)) + 1; + wined3d_mutex_lock(); hr = wined3d_texture_create(device->wined3d_device, &desc, levels, 0, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
participants (1)
-
Alexandre Julliard