Module: wine Branch: master Commit: e58689a3981fae5b312b12e9f6801adf289d04c0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e58689a3981fae5b312b12e9f6... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Sep 20 11:41:37 2016 +0200 wined3d: Implement the initial texture data upload on top of wined3d_device_update_sub_resource(). The idea is that wined3d_device_update_sub_resource() would get sent through the command stream, while the current implementation wouldn't. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index a13f2c6..8e5a5f1 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2821,7 +2821,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct if (data) { unsigned int sub_count = level_count * layer_count; - struct wined3d_context *context; unsigned int i; for (i = 0; i < sub_count; ++i) @@ -2835,21 +2834,11 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct } } - context = context_acquire(device, NULL); - - wined3d_texture_prepare_texture(object, context, FALSE); - wined3d_texture_bind_and_dirtify(object, context, FALSE); - for (i = 0; i < sub_count; ++i) { - const struct wined3d_const_bo_address addr = {0, data[i].data}; - - wined3d_texture_upload_data(object, i, context, &addr, data[i].row_pitch, data[i].slice_pitch); - wined3d_texture_validate_location(object, i, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_invalidate_location(object, i, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_device_update_sub_resource(device, &object->resource, + i, NULL, data[i].data, data[i].row_pitch, data[i].slice_pitch); } - - context_release(context); } TRACE("Created texture %p.\n", object);