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

Fixes a regression introduced by commit
490c6d548a.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45996
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-10-18 12:26:33 +02:00 committed by Alexandre Julliard
parent 63cd3de5e8
commit 94f499335a
1 changed files with 10 additions and 2 deletions

View File

@ -3645,6 +3645,8 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
if (data)
{
unsigned int sub_count = level_count * layer_count;
unsigned int level, width, height, depth;
struct wined3d_box box;
unsigned int i;
for (i = 0; i < sub_count; ++i)
@ -3660,8 +3662,14 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
for (i = 0; i < sub_count; ++i)
{
wined3d_device_update_sub_resource(device, &object->resource,
i, NULL, data[i].data, data[i].row_pitch, data[i].slice_pitch, 0);
level = i % object->level_count;
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);
}
}