From aad6fb4a424d3ae1952da1633073ff9a9b3abf82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 14 Apr 2016 19:32:50 +0200 Subject: [PATCH] wined3d: Explicitly pass a wined3d_state structure to context_apply_draw_state(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/context.c | 4 ++-- dlls/wined3d/drawprim.c | 2 +- dlls/wined3d/wined3d_private.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index d6833278609..3cd7c8c9aba 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -3318,9 +3318,9 @@ static void context_bind_shader_resources(struct wined3d_context *context, const } /* Context activation is done by the caller. */ -BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) +BOOL context_apply_draw_state(struct wined3d_context *context, + const struct wined3d_device *device, const struct wined3d_state *state) { - const struct wined3d_state *state = &device->state; const struct StateEntry *state_table = context->state_table; const struct wined3d_fb_state *fb = state->fb; unsigned int i; diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 6857b0ddde3..bd62b686e31 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -488,7 +488,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s wined3d_surface_prepare(ds, context, location); } - if (!context_apply_draw_state(context, device)) + if (!context_apply_draw_state(context, device, state)) { context_release(context); WARN("Unable to apply draw state, skipping draw.\n"); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7c3ea65b802..0f55d797211 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1582,7 +1582,8 @@ void context_alloc_occlusion_query(struct wined3d_context *context, 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; -BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) DECLSPEC_HIDDEN; +BOOL context_apply_draw_state(struct wined3d_context *context, + const struct wined3d_device *device, const struct wined3d_state *state) DECLSPEC_HIDDEN; void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info,