Commit de035b71 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move the WGL fields from struct wined3d_context to struct wined3d_context_gl.

parent 7d3eda57
...@@ -7879,7 +7879,7 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl ...@@ -7879,7 +7879,7 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl
if (dst_location == WINED3D_LOCATION_DRAWABLE) if (dst_location == WINED3D_LOCATION_DRAWABLE)
{ {
d = *dst_rect; d = *dst_rect;
wined3d_texture_translate_drawable_coords(dst_texture, context->win_handle, &d); wined3d_texture_translate_drawable_coords(dst_texture, context_gl->window, &d);
dst_rect = &d; dst_rect = &d;
} }
......
...@@ -13015,7 +13015,7 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli ...@@ -13015,7 +13015,7 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli
if (dst_location == WINED3D_LOCATION_DRAWABLE) if (dst_location == WINED3D_LOCATION_DRAWABLE)
{ {
d = *dst_rect; d = *dst_rect;
wined3d_texture_translate_drawable_coords(dst_texture, context->win_handle, &d); wined3d_texture_translate_drawable_coords(dst_texture, context_gl->window, &d);
dst_rect = &d; dst_rect = &d;
} }
......
...@@ -239,7 +239,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3 ...@@ -239,7 +239,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3
TRACE("Source texture %p is onscreen.\n", src_texture); TRACE("Source texture %p is onscreen.\n", src_texture);
buffer = wined3d_texture_get_gl_buffer(src_texture); buffer = wined3d_texture_get_gl_buffer(src_texture);
s = *src_rect; s = *src_rect;
wined3d_texture_translate_drawable_coords(src_texture, context->win_handle, &s); wined3d_texture_translate_drawable_coords(src_texture, context_gl->window, &s);
src_rect = &s; src_rect = &s;
} }
else else
...@@ -259,7 +259,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3 ...@@ -259,7 +259,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3
TRACE("Destination texture %p is onscreen.\n", dst_texture); TRACE("Destination texture %p is onscreen.\n", dst_texture);
buffer = wined3d_texture_get_gl_buffer(dst_texture); buffer = wined3d_texture_get_gl_buffer(dst_texture);
d = *dst_rect; d = *dst_rect;
wined3d_texture_translate_drawable_coords(dst_texture, context->win_handle, &d); wined3d_texture_translate_drawable_coords(dst_texture, context_gl->window, &d);
dst_rect = &d; dst_rect = &d;
} }
else else
...@@ -1056,12 +1056,12 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_texture_gl *dst_texture, ...@@ -1056,12 +1056,12 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_texture_gl *dst_texture,
/* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring. /* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring.
* This way we don't have to wait for the 2nd readback to finish to leave this function. * This way we don't have to wait for the 2nd readback to finish to leave this function.
*/ */
if (context->aux_buffers >= 2) if (context_gl->aux_buffers >= 2)
{ {
/* Got more than one aux buffer? Use the 2nd aux buffer */ /* Got more than one aux buffer? Use the 2nd aux buffer */
drawBuffer = GL_AUX1; drawBuffer = GL_AUX1;
} }
else if ((!src_offscreen || offscreen_buffer == GL_BACK) && context->aux_buffers >= 1) else if ((!src_offscreen || offscreen_buffer == GL_BACK) && context_gl->aux_buffers >= 1)
{ {
/* Only one aux buffer, but it isn't used (Onscreen rendering, or non-aux orm)? Use it! */ /* Only one aux buffer, but it isn't used (Onscreen rendering, or non-aux orm)? Use it! */
drawBuffer = GL_AUX0; drawBuffer = GL_AUX0;
...@@ -2241,7 +2241,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit ...@@ -2241,7 +2241,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
if (dst_location == WINED3D_LOCATION_DRAWABLE) if (dst_location == WINED3D_LOCATION_DRAWABLE)
{ {
r = *dst_rect; r = *dst_rect;
wined3d_texture_translate_drawable_coords(dst_texture, context->win_handle, &r); wined3d_texture_translate_drawable_coords(dst_texture, context_gl->window, &r);
dst_rect = &r; dst_rect = &r;
} }
......
...@@ -428,6 +428,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, ...@@ -428,6 +428,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
const struct wined3d_fb_state *fb = &swapchain->device->cs->fb; const struct wined3d_fb_state *fb = &swapchain->device->cs->fb;
struct wined3d_rendertarget_view *dsv = fb->depth_stencil; struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
const struct wined3d_gl_info *gl_info; const struct wined3d_gl_info *gl_info;
struct wined3d_context_gl *context_gl;
struct wined3d_texture *logo_texture; struct wined3d_texture *logo_texture;
struct wined3d_context *context; struct wined3d_context *context;
BOOL render_to_fbo; BOOL render_to_fbo;
...@@ -439,6 +440,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, ...@@ -439,6 +440,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
WARN("Invalid context, skipping present.\n"); WARN("Invalid context, skipping present.\n");
return; return;
} }
context_gl = wined3d_context_gl(context);
gl_info = context->gl_info; gl_info = context->gl_info;
...@@ -481,7 +483,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, ...@@ -481,7 +483,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT); WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT);
} }
TRACE("Presenting HDC %p.\n", context->hdc); TRACE("Presenting DC %p.\n", context_gl->dc);
if (!(render_to_fbo = swapchain->render_to_fbo) if (!(render_to_fbo = swapchain->render_to_fbo)
&& (src_rect->left || src_rect->top && (src_rect->left || src_rect->top
...@@ -518,7 +520,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, ...@@ -518,7 +520,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
gl_info->gl_ops.gl.p_glFinish(); gl_info->gl_ops.gl.p_glFinish();
/* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */
gl_info->gl_ops.wgl.p_wglSwapBuffers(context->hdc); gl_info->gl_ops.wgl.p_wglSwapBuffers(context_gl->dc);
wined3d_swapchain_gl_rotate(swapchain, context); wined3d_swapchain_gl_rotate(swapchain, context);
......
...@@ -1927,8 +1927,7 @@ struct wined3d_context ...@@ -1927,8 +1927,7 @@ struct wined3d_context
DWORD lowest_disabled_stage : 4; /* Max WINED3D_MAX_TEXTURES, 8 */ DWORD lowest_disabled_stage : 4; /* Max WINED3D_MAX_TEXTURES, 8 */
DWORD use_immediate_mode_draw : 1; DWORD use_immediate_mode_draw : 1;
DWORD needs_set : 1; DWORD needs_set : 1;
DWORD hdc_is_private : 1; DWORD num_untracked_materials : 2; /* Max value 2 */
DWORD hdc_has_format : 1; /* only meaningful if hdc_is_private */
DWORD update_shader_resource_bindings : 1; DWORD update_shader_resource_bindings : 1;
DWORD update_compute_shader_resource_bindings : 1; DWORD update_compute_shader_resource_bindings : 1;
...@@ -1939,8 +1938,7 @@ struct wined3d_context ...@@ -1939,8 +1938,7 @@ struct wined3d_context
DWORD transform_feedback_paused : 1; DWORD transform_feedback_paused : 1;
DWORD shader_update_mask : 6; /* WINED3D_SHADER_TYPE_COUNT, 6 */ DWORD shader_update_mask : 6; /* WINED3D_SHADER_TYPE_COUNT, 6 */
DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */ DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */
DWORD num_untracked_materials : 2; /* Max value 2 */ DWORD padding : 11;
DWORD padding : 9;
DWORD constant_update_mask; DWORD constant_update_mask;
DWORD numbered_array_mask; DWORD numbered_array_mask;
...@@ -1952,17 +1950,7 @@ struct wined3d_context ...@@ -1952,17 +1950,7 @@ struct wined3d_context
UINT instance_count; UINT instance_count;
/* The actual opengl context */
UINT level; UINT level;
HGLRC restore_ctx;
HDC restore_dc;
int restore_pf;
HWND restore_pf_win;
HGLRC glCtx;
HWND win_handle;
HDC hdc;
int pixel_format;
GLint aux_buffers;
void *shader_backend_data; void *shader_backend_data;
void *fragment_pipe_data; void *fragment_pipe_data;
...@@ -1986,15 +1974,28 @@ struct wined3d_context_gl ...@@ -1986,15 +1974,28 @@ struct wined3d_context_gl
{ {
struct wined3d_context c; struct wined3d_context c;
uint32_t dc_is_private : 1;
uint32_t dc_has_format : 1; /* Only meaningful for private DCs. */
uint32_t fog_enabled : 1; uint32_t fog_enabled : 1;
uint32_t diffuse_attrib_to_1 : 1; uint32_t diffuse_attrib_to_1 : 1;
uint32_t rebind_fbo : 1; uint32_t rebind_fbo : 1;
uint32_t padding : 29; uint32_t padding : 27;
uint32_t default_attrib_value_set; uint32_t default_attrib_value_set;
GLenum *texture_type; GLenum *texture_type;
/* The WGL context. */
HGLRC restore_ctx;
HDC restore_dc;
int restore_pf;
HWND restore_pf_win;
HGLRC gl_ctx;
HDC dc;
int pixel_format;
HWND window;
GLint aux_buffers;
/* FBOs. */ /* FBOs. */
unsigned int fbo_entry_count; unsigned int fbo_entry_count;
struct list fbo_list; struct list fbo_list;
......
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