Module: wine Branch: master Commit: e686b5a62ff938a285bc4e58f6669e28708fbc7a URL: http://source.winehq.org/git/wine.git/?a=commit;h=e686b5a62ff938a285bc4e58f6...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Apr 6 19:12:03 2016 +0200
wined3d: Explicitly pass a wined3d_state structure to context_apply_clear_state().
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/context.c | 10 +++++----- dlls/wined3d/device.c | 5 +++-- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 670bf6f..48c82cf 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2507,7 +2507,7 @@ static BOOL context_validate_rt_config(UINT rt_count, struct wined3d_rendertarge }
/* Context activation is done by the caller. */ -BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device, +BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_state *state, UINT rt_count, const struct wined3d_fb_state *fb) { struct wined3d_rendertarget_view **rts = fb->render_targets; @@ -2516,8 +2516,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win DWORD rt_mask = 0, *cur_mask; UINT i;
- if (isStateDirty(context, STATE_FRAMEBUFFER) || fb != &device->fb - || rt_count != context->gl_info->limits.buffers) + if (isStateDirty(context, STATE_FRAMEBUFFER) || fb != state->fb + || rt_count != gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) return FALSE; @@ -2534,7 +2534,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win if (rts[i] && rts[i]->format->id != WINED3DFMT_NULL) rt_mask |= (1u << i); } - while (i < context->gl_info->limits.buffers) + while (i < gl_info->limits.buffers) { context->blit_targets[i] = NULL; ++i; @@ -2601,7 +2601,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST); if (rt_count && gl_info->supported[ARB_FRAMEBUFFER_SRGB]) { - if (needs_srgb_write(context, &device->state, fb)) + if (needs_srgb_write(context, state, fb)) gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB); else gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 5231533..619ad1e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -294,6 +294,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c struct wined3d_surface *target = rt_count ? wined3d_rendertarget_view_get_surface(fb->render_targets[0]) : NULL; struct wined3d_surface *depth_stencil = fb->depth_stencil ? wined3d_rendertarget_view_get_surface(fb->depth_stencil) : NULL; + const struct wined3d_state *state = &device->state; const struct wined3d_gl_info *gl_info; UINT drawable_width, drawable_height; struct wined3d_color corrected_color; @@ -359,7 +360,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c draw_rect, rect_count, clear_rect, &ds_rect); }
- if (!context_apply_clear_state(context, device, rt_count, fb)) + if (!context_apply_clear_state(context, state, rt_count, fb)) { context_release(context); WARN("Failed to apply clear state, skipping clear.\n"); @@ -415,7 +416,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c wined3d_texture_invalidate_location(texture, rtv->sub_resource_idx, ~rtv->resource->draw_binding); }
- if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && needs_srgb_write(context, &device->state, fb)) + if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && needs_srgb_write(context, state, fb)) { if (rt_count > 1) WARN("Clearing multiple sRGB render targets with no GL_ARB_framebuffer_sRGB " diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7f384a0..6a105cb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1575,7 +1575,7 @@ void context_alloc_event_query(struct wined3d_context *context, 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_device *device, +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; void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,