Commit 0781596c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move the "tid" field from struct wined3d_context to struct wined3d_context_gl.

parent f33a3370
...@@ -1917,7 +1917,6 @@ static void wined3d_context_init(struct wined3d_context *context, struct wined3d ...@@ -1917,7 +1917,6 @@ static void wined3d_context_init(struct wined3d_context *context, struct wined3d
context->swapchain = swapchain; context->swapchain = swapchain;
context->current_rt.texture = swapchain->front_buffer; context->current_rt.texture = swapchain->front_buffer;
context->current_rt.sub_resource_idx = 0; context->current_rt.sub_resource_idx = 0;
context->tid = GetCurrentThreadId();
context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL)
| (1u << WINED3D_SHADER_TYPE_VERTEX) | (1u << WINED3D_SHADER_TYPE_VERTEX)
...@@ -1956,6 +1955,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi ...@@ -1956,6 +1955,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
gl_info = context->gl_info; gl_info = context->gl_info;
d3d_info = context->d3d_info; d3d_info = context->d3d_info;
context_gl->tid = GetCurrentThreadId();
context_gl->window = context->swapchain->win_handle; context_gl->window = context->swapchain->win_handle;
if (!(context_gl->dc = GetDCEx(context_gl->window, 0, DCX_USESTYLE | DCX_CACHE))) 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) ...@@ -2324,7 +2324,7 @@ void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl)
device_context_remove(device, &context_gl->c); 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; struct wined3d_gl_info *gl_info;
...@@ -4264,7 +4264,7 @@ struct wined3d_context_gl *wined3d_context_gl_reacquire(struct wined3d_context_g ...@@ -4264,7 +4264,7 @@ struct wined3d_context_gl *wined3d_context_gl_reacquire(struct wined3d_context_g
struct wined3d_context *acquired_context; struct wined3d_context *acquired_context;
struct wined3d_device *device; struct wined3d_device *device;
if (!context_gl || context_gl->c.tid != GetCurrentThreadId()) if (!context_gl || context_gl->tid != GetCurrentThreadId())
return NULL; return NULL;
device = context_gl->c.device; device = context_gl->c.device;
......
...@@ -1126,7 +1126,7 @@ struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchai ...@@ -1126,7 +1126,7 @@ struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchai
for (i = 0; i < swapchain->num_contexts; ++i) 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]; return swapchain->context[i];
} }
......
...@@ -1900,7 +1900,6 @@ struct wined3d_context ...@@ -1900,7 +1900,6 @@ struct wined3d_context
struct wined3d_texture *texture; struct wined3d_texture *texture;
unsigned int sub_resource_idx; unsigned int sub_resource_idx;
} current_rt; } current_rt;
DWORD tid; /* Thread ID which owns this context at the moment */
/* Stores some information about the context state for optimization */ /* Stores some information about the context state for optimization */
DWORD shader_update_mask : 6; /* WINED3D_SHADER_TYPE_COUNT, 6 */ DWORD shader_update_mask : 6; /* WINED3D_SHADER_TYPE_COUNT, 6 */
...@@ -1967,6 +1966,8 @@ struct wined3d_context_gl ...@@ -1967,6 +1966,8 @@ struct wined3d_context_gl
{ {
struct wined3d_context c; struct wined3d_context c;
DWORD tid; /* Thread ID which owns this context at the moment. */
uint32_t dc_is_private : 1; uint32_t dc_is_private : 1;
uint32_t dc_has_format : 1; /* Only meaningful for private DCs. */ uint32_t dc_has_format : 1; /* Only meaningful for private DCs. */
uint32_t fog_enabled : 1; uint32_t fog_enabled : 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment