From 718c6149377d1ecdec054a8a64685b2f6abf653e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Sat, 2 Jul 2011 11:29:28 +0200 Subject: [PATCH] wined3d: Pass a struct wined3d_fb_state * to context_apply_clear_state. --- dlls/wined3d/context.c | 11 ++++++----- dlls/wined3d/device.c | 2 +- dlls/wined3d/wined3d_private.h | 14 +++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 94ed896f82..78951563e3 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2083,19 +2083,20 @@ static BOOL context_validate_rt_config(UINT rt_count, /* Context activation is done by the caller. */ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_device *device, - UINT rt_count, struct wined3d_surface **rts, struct wined3d_surface *depth_stencil) + UINT rt_count, const struct wined3d_fb_state *fb) { const struct StateEntry *state_table = device->StateTable; DWORD rt_mask = 0; UINT i; + struct wined3d_surface **rts = fb->render_targets; - if (!context_validate_rt_config(rt_count, rts, depth_stencil)) + if (!context_validate_rt_config(rt_count, rts, fb->depth_stencil)) return FALSE; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { - context_validate_onscreen_formats(device, context, depth_stencil); + context_validate_onscreen_formats(device, context, fb->depth_stencil); ENTER_GL(); @@ -2112,7 +2113,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_d context->blit_targets[i] = NULL; ++i; } - context_apply_fbo_state(context, GL_FRAMEBUFFER, context->blit_targets, depth_stencil, SFLAG_INTEXTURE); + context_apply_fbo_state(context, GL_FRAMEBUFFER, context->blit_targets, fb->depth_stencil, SFLAG_INTEXTURE); glReadBuffer(GL_NONE); checkGLcall("glReadBuffer"); } @@ -2124,7 +2125,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_d LEAVE_GL(); - /* TODO: This is not necessary if the rts are the device's current targets */ + /* TODO: This is not necessary if the framebuffer is the device's current framebuffer */ context_invalidate_state(context, STATE_FRAMEBUFFER, device->StateTable); } else diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 14e66139e6..a47911926f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -685,7 +685,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count return WINED3D_OK; } - if (!context_apply_clear_state(context, device, rt_count, fb->render_targets, fb->depth_stencil)) + if (!context_apply_clear_state(context, device, rt_count, fb)) { context_release(context); WARN("Failed to apply clear state, skipping clear.\n"); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1b040ff5f9..1fedc9c4f4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1130,6 +1130,12 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; +struct wined3d_fb_state +{ + struct wined3d_surface **render_targets; + struct wined3d_surface *depth_stencil; +}; + typedef void (*APPLYSTATEFUNC)(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *ctx); struct StateEntry @@ -1223,7 +1229,7 @@ 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, struct wined3d_device *device) DECLSPEC_HIDDEN; BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_device *device, - UINT rt_count, struct wined3d_surface **rts, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; + 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, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; @@ -1613,12 +1619,6 @@ void wined3d_unregister_window(HWND window) DECLSPEC_HIDDEN; /* Multithreaded flag. Removed from the public header to signal that IWineD3D::CreateDevice ignores it */ #define WINED3DCREATE_MULTITHREADED 0x00000004 -struct wined3d_fb_state -{ - struct wined3d_surface **render_targets; - struct wined3d_surface *depth_stencil; -}; - struct wined3d_device { LONG ref; -- 2.32.0.93.g670b81a890