From: Henri Verbeet Subject: [PATCH 1/5] wined3d: Replace surface_update_draw_binding() with wined3d_resource_update_draw_binding(). Message-Id: <1408533603-30259-1-git-send-email-hverbeet@codeweavers.com> Date: Wed, 20 Aug 2014 13:19:59 +0200 --- dlls/wined3d/resource.c | 10 ++++++++++ dlls/wined3d/surface.c | 14 ++------------ dlls/wined3d/swapchain.c | 4 ++-- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index dd31cb6..cb7ee9e 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -323,3 +323,13 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) * offscreen, otherwise onscreen */ return swapchain->render_to_fbo; } + +void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) +{ + if (!wined3d_resource_is_offscreen(resource) || wined3d_settings.offscreen_rendering_mode != ORM_FBO) + resource->draw_binding = WINED3D_LOCATION_DRAWABLE; + else if (resource->multisample_type) + resource->draw_binding = WINED3D_LOCATION_RB_MULTISAMPLE; + else + resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 3110e56..6603d46 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -112,16 +112,6 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) HeapFree(GetProcessHeap(), 0, surface); } -void surface_update_draw_binding(struct wined3d_surface *surface) -{ - if (!wined3d_resource_is_offscreen(&surface->resource) || wined3d_settings.offscreen_rendering_mode != ORM_FBO) - surface->resource.draw_binding = WINED3D_LOCATION_DRAWABLE; - else if (surface->resource.multisample_type) - surface->resource.draw_binding = WINED3D_LOCATION_RB_MULTISAMPLE; - else - surface->resource.draw_binding = WINED3D_LOCATION_TEXTURE_RGB; -} - void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) { @@ -157,7 +147,7 @@ void surface_set_swapchain(struct wined3d_surface *surface, struct wined3d_swapc TRACE("surface %p, swapchain %p.\n", surface, swapchain); surface->swapchain = swapchain; - surface_update_draw_binding(surface); + wined3d_resource_update_draw_binding(&surface->resource); } struct blt_info @@ -5974,7 +5964,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text } surface->container = container; - surface_update_draw_binding(surface); + wined3d_resource_update_draw_binding(&surface->resource); surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); list_init(&surface->renderbuffers); list_init(&surface->overlays); diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 1648a11..1582193 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1144,10 +1144,10 @@ void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) { UINT i; - surface_update_draw_binding(swapchain->front_buffer); + wined3d_resource_update_draw_binding(&swapchain->front_buffer->resource); for (i = 0; i < swapchain->desc.backbuffer_count; ++i) { - surface_update_draw_binding(swapchain->back_buffers[i]); + wined3d_resource_update_draw_binding(&swapchain->back_buffers[i]->resource); } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 118b5c8..086d13c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2065,6 +2065,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; +void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 @@ -2305,7 +2306,6 @@ void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, void surface_set_swapchain(struct wined3d_surface *surface, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void surface_set_texture_target(struct wined3d_surface *surface, GLenum target, GLint level) DECLSPEC_HIDDEN; void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN; -void surface_update_draw_binding(struct wined3d_surface *surface) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; void surface_validate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; -- 1.7.10.4