diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 32a876e6..1561e751 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -374,6 +374,7 @@ patch_enable_all () enable_wined3d_DXTn="$1" enable_wined3d_Limit_Vram="$1" enable_wined3d_QUERY_Stubs="$1" + enable_wined3d_Revert_Texture_Upload="$1" enable_wined3d_Silence_FIXMEs="$1" enable_wined3d_WINED3DFMT_R32G32_UINT="$1" enable_wined3d_check_format_support="$1" @@ -1305,6 +1306,9 @@ patch_enable () wined3d-QUERY_Stubs) enable_wined3d_QUERY_Stubs="$2" ;; + wined3d-Revert_Texture_Upload) + enable_wined3d_Revert_Texture_Upload="$2" + ;; wined3d-Silence_FIXMEs) enable_wined3d_Silence_FIXMEs="$2" ;; @@ -7495,6 +7499,18 @@ if test "$enable_wined3d_Limit_Vram" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-Revert_Texture_Upload +# | +# | Modified files: +# | * dlls/wined3d/texture.c +# | +if test "$enable_wined3d_Revert_Texture_Upload" -eq 1; then + patch_apply wined3d-Revert_Texture_Upload/0001-Revert-wined3d-Implement-the-initial-texture-data-up.patch + ( + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Implement the initial texture data upload on top of wined3d_device_update_sub_resource().\".", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-WINED3DFMT_R32G32_UINT # | # | Modified files: diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 9928fd6c..78ee5c5c 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -7873,7 +7873,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->resource.map_binding = WINED3D_LOCATION_BUFFER; } -@@ -3344,13 +3841,47 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct +@@ -3355,13 +3852,47 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct return WINED3D_OK; } @@ -7921,7 +7921,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); -@@ -3375,6 +3906,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -3386,6 +3917,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) return WINED3DERR_INVALIDCALL; @@ -7929,7 +7929,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (device->d3d_initialized) context = context_acquire(device, NULL); -@@ -3397,6 +3929,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -3408,6 +3940,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i TRACE("Returning dc %p.\n", *dc); return hr; @@ -7962,7 +7962,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) -@@ -3427,6 +3985,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -3438,6 +3996,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign return WINED3DERR_INVALIDCALL; } @@ -7970,7 +7970,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D)) wined3d_surface_destroy_dc(surface); -@@ -3435,6 +3994,9 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -3446,6 +4005,9 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign wined3d_texture_update_map_binding(texture); if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE; diff --git a/patches/wined3d-Revert_Texture_Upload/0001-Revert-wined3d-Implement-the-initial-texture-data-up.patch b/patches/wined3d-Revert_Texture_Upload/0001-Revert-wined3d-Implement-the-initial-texture-data-up.patch new file mode 100644 index 00000000..9ac168ef --- /dev/null +++ b/patches/wined3d-Revert_Texture_Upload/0001-Revert-wined3d-Implement-the-initial-texture-data-up.patch @@ -0,0 +1,50 @@ +From 364b6bf5c142544b442c6d69911839edca9e994b Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 21 Sep 2016 01:18:41 +0200 +Subject: Revert "wined3d: Implement the initial texture data upload on top of + wined3d_device_update_sub_resource()." + +This reverts commit e58689a3981fae5b312b12e9f6801adf289d04c0. +--- + dlls/wined3d/texture.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +index c82016e5..dddd2fa 100644 +--- a/dlls/wined3d/texture.c ++++ b/dlls/wined3d/texture.c +@@ -2828,6 +2828,7 @@ 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) +@@ -2841,11 +2842,21 @@ 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) + { +- wined3d_device_update_sub_resource(device, &object->resource, +- i, NULL, data[i].data, data[i].row_pitch, data[i].slice_pitch); ++ 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); + } ++ ++ context_release(context); + } + + TRACE("Created texture %p.\n", object); +-- +2.9.0 + diff --git a/patches/wined3d-Revert_Texture_Upload/definition b/patches/wined3d-Revert_Texture_Upload/definition new file mode 100644 index 00000000..55083e4b --- /dev/null +++ b/patches/wined3d-Revert_Texture_Upload/definition @@ -0,0 +1,2 @@ +Fixes: Fix initial texture upload for 1D/3D textures +# FIXME: Needs support in wined3d_device_update_sub_resource.