You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-12-15 08:03:15 -08:00
Rebase against d00f7315e0cec0c2fe34ba5ab2b55cf5718860dd.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From b79fac0cba54644719f1993f48550212666185ee Mon Sep 17 00:00:00 2001
|
||||
From 821cc7c5d0922b0e3eea0e2ce8d5dcc37ecca6d3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Tue, 1 Oct 2013 14:31:56 +0200
|
||||
Subject: wined3d: Hackily introduce a multithreaded command stream
|
||||
@@ -14,7 +14,7 @@ Subject: wined3d: Hackily introduce a multithreaded command stream
|
||||
7 files changed, 517 insertions(+), 67 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
|
||||
index 8cb90b796b8..b1b57a261a3 100644
|
||||
index dc9f77f302e..6197ea2ce8a 100644
|
||||
--- a/dlls/d3d10core/tests/device.c
|
||||
+++ b/dlls/d3d10core/tests/device.c
|
||||
@@ -3772,7 +3772,7 @@ static void test_occlusion_query(void)
|
||||
@@ -27,10 +27,10 @@ index 8cb90b796b8..b1b57a261a3 100644
|
||||
memset(&data, 0xff, sizeof(data));
|
||||
hr = ID3D10Asynchronous_GetData(query, &data, sizeof(DWORD), 0);
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index e477f220817..380224e2de7 100644
|
||||
index ab3fa83a103..be7ef5b3b1a 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -5255,7 +5255,7 @@ static void test_occlusion_query(void)
|
||||
@@ -5271,7 +5271,7 @@ static void test_occlusion_query(void)
|
||||
memset(&data, 0xff, sizeof(data));
|
||||
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
@@ -39,7 +39,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
memset(&data, 0xff, sizeof(data));
|
||||
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(DWORD), 0);
|
||||
@@ -9543,7 +9543,7 @@ static void test_draw_uav_only(void)
|
||||
@@ -9606,7 +9606,7 @@ static void test_draw_uav_only(void)
|
||||
draw_quad(&test_context);
|
||||
draw_quad(&test_context);
|
||||
draw_quad(&test_context);
|
||||
@@ -48,7 +48,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
ID3D11PixelShader_Release(ps);
|
||||
ID3D11Texture2D_Release(texture);
|
||||
@@ -13215,12 +13215,12 @@ static void test_cs_uav_store(void)
|
||||
@@ -13278,12 +13278,12 @@ static void test_cs_uav_store(void)
|
||||
ID3D11DeviceContext_CSSetShader(context, cs, NULL, 0);
|
||||
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -63,7 +63,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13228,19 +13228,19 @@ static void test_cs_uav_store(void)
|
||||
@@ -13291,19 +13291,19 @@ static void test_cs_uav_store(void)
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_CSSetShader(context, NULL, NULL, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -86,7 +86,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13251,17 +13251,17 @@ static void test_cs_uav_store(void)
|
||||
@@ -13314,17 +13314,17 @@ static void test_cs_uav_store(void)
|
||||
input.x = 1.0f;
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, texture_desc.Width, texture_desc.Height, 1);
|
||||
@@ -108,7 +108,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13273,16 +13273,16 @@ static void test_cs_uav_store(void)
|
||||
@@ -13336,16 +13336,16 @@ static void test_cs_uav_store(void)
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, 15, 15, 1);
|
||||
SetRect(&rect, 0, 0, 60, 60);
|
||||
@@ -129,7 +129,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13293,12 +13293,12 @@ static void test_cs_uav_store(void)
|
||||
@@ -13356,12 +13356,12 @@ static void test_cs_uav_store(void)
|
||||
input.x = 0.3f;
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -144,7 +144,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13451,10 +13451,10 @@ static void test_ps_cs_uav_binding(void)
|
||||
@@ -13514,10 +13514,10 @@ static void test_ps_cs_uav_binding(void)
|
||||
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
|
||||
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -157,7 +157,7 @@ index e477f220817..380224e2de7 100644
|
||||
check_texture_float(ps_texture, 1.0f, 2);
|
||||
|
||||
input.x = 0.5f;
|
||||
@@ -13473,10 +13473,10 @@ static void test_ps_cs_uav_binding(void)
|
||||
@@ -13536,10 +13536,10 @@ static void test_ps_cs_uav_binding(void)
|
||||
input.x = 4.0f;
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)ps_cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -171,7 +171,7 @@ index e477f220817..380224e2de7 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index 778cd4679ff..d3b8c24f511 100644
|
||||
index b73c992d854..8483a28283f 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -1353,6 +1353,9 @@ void context_release(struct wined3d_context *context)
|
||||
@@ -184,9 +184,9 @@ index 778cd4679ff..d3b8c24f511 100644
|
||||
if (!--context->level)
|
||||
{
|
||||
if (context_restore_pixel_format(context))
|
||||
@@ -3692,6 +3695,13 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str
|
||||
@@ -3702,6 +3705,13 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device,
|
||||
|
||||
TRACE("device %p, target %p.\n", device, target);
|
||||
TRACE("device %p, texture %p, sub_resource_idx %u.\n", device, texture, sub_resource_idx);
|
||||
|
||||
+ if (wined3d_settings.cs_multithreaded && device->cs->thread_id != GetCurrentThreadId())
|
||||
+ {
|
||||
@@ -1231,10 +1231,10 @@ index 3a46a3c9a30..aabcb675044 100644
|
||||
HeapFree(GetProcessHeap(), 0, cs->data);
|
||||
HeapFree(GetProcessHeap(), 0, cs);
|
||||
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
index 3bdba105105..abb4a664c1a 100644
|
||||
index 880f82f12ce..90208e607f3 100644
|
||||
--- a/dlls/wined3d/query.c
|
||||
+++ b/dlls/wined3d/query.c
|
||||
@@ -347,7 +347,7 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query,
|
||||
@@ -350,7 +350,7 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query,
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@@ -1274,7 +1274,7 @@ index e7962465279..a8409cfd4b8 100644
|
||||
if (hkey) RegCloseKey( hkey );
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 0931d6aea95..684a04716dd 100644
|
||||
index 02e9d949db9..9d969287efc 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -306,6 +306,7 @@ struct wined3d_settings
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 04ea21a9ee8a73a1c463118a26f315cbe83d5fbf Mon Sep 17 00:00:00 2001
|
||||
From ff5e660a852ffa512b61f5bf3f8755376fec0370 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 10 Apr 2013 20:09:55 +0200
|
||||
Subject: wined3d: Wait for the cs to finish before destroying the device
|
||||
@@ -8,19 +8,19 @@ Subject: wined3d: Wait for the cs to finish before destroying the device
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index d20906e7cc5..71701a816da 100644
|
||||
index b1ecc73f9f3..a410e7e2be5 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -1130,6 +1130,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
@@ -1192,6 +1192,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
if (!device->d3d_initialized)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ device->cs->ops->submit_and_wait(device->cs);
|
||||
+
|
||||
/* I don't think that the interface guarantees that the device is destroyed from the same thread
|
||||
* it was created. Thus make sure a context is active for the glDelete* calls
|
||||
*/
|
||||
if (device->logo_texture)
|
||||
wined3d_texture_decref(device->logo_texture);
|
||||
if (device->cursor_texture)
|
||||
--
|
||||
2.11.0
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ index 4fcc496bb2d..e236edd97f2 100644
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
- context = context_acquire(device, NULL);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
- /* We only have to do this if we need to read the, swapbuffers performs a flush for us */
|
||||
- context->gl_info->gl_ops.gl.p_glFlush();
|
||||
- /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever
|
||||
|
||||
@@ -44,7 +44,7 @@ index 3747197a26e..9f7f8455a01 100644
|
||||
+ const struct wined3d_cs_update_texture *op = data;
|
||||
+ struct wined3d_context *context;
|
||||
+
|
||||
+ context = context_acquire(cs->device, NULL);
|
||||
+ context = context_acquire(cs->device, NULL, 0);
|
||||
+ device_exec_update_texture(context, op->src, op->dst);
|
||||
+ context_release(context);
|
||||
+
|
||||
@@ -118,7 +118,7 @@ index e236edd97f2..f712113e86e 100644
|
||||
- return WINED3DERR_INVALIDCALL;
|
||||
- }
|
||||
-
|
||||
- context = context_acquire(device, NULL);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
+ TRACE("context %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n",
|
||||
+ context, src_texture, src_level, dst_texture, level_count);
|
||||
|
||||
@@ -251,7 +251,7 @@ index e236edd97f2..f712113e86e 100644
|
||||
}
|
||||
|
||||
- /* Make sure that the destination texture is loaded. */
|
||||
- context = context_acquire(device, NULL);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
- wined3d_texture_load(dst_texture, context, FALSE);
|
||||
- context_release(context);
|
||||
-
|
||||
|
||||
@@ -60,7 +60,7 @@ index 9f7f8455a01..f021b9320e5 100644
|
||||
+ addr.buffer_object = 0;
|
||||
+ addr.addr = op->data;
|
||||
+
|
||||
+ context = context_acquire(texture->resource.device, NULL);
|
||||
+ context = context_acquire(texture->resource.device, NULL, 0);
|
||||
+
|
||||
+ /* Only load the sub-resource for partial updates. */
|
||||
+ if (!op->box || (!op->box->left && !op->box->top && !op->box->front
|
||||
@@ -131,7 +131,7 @@ index 4f4221c1223..a6b2996f112 100644
|
||||
- addr.buffer_object = 0;
|
||||
- addr.addr = data;
|
||||
-
|
||||
- context = context_acquire(resource->device, NULL);
|
||||
- context = context_acquire(resource->device, NULL, 0);
|
||||
-
|
||||
- /* Only load the sub-resource for partial updates. */
|
||||
- if (!box || (!box->left && !box->top && !box->front
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
From 2fb94b8d1c47c38586073f1fb8a7355c827e4082 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 2 Oct 2013 23:28:56 +0200
|
||||
Subject: wined3d: Unload resources through the CS in uninit_3d.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 6395aaea6be..082489c295e 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -1153,6 +1153,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
wined3d_cs_emit_unload_resource(device->cs, resource);
|
||||
}
|
||||
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ device->cs->ops->submit_and_wait(device->cs);
|
||||
+
|
||||
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
|
||||
|
||||
/* Destroy the depth blt resources, they will be invalid after the reset. Also free shader
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -123,7 +123,7 @@ index 1b4fa46b55e..e9641b95099 100644
|
||||
+ HRESULT hr = WINED3D_OK;
|
||||
+
|
||||
+ if (device->d3d_initialized)
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ context = context_acquire(device, NULL, 0);
|
||||
+
|
||||
+ wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding);
|
||||
+ wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
|
||||
@@ -159,7 +159,7 @@ index 1b4fa46b55e..e9641b95099 100644
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
- if (device->d3d_initialized)
|
||||
- context = context_acquire(device, NULL);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
-
|
||||
- wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding);
|
||||
- wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From b8980974b1117ed0b1b792118e64265d2de984ff Mon Sep 17 00:00:00 2001
|
||||
From c3cc04eaa9c6274fdc189d39d995e2cfccab489a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 10 Oct 2013 16:29:42 +0200
|
||||
Subject: wined3d: Create dummy textures through the CS.
|
||||
@@ -13,10 +13,10 @@ crash.
|
||||
4 files changed, 51 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 045e2fa54f2..2e67b720f56 100644
|
||||
index 507496cace1..ab3fa83a103 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -13205,12 +13205,12 @@ static void test_cs_uav_store(void)
|
||||
@@ -13278,12 +13278,12 @@ static void test_cs_uav_store(void)
|
||||
ID3D11DeviceContext_CSSetShader(context, cs, NULL, 0);
|
||||
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -31,7 +31,7 @@ index 045e2fa54f2..2e67b720f56 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13218,19 +13218,19 @@ static void test_cs_uav_store(void)
|
||||
@@ -13291,19 +13291,19 @@ static void test_cs_uav_store(void)
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_CSSetShader(context, NULL, NULL, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -54,7 +54,7 @@ index 045e2fa54f2..2e67b720f56 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13241,17 +13241,17 @@ static void test_cs_uav_store(void)
|
||||
@@ -13314,17 +13314,17 @@ static void test_cs_uav_store(void)
|
||||
input.x = 1.0f;
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, texture_desc.Width, texture_desc.Height, 1);
|
||||
@@ -76,7 +76,7 @@ index 045e2fa54f2..2e67b720f56 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13263,16 +13263,16 @@ static void test_cs_uav_store(void)
|
||||
@@ -13336,16 +13336,16 @@ static void test_cs_uav_store(void)
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, 15, 15, 1);
|
||||
SetRect(&rect, 0, 0, 60, 60);
|
||||
@@ -97,7 +97,7 @@ index 045e2fa54f2..2e67b720f56 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13283,12 +13283,12 @@ static void test_cs_uav_store(void)
|
||||
@@ -13356,12 +13356,12 @@ static void test_cs_uav_store(void)
|
||||
input.x = 0.3f;
|
||||
ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -112,7 +112,7 @@ index 045e2fa54f2..2e67b720f56 100644
|
||||
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
@@ -13441,10 +13441,10 @@ static void test_ps_cs_uav_binding(void)
|
||||
@@ -13514,10 +13514,10 @@ static void test_ps_cs_uav_binding(void)
|
||||
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
|
||||
|
||||
ID3D11DeviceContext_Dispatch(context, 1, 1, 1);
|
||||
@@ -126,7 +126,7 @@ index 045e2fa54f2..2e67b720f56 100644
|
||||
|
||||
input.x = 0.5f;
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 9b267871a37..3a6bfe4d38a 100644
|
||||
index 7f5339599d8..bf6adf4be71 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -85,6 +85,7 @@ enum wined3d_cs_op
|
||||
@@ -149,14 +149,14 @@ index 9b267871a37..3a6bfe4d38a 100644
|
||||
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
|
||||
|
||||
@@ -2323,6 +2329,27 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
|
||||
@@ -2331,6 +2337,27 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
|
||||
return hr;
|
||||
}
|
||||
|
||||
+static UINT wined3d_cs_exec_create_dummy_textures(struct wined3d_cs *cs, const void *data)
|
||||
+{
|
||||
+ const struct wined3d_cs_create_dummy_textures *op = data;
|
||||
+ struct wined3d_context *context = context_acquire(cs->device, NULL);
|
||||
+ struct wined3d_context *context = context_acquire(cs->device, NULL, 0);
|
||||
+
|
||||
+ device_create_dummy_textures(cs->device, context);
|
||||
+
|
||||
@@ -177,7 +177,7 @@ index 9b267871a37..3a6bfe4d38a 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
|
||||
@@ -2373,6 +2400,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2381,6 +2408,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
|
||||
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
|
||||
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
|
||||
@@ -186,10 +186,10 @@ index 9b267871a37..3a6bfe4d38a 100644
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index b62d3ba473f..4f5a45c1f60 100644
|
||||
index 9c69d04c3f0..008be8ae010 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -607,7 +607,7 @@ out:
|
||||
@@ -610,7 +610,7 @@ out:
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -198,12 +198,21 @@ index b62d3ba473f..4f5a45c1f60 100644
|
||||
{
|
||||
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
@@ -1038,17 +1038,15 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
|
||||
@@ -1029,7 +1029,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
|
||||
|
||||
target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer;
|
||||
context = context_acquire(device, target, 0);
|
||||
- create_dummy_textures(device, context);
|
||||
+ device_create_dummy_textures(device, context);
|
||||
create_default_samplers(device, context);
|
||||
context_release(context);
|
||||
|
||||
@@ -1106,17 +1106,15 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
|
||||
device->swapchains[0] = swapchain;
|
||||
device_init_swapchain_state(device, swapchain);
|
||||
|
||||
+ wined3d_cs_emit_create_dummy_textures(device->cs);
|
||||
context = context_acquire(device, NULL);
|
||||
context = context_acquire(device, NULL, 0);
|
||||
-
|
||||
- create_dummy_textures(device, context);
|
||||
create_default_samplers(device, context);
|
||||
@@ -218,17 +227,8 @@ index b62d3ba473f..4f5a45c1f60 100644
|
||||
/* Clear the screen */
|
||||
if (swapchain->back_buffers && swapchain->back_buffers[0])
|
||||
clear_flags |= WINED3DCLEAR_TARGET;
|
||||
@@ -4758,7 +4756,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
|
||||
|
||||
swapchain->context[0] = context;
|
||||
swapchain->num_contexts = 1;
|
||||
- create_dummy_textures(device, context);
|
||||
+ device_create_dummy_textures(device, context);
|
||||
create_default_samplers(device, context);
|
||||
context_release(context);
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 1ccb02544ce..e6d349b8186 100644
|
||||
index 2d0a97f706c..efd4a4dfd6d 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2672,6 +2672,7 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From dd497359d661b8ca14cdeb83140f569bab3632e1 Mon Sep 17 00:00:00 2001
|
||||
From 716641434adb8c9e8c9dc940d5a3a1f82c147de2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 10 Oct 2013 18:40:04 +0200
|
||||
Subject: wined3d: Recreate ctx and dummy textures through the CS after resets.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 23 +++++------------------
|
||||
1 file changed, 5 insertions(+), 18 deletions(-)
|
||||
dlls/wined3d/device.c | 15 +++++++++++----
|
||||
1 file changed, 11 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index f3b74bb5a45..fe9c524d36c 100644
|
||||
index 008be8ae010..1427e4c85ef 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -4711,7 +4711,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
|
||||
@@ -1010,7 +1010,6 @@ static void wined3d_device_delete_opengl_contexts(struct wined3d_device *device)
|
||||
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
struct wined3d_context *context;
|
||||
@@ -19,38 +19,24 @@ index f3b74bb5a45..fe9c524d36c 100644
|
||||
HRESULT hr;
|
||||
|
||||
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
|
||||
@@ -4728,29 +4727,17 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
|
||||
@@ -1027,9 +1026,17 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
|
||||
return hr;
|
||||
}
|
||||
|
||||
- /* Recreate the primary swapchain's context */
|
||||
- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context));
|
||||
- if (!swapchain->context)
|
||||
- {
|
||||
- ERR("Failed to allocate memory for swapchain context array.\n");
|
||||
- device->blitter->free_private(device);
|
||||
- device->shader_backend->shader_free_private(device);
|
||||
- return E_OUTOFMEMORY;
|
||||
- }
|
||||
-
|
||||
- target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer;
|
||||
- if (!(context = context_create(swapchain, target, swapchain->ds_format)))
|
||||
- context = context_acquire(device, target, 0);
|
||||
- device_create_dummy_textures(device, context);
|
||||
+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
|
||||
+ if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to create context.\n");
|
||||
device->blitter->free_private(device);
|
||||
device->shader_backend->shader_free_private(device);
|
||||
- HeapFree(GetProcessHeap(), 0, swapchain->context);
|
||||
- return E_FAIL;
|
||||
+ {
|
||||
+ WARN("Failed to create context.\n");
|
||||
+ device->blitter->free_private(device);
|
||||
+ device->shader_backend->shader_free_private(device);
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
- swapchain->context[0] = context;
|
||||
- swapchain->num_contexts = 1;
|
||||
- device_create_dummy_textures(device, context);
|
||||
+ }
|
||||
+
|
||||
+ wined3d_cs_emit_create_dummy_textures(device->cs);
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ context = context_acquire(device, NULL, 0);
|
||||
create_default_samplers(device, context);
|
||||
context_release(context);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From aa4fb9f42031758a65fc644884ab638799bb2264 Mon Sep 17 00:00:00 2001
|
||||
From 0c7a163631a32c68e50a24a4353665edf19c8f4f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
|
||||
Date: Sat, 7 May 2016 21:16:47 +0100
|
||||
Subject: wined3d: Call create_default_sampler from create_dummy_textures.
|
||||
@@ -9,10 +9,10 @@ I should really rename it, don't feel like it now.
|
||||
1 file changed, 34 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index fe9c524d36c..33955e3f3f4 100644
|
||||
index 1427e4c85ef..7bb9895f90d 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -607,6 +607,39 @@ out:
|
||||
@@ -610,6 +610,39 @@ out:
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -52,7 +52,7 @@ index fe9c524d36c..33955e3f3f4 100644
|
||||
void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context)
|
||||
{
|
||||
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
|
||||
@@ -741,6 +774,7 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
||||
@@ -744,6 +777,7 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_
|
||||
}
|
||||
|
||||
context_bind_dummy_textures(device, context);
|
||||
@@ -60,7 +60,7 @@ index fe9c524d36c..33955e3f3f4 100644
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -775,39 +809,6 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
||||
@@ -778,39 +812,6 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -100,25 +100,7 @@ index fe9c524d36c..33955e3f3f4 100644
|
||||
static void destroy_default_samplers(struct wined3d_device *device, struct wined3d_context *context)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
@@ -974,7 +975,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
|
||||
static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
struct wined3d_swapchain *swapchain = NULL;
|
||||
- struct wined3d_context *context;
|
||||
DWORD clear_flags = 0;
|
||||
HRESULT hr;
|
||||
|
||||
@@ -1039,9 +1039,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
|
||||
device_init_swapchain_state(device, swapchain);
|
||||
|
||||
wined3d_cs_emit_create_dummy_textures(device->cs);
|
||||
- context = context_acquire(device, NULL);
|
||||
- create_default_samplers(device, context);
|
||||
- context_release(context);
|
||||
|
||||
device->contexts[0]->last_was_rhw = 0;
|
||||
|
||||
@@ -4710,7 +4707,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
|
||||
@@ -1009,7 +1010,6 @@ static void wined3d_device_delete_opengl_contexts(struct wined3d_device *device)
|
||||
|
||||
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
@@ -126,16 +108,34 @@ index fe9c524d36c..33955e3f3f4 100644
|
||||
HRESULT hr;
|
||||
|
||||
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
|
||||
@@ -4737,9 +4733,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
|
||||
@@ -1036,9 +1036,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
|
||||
}
|
||||
|
||||
wined3d_cs_emit_create_dummy_textures(device->cs);
|
||||
- context = context_acquire(device, NULL);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
- create_default_samplers(device, context);
|
||||
- context_release(context);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -1049,7 +1046,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
|
||||
static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
struct wined3d_swapchain *swapchain = NULL;
|
||||
- struct wined3d_context *context;
|
||||
DWORD clear_flags = 0;
|
||||
HRESULT hr;
|
||||
|
||||
@@ -1114,9 +1110,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
|
||||
device_init_swapchain_state(device, swapchain);
|
||||
|
||||
wined3d_cs_emit_create_dummy_textures(device->cs);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
- create_default_samplers(device, context);
|
||||
- context_release(context);
|
||||
|
||||
device->contexts[0]->last_was_rhw = 0;
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
|
||||
@@ -90,8 +90,8 @@ index 5902feb88fa..93730acb906 100644
|
||||
- sampler->parent = parent;
|
||||
- sampler->desc = *desc;
|
||||
-
|
||||
- context = context_acquire(device, NULL);
|
||||
+ context = context_acquire(sampler->device, NULL);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
+ context = context_acquire(sampler->device, NULL, 0);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
GL_EXTCALL(glGenSamplers(1, &sampler->name));
|
||||
|
||||
@@ -46,7 +46,7 @@ index 3e385ddf736..cdd11e41c91 100644
|
||||
+ struct wined3d_texture *texture = op->texture;
|
||||
+ struct wined3d_context *context;
|
||||
+
|
||||
+ context = context_acquire(cs->device, NULL);
|
||||
+ context = context_acquire(cs->device, NULL, 0);
|
||||
+ if (!wined3d_texture_load_location(texture, op->sub_resource_idx, context, texture->resource.map_binding))
|
||||
+ {
|
||||
+ ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
|
||||
@@ -111,7 +111,7 @@ index b62fff8c503..1ff9cbb87c3 100644
|
||||
- if (dirty_region)
|
||||
- WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
|
||||
-
|
||||
- context = context_acquire(texture->resource.device, NULL);
|
||||
- context = context_acquire(texture->resource.device, NULL, 0);
|
||||
- if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding))
|
||||
- {
|
||||
- ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
|
||||
|
||||
@@ -157,7 +157,7 @@ index 1ff9cbb87c3..02119dee645 100644
|
||||
* general, but if a buffer object was previously created we can. */
|
||||
if (!context)
|
||||
- {
|
||||
context = context_acquire(device, NULL);
|
||||
context = context_acquire(device, NULL, 0);
|
||||
- gl_info = context->gl_info;
|
||||
- }
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,17 @@
|
||||
From 7888d0d12d9182cf9d5801cfe3b884f3f7a2708c Mon Sep 17 00:00:00 2001
|
||||
From 6473e74391c83d4035556251a0ff2e0c6904d6be Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 11 Oct 2013 10:11:13 +0200
|
||||
Subject: wined3d: Delete GL contexts through the CS in reset.
|
||||
|
||||
Let's see if this fixes the remaining fglrx crashes...
|
||||
---
|
||||
dlls/wined3d/cs.c | 29 ++++++++++++++++++++++++++++-
|
||||
dlls/wined3d/cs.c | 27 ++++++++++++++++++++++++++-
|
||||
dlls/wined3d/device.c | 25 ++++++++++++++-----------
|
||||
dlls/wined3d/wined3d_private.h | 4 ++++
|
||||
3 files changed, 46 insertions(+), 12 deletions(-)
|
||||
dlls/wined3d/wined3d_private.h | 2 ++
|
||||
3 files changed, 42 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index d65276072d4..1d7d6b9cd94 100644
|
||||
index 55c175ef093..cf59192bc4f 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -93,6 +93,7 @@ enum wined3d_cs_op
|
||||
@@ -22,20 +22,19 @@ index d65276072d4..1d7d6b9cd94 100644
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -521,6 +522,12 @@ struct wined3d_cs_create_texture_view
|
||||
@@ -521,6 +522,11 @@ struct wined3d_cs_create_texture_view
|
||||
const struct wined3d_format *view_format;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_delete_gl_contexts
|
||||
+{
|
||||
+ enum wined3d_cs_op opcode;
|
||||
+ struct wined3d_swapchain *swapchain;
|
||||
+};
|
||||
+
|
||||
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
|
||||
|
||||
@@ -2628,6 +2635,26 @@ void wined3d_cs_emit_create_texture_view(struct wined3d_cs *cs, struct wined3d_g
|
||||
@@ -2628,6 +2634,25 @@ void wined3d_cs_emit_create_texture_view(struct wined3d_cs *cs, struct wined3d_g
|
||||
cs->ops->submit_and_wait(cs);
|
||||
}
|
||||
|
||||
@@ -43,18 +42,17 @@ index d65276072d4..1d7d6b9cd94 100644
|
||||
+{
|
||||
+ const struct wined3d_cs_delete_gl_contexts *op = data;
|
||||
+
|
||||
+ device_delete_opengl_contexts_cs(cs->device, op->swapchain);
|
||||
+ device_delete_opengl_contexts_cs(cs->device);
|
||||
+
|
||||
+ return sizeof(*op);
|
||||
+}
|
||||
+
|
||||
+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
|
||||
+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs)
|
||||
+{
|
||||
+ struct wined3d_cs_delete_gl_contexts *op;
|
||||
+
|
||||
+ op = cs->ops->require_space(cs, sizeof(*op));
|
||||
+ op->opcode = WINED3D_CS_OP_DELETE_GL_CONTEXTS;
|
||||
+ op->swapchain = swapchain;
|
||||
+
|
||||
+ cs->ops->submit_and_wait(cs);
|
||||
+}
|
||||
@@ -62,7 +60,7 @@ index d65276072d4..1d7d6b9cd94 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
|
||||
@@ -2686,7 +2713,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2686,7 +2711,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_BUFFER_COPY */ wined3d_cs_exec_buffer_copy,
|
||||
/* WINED3D_CS_OP_CREATE_BUFFER_VIEW */ wined3d_cs_exec_create_buffer_view,
|
||||
/* WINED3D_CS_OP_CREATE_TEXTURE_VIEW */ wined3d_cs_exec_create_texture_view,
|
||||
@@ -72,18 +70,17 @@ index d65276072d4..1d7d6b9cd94 100644
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 3f5fd7988d4..880e6c002ac 100644
|
||||
index adcd8dd2486..b95c7837139 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -4635,22 +4635,12 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
|
||||
}
|
||||
@@ -971,21 +971,11 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
|
||||
wined3d_device_set_render_state(device, WINED3D_RS_ZENABLE, ds_enable);
|
||||
}
|
||||
|
||||
-static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
+void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
-static void wined3d_device_delete_opengl_contexts(struct wined3d_device *device)
|
||||
+void device_delete_opengl_contexts_cs(struct wined3d_device *device)
|
||||
{
|
||||
- struct wined3d_resource *resource, *cursor;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
struct wined3d_shader *shader;
|
||||
|
||||
@@ -99,11 +96,11 @@ index 3f5fd7988d4..880e6c002ac 100644
|
||||
LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry)
|
||||
{
|
||||
device->shader_backend->shader_destroy(shader);
|
||||
@@ -4684,6 +4674,19 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
|
||||
swapchain->context = NULL;
|
||||
@@ -1007,6 +997,19 @@ static void wined3d_device_delete_opengl_contexts(struct wined3d_device *device)
|
||||
}
|
||||
}
|
||||
|
||||
+static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
+static void wined3d_device_delete_opengl_contexts(struct wined3d_device *device)
|
||||
+{
|
||||
+ struct wined3d_resource *resource, *cursor;
|
||||
+
|
||||
@@ -113,31 +110,29 @@ index 3f5fd7988d4..880e6c002ac 100644
|
||||
+ wined3d_cs_emit_unload_resource(device->cs, resource);
|
||||
+ }
|
||||
+
|
||||
+ wined3d_cs_emit_delete_opengl_contexts(device->cs, swapchain);
|
||||
+ wined3d_cs_emit_delete_opengl_contexts(device->cs);
|
||||
+}
|
||||
+
|
||||
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
HRESULT hr;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 454a64eb2ff..2eb5bbeca29 100644
|
||||
index dad79e97ae2..abb4ce0ec52 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2708,6 +2708,8 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D
|
||||
@@ -2705,6 +2705,7 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D
|
||||
void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
|
||||
struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN;
|
||||
void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||
+void device_delete_opengl_contexts_cs(struct wined3d_device *device,
|
||||
+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
+void device_delete_opengl_contexts_cs(struct wined3d_device *device) DECLSPEC_HIDDEN;
|
||||
struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage,
|
||||
GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||
void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo,
|
||||
@@ -3270,6 +3272,8 @@ HRESULT wined3d_cs_emit_create_buffer_view(struct wined3d_cs *cs, struct wined3d
|
||||
@@ -3267,6 +3268,7 @@ HRESULT wined3d_cs_emit_create_buffer_view(struct wined3d_cs *cs, struct wined3d
|
||||
void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
|
||||
HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs,
|
||||
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs,
|
||||
+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_create_texture_view(struct wined3d_cs *cs, struct wined3d_gl_view *view,
|
||||
GLenum view_target, const struct wined3d_view_desc *desc, struct wined3d_texture *texture,
|
||||
const struct wined3d_format *view_format) DECLSPEC_HIDDEN;
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
From 7e94bce422efd1634e69cc8b9729cf0744672e4c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 11 Oct 2013 10:17:42 +0200
|
||||
Subject: wined3d: Delete GL contexts through the CS in uninit_3d.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 30 +++---------------------------
|
||||
1 file changed, 3 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 762ab2747c2..b990682a921 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -1110,8 +1110,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context)
|
||||
HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
{
|
||||
struct wined3d_resource *resource, *cursor;
|
||||
- const struct wined3d_gl_info *gl_info;
|
||||
- struct wined3d_context *context;
|
||||
UINT i;
|
||||
|
||||
TRACE("device %p.\n", device);
|
||||
@@ -1122,12 +1120,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
if (wined3d_settings.cs_multithreaded)
|
||||
device->cs->ops->submit_and_wait(device->cs);
|
||||
|
||||
- /* I don't think that the interface guarantees that the device is destroyed from the same thread
|
||||
- * it was created. Thus make sure a context is active for the glDelete* calls
|
||||
- */
|
||||
- context = context_acquire(device, NULL);
|
||||
- gl_info = context->gl_info;
|
||||
-
|
||||
if (device->logo_texture)
|
||||
wined3d_texture_decref(device->logo_texture);
|
||||
if (device->cursor_texture)
|
||||
@@ -1148,27 +1140,10 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
wined3d_cs_emit_unload_resource(device->cs, resource);
|
||||
}
|
||||
|
||||
- if (wined3d_settings.cs_multithreaded)
|
||||
- device->cs->ops->submit_and_wait(device->cs);
|
||||
-
|
||||
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
|
||||
|
||||
- /* Destroy the depth blt resources, they will be invalid after the reset. Also free shader
|
||||
- * private data, it might contain opengl pointers
|
||||
- */
|
||||
- if (device->depth_blt_texture)
|
||||
- {
|
||||
- gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture);
|
||||
- device->depth_blt_texture = 0;
|
||||
- }
|
||||
-
|
||||
- /* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */
|
||||
- device->blitter->free_private(device);
|
||||
- device->shader_backend->shader_free_private(device);
|
||||
- destroy_dummy_textures(device, context);
|
||||
- destroy_default_samplers(device, context);
|
||||
-
|
||||
- context_release(context);
|
||||
+ /* FIXME: Is this in the right place??? */
|
||||
+ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]);
|
||||
|
||||
if (device->back_buffer_view)
|
||||
{
|
||||
@@ -4658,6 +4633,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, swapchain->context);
|
||||
swapchain->context = NULL;
|
||||
+ swapchain->num_contexts = 0;
|
||||
}
|
||||
|
||||
static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 0c368a9fa4e1417a0f5114769fa0b9f44d35ebde Mon Sep 17 00:00:00 2001
|
||||
From 4f06f7af54f1be5fee2c40c9a8d79d6f3d393a4e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 7 Feb 2017 22:37:58 +0100
|
||||
Subject: wined3d: Map vertex buffers through cs.
|
||||
@@ -10,7 +10,7 @@ Subject: wined3d: Map vertex buffers through cs.
|
||||
3 files changed, 76 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 42779efe69d..42ce9bafb80 100644
|
||||
index c71019b06bf..bd1ea2594b6 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -94,6 +94,7 @@ enum wined3d_cs_op
|
||||
@@ -21,8 +21,8 @@ index 42779efe69d..42ce9bafb80 100644
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -528,6 +529,13 @@ struct wined3d_cs_delete_gl_contexts
|
||||
struct wined3d_swapchain *swapchain;
|
||||
@@ -527,6 +528,13 @@ struct wined3d_cs_delete_gl_contexts
|
||||
enum wined3d_cs_op opcode;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_map_vertex_buffers
|
||||
@@ -35,7 +35,7 @@ index 42779efe69d..42ce9bafb80 100644
|
||||
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
|
||||
|
||||
@@ -2655,6 +2663,70 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3
|
||||
@@ -2653,6 +2661,70 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs)
|
||||
cs->ops->submit_and_wait(cs);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ index 42779efe69d..42ce9bafb80 100644
|
||||
+ WORD map;
|
||||
+
|
||||
+ /* Need any context to write to the vbo. */
|
||||
+ context = context_acquire(cs->device, NULL);
|
||||
+ context = context_acquire(cs->device, NULL, 0);
|
||||
+ gl_info = context->gl_info;
|
||||
+
|
||||
+ vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
|
||||
@@ -106,7 +106,7 @@ index 42779efe69d..42ce9bafb80 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
|
||||
@@ -2714,6 +2786,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2712,6 +2784,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_CREATE_BUFFER_VIEW */ wined3d_cs_exec_create_buffer_view,
|
||||
/* WINED3D_CS_OP_CREATE_TEXTURE_VIEW */ wined3d_cs_exec_create_texture_view,
|
||||
/* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts,
|
||||
@@ -115,10 +115,10 @@ index 42779efe69d..42ce9bafb80 100644
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index ccfaa7f19e6..369fc47c097 100644
|
||||
index 9752912b1b0..5ef2886df06 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -2851,7 +2851,6 @@ void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *devic
|
||||
@@ -2916,7 +2916,6 @@ void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *devic
|
||||
wined3d_device_set_pipeline_unordered_access_view(device, WINED3D_PIPELINE_GRAPHICS, idx, uav);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ index ccfaa7f19e6..369fc47c097 100644
|
||||
#define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size)
|
||||
static HRESULT process_vertices_strided(const struct wined3d_device *device, DWORD dwDestIndex, DWORD dwCount,
|
||||
const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD flags,
|
||||
@@ -3127,14 +3126,8 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
|
||||
@@ -3192,14 +3191,8 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
|
||||
UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer,
|
||||
const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
|
||||
{
|
||||
@@ -141,12 +141,12 @@ index ccfaa7f19e6..369fc47c097 100644
|
||||
|
||||
TRACE("device %p, src_start_idx %u, dst_idx %u, vertex_count %u, "
|
||||
"dst_buffer %p, declaration %p, flags %#x, dst_fvf %#x.\n",
|
||||
@@ -3144,47 +3137,11 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
|
||||
@@ -3209,47 +3202,11 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
|
||||
if (declaration)
|
||||
FIXME("Output vertex declaration not implemented yet.\n");
|
||||
|
||||
- /* Need any context to write to the vbo. */
|
||||
- context = context_acquire(device, NULL);
|
||||
- context = context_acquire(device, NULL, 0);
|
||||
- gl_info = context->gl_info;
|
||||
-
|
||||
- vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
|
||||
@@ -191,10 +191,10 @@ index ccfaa7f19e6..369fc47c097 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index c1200b127c5..a6a3eca0da2 100644
|
||||
index 6d8495f1993..aa54fc3a3e6 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3359,6 +3359,8 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
|
||||
@@ -3354,6 +3354,8 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN;
|
||||
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource,
|
||||
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user