Commit 94f49933 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Call wined3d_cs_emit_update_sub_resource() directly in wined3d_texture_create().

Fixes a regression introduced by commit 490c6d54. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45996Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 63cd3de5
...@@ -3645,6 +3645,8 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct ...@@ -3645,6 +3645,8 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
if (data) if (data)
{ {
unsigned int sub_count = level_count * layer_count; unsigned int sub_count = level_count * layer_count;
unsigned int level, width, height, depth;
struct wined3d_box box;
unsigned int i; unsigned int i;
for (i = 0; i < sub_count; ++i) for (i = 0; i < sub_count; ++i)
...@@ -3660,8 +3662,14 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct ...@@ -3660,8 +3662,14 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
for (i = 0; i < sub_count; ++i) for (i = 0; i < sub_count; ++i)
{ {
wined3d_device_update_sub_resource(device, &object->resource, level = i % object->level_count;
i, NULL, data[i].data, data[i].row_pitch, data[i].slice_pitch, 0); width = wined3d_texture_get_level_width(object, level);
height = wined3d_texture_get_level_height(object, level);
depth = wined3d_texture_get_level_depth(object, level);
wined3d_box_set(&box, 0, 0, width, height, 0, depth);
wined3d_cs_emit_update_sub_resource(device->cs, &object->resource,
i, &box, data[i].data, data[i].row_pitch, data[i].slice_pitch);
} }
} }
......
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