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

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2019-06-07 17:22:27 +04:30 committed by Alexandre Julliard
parent f33a33700d
commit 0781596cb6
3 changed files with 6 additions and 5 deletions

View File

@ -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;

View File

@ -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];
}

View File

@ -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;