Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/surface.c | 39 --------------------------------------- dlls/wined3d/texture.c | 40 +++++++++++++++++++++++++++++++++++++++- dlls/wined3d/wined3d_private.h | 2 -- 3 files changed, 39 insertions(+), 42 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index fc8be3827ba..3668c61fa33 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1423,45 +1423,6 @@ static HRESULT wined3d_texture_blt_special(struct wined3d_texture *dst_texture, }
/* Context activation is done by the caller. */ -BOOL texture2d_load_renderbuffer(struct wined3d_texture *texture, unsigned int sub_resource_idx, - struct wined3d_context *context, DWORD dst_location) -{ - unsigned int level = sub_resource_idx % texture->level_count; - const RECT rect = {0, 0, - wined3d_texture_get_level_width(texture, level), - wined3d_texture_get_level_height(texture, level)}; - struct wined3d_texture_sub_resource *sub_resource; - DWORD src_location, locations; - - sub_resource = &texture->sub_resources[sub_resource_idx]; - locations = sub_resource->locations; - if (texture->resource.bind_flags & WINED3D_BIND_DEPTH_STENCIL) - { - FIXME("Unimplemented copy from %s for depth/stencil buffers.\n", - wined3d_debug_location(locations)); - return FALSE; - } - - if (locations & WINED3D_LOCATION_RB_MULTISAMPLE) - src_location = WINED3D_LOCATION_RB_MULTISAMPLE; - else if (locations & WINED3D_LOCATION_RB_RESOLVED) - src_location = WINED3D_LOCATION_RB_RESOLVED; - else if (locations & WINED3D_LOCATION_TEXTURE_SRGB) - src_location = WINED3D_LOCATION_TEXTURE_SRGB; - else if (locations & WINED3D_LOCATION_TEXTURE_RGB) - src_location = WINED3D_LOCATION_TEXTURE_RGB; - else if (locations & WINED3D_LOCATION_DRAWABLE) - src_location = WINED3D_LOCATION_DRAWABLE; - else /* texture2d_blt_fbo() will load the source location if necessary. */ - src_location = WINED3D_LOCATION_TEXTURE_RGB; - - texture2d_blt_fbo(texture->resource.device, context, WINED3D_TEXF_POINT, texture, - sub_resource_idx, src_location, &rect, texture, sub_resource_idx, dst_location, &rect); - - return TRUE; -} - -/* Context activation is done by the caller. */ static void fbo_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context) { struct wined3d_blitter *next; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 4ae869b4b2a..88db24927d1 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2528,6 +2528,44 @@ static BOOL wined3d_texture_load_drawable(struct wined3d_texture *texture, return TRUE; }
+static BOOL wined3d_texture_load_renderbuffer(struct wined3d_texture *texture, + unsigned int sub_resource_idx, struct wined3d_context *context, DWORD dst_location) +{ + unsigned int level = sub_resource_idx % texture->level_count; + const RECT rect = {0, 0, + wined3d_texture_get_level_width(texture, level), + wined3d_texture_get_level_height(texture, level)}; + struct wined3d_texture_sub_resource *sub_resource; + DWORD src_location, locations; + + sub_resource = &texture->sub_resources[sub_resource_idx]; + locations = sub_resource->locations; + if (texture->resource.bind_flags & WINED3D_BIND_DEPTH_STENCIL) + { + FIXME("Unimplemented copy from %s for depth/stencil buffers.\n", + wined3d_debug_location(locations)); + return FALSE; + } + + if (locations & WINED3D_LOCATION_RB_MULTISAMPLE) + src_location = WINED3D_LOCATION_RB_MULTISAMPLE; + else if (locations & WINED3D_LOCATION_RB_RESOLVED) + src_location = WINED3D_LOCATION_RB_RESOLVED; + else if (locations & WINED3D_LOCATION_TEXTURE_SRGB) + src_location = WINED3D_LOCATION_TEXTURE_SRGB; + else if (locations & WINED3D_LOCATION_TEXTURE_RGB) + src_location = WINED3D_LOCATION_TEXTURE_RGB; + else if (locations & WINED3D_LOCATION_DRAWABLE) + src_location = WINED3D_LOCATION_DRAWABLE; + else /* texture2d_blt_fbo() will load the source location if necessary. */ + src_location = WINED3D_LOCATION_TEXTURE_RGB; + + texture2d_blt_fbo(texture->resource.device, context, WINED3D_TEXF_POINT, texture, + sub_resource_idx, src_location, &rect, texture, sub_resource_idx, dst_location, &rect); + + return TRUE; +} + static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, BOOL srgb) { @@ -2702,7 +2740,7 @@ static BOOL wined3d_texture_gl_load_location(struct wined3d_texture *texture,
case WINED3D_LOCATION_RB_RESOLVED: case WINED3D_LOCATION_RB_MULTISAMPLE: - return texture2d_load_renderbuffer(texture, sub_resource_idx, context, location); + return wined3d_texture_load_renderbuffer(texture, sub_resource_idx, context, location);
case WINED3D_LOCATION_TEXTURE_RGB: case WINED3D_LOCATION_TEXTURE_SRGB: diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f796d12446f..b6f4b670182 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3551,8 +3551,6 @@ void texture2d_get_blt_info(const struct wined3d_texture_gl *texture_gl, unsigne const RECT *rect, struct wined3d_blt_info *info) DECLSPEC_HIDDEN; void texture2d_load_fb_texture(struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; -BOOL texture2d_load_renderbuffer(struct wined3d_texture *texture, unsigned int sub_resource_idx, - struct wined3d_context *context, DWORD dst_location) DECLSPEC_HIDDEN; void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD src_location, DWORD dst_location) DECLSPEC_HIDDEN;