From 54945f04de7ff17d235e54309e80c780ac2ca2fa Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 9 May 2019 19:11:11 +0430 Subject: [PATCH] wined3d: Pass a wined3d_context_gl structure to context_apply_blit_state(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/context.c | 15 ++++++++++----- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/surface.c | 4 ++-- dlls/wined3d/wined3d_private.h | 3 ++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index b72f61bb02b..506bb720831 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2749,16 +2749,20 @@ static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *conte } /* Context activation is done by the caller. */ -void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) +void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device) { - const struct wined3d_gl_info *gl_info = context->gl_info; - struct wined3d_texture *rt = context->current_rt.texture; + struct wined3d_context *context = &context_gl->c; + const struct wined3d_gl_info *gl_info; + struct wined3d_texture *rt; DWORD rt_mask, *cur_mask; unsigned int sampler; SIZE rt_size; TRACE("Setting up context %p for blitting.\n", context); + gl_info = context->gl_info; + rt = context->current_rt.texture; + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { if (context->render_offscreen) @@ -2906,6 +2910,7 @@ static void context_apply_blit_projection(const struct wined3d_context *context, /* Context activation is done by the caller. */ void context_apply_ffp_blit_state(struct wined3d_context *context, const struct wined3d_device *device) { + struct wined3d_context_gl *context_gl = wined3d_context_gl(context); const struct wined3d_gl_info *gl_info = context->gl_info; unsigned int i, sampler; @@ -2919,14 +2924,14 @@ void context_apply_ffp_blit_state(struct wined3d_context *context, const struct context_get_rt_size(context, &rt_size); if (context->blit_w != rt_size.cx || context->blit_h != rt_size.cy) context_apply_blit_projection(context, rt_size.cx, rt_size.cy); - context_apply_blit_state(context, device); + wined3d_context_gl_apply_blit_state(context_gl, device); checkGLcall("ffp blit state application"); return; } context->last_was_ffp_blit = TRUE; - context_apply_blit_state(context, device); + wined3d_context_gl_apply_blit_state(context_gl, device); /* Disable all textures. The caller can then bind a texture it wants to blit * from. */ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 5ee40b00358..386ce78f419 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13307,7 +13307,7 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli wined3d_texture_load(src_texture, context, FALSE); } - context_apply_blit_state(context, device); + wined3d_context_gl_apply_blit_state(wined3d_context_gl(context), device); if (dst_location == WINED3D_LOCATION_DRAWABLE) { diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 2c5ea75ebbb..06c0a23b992 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -737,7 +737,7 @@ static void texture2d_read_from_framebuffer(struct wined3d_texture *texture, uns } else { - context_apply_blit_state(context, device); + wined3d_context_gl_apply_blit_state(wined3d_context_gl(context), device); } /* Select the correct read buffer, and give some debug output. @@ -908,7 +908,7 @@ static void fb_copy_to_texture_direct(struct wined3d_texture_gl *dst_texture, un context = context_acquire(device, &src_texture->t, src_sub_resource_idx); context_gl = wined3d_context_gl(context); gl_info = context->gl_info; - context_apply_blit_state(context, device); + wined3d_context_gl_apply_blit_state(context_gl, device); wined3d_texture_load(&dst_texture->t, context, FALSE); /* Bind the target texture */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index fc75ddd0fd7..bb57f62ead1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2054,6 +2054,8 @@ static inline const struct wined3d_context_gl *wined3d_context_gl_const(const st return CONTAINING_RECORD(context, struct wined3d_context_gl, c); } +void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, + const struct wined3d_device *device) DECLSPEC_HIDDEN; void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name) DECLSPEC_HIDDEN; void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; @@ -2207,7 +2209,6 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, void context_alloc_fence(struct wined3d_context *context, struct wined3d_fence *fence) DECLSPEC_HIDDEN; void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; -void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_state *state, UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,