Henri Verbeet : wined3d: Move the "tid" field from struct wined3d_context to struct wined3d_context_gl.
Alexandre Julliard
julliard at winehq.org
Mon Jun 10 13:43:53 CDT 2019
Module: wine
Branch: master
Commit: 0781596cb66f20befacf8c607ef19a0cc9edbb05
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0781596cb66f20befacf8c607ef19a0cc9edbb05
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Fri Jun 7 17:40:27 2019 +0430
wined3d: Move the "tid" field from struct wined3d_context to struct wined3d_context_gl.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/context.c | 6 +++---
dlls/wined3d/swapchain.c | 2 +-
dlls/wined3d/wined3d_private.h | 3 ++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 2e56284..8744570 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1917,7 +1917,6 @@ static void wined3d_context_init(struct wined3d_context *context, struct wined3d
context->swapchain = swapchain;
context->current_rt.texture = swapchain->front_buffer;
context->current_rt.sub_resource_idx = 0;
- context->tid = GetCurrentThreadId();
context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL)
| (1u << WINED3D_SHADER_TYPE_VERTEX)
@@ -1956,6 +1955,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
gl_info = context->gl_info;
d3d_info = context->d3d_info;
+ context_gl->tid = GetCurrentThreadId();
context_gl->window = context->swapchain->win_handle;
if (!(context_gl->dc = GetDCEx(context_gl->window, 0, DCX_USESTYLE | DCX_CACHE)))
{
@@ -2324,7 +2324,7 @@ void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl)
device_context_remove(device, &context_gl->c);
- if (context_gl->c.current && context_gl->c.tid != GetCurrentThreadId())
+ if (context_gl->c.current && context_gl->tid != GetCurrentThreadId())
{
struct wined3d_gl_info *gl_info;
@@ -4264,7 +4264,7 @@ struct wined3d_context_gl *wined3d_context_gl_reacquire(struct wined3d_context_g
struct wined3d_context *acquired_context;
struct wined3d_device *device;
- if (!context_gl || context_gl->c.tid != GetCurrentThreadId())
+ if (!context_gl || context_gl->tid != GetCurrentThreadId())
return NULL;
device = context_gl->c.device;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index c18f730..dd9ec12 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -1126,7 +1126,7 @@ struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchai
for (i = 0; i < swapchain->num_contexts; ++i)
{
- if (swapchain->context[i]->tid == tid)
+ if (wined3d_context_gl(swapchain->context[i])->tid == tid)
return swapchain->context[i];
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8272a56..4471e7c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1900,7 +1900,6 @@ struct wined3d_context
struct wined3d_texture *texture;
unsigned int sub_resource_idx;
} current_rt;
- DWORD tid; /* Thread ID which owns this context at the moment */
/* Stores some information about the context state for optimization */
DWORD shader_update_mask : 6; /* WINED3D_SHADER_TYPE_COUNT, 6 */
@@ -1967,6 +1966,8 @@ struct wined3d_context_gl
{
struct wined3d_context c;
+ DWORD tid; /* Thread ID which owns this context at the moment. */
+
uint32_t dc_is_private : 1;
uint32_t dc_has_format : 1; /* Only meaningful for private DCs. */
uint32_t fog_enabled : 1;
More information about the wine-cvs
mailing list