From: Matteo Bruni mbruni@codeweavers.com
Strict superset of the older wined3d_context_gl_apply_fbo_state_blit() function it replaces, correctly handles depth/stencil textures. --- dlls/wined3d/context_gl.c | 6 +++--- dlls/wined3d/surface.c | 6 ++---- dlls/wined3d/texture.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 5 ++--- 4 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 5b3630bf159..5ddb2fa3a93 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -849,7 +849,7 @@ static void wined3d_context_gl_apply_fbo_state(struct wined3d_context_gl *contex }
/* Context activation is done by the caller. */ -void wined3d_context_gl_apply_fbo_state_blit(struct wined3d_context_gl *context_gl, GLenum target, +static void context_gl_apply_fbo_state_blit(struct wined3d_context_gl *context_gl, GLenum target, struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, uint32_t location) { @@ -3247,10 +3247,10 @@ void wined3d_context_gl_apply_blit_state_fbo(struct wined3d_context_gl *context_ if (location != WINED3D_LOCATION_DRAWABLE) { if (format->depth_size || format->stencil_size) - wined3d_context_gl_apply_fbo_state_blit(context_gl, target, NULL, + context_gl_apply_fbo_state_blit(context_gl, target, NULL, 0, &texture->resource, sub_resource_idx, location); else - wined3d_context_gl_apply_fbo_state_blit(context_gl, target, &texture->resource, + context_gl_apply_fbo_state_blit(context_gl, target, &texture->resource, sub_resource_idx, NULL, 0, location); } else diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index fd8db9ce60d..760682eae81 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -373,10 +373,8 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i
if (src_location != resource->draw_binding) { - wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_READ_FRAMEBUFFER, - resource, sub_resource_idx, NULL, 0, src_location); - wined3d_context_gl_check_fbo_status(context_gl, GL_READ_FRAMEBUFFER); - context_invalidate_state(context, STATE_FRAMEBUFFER); + wined3d_context_gl_apply_blit_state_fbo(context_gl, GL_READ_FRAMEBUFFER, + texture, sub_resource_idx, src_location); } else { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 32923349c6b..359e3719172 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -529,8 +529,8 @@ static void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_cont buffer = GL_COLOR_ATTACHMENT0; }
- wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_READ_FRAMEBUFFER, - &src_texture->resource, src_sub_resource_idx, NULL, 0, src_location); + wined3d_context_gl_apply_blit_state_fbo(context_gl, GL_READ_FRAMEBUFFER, + src_texture, src_sub_resource_idx, src_location); gl_info->gl_ops.gl.p_glReadBuffer(buffer); checkGLcall("glReadBuffer()"); wined3d_context_gl_check_fbo_status(context_gl, GL_READ_FRAMEBUFFER); @@ -630,8 +630,8 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct else wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location);
- wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_READ_FRAMEBUFFER, NULL, 0, - &src_texture->resource, src_sub_resource_idx, src_location); + wined3d_context_gl_apply_blit_state_fbo(context_gl, GL_READ_FRAMEBUFFER, + src_texture, src_sub_resource_idx, src_location); wined3d_context_gl_check_fbo_status(context_gl, GL_READ_FRAMEBUFFER);
context_gl_apply_texture_draw_state(context_gl, dst_texture, dst_sub_resource_idx, dst_location); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 001534e8c38..6881868a2db 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2467,11 +2467,10 @@ GLuint wined3d_context_gl_allocate_vram_chunk_buffer(struct wined3d_context_gl * unsigned int pool, size_t size) DECLSPEC_HIDDEN; void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device) DECLSPEC_HIDDEN; +void wined3d_context_gl_apply_blit_state_fbo(struct wined3d_context_gl *context_gl, GLenum target, + struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; -void wined3d_context_gl_apply_fbo_state_blit(struct wined3d_context_gl *context_gl, GLenum target, - struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, - struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, uint32_t location) DECLSPEC_HIDDEN; void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device) DECLSPEC_HIDDEN; void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum binding, GLuint name) DECLSPEC_HIDDEN;