You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added patches for CSMT support (not enabled yet).
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
From d802d551603f20fde872cf45d43064426bea4434 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 19:10:18 +0100
|
||||
Subject: wined3d: Pass a context to surface_load_sysmem.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 22 +++++++++++-----------
|
||||
1 file changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index d9b1846..3877139 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -4010,9 +4010,12 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
|
||||
memcpy(dst.addr, src.addr, size);
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
- const struct wined3d_gl_info *gl_info, DWORD dst_location)
|
||||
+ struct wined3d_context *context, DWORD dst_location)
|
||||
{
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
+
|
||||
if (surface->locations & surface_simple_locations)
|
||||
{
|
||||
surface_copy_simple_location(surface, dst_location);
|
||||
@@ -4025,18 +4028,10 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
/* Download the surface to system memory. */
|
||||
if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
- struct wined3d_device *device = surface->resource.device;
|
||||
- struct wined3d_context *context;
|
||||
-
|
||||
- /* TODO: Use already acquired context when possible. */
|
||||
- context = context_acquire(device, NULL);
|
||||
-
|
||||
wined3d_texture_bind_and_dirtify(surface->container, context,
|
||||
!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB));
|
||||
surface_download_data(surface, gl_info, dst_location);
|
||||
|
||||
- context_release(context);
|
||||
-
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4266,6 +4261,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
struct wined3d_device *device = surface->resource.device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
HRESULT hr;
|
||||
+ struct wined3d_context *context = NULL;
|
||||
|
||||
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
|
||||
|
||||
@@ -4274,7 +4270,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
if (location == WINED3D_LOCATION_TEXTURE_RGB
|
||||
&& surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
|
||||
{
|
||||
- struct wined3d_context *context = context_acquire(device, NULL);
|
||||
+ context = context_acquire(device, NULL);
|
||||
surface_load_ds_location(surface, context, location);
|
||||
context_release(context);
|
||||
return WINED3D_OK;
|
||||
@@ -4320,7 +4316,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
case WINED3D_LOCATION_USER_MEMORY:
|
||||
case WINED3D_LOCATION_SYSMEM:
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
- surface_load_sysmem(surface, gl_info, location);
|
||||
+ if (device->d3d_initialized)
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ surface_load_sysmem(surface, context, location);
|
||||
+ if (context)
|
||||
+ context_release(context);
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_DRAWABLE:
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,81 @@
|
||||
From e29e2b0ccda7ed5e930eb18b3c73204150a68123 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 19:16:40 +0100
|
||||
Subject: wined3d: Pass a context to read_from_framebuffer.
|
||||
|
||||
In the average case the function will not be able to reuse it, because
|
||||
it requires a specific context to access the WGL framebuffer. It will
|
||||
restore the original context afterwards to hide the context change from
|
||||
load_location / preload callers. This is related to bug 34574.
|
||||
---
|
||||
dlls/wined3d/surface.c | 29 +++++++++++++++++++++++++----
|
||||
1 file changed, 25 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 3877139..ef6a233 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -2781,11 +2781,13 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
-static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_location)
|
||||
+static void read_from_framebuffer(struct wined3d_surface *surface,
|
||||
+ struct wined3d_context *old_ctx, DWORD dst_location)
|
||||
{
|
||||
struct wined3d_device *device = surface->resource.device;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
+ struct wined3d_surface *restore_rt;
|
||||
BYTE *mem;
|
||||
BYTE *row, *top, *bottom;
|
||||
int i;
|
||||
@@ -2794,7 +2796,21 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
|
||||
|
||||
surface_get_memory(surface, &data, dst_location);
|
||||
|
||||
- context = context_acquire(device, surface);
|
||||
+ /* Context_release does not restore the original context in case of
|
||||
+ * nested context_acquire calls. Only read_from_framebuffer and
|
||||
+ * surface_blt_to_drawable use nested context_acquire calls. Manually
|
||||
+ * restore the original context at the end of the function if needed. */
|
||||
+ if (old_ctx->current_rt == surface)
|
||||
+ {
|
||||
+ restore_rt = NULL;
|
||||
+ context = old_ctx;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ restore_rt = old_ctx->current_rt;
|
||||
+ context = context_acquire(device, surface);
|
||||
+ }
|
||||
+
|
||||
context_apply_blit_state(context, device);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
@@ -2882,7 +2898,12 @@ error:
|
||||
checkGLcall("glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)");
|
||||
}
|
||||
|
||||
- context_release(context);
|
||||
+ if (restore_rt)
|
||||
+ {
|
||||
+ context_release(context);
|
||||
+ context = context_acquire(device, restore_rt);
|
||||
+ context_release(context);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Read the framebuffer contents into a texture. Note that this function
|
||||
@@ -4037,7 +4058,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
|
||||
if (surface->locations & WINED3D_LOCATION_DRAWABLE)
|
||||
{
|
||||
- read_from_framebuffer(surface, dst_location);
|
||||
+ read_from_framebuffer(surface, context, dst_location);
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,121 @@
|
||||
From da5210457d0a852e97fd20fed4b33030585b0549 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 19:34:26 +0100
|
||||
Subject: wined3d: Pass a context to surface_load_drawable and
|
||||
surface_blt_to_drawable.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 40 ++++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 34 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index ef6a233..7a32f7f 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -3452,19 +3452,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW
|
||||
rect->bottom = drawable_height - rect->bottom;
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
static void surface_blt_to_drawable(const struct wined3d_device *device,
|
||||
+ struct wined3d_context *old_ctx,
|
||||
enum wined3d_texture_filter_type filter, BOOL alpha_test,
|
||||
struct wined3d_surface *src_surface, const RECT *src_rect_in,
|
||||
struct wined3d_surface *dst_surface, const RECT *dst_rect_in)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
+ struct wined3d_surface *restore_rt;
|
||||
RECT src_rect, dst_rect;
|
||||
|
||||
src_rect = *src_rect_in;
|
||||
dst_rect = *dst_rect_in;
|
||||
|
||||
- context = context_acquire(device, dst_surface);
|
||||
+ /* Context_release does not restore the original context in case of
|
||||
+ * nested context_acquire calls. Only read_from_framebuffer and
|
||||
+ * surface_blt_to_drawable use nested context_acquire calls. Manually
|
||||
+ * restore the original context at the end of the function if needed. */
|
||||
+ if (old_ctx->current_rt == dst_surface)
|
||||
+ {
|
||||
+ restore_rt = NULL;
|
||||
+ context = old_ctx;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ restore_rt = old_ctx->current_rt;
|
||||
+ context = context_acquire(device, dst_surface);
|
||||
+ }
|
||||
gl_info = context->gl_info;
|
||||
|
||||
/* Make sure the surface is up-to-date. This should probably use
|
||||
@@ -3517,7 +3533,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
|
||||
&& dst_surface->container->swapchain->front_buffer == dst_surface->container))
|
||||
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
|
||||
|
||||
- context_release(context);
|
||||
+ if (restore_rt)
|
||||
+ {
|
||||
+ context_release(context);
|
||||
+ context = context_acquire(device, restore_rt);
|
||||
+ context_release(context);
|
||||
+ }
|
||||
}
|
||||
|
||||
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color)
|
||||
@@ -3668,6 +3689,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
|
||||
/* Blit from offscreen surface to render target */
|
||||
struct wined3d_color_key old_blt_key = src_surface->container->src_blt_color_key;
|
||||
DWORD old_color_key_flags = src_surface->container->color_key_flags;
|
||||
+ struct wined3d_context *context;
|
||||
|
||||
TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface);
|
||||
|
||||
@@ -3701,9 +3723,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
|
||||
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, NULL);
|
||||
}
|
||||
|
||||
- surface_blt_to_drawable(device, filter,
|
||||
+ context = context_acquire(device, dst_surface);
|
||||
+ surface_blt_to_drawable(device, context, filter,
|
||||
flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_ALPHATEST),
|
||||
src_surface, src_rect, dst_surface, dst_rect);
|
||||
+ context_release(context);
|
||||
|
||||
/* Restore the color key parameters */
|
||||
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT,
|
||||
@@ -4066,8 +4090,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
surface, wined3d_debug_location(surface->locations));
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
static HRESULT surface_load_drawable(struct wined3d_surface *surface,
|
||||
- const struct wined3d_gl_info *gl_info)
|
||||
+ struct wined3d_context *context)
|
||||
{
|
||||
RECT r;
|
||||
|
||||
@@ -4080,7 +4105,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
|
||||
|
||||
surface_get_rect(surface, NULL, &r);
|
||||
surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
- surface_blt_to_drawable(surface->resource.device,
|
||||
+ surface_blt_to_drawable(surface->resource.device, context,
|
||||
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -4345,7 +4370,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_DRAWABLE:
|
||||
- if (FAILED(hr = surface_load_drawable(surface, gl_info)))
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ hr = surface_load_drawable(surface, context);
|
||||
+ context_release(context);
|
||||
+ if (FAILED(hr))
|
||||
return hr;
|
||||
break;
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,140 @@
|
||||
From 61070d97c76557046a90cac37fbdf9c5f033adb4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 19:49:38 +0100
|
||||
Subject: wined3d: Pass a context to surface_blt_fbo.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 53 +++++++++++++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 42 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 7a32f7f..a2f8112 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -860,13 +860,15 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
|
||||
}
|
||||
|
||||
/* Blit between surface locations. Onscreen on different swapchains is not supported.
|
||||
- * Depth / stencil is not supported. */
|
||||
-static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_texture_filter_type filter,
|
||||
+ * Depth / stencil is not supported. Context activation is done by the caller. */
|
||||
+static void surface_blt_fbo(const struct wined3d_device *device,
|
||||
+ struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter,
|
||||
struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in,
|
||||
struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
+ struct wined3d_surface *required_rt, *restore_rt;
|
||||
RECT src_rect, dst_rect;
|
||||
GLenum gl_filter;
|
||||
GLenum buffer;
|
||||
@@ -909,9 +911,20 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
|
||||
if (!surface_is_full_rect(dst_surface, &dst_rect))
|
||||
surface_load_location(dst_surface, dst_location);
|
||||
|
||||
- if (src_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, src_surface);
|
||||
- else if (dst_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, dst_surface);
|
||||
- else context = context_acquire(device, NULL);
|
||||
+ if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
|
||||
+ else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
|
||||
+ else required_rt = NULL;
|
||||
+
|
||||
+ if (required_rt && required_rt != old_ctx->current_rt)
|
||||
+ {
|
||||
+ restore_rt = context->current_rt;
|
||||
+ context = context_acquire(device, required_rt);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ restore_rt = NULL;
|
||||
+ context = old_ctx;
|
||||
+ }
|
||||
|
||||
if (!context->valid)
|
||||
{
|
||||
@@ -974,7 +987,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
|
||||
&& dst_surface->container->swapchain->front_buffer == dst_surface->container))
|
||||
gl_info->gl_ops.gl.p_glFlush();
|
||||
|
||||
- context_release(context);
|
||||
+ if (restore_rt)
|
||||
+ {
|
||||
+ context_release(context);
|
||||
+ context = context_acquire(device, restore_rt);
|
||||
+ context_release(context);
|
||||
+ }
|
||||
}
|
||||
|
||||
static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op,
|
||||
@@ -4140,13 +4158,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
|
||||
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
|
||||
{
|
||||
+ context = context_acquire(device, NULL);
|
||||
+
|
||||
if (srgb)
|
||||
- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB,
|
||||
+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB,
|
||||
&src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect);
|
||||
else
|
||||
- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB,
|
||||
+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB,
|
||||
&src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect);
|
||||
|
||||
+ context_release(context);
|
||||
+
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
@@ -4161,8 +4183,10 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
|
||||
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||
|
||||
- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, src_location,
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location,
|
||||
&rect, surface, dst_location, &rect);
|
||||
+ context_release(context);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -4292,14 +4316,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
|
||||
static void surface_multisample_resolve(struct wined3d_surface *surface)
|
||||
{
|
||||
+ struct wined3d_context *context;
|
||||
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||
|
||||
if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
|
||||
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
|
||||
surface);
|
||||
|
||||
- surface_blt_fbo(surface->resource.device, WINED3D_TEXF_POINT,
|
||||
+ context = context_acquire(surface->resource.device, NULL);
|
||||
+ surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT,
|
||||
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
|
||||
+ context_release(context);
|
||||
}
|
||||
|
||||
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
@@ -5474,11 +5501,15 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
|
||||
&src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format,
|
||||
&dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format))
|
||||
{
|
||||
+ struct wined3d_context *context;
|
||||
TRACE("Using FBO blit.\n");
|
||||
|
||||
- surface_blt_fbo(device, filter,
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ surface_blt_fbo(device, context, filter,
|
||||
src_surface, src_surface->container->resource.draw_binding, &src_rect,
|
||||
dst_surface, dst_surface->container->resource.draw_binding, &dst_rect);
|
||||
+ context_release(context);
|
||||
+
|
||||
surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
|
||||
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,49 @@
|
||||
From f3cecdde174e3fc350ca4a35771183695b6777de Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 19:50:47 +0100
|
||||
Subject: wined3d: Pass a context to surface_multisample_resolve.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index a2f8112..ee6cfdd 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -4314,19 +4314,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
-static void surface_multisample_resolve(struct wined3d_surface *surface)
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void surface_multisample_resolve(struct wined3d_surface *surface, struct wined3d_context *context)
|
||||
{
|
||||
- struct wined3d_context *context;
|
||||
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||
|
||||
if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
|
||||
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
|
||||
surface);
|
||||
|
||||
- context = context_acquire(surface->resource.device, NULL);
|
||||
surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT,
|
||||
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
|
||||
- context_release(context);
|
||||
}
|
||||
|
||||
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
@@ -4405,7 +4403,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_RB_RESOLVED:
|
||||
- surface_multisample_resolve(surface);
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ surface_multisample_resolve(surface, context);
|
||||
+ context_release(context);
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,100 @@
|
||||
From c47fbee59422dcccdf545d9ca1a37eba75e7ef92 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 19:52:56 +0100
|
||||
Subject: wined3d: Pass a context to surface_load_texture.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 21 ++++++---------------
|
||||
1 file changed, 6 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index ee6cfdd..b37dca9 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -4130,13 +4130,13 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
|
||||
}
|
||||
|
||||
static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
- const struct wined3d_gl_info *gl_info, BOOL srgb)
|
||||
+ struct wined3d_context *context, BOOL srgb)
|
||||
{
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
RECT src_rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||
struct wined3d_device *device = surface->resource.device;
|
||||
const struct wined3d_color_key_conversion *conversion;
|
||||
struct wined3d_texture *texture = surface->container;
|
||||
- struct wined3d_context *context;
|
||||
UINT width, src_row_pitch, src_slice_pitch, dst_pitch;
|
||||
struct wined3d_bo_address data;
|
||||
struct wined3d_format format;
|
||||
@@ -4158,8 +4158,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
|
||||
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
|
||||
{
|
||||
- context = context_acquire(device, NULL);
|
||||
-
|
||||
if (srgb)
|
||||
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB,
|
||||
&src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect);
|
||||
@@ -4167,8 +4165,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB,
|
||||
&src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect);
|
||||
|
||||
- context_release(context);
|
||||
-
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
@@ -4183,10 +4179,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
|
||||
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||
|
||||
- context = context_acquire(device, NULL);
|
||||
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location,
|
||||
&rect, surface, dst_location, &rect);
|
||||
- context_release(context);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -4224,9 +4218,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
surface_load_location(surface, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
- /* TODO: Use already acquired context when possible. */
|
||||
- context = context_acquire(device, NULL);
|
||||
-
|
||||
wined3d_texture_prepare_texture(texture, context, srgb);
|
||||
wined3d_texture_bind_and_dirtify(texture, context, srgb);
|
||||
|
||||
@@ -4307,8 +4298,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
|
||||
surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, &data);
|
||||
|
||||
- context_release(context);
|
||||
-
|
||||
HeapFree(GetProcessHeap(), 0, mem);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -4330,7 +4319,6 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
|
||||
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
{
|
||||
struct wined3d_device *device = surface->resource.device;
|
||||
- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
HRESULT hr;
|
||||
struct wined3d_context *context = NULL;
|
||||
|
||||
@@ -4410,7 +4398,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
|
||||
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
- if (FAILED(hr = surface_load_texture(surface, gl_info, location == WINED3D_LOCATION_TEXTURE_SRGB)))
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
+ context_release(context);
|
||||
+ if (FAILED(hr))
|
||||
return hr;
|
||||
break;
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
From 7059ae36100e7efafcbcefcf582c34c0ce99e435 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 20:25:01 +0100
|
||||
Subject: wined3d: Make surface_load_location return nothing.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 18 +++++++++---------
|
||||
dlls/wined3d/wined3d_private.h | 2 +-
|
||||
2 files changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 66956df..8a14169 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -4353,7 +4353,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
|
||||
-HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
|
||||
+void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
@@ -4365,26 +4365,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
&& surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
|
||||
{
|
||||
surface_load_ds_location(surface, context, location);
|
||||
- return WINED3D_OK;
|
||||
+ return;
|
||||
}
|
||||
else if (location & surface->locations
|
||||
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
|
||||
{
|
||||
/* Already up to date, nothing to do. */
|
||||
- return WINED3D_OK;
|
||||
+ return;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
|
||||
wined3d_debug_location(surface->locations), wined3d_debug_location(location));
|
||||
- return WINED3DERR_INVALIDCALL;
|
||||
+ return;
|
||||
}
|
||||
}
|
||||
|
||||
if (surface->locations & location)
|
||||
{
|
||||
TRACE("Location already up to date.\n");
|
||||
- return WINED3D_OK;
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (WARN_ON(d3d_surface))
|
||||
@@ -4399,7 +4399,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
{
|
||||
ERR("Surface %p does not have any up to date location.\n", surface);
|
||||
surface->flags |= SFLAG_LOST;
|
||||
- return WINED3DERR_DEVICELOST;
|
||||
+ return;
|
||||
}
|
||||
|
||||
switch (location)
|
||||
@@ -4413,7 +4413,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
|
||||
case WINED3D_LOCATION_DRAWABLE:
|
||||
if (FAILED(hr = surface_load_drawable(surface, context)))
|
||||
- return hr;
|
||||
+ return;
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_RB_RESOLVED:
|
||||
@@ -4424,7 +4424,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
if (FAILED(hr = surface_load_texture(surface, context,
|
||||
location == WINED3D_LOCATION_TEXTURE_SRGB)))
|
||||
- return hr;
|
||||
+ return;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -4437,7 +4437,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM))
|
||||
surface_evict_sysmem(surface);
|
||||
|
||||
- return WINED3D_OK;
|
||||
+ return;
|
||||
}
|
||||
|
||||
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 7115eca..f24808b 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2354,7 +2354,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
|
||||
void surface_load_ds_location(struct wined3d_surface *surface,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
-HRESULT surface_load_location(struct wined3d_surface *surface,
|
||||
+void surface_load_location(struct wined3d_surface *surface,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
|
||||
void surface_prepare_rb(struct wined3d_surface *surface,
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,203 @@
|
||||
From 98ce21ea2f7c29d885b7dcf5b36819f8d977c5a5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 3 Oct 2013 12:31:24 +0200
|
||||
Subject: wined3d: Store volume locations in the resource.
|
||||
|
||||
---
|
||||
dlls/wined3d/volume.c | 46 +++++++++++++++++++++---------------------
|
||||
dlls/wined3d/wined3d_private.h | 5 +++--
|
||||
2 files changed, 26 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index af99825..ea56b38 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -101,15 +101,15 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
|
||||
static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location)
|
||||
{
|
||||
TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location));
|
||||
- volume->locations |= location;
|
||||
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations));
|
||||
+ volume->resource.locations |= location;
|
||||
+ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
|
||||
}
|
||||
|
||||
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location)
|
||||
{
|
||||
TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location));
|
||||
- volume->locations &= ~location;
|
||||
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations));
|
||||
+ volume->resource.locations &= ~location;
|
||||
+ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -217,9 +217,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
DWORD required_access = volume_access_from_location(location);
|
||||
|
||||
TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location),
|
||||
- wined3d_debug_location(volume->locations));
|
||||
+ wined3d_debug_location(volume->resource.locations));
|
||||
|
||||
- if ((volume->locations & location) == location)
|
||||
+ if ((volume->resource.locations & location) == location)
|
||||
{
|
||||
TRACE("Location(s) already up to date.\n");
|
||||
return;
|
||||
@@ -242,32 +242,32 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
&& !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED)))
|
||||
ERR("Trying to load (s)RGB texture without prior allocation.\n");
|
||||
|
||||
- if (volume->locations & WINED3D_LOCATION_DISCARDED)
|
||||
+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
TRACE("Volume previously discarded, nothing to do.\n");
|
||||
wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
- else if (volume->locations & WINED3D_LOCATION_SYSMEM)
|
||||
+ else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM)
|
||||
{
|
||||
struct wined3d_bo_address data = {0, volume->resource.heap_memory};
|
||||
wined3d_volume_upload_data(volume, context, &data);
|
||||
}
|
||||
- else if (volume->locations & WINED3D_LOCATION_BUFFER)
|
||||
+ else if (volume->resource.locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
struct wined3d_bo_address data = {volume->pbo, NULL};
|
||||
wined3d_volume_upload_data(volume, context, &data);
|
||||
}
|
||||
- else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
{
|
||||
wined3d_volume_srgb_transfer(volume, context, TRUE);
|
||||
}
|
||||
- else if (volume->locations & WINED3D_LOCATION_TEXTURE_SRGB)
|
||||
+ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_SRGB)
|
||||
{
|
||||
wined3d_volume_srgb_transfer(volume, context, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
- FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->locations));
|
||||
+ FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations));
|
||||
return;
|
||||
}
|
||||
wined3d_volume_validate_location(volume, location);
|
||||
@@ -281,16 +281,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
if (!volume->resource.heap_memory)
|
||||
ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n");
|
||||
|
||||
- if (volume->locations & WINED3D_LOCATION_DISCARDED)
|
||||
+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
TRACE("Volume previously discarded, nothing to do.\n");
|
||||
wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
+ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
struct wined3d_bo_address data = {0, volume->resource.heap_memory};
|
||||
|
||||
- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
|
||||
else
|
||||
wined3d_texture_bind_and_dirtify(volume->container, context, TRUE);
|
||||
@@ -301,7 +301,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
else
|
||||
{
|
||||
FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n",
|
||||
- wined3d_debug_location(volume->locations));
|
||||
+ wined3d_debug_location(volume->resource.locations));
|
||||
return;
|
||||
}
|
||||
wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
|
||||
@@ -311,16 +311,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
if (!volume->pbo)
|
||||
ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n");
|
||||
|
||||
- if (volume->locations & WINED3D_LOCATION_DISCARDED)
|
||||
+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
TRACE("Volume previously discarded, nothing to do.\n");
|
||||
wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
+ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
struct wined3d_bo_address data = {volume->pbo, NULL};
|
||||
|
||||
- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
|
||||
else
|
||||
wined3d_texture_bind_and_dirtify(volume->container, context, TRUE);
|
||||
@@ -330,7 +330,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
else
|
||||
{
|
||||
FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n",
|
||||
- wined3d_debug_location(volume->locations));
|
||||
+ wined3d_debug_location(volume->resource.locations));
|
||||
return;
|
||||
}
|
||||
wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER);
|
||||
@@ -338,7 +338,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
|
||||
default:
|
||||
FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location),
|
||||
- wined3d_debug_location(volume->locations));
|
||||
+ wined3d_debug_location(volume->resource.locations));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
{
|
||||
wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
- else if (!(volume->locations & WINED3D_LOCATION_SYSMEM))
|
||||
+ else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
{
|
||||
context = context_acquire(device, NULL);
|
||||
wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM);
|
||||
@@ -743,7 +743,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture
|
||||
}
|
||||
|
||||
volume->texture_level = level;
|
||||
- volume->locations = WINED3D_LOCATION_DISCARDED;
|
||||
+ volume->resource.locations = WINED3D_LOCATION_DISCARDED;
|
||||
|
||||
if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC
|
||||
&& gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index f24808b..57a048f 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright 2002-2003 Raphael Junqueira
|
||||
* Copyright 2002-2003, 2004 Jason Edmeades
|
||||
* Copyright 2005 Oliver Stieber
|
||||
- * Copyright 2006-2011, 2013 Stefan Dösinger for CodeWeavers
|
||||
+ * Copyright 2006-2011, 2013-2014 Stefan Dösinger for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -2082,6 +2082,7 @@ struct wined3d_resource
|
||||
void *heap_memory;
|
||||
UINT custom_row_pitch, custom_slice_pitch;
|
||||
struct list resource_list_entry;
|
||||
+ DWORD locations;
|
||||
|
||||
void *parent;
|
||||
const struct wined3d_parent_ops *parent_ops;
|
||||
@@ -2236,7 +2237,7 @@ struct wined3d_volume
|
||||
struct wined3d_resource resource;
|
||||
struct wined3d_texture *container;
|
||||
|
||||
- DWORD flags, locations;
|
||||
+ DWORD flags;
|
||||
GLint texture_level;
|
||||
DWORD download_count;
|
||||
GLuint pbo;
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,116 @@
|
||||
From 8b7f33e2323fa2acac3722c3a8a753b7a8f11db2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 3 Oct 2013 12:34:13 +0200
|
||||
Subject: wined3d: Move validate_location to resource.c.
|
||||
|
||||
---
|
||||
dlls/wined3d/resource.c | 7 +++++++
|
||||
dlls/wined3d/volume.c | 19 ++++++-------------
|
||||
dlls/wined3d/wined3d_private.h | 1 +
|
||||
3 files changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 8032a4c..bac15c0 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -332,6 +332,13 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
|
||||
resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
|
||||
}
|
||||
|
||||
+void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location)
|
||||
+{
|
||||
+ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location));
|
||||
+ resource->locations |= location;
|
||||
+ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
|
||||
+}
|
||||
+
|
||||
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
UINT *slice_pitch)
|
||||
{
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index ea56b38..6bc2724 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -98,13 +98,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
|
||||
HeapFree(GetProcessHeap(), 0, mem);
|
||||
}
|
||||
|
||||
-static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location)
|
||||
-{
|
||||
- TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location));
|
||||
- volume->resource.locations |= location;
|
||||
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
|
||||
-}
|
||||
-
|
||||
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location)
|
||||
{
|
||||
TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location));
|
||||
@@ -270,7 +263,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations));
|
||||
return;
|
||||
}
|
||||
- wined3d_volume_validate_location(volume, location);
|
||||
+ wined3d_resource_validate_location(&volume->resource, location);
|
||||
|
||||
if (wined3d_volume_can_evict(volume))
|
||||
wined3d_volume_evict_sysmem(volume);
|
||||
@@ -304,7 +297,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
wined3d_debug_location(volume->resource.locations));
|
||||
return;
|
||||
}
|
||||
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
@@ -333,7 +326,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
wined3d_debug_location(volume->resource.locations));
|
||||
return;
|
||||
}
|
||||
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER);
|
||||
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -412,7 +405,7 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
else
|
||||
{
|
||||
ERR("Out of memory when unloading volume %p.\n", volume);
|
||||
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_DISCARDED);
|
||||
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
|
||||
wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
@@ -558,7 +551,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
|
||||
wined3d_volume_prepare_pbo(volume, context);
|
||||
if (flags & WINED3D_MAP_DISCARD)
|
||||
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER);
|
||||
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER);
|
||||
else
|
||||
wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER);
|
||||
|
||||
@@ -593,7 +586,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
|
||||
if (flags & WINED3D_MAP_DISCARD)
|
||||
{
|
||||
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
{
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 57a048f..0c698b6 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2114,6 +2114,7 @@ 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;
|
||||
+void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Tests show that the start address of resources is 32 byte aligned */
|
||||
#define RESOURCE_ALIGNMENT 16
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,457 @@
|
||||
From 298ba6d476f8f76000f879b2ca61ff1fd0e810ff Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Tue, 21 Jan 2014 12:22:30 +0100
|
||||
Subject: wined3d: Move surface locations into the resource.
|
||||
|
||||
---
|
||||
dlls/wined3d/arb_program_shader.c | 2 +-
|
||||
dlls/wined3d/device.c | 4 +-
|
||||
dlls/wined3d/drawprim.c | 2 +-
|
||||
dlls/wined3d/surface.c | 99 ++++++++++++++++++++-------------------
|
||||
dlls/wined3d/swapchain.c | 4 +-
|
||||
dlls/wined3d/wined3d_private.h | 1 -
|
||||
6 files changed, 56 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
|
||||
index bc66c4a..c1b3b6d 100644
|
||||
--- a/dlls/wined3d/arb_program_shader.c
|
||||
+++ b/dlls/wined3d/arb_program_shader.c
|
||||
@@ -7649,7 +7649,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
|
||||
|
||||
/* Now load the surface */
|
||||
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
|
||||
- && (src_surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE))
|
||||
+ && (src_surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE))
|
||||
== WINED3D_LOCATION_DRAWABLE
|
||||
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
|
||||
{
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 0b4c6f9..01ccd9d 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
|
||||
{
|
||||
RECT current_rect, r;
|
||||
|
||||
- if (ds->locations & WINED3D_LOCATION_DISCARDED)
|
||||
+ if (ds->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
/* Depth buffer was discarded, make it entirely current in its new location since
|
||||
* there is no other place where we would get data anyway. */
|
||||
@@ -244,7 +244,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
|
||||
return;
|
||||
}
|
||||
|
||||
- if (ds->locations & location)
|
||||
+ if (ds->resource.locations & location)
|
||||
SetRect(¤t_rect, 0, 0,
|
||||
ds->ds_current_size.cx,
|
||||
ds->ds_current_size.cy);
|
||||
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
|
||||
index 2d39a83..7034b25 100644
|
||||
--- a/dlls/wined3d/drawprim.c
|
||||
+++ b/dlls/wined3d/drawprim.c
|
||||
@@ -648,7 +648,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
|
||||
if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
|
||||
device_switch_onscreen_ds(device, context, ds);
|
||||
|
||||
- if (ds->locations & location)
|
||||
+ if (ds->resource.locations & location)
|
||||
SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy);
|
||||
else
|
||||
SetRectEmpty(¤t_rect);
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 8a14169..c44179f 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
|
||||
if (!wined3d_resource_allocate_sysmem(&surface->resource))
|
||||
ERR("Failed to allocate system memory.\n");
|
||||
|
||||
- if (surface->locations & WINED3D_LOCATION_SYSMEM)
|
||||
+ if (surface->resource.locations & WINED3D_LOCATION_SYSMEM)
|
||||
ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n");
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
|
||||
}
|
||||
|
||||
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||
- surface->locations = WINED3D_LOCATION_DISCARDED;
|
||||
+ surface->resource.locations = WINED3D_LOCATION_DISCARDED;
|
||||
|
||||
if (surface_use_pbo(surface))
|
||||
surface->resource.map_binding = WINED3D_LOCATION_BUFFER;
|
||||
@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface)
|
||||
ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding));
|
||||
}
|
||||
|
||||
- if (surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))
|
||||
+ if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))
|
||||
{
|
||||
TRACE("Not dirtified, nothing to do.\n");
|
||||
return;
|
||||
@@ -1726,7 +1726,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
|
||||
surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
wined3d_texture_bind(dst_surface->container, context, FALSE);
|
||||
|
||||
- surface_get_memory(src_surface, &data, src_surface->locations);
|
||||
+ surface_get_memory(src_surface, &data, src_surface->resource.locations);
|
||||
wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
|
||||
|
||||
surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_row_pitch, dst_point, FALSE, &data);
|
||||
@@ -1872,7 +1872,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
|
||||
if (ck_changed)
|
||||
wined3d_texture_force_reload(surface->container);
|
||||
}
|
||||
- else if (!(surface->locations & location))
|
||||
+ else if (!(surface->resource.locations & location))
|
||||
{
|
||||
TRACE("Reloading because surface is dirty.\n");
|
||||
}
|
||||
@@ -2186,7 +2186,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
|
||||
create_dib = TRUE;
|
||||
}
|
||||
|
||||
- surface->locations = 0;
|
||||
+ surface->resource.locations = 0;
|
||||
wined3d_resource_free_sysmem(&surface->resource);
|
||||
|
||||
width = texture_resource->width;
|
||||
@@ -3088,9 +3088,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
|
||||
back->flags = front->flags;
|
||||
front->flags = tmp_flags;
|
||||
|
||||
- tmp_flags = back->locations;
|
||||
- back->locations = front->locations;
|
||||
- front->locations = tmp_flags;
|
||||
+ tmp_flags = back->resource.locations;
|
||||
+ back->resource.locations = front->resource.locations;
|
||||
+ front->resource.locations = tmp_flags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3269,7 +3269,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
|
||||
checkGLcall("glEnable(texture_target)");
|
||||
|
||||
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
|
||||
- src_surface->locations &= ~WINED3D_LOCATION_TEXTURE_RGB;
|
||||
+ src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB;
|
||||
}
|
||||
|
||||
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
|
||||
@@ -3863,13 +3863,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
|
||||
{
|
||||
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
|
||||
|
||||
- if (((surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB))
|
||||
- || (!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB)))
|
||||
+ if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB))
|
||||
+ || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ && (location & WINED3D_LOCATION_TEXTURE_RGB)))
|
||||
wined3d_texture_set_dirty(surface->container);
|
||||
|
||||
surface->ds_current_size.cx = w;
|
||||
surface->ds_current_size.cy = h;
|
||||
- surface->locations = location;
|
||||
+ surface->resource.locations = location;
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -3884,7 +3885,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
/* TODO: Make this work for modes other than FBO */
|
||||
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
|
||||
|
||||
- if (!(surface->locations & location))
|
||||
+ if (!(surface->resource.locations & location))
|
||||
{
|
||||
w = surface->ds_current_size.cx;
|
||||
h = surface->ds_current_size.cy;
|
||||
@@ -3910,7 +3911,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
return;
|
||||
}
|
||||
|
||||
- if (surface->locations & WINED3D_LOCATION_DISCARDED)
|
||||
+ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
TRACE("Surface was discarded, no need copy data.\n");
|
||||
switch (location)
|
||||
@@ -3927,17 +3928,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
default:
|
||||
FIXME("Unhandled location %#x\n", location);
|
||||
}
|
||||
- surface->locations &= ~WINED3D_LOCATION_DISCARDED;
|
||||
- surface->locations |= location;
|
||||
+ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED;
|
||||
+ surface->resource.locations |= location;
|
||||
surface->ds_current_size.cx = surface->resource.width;
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
return;
|
||||
}
|
||||
|
||||
- if (!surface->locations)
|
||||
+ if (!surface->resource.locations)
|
||||
{
|
||||
FIXME("No up to date depth stencil location.\n");
|
||||
- surface->locations |= location;
|
||||
+ surface->resource.locations |= location;
|
||||
surface->ds_current_size.cx = surface->resource.width;
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
return;
|
||||
@@ -4026,7 +4027,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
ERR("Invalid location (%#x) specified.\n", location);
|
||||
}
|
||||
|
||||
- surface->locations |= location;
|
||||
+ surface->resource.locations |= location;
|
||||
surface->ds_current_size.cx = surface->resource.width;
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
}
|
||||
@@ -4035,7 +4036,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
|
||||
{
|
||||
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
|
||||
|
||||
- surface->locations |= location;
|
||||
+ surface->resource.locations |= location;
|
||||
}
|
||||
|
||||
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
|
||||
@@ -4044,9 +4045,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
|
||||
|
||||
if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
wined3d_texture_set_dirty(surface->container);
|
||||
- surface->locations &= ~location;
|
||||
+ surface->resource.locations &= ~location;
|
||||
|
||||
- if (!surface->locations)
|
||||
+ if (!surface->resource.locations)
|
||||
ERR("Surface %p does not have any up to date location.\n", surface);
|
||||
}
|
||||
|
||||
@@ -4082,7 +4083,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
|
||||
UINT size = surface->resource.size;
|
||||
|
||||
surface_get_memory(surface, &dst, location);
|
||||
- surface_get_memory(surface, &src, surface->locations);
|
||||
+ surface_get_memory(surface, &src, surface->resource.locations);
|
||||
|
||||
if (dst.buffer_object)
|
||||
{
|
||||
@@ -4115,33 +4116,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
- if (surface->locations & surface_simple_locations)
|
||||
+ if (surface->resource.locations & surface_simple_locations)
|
||||
{
|
||||
surface_copy_simple_location(surface, dst_location);
|
||||
return;
|
||||
}
|
||||
|
||||
- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
|
||||
+ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
|
||||
surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
|
||||
/* Download the surface to system memory. */
|
||||
- if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
+ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
wined3d_texture_bind_and_dirtify(surface->container, context,
|
||||
- !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB));
|
||||
+ !(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB));
|
||||
surface_download_data(surface, gl_info, dst_location);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
- if (surface->locations & WINED3D_LOCATION_DRAWABLE)
|
||||
+ if (surface->resource.locations & WINED3D_LOCATION_DRAWABLE)
|
||||
{
|
||||
read_from_framebuffer(surface, context, dst_location);
|
||||
return;
|
||||
}
|
||||
|
||||
FIXME("Can't load surface %p with location flags %s into sysmem.\n",
|
||||
- surface, wined3d_debug_location(surface->locations));
|
||||
+ surface, wined3d_debug_location(surface->resource.locations));
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -4181,14 +4182,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
|
||||
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
|
||||
&& wined3d_resource_is_offscreen(&texture->resource)
|
||||
- && (surface->locations & WINED3D_LOCATION_DRAWABLE))
|
||||
+ && (surface->resource.locations & WINED3D_LOCATION_DRAWABLE))
|
||||
{
|
||||
surface_load_fb_texture(surface, srgb);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
- if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
|
||||
+ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
|
||||
&& (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
|
||||
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
|
||||
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
|
||||
@@ -4204,13 +4205,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)
|
||||
+ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)
|
||||
&& (!srgb || (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB))
|
||||
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
|
||||
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
|
||||
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
|
||||
{
|
||||
- DWORD src_location = surface->locations & WINED3D_LOCATION_RB_RESOLVED ?
|
||||
+ DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ?
|
||||
WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE;
|
||||
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
|
||||
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||
@@ -4225,7 +4226,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
|
||||
if (srgb)
|
||||
{
|
||||
- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding))
|
||||
+ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding))
|
||||
== WINED3D_LOCATION_TEXTURE_RGB)
|
||||
{
|
||||
/* Performance warning... */
|
||||
@@ -4236,7 +4237,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
}
|
||||
else
|
||||
{
|
||||
- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding))
|
||||
+ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding))
|
||||
== WINED3D_LOCATION_TEXTURE_SRGB)
|
||||
{
|
||||
/* Performance warning... */
|
||||
@@ -4246,7 +4247,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
}
|
||||
}
|
||||
|
||||
- if (!(surface->locations & surface_simple_locations))
|
||||
+ if (!(surface->resource.locations & surface_simple_locations))
|
||||
{
|
||||
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
|
||||
/* Lets hope we get it from somewhere... */
|
||||
@@ -4288,7 +4289,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
surface_remove_pbo(surface, gl_info);
|
||||
}
|
||||
|
||||
- surface_get_memory(surface, &data, surface->locations);
|
||||
+ surface_get_memory(surface, &data, surface->resource.locations);
|
||||
if (format.convert)
|
||||
{
|
||||
/* This code is entered for texture formats which need a fixup. */
|
||||
@@ -4344,7 +4345,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
|
||||
{
|
||||
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
|
||||
|
||||
- if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
|
||||
+ if (!(surface->resource.locations & WINED3D_LOCATION_RB_MULTISAMPLE))
|
||||
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
|
||||
surface);
|
||||
|
||||
@@ -4362,12 +4363,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||
{
|
||||
if (location == WINED3D_LOCATION_TEXTURE_RGB
|
||||
- && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
|
||||
+ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
|
||||
{
|
||||
surface_load_ds_location(surface, context, location);
|
||||
return;
|
||||
}
|
||||
- else if (location & surface->locations
|
||||
+ else if (location & surface->resource.locations
|
||||
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
|
||||
{
|
||||
/* Already up to date, nothing to do. */
|
||||
@@ -4376,12 +4377,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
else
|
||||
{
|
||||
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
|
||||
- wined3d_debug_location(surface->locations), wined3d_debug_location(location));
|
||||
+ wined3d_debug_location(surface->resource.locations), wined3d_debug_location(location));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
- if (surface->locations & location)
|
||||
+ if (surface->resource.locations & location)
|
||||
{
|
||||
TRACE("Location already up to date.\n");
|
||||
return;
|
||||
@@ -4395,7 +4396,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
required_access, surface->resource.access_flags);
|
||||
}
|
||||
|
||||
- if (!surface->locations)
|
||||
+ if (!surface->resource.locations)
|
||||
{
|
||||
ERR("Surface %p does not have any up to date location.\n", surface);
|
||||
surface->flags |= SFLAG_LOST;
|
||||
@@ -4434,7 +4435,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
|
||||
surface_validate_location(surface, location);
|
||||
|
||||
- if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM))
|
||||
+ if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
surface_evict_sysmem(surface);
|
||||
|
||||
return;
|
||||
@@ -5439,8 +5440,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
|
||||
{
|
||||
/* In principle this would apply to depth blits as well, but we don't
|
||||
* implement those in the CPU blitter at the moment. */
|
||||
- if ((dst_surface->locations & dst_surface->resource.map_binding)
|
||||
- && (!src_surface || (src_surface->locations & src_surface->resource.map_binding)))
|
||||
+ if ((dst_surface->resource.locations & dst_surface->resource.map_binding)
|
||||
+ && (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding)))
|
||||
{
|
||||
if (scale)
|
||||
TRACE("Not doing sysmem blit because of scaling.\n");
|
||||
@@ -5467,8 +5468,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
|
||||
TRACE("Color blit.\n");
|
||||
|
||||
/* Upload */
|
||||
- if ((src_surface->locations & WINED3D_LOCATION_SYSMEM)
|
||||
- && !(dst_surface->locations & WINED3D_LOCATION_SYSMEM))
|
||||
+ if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM)
|
||||
+ && !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
{
|
||||
if (scale)
|
||||
TRACE("Not doing upload because of scaling.\n");
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index d742b11..601d3ad 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -555,8 +555,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
|
||||
}
|
||||
|
||||
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
|
||||
- if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM)
|
||||
- || (back_buffer->locations & WINED3D_LOCATION_SYSMEM)))
|
||||
+ if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM)
|
||||
+ || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM)))
|
||||
{
|
||||
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
|
||||
* Doesn't work with render_to_fbo because we're not flipping
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 0c698b6..4011833 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2297,7 +2297,6 @@ struct wined3d_surface
|
||||
const struct wined3d_surface_ops *surface_ops;
|
||||
struct wined3d_texture *container;
|
||||
void *user_memory;
|
||||
- DWORD locations;
|
||||
|
||||
DWORD flags;
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,217 @@
|
||||
From a15ccac8ee6ece2955548900f4e7b4a993a498b2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sat, 4 Jan 2014 00:53:47 +0100
|
||||
Subject: wined3d: Remove surface_validate_location.
|
||||
|
||||
---
|
||||
dlls/wined3d/arb_program_shader.c | 2 +-
|
||||
dlls/wined3d/device.c | 2 +-
|
||||
dlls/wined3d/surface.c | 29 +++++++++++------------------
|
||||
dlls/wined3d/swapchain.c | 12 ++++++------
|
||||
dlls/wined3d/wined3d_private.h | 1 -
|
||||
5 files changed, 19 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
|
||||
index c1b3b6d..08f92cb 100644
|
||||
--- a/dlls/wined3d/arb_program_shader.c
|
||||
+++ b/dlls/wined3d/arb_program_shader.c
|
||||
@@ -7686,7 +7686,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
|
||||
|
||||
context_release(context);
|
||||
|
||||
- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
|
||||
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
|
||||
|
||||
return WINED3D_OK;
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 01ccd9d..e10ea1c 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -392,7 +392,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
|
||||
|
||||
if (rt)
|
||||
{
|
||||
- surface_validate_location(rt, rt->container->resource.draw_binding);
|
||||
+ wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding);
|
||||
surface_invalidate_location(rt, ~rt->container->resource.draw_binding);
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index c44179f..b56796e 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -1224,7 +1224,7 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
* and all flags get lost */
|
||||
surface_prepare_system_memory(surface);
|
||||
memset(surface->resource.heap_memory, 0, surface->resource.size);
|
||||
- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
|
||||
surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM);
|
||||
|
||||
/* We also get here when the ddraw swapchain is destroyed, for example
|
||||
@@ -1735,7 +1735,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
|
||||
|
||||
context_release(context);
|
||||
|
||||
- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2253,7 +2253,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
|
||||
valid_location = WINED3D_LOCATION_SYSMEM;
|
||||
}
|
||||
|
||||
- surface_validate_location(surface, valid_location);
|
||||
+ wined3d_resource_validate_location(&surface->resource, valid_location);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -2645,7 +2645,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
|
||||
{
|
||||
TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n",
|
||||
wined3d_debug_location(surface->resource.map_binding));
|
||||
- surface_validate_location(surface, surface->resource.map_binding);
|
||||
+ wined3d_resource_validate_location(&surface->resource, surface->resource.map_binding);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3200,7 +3200,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
|
||||
|
||||
/* The texture is now most up to date - If the surface is a render target
|
||||
* and has a drawable, this path is never entered. */
|
||||
- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
@@ -3474,7 +3474,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
|
||||
|
||||
/* The texture is now most up to date - If the surface is a render target
|
||||
* and has a drawable, this path is never entered. */
|
||||
- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
@@ -3787,7 +3787,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
|
||||
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT,
|
||||
(old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL);
|
||||
|
||||
- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
|
||||
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -4032,13 +4032,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
}
|
||||
|
||||
-void surface_validate_location(struct wined3d_surface *surface, DWORD location)
|
||||
-{
|
||||
- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
|
||||
-
|
||||
- surface->resource.locations |= location;
|
||||
-}
|
||||
-
|
||||
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
|
||||
{
|
||||
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
|
||||
@@ -4433,7 +4426,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
break;
|
||||
}
|
||||
|
||||
- surface_validate_location(surface, location);
|
||||
+ wined3d_resource_validate_location(&surface->resource, location);
|
||||
|
||||
if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
surface_evict_sysmem(surface);
|
||||
@@ -5528,7 +5521,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
|
||||
dst_surface, dst_surface->container->resource.draw_binding, &dst_rect);
|
||||
context_release(context);
|
||||
|
||||
- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
|
||||
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -5625,7 +5618,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
|
||||
}
|
||||
|
||||
surface->container = container;
|
||||
- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
|
||||
list_init(&surface->renderbuffers);
|
||||
list_init(&surface->overlays);
|
||||
|
||||
@@ -5657,7 +5650,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
|
||||
if (surface->resource.map_binding == WINED3D_LOCATION_DIB)
|
||||
{
|
||||
wined3d_resource_free_sysmem(&surface->resource);
|
||||
- surface_validate_location(surface, WINED3D_LOCATION_DIB);
|
||||
+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB);
|
||||
surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index 601d3ad..bdb4b67 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -569,19 +569,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
|
||||
/* Tell the front buffer surface that is has been modified. However,
|
||||
* the other locations were preserved during that, so keep the flags.
|
||||
* This serves to update the emulated overlay, if any. */
|
||||
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
|
||||
- surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
|
||||
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
|
||||
* and INTEXTURE copies can keep their old content if they have any defined content.
|
||||
@@ -590,7 +590,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
|
||||
*/
|
||||
if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
|
||||
{
|
||||
- surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding);
|
||||
+ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
|
||||
surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
|
||||
}
|
||||
}
|
||||
@@ -865,7 +865,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
|
||||
wined3d_texture_set_swapchain(swapchain->front_buffer, swapchain);
|
||||
if (!(device->wined3d->flags & WINED3D_NO3D))
|
||||
{
|
||||
- surface_validate_location(front_buffer, WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE);
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 4011833..5ca3ab8 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2368,7 +2368,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
|
||||
const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) 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;
|
||||
HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
|
||||
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
|
||||
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,161 @@
|
||||
From c7669f4cc8e98c81027cd1c2392d3435ec534206 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 3 Oct 2013 12:36:46 +0200
|
||||
Subject: wined3d: Move invalidate_location to resource.c.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 2 +-
|
||||
dlls/wined3d/resource.c | 7 +++++++
|
||||
dlls/wined3d/texture.c | 4 +---
|
||||
dlls/wined3d/volume.c | 21 +++++++--------------
|
||||
dlls/wined3d/wined3d_private.h | 2 +-
|
||||
5 files changed, 17 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index e10ea1c..600afed 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -3487,7 +3487,7 @@ static HRESULT device_update_volume(struct wined3d_device *device,
|
||||
data.buffer_object = 0;
|
||||
data.addr = src.data;
|
||||
wined3d_volume_upload_data(dst_volume, context, &data);
|
||||
- wined3d_volume_invalidate_location(dst_volume, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
|
||||
context_release(context);
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index bac15c0..1ec27d3 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -339,6 +339,13 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD
|
||||
TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
|
||||
}
|
||||
|
||||
+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location)
|
||||
+{
|
||||
+ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location));
|
||||
+ resource->locations &= ~location;
|
||||
+ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
|
||||
+}
|
||||
+
|
||||
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
UINT *slice_pitch)
|
||||
{
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index c173518..f003fa2 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1286,9 +1286,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource
|
||||
|
||||
static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location)
|
||||
{
|
||||
- struct wined3d_volume *volume = volume_from_resource(sub_resource);
|
||||
-
|
||||
- wined3d_volume_invalidate_location(volume, location);
|
||||
+ wined3d_resource_invalidate_location(sub_resource, location);
|
||||
}
|
||||
|
||||
static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index 6bc2724..3b742d2 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -98,13 +98,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
|
||||
HeapFree(GetProcessHeap(), 0, mem);
|
||||
}
|
||||
|
||||
-void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location)
|
||||
-{
|
||||
- TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location));
|
||||
- volume->resource.locations &= ~location;
|
||||
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
|
||||
-}
|
||||
-
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_volume_download_data(struct wined3d_volume *volume,
|
||||
const struct wined3d_context *context, const struct wined3d_bo_address *data)
|
||||
@@ -140,7 +133,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume,
|
||||
static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
|
||||
{
|
||||
wined3d_resource_free_sysmem(&volume->resource);
|
||||
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
static DWORD volume_access_from_location(DWORD location)
|
||||
@@ -238,7 +231,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
TRACE("Volume previously discarded, nothing to do.\n");
|
||||
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
|
||||
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM)
|
||||
{
|
||||
@@ -277,7 +270,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
TRACE("Volume previously discarded, nothing to do.\n");
|
||||
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
|
||||
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@@ -307,7 +300,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
{
|
||||
TRACE("Volume previously discarded, nothing to do.\n");
|
||||
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
|
||||
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@@ -400,13 +393,13 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
context = context_acquire(device, NULL);
|
||||
wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM);
|
||||
context_release(context);
|
||||
- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("Out of memory when unloading volume %p.\n", volume);
|
||||
wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
|
||||
- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED);
|
||||
+ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
if (volume->pbo)
|
||||
@@ -640,7 +633,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
|
||||
{
|
||||
wined3d_texture_set_dirty(volume->container);
|
||||
- wined3d_volume_invalidate_location(volume, ~volume->resource.map_binding);
|
||||
+ wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding);
|
||||
}
|
||||
|
||||
volume->resource.map_count++;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 5ca3ab8..fd28fa5 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2115,6 +2115,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H
|
||||
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;
|
||||
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Tests show that the start address of resources is 32 byte aligned */
|
||||
#define RESOURCE_ALIGNMENT 16
|
||||
@@ -2255,7 +2256,6 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi
|
||||
void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN;
|
||||
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context,
|
||||
BOOL srgb_mode) DECLSPEC_HIDDEN;
|
||||
-void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN;
|
||||
void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context,
|
||||
const struct wined3d_bo_address *data) DECLSPEC_HIDDEN;
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,144 @@
|
||||
From 39c0dd79f403ac4aac1cf660e207b0ed2703e81b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 18:44:48 +0100
|
||||
Subject: wined3d: Invalidate containers via callback.
|
||||
|
||||
---
|
||||
dlls/wined3d/buffer.c | 6 ++++++
|
||||
dlls/wined3d/resource.c | 2 ++
|
||||
dlls/wined3d/surface.c | 6 ++++++
|
||||
dlls/wined3d/texture.c | 6 ++++++
|
||||
dlls/wined3d/volume.c | 12 +++++++++---
|
||||
dlls/wined3d/wined3d_private.h | 1 +
|
||||
6 files changed, 30 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 989026f..d9bc820 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -1123,11 +1123,17 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource)
|
||||
return wined3d_buffer_decref(buffer_from_resource(resource));
|
||||
}
|
||||
|
||||
+static void wined3d_buffer_location_invalidated(struct wined3d_resource *resource, DWORD location)
|
||||
+{
|
||||
+ ERR("Not yet implemented.\n");
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_resource_ops buffer_resource_ops =
|
||||
{
|
||||
buffer_resource_incref,
|
||||
buffer_resource_decref,
|
||||
buffer_unload,
|
||||
+ wined3d_buffer_location_invalidated,
|
||||
};
|
||||
|
||||
static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device,
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 1ec27d3..9d2db2b 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -344,6 +344,8 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
|
||||
TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location));
|
||||
resource->locations &= ~location;
|
||||
TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
|
||||
+
|
||||
+ resource->resource_ops->resource_location_invalidated(resource, location);
|
||||
}
|
||||
|
||||
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index b56796e..6c2698a 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -1273,11 +1273,17 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
resource_unload(resource);
|
||||
}
|
||||
|
||||
+static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location)
|
||||
+{
|
||||
+ ERR("Not yet implemented.\n");
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_resource_ops surface_resource_ops =
|
||||
{
|
||||
surface_resource_incref,
|
||||
surface_resource_decref,
|
||||
surface_unload,
|
||||
+ wined3d_surface_location_invalidated,
|
||||
};
|
||||
|
||||
static const struct wined3d_surface_ops surface_ops =
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index f003fa2..c42e475 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -986,11 +986,17 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
wined3d_texture_unload_gl_texture(texture);
|
||||
}
|
||||
|
||||
+static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location)
|
||||
+{
|
||||
+ ERR("Should not be called on textures.\n");
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_resource_ops texture_resource_ops =
|
||||
{
|
||||
texture_resource_incref,
|
||||
texture_resource_decref,
|
||||
wined3d_texture_unload,
|
||||
+ wined3d_texture_load_location_invalidated,
|
||||
};
|
||||
|
||||
static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc,
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index 3b742d2..6921b87 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -631,10 +631,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
}
|
||||
|
||||
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
|
||||
- {
|
||||
- wined3d_texture_set_dirty(volume->container);
|
||||
wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding);
|
||||
- }
|
||||
|
||||
volume->resource.map_count++;
|
||||
|
||||
@@ -688,11 +685,20 @@ static ULONG volume_resource_decref(struct wined3d_resource *resource)
|
||||
return wined3d_volume_decref(volume_from_resource(resource));
|
||||
}
|
||||
|
||||
+static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location)
|
||||
+{
|
||||
+ struct wined3d_volume *volume = volume_from_resource(resource);
|
||||
+
|
||||
+ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
+ wined3d_texture_set_dirty(volume->container);
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_resource_ops volume_resource_ops =
|
||||
{
|
||||
volume_resource_incref,
|
||||
volume_resource_decref,
|
||||
volume_unload,
|
||||
+ wined3d_volume_location_invalidated,
|
||||
};
|
||||
|
||||
static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container,
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index fd28fa5..60d1b56 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2057,6 +2057,7 @@ struct wined3d_resource_ops
|
||||
ULONG (*resource_incref)(struct wined3d_resource *resource);
|
||||
ULONG (*resource_decref)(struct wined3d_resource *resource);
|
||||
void (*resource_unload)(struct wined3d_resource *resource);
|
||||
+ void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location);
|
||||
};
|
||||
|
||||
struct wined3d_resource
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,327 @@
|
||||
From 421ef7716a0748076fd14bb607849f81ab149679 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sat, 4 Jan 2014 01:02:15 +0100
|
||||
Subject: wined3d: Remove surface_invalidate_location.
|
||||
|
||||
---
|
||||
dlls/wined3d/arb_program_shader.c | 2 +-
|
||||
dlls/wined3d/context.c | 2 +-
|
||||
dlls/wined3d/device.c | 2 +-
|
||||
dlls/wined3d/drawprim.c | 2 +-
|
||||
dlls/wined3d/surface.c | 47 ++++++++++++++++-----------------------
|
||||
dlls/wined3d/swapchain.c | 12 +++++-----
|
||||
dlls/wined3d/texture.c | 6 ++---
|
||||
dlls/wined3d/wined3d_private.h | 1 -
|
||||
8 files changed, 31 insertions(+), 43 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
|
||||
index 08f92cb..f612099 100644
|
||||
--- a/dlls/wined3d/arb_program_shader.c
|
||||
+++ b/dlls/wined3d/arb_program_shader.c
|
||||
@@ -7687,7 +7687,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
|
||||
context_release(context);
|
||||
|
||||
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
|
||||
- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index 1f34992..61c074f 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -3085,7 +3085,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
|
||||
if (texture->texture_srgb.name)
|
||||
wined3d_texture_load(texture, context, TRUE);
|
||||
wined3d_texture_load(texture, context, FALSE);
|
||||
- surface_invalidate_location(context->current_rt, WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_invalidate_location(&context->current_rt->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 600afed..70a30f0 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -393,7 +393,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
|
||||
if (rt)
|
||||
{
|
||||
wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding);
|
||||
- surface_invalidate_location(rt, ~rt->container->resource.draw_binding);
|
||||
+ wined3d_resource_invalidate_location(&rt->resource, ~rt->container->resource.draw_binding);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
|
||||
index 7034b25..eef7e2c 100644
|
||||
--- a/dlls/wined3d/drawprim.c
|
||||
+++ b/dlls/wined3d/drawprim.c
|
||||
@@ -626,7 +626,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
|
||||
if (target)
|
||||
{
|
||||
surface_load_location(target, context, target->container->resource.draw_binding);
|
||||
- surface_invalidate_location(target, ~target->container->resource.draw_binding);
|
||||
+ wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 6c2698a..ef52ed0 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -599,7 +599,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
|
||||
return;
|
||||
|
||||
wined3d_resource_free_sysmem(&surface->resource);
|
||||
- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
static void surface_release_client_storage(struct wined3d_surface *surface)
|
||||
@@ -1185,7 +1185,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
|
||||
checkGLcall("glDeleteBuffersARB(1, &surface->pbo)");
|
||||
|
||||
surface->pbo = 0;
|
||||
- surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER);
|
||||
}
|
||||
|
||||
static ULONG surface_resource_incref(struct wined3d_resource *resource)
|
||||
@@ -1225,7 +1225,7 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
surface_prepare_system_memory(surface);
|
||||
memset(surface->resource.heap_memory, 0, surface->resource.size);
|
||||
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
|
||||
- surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_SYSMEM);
|
||||
|
||||
/* We also get here when the ddraw swapchain is destroyed, for example
|
||||
* for a mode switch. In this case this surface won't necessarily be
|
||||
@@ -1237,7 +1237,7 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
{
|
||||
surface_prepare_map_memory(surface);
|
||||
surface_load_location(surface, context, surface->resource.map_binding);
|
||||
- surface_invalidate_location(surface, ~surface->resource.map_binding);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
|
||||
}
|
||||
|
||||
/* Destroy PBOs, but load them into real sysmem before */
|
||||
@@ -1275,7 +1275,10 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
|
||||
static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location)
|
||||
{
|
||||
- ERR("Not yet implemented.\n");
|
||||
+ struct wined3d_surface *surface = surface_from_resource(resource);
|
||||
+
|
||||
+ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
+ wined3d_texture_set_dirty(surface->container);
|
||||
}
|
||||
|
||||
static const struct wined3d_resource_ops surface_resource_ops =
|
||||
@@ -1742,7 +1745,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
|
||||
context_release(context);
|
||||
|
||||
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -1873,7 +1876,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
|
||||
|
||||
surface_prepare_map_memory(surface);
|
||||
surface_load_location(surface, context, surface->resource.map_binding);
|
||||
- surface_invalidate_location(surface, ~surface->resource.map_binding);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
|
||||
/* Switching color keying on / off may change the internal format. */
|
||||
if (ck_changed)
|
||||
wined3d_texture_force_reload(surface->container);
|
||||
@@ -2668,7 +2671,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
|
||||
}
|
||||
|
||||
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
|
||||
- surface_invalidate_location(surface, ~surface->resource.map_binding);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
|
||||
|
||||
switch (surface->resource.map_binding)
|
||||
{
|
||||
@@ -2784,7 +2787,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
|
||||
}
|
||||
|
||||
surface_load_location(surface, context, WINED3D_LOCATION_DIB);
|
||||
- surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB);
|
||||
|
||||
if (context)
|
||||
context_release(context);
|
||||
@@ -2833,7 +2836,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
|
||||
context = context_acquire(device, NULL);
|
||||
|
||||
surface_load_location(surface, context, surface->resource.map_binding);
|
||||
- surface_invalidate_location(surface, WINED3D_LOCATION_DIB);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB);
|
||||
if (context)
|
||||
context_release(context);
|
||||
}
|
||||
@@ -3207,7 +3210,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
|
||||
/* The texture is now most up to date - If the surface is a render target
|
||||
* and has a drawable, this path is never entered. */
|
||||
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
/* Uses the hardware to stretch and flip the image */
|
||||
@@ -3275,7 +3278,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
|
||||
checkGLcall("glEnable(texture_target)");
|
||||
|
||||
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
|
||||
- src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB;
|
||||
+ wined3d_resource_invalidate_location(&src_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
|
||||
@@ -3481,7 +3484,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
|
||||
/* The texture is now most up to date - If the surface is a render target
|
||||
* and has a drawable, this path is never entered. */
|
||||
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
/* Front buffer coordinates are always full screen coordinates, but our GL
|
||||
@@ -3794,7 +3797,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
|
||||
(old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL);
|
||||
|
||||
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
|
||||
- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -4038,18 +4041,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
}
|
||||
|
||||
-void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
|
||||
-{
|
||||
- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
|
||||
-
|
||||
- if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
- wined3d_texture_set_dirty(surface->container);
|
||||
- surface->resource.locations &= ~location;
|
||||
-
|
||||
- if (!surface->resource.locations)
|
||||
- ERR("Surface %p does not have any up to date location.\n", surface);
|
||||
-}
|
||||
-
|
||||
static DWORD resource_access_from_location(DWORD location)
|
||||
{
|
||||
switch (location)
|
||||
@@ -5528,7 +5519,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
|
||||
context_release(context);
|
||||
|
||||
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
|
||||
- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -5657,7 +5648,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
|
||||
{
|
||||
wined3d_resource_free_sysmem(&surface->resource);
|
||||
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB);
|
||||
- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
return hr;
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index bdb4b67..e64715e 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -512,7 +512,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
|
||||
if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
|
||||
{
|
||||
surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
- surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
swapchain->render_to_fbo = TRUE;
|
||||
swapchain_update_draw_bindings(swapchain);
|
||||
}
|
||||
@@ -574,15 +574,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
|
||||
else
|
||||
{
|
||||
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
|
||||
wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
- surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
|
||||
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
|
||||
* and INTEXTURE copies can keep their old content if they have any defined content.
|
||||
* If the swapeffect is COPY, the content remains the same. If it is FLIP however,
|
||||
@@ -591,7 +591,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
|
||||
if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
|
||||
{
|
||||
wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
|
||||
- surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
|
||||
+ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -866,7 +866,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
|
||||
if (!(device->wined3d->flags & WINED3D_NO3D))
|
||||
{
|
||||
wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
- surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE);
|
||||
+ wined3d_resource_invalidate_location(&front_buffer->resource, ~WINED3D_LOCATION_DRAWABLE);
|
||||
}
|
||||
|
||||
/* MSDN says we're only allowed a single fullscreen swapchain per device,
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index c42e475..941d935 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -832,7 +832,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
|
||||
context = context_acquire(surface->resource.device, NULL);
|
||||
surface_load_location(surface, context, surface->resource.map_binding);
|
||||
context_release(context);
|
||||
- surface_invalidate_location(surface, ~surface->resource.map_binding);
|
||||
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
|
||||
}
|
||||
|
||||
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
|
||||
@@ -844,9 +844,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
|
||||
|
||||
static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location)
|
||||
{
|
||||
- struct wined3d_surface *surface = surface_from_resource(sub_resource);
|
||||
-
|
||||
- surface_invalidate_location(surface, location);
|
||||
+ wined3d_resource_invalidate_location(sub_resource, location);
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 60d1b56..640aa95 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2351,7 +2351,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s,
|
||||
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
|
||||
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
|
||||
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
|
||||
-void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;
|
||||
void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
void surface_load_ds_location(struct wined3d_surface *surface,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,171 @@
|
||||
From 2341723442d5ab7fb42bb82d066b306cc458813d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 16 Jan 2014 22:04:55 +0100
|
||||
Subject: wined3d: Move bitmap_data and user_memory into the resource.
|
||||
|
||||
I may want to change this to keep this in the surface. Not sure yet.
|
||||
---
|
||||
dlls/wined3d/surface.c | 32 ++++++++++++++++----------------
|
||||
dlls/wined3d/swapchain.c | 6 +++---
|
||||
dlls/wined3d/wined3d_private.h | 4 +---
|
||||
3 files changed, 20 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index ef52ed0..c689880 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -88,7 +88,7 @@ static void surface_cleanup(struct wined3d_surface *surface)
|
||||
{
|
||||
DeleteDC(surface->hDC);
|
||||
DeleteObject(surface->dib.DIBsection);
|
||||
- surface->dib.bitmap_data = NULL;
|
||||
+ surface->resource.bitmap_data = NULL;
|
||||
}
|
||||
|
||||
if (surface->overlay_dest)
|
||||
@@ -456,7 +456,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
|
||||
TRACE("Creating a DIB section with size %dx%dx%d, size=%d.\n",
|
||||
b_info->bmiHeader.biWidth, b_info->bmiHeader.biHeight,
|
||||
b_info->bmiHeader.biBitCount, b_info->bmiHeader.biSizeImage);
|
||||
- surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->dib.bitmap_data, 0, 0);
|
||||
+ surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->resource.bitmap_data, 0, 0);
|
||||
|
||||
if (!surface->dib.DIBsection)
|
||||
{
|
||||
@@ -465,7 +465,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
|
||||
- TRACE("DIBSection at %p.\n", surface->dib.bitmap_data);
|
||||
+ TRACE("DIBSection at %p.\n", surface->resource.bitmap_data);
|
||||
surface->dib.bitmap_size = b_info->bmiHeader.biSizeImage;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, b_info);
|
||||
@@ -490,13 +490,13 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win
|
||||
}
|
||||
if (location & WINED3D_LOCATION_USER_MEMORY)
|
||||
{
|
||||
- data->addr = surface->user_memory;
|
||||
+ data->addr = surface->resource.user_memory;
|
||||
data->buffer_object = 0;
|
||||
return;
|
||||
}
|
||||
if (location & WINED3D_LOCATION_DIB)
|
||||
{
|
||||
- data->addr = surface->dib.bitmap_data;
|
||||
+ data->addr = surface->resource.bitmap_data;
|
||||
data->buffer_object = 0;
|
||||
return;
|
||||
}
|
||||
@@ -569,13 +569,13 @@ void surface_prepare_map_memory(struct wined3d_surface *surface)
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_USER_MEMORY:
|
||||
- if (!surface->user_memory)
|
||||
- ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->user_memory is NULL.\n");
|
||||
+ if (!surface->resource.user_memory)
|
||||
+ ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->resource.user_memory is NULL.\n");
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_DIB:
|
||||
- if (!surface->dib.bitmap_data)
|
||||
- ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->dib.bitmap_data is NULL.\n");
|
||||
+ if (!surface->resource.bitmap_data)
|
||||
+ ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->resource.bitmap_data is NULL.\n");
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
@@ -2190,7 +2190,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
|
||||
{
|
||||
DeleteDC(surface->hDC);
|
||||
DeleteObject(surface->dib.DIBsection);
|
||||
- surface->dib.bitmap_data = NULL;
|
||||
+ surface->resource.bitmap_data = NULL;
|
||||
surface->flags &= ~SFLAG_DIBSECTION;
|
||||
create_dib = TRUE;
|
||||
}
|
||||
@@ -2222,7 +2222,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
|
||||
else
|
||||
surface->flags &= ~SFLAG_NONPOW2;
|
||||
|
||||
- if ((surface->user_memory = mem))
|
||||
+ if ((surface->resource.user_memory = mem))
|
||||
{
|
||||
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
|
||||
valid_location = WINED3D_LOCATION_USER_MEMORY;
|
||||
@@ -2680,11 +2680,11 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_USER_MEMORY:
|
||||
- base_memory = surface->user_memory;
|
||||
+ base_memory = surface->resource.user_memory;
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_DIB:
|
||||
- base_memory = surface->dib.bitmap_data;
|
||||
+ base_memory = surface->resource.bitmap_data;
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
@@ -3052,9 +3052,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
|
||||
{
|
||||
void* tmp;
|
||||
|
||||
- tmp = front->dib.bitmap_data;
|
||||
- front->dib.bitmap_data = back->dib.bitmap_data;
|
||||
- back->dib.bitmap_data = tmp;
|
||||
+ tmp = front->resource.bitmap_data;
|
||||
+ front->resource.bitmap_data = back->resource.bitmap_data;
|
||||
+ back->resource.bitmap_data = tmp;
|
||||
|
||||
tmp = front->resource.heap_memory;
|
||||
front->resource.heap_memory = back->resource.heap_memory;
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index e64715e..17f1afe 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -695,9 +695,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC
|
||||
{
|
||||
void *tmp;
|
||||
|
||||
- tmp = front->dib.bitmap_data;
|
||||
- front->dib.bitmap_data = back->dib.bitmap_data;
|
||||
- back->dib.bitmap_data = tmp;
|
||||
+ tmp = front->resource.bitmap_data;
|
||||
+ front->resource.bitmap_data = back->resource.bitmap_data;
|
||||
+ back->resource.bitmap_data = tmp;
|
||||
|
||||
if (front->resource.heap_memory)
|
||||
ERR("GDI Surface %p has heap memory allocated.\n", front);
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 640aa95..52280a7 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2080,7 +2080,7 @@ struct wined3d_resource
|
||||
UINT depth;
|
||||
UINT size;
|
||||
DWORD priority;
|
||||
- void *heap_memory;
|
||||
+ void *heap_memory, *user_memory, *bitmap_data;
|
||||
UINT custom_row_pitch, custom_slice_pitch;
|
||||
struct list resource_list_entry;
|
||||
DWORD locations;
|
||||
@@ -2263,7 +2263,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
|
||||
struct wined3d_surface_dib
|
||||
{
|
||||
HBITMAP DIBsection;
|
||||
- void *bitmap_data;
|
||||
UINT bitmap_size;
|
||||
};
|
||||
|
||||
@@ -2297,7 +2296,6 @@ struct wined3d_surface
|
||||
struct wined3d_resource resource;
|
||||
const struct wined3d_surface_ops *surface_ops;
|
||||
struct wined3d_texture *container;
|
||||
- void *user_memory;
|
||||
|
||||
DWORD flags;
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,309 @@
|
||||
From 647e3b2622558e3a8350bb3521fdbd3119b92d95 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 3 Oct 2013 12:47:01 +0200
|
||||
Subject: wined3d: Move load_location into the resource.
|
||||
|
||||
The resource part of load_location will handle transfers between sysmem
|
||||
locations (heap memory, user memory, dib) and buffers. Texture loading
|
||||
and downloading from textures will be delegated to surfaces / volumes.
|
||||
---
|
||||
dlls/wined3d/buffer.c | 8 +++++++
|
||||
dlls/wined3d/resource.c | 50 ++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/surface.c | 12 ++++++++--
|
||||
dlls/wined3d/texture.c | 8 +++++++
|
||||
dlls/wined3d/volume.c | 42 ++++++++---------------------------
|
||||
dlls/wined3d/wined3d_private.h | 7 +++++-
|
||||
6 files changed, 91 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index d9bc820..2e44f0f 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -1128,12 +1128,20 @@ static void wined3d_buffer_location_invalidated(struct wined3d_resource *resourc
|
||||
ERR("Not yet implemented.\n");
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void wined3d_buffer_load_location(struct wined3d_resource *resource,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
+{
|
||||
+ ERR("Not yet implemented.\n");
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_resource_ops buffer_resource_ops =
|
||||
{
|
||||
buffer_resource_incref,
|
||||
buffer_resource_decref,
|
||||
buffer_unload,
|
||||
wined3d_buffer_location_invalidated,
|
||||
+ wined3d_buffer_load_location,
|
||||
};
|
||||
|
||||
static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device,
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 9d2db2b..63f8584 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -348,6 +348,56 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
|
||||
resource->resource_ops->resource_location_invalidated(resource, location);
|
||||
}
|
||||
|
||||
+DWORD wined3d_resource_access_from_location(DWORD location)
|
||||
+{
|
||||
+ switch (location)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_DISCARDED:
|
||||
+ return 0;
|
||||
+
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ case WINED3D_LOCATION_USER_MEMORY:
|
||||
+ case WINED3D_LOCATION_DIB:
|
||||
+ return WINED3D_RESOURCE_ACCESS_CPU;
|
||||
+
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
+ case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
+ case WINED3D_LOCATION_DRAWABLE:
|
||||
+ case WINED3D_LOCATION_RB_MULTISAMPLE:
|
||||
+ case WINED3D_LOCATION_RB_RESOLVED:
|
||||
+ return WINED3D_RESOURCE_ACCESS_GPU;
|
||||
+
|
||||
+ default:
|
||||
+ FIXME("Unhandled location %#x.\n", location);
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* Context activation is optionally by the caller. Context may be NULL. */
|
||||
+void wined3d_resource_load_location(struct wined3d_resource *resource,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
+{
|
||||
+ DWORD required_access = wined3d_resource_access_from_location(location);
|
||||
+
|
||||
+ if ((resource->locations & location) == location)
|
||||
+ {
|
||||
+ TRACE("Location(s) already up to date.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Keep this a WARN for now until surfaces are cleaned up. */
|
||||
+ if ((resource->access_flags & required_access) != required_access)
|
||||
+ WARN("Operation requires %#x access, but resource only has %#x.\n",
|
||||
+ required_access, resource->access_flags);
|
||||
+
|
||||
+ /* Context is NULL in ddraw-only operation without OpenGL. */
|
||||
+ if (!context)
|
||||
+ ERR("A context is required for non-sysmem operation.\n");
|
||||
+
|
||||
+ resource->resource_ops->resource_load_location(resource, context, location);
|
||||
+}
|
||||
+
|
||||
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
UINT *slice_pitch)
|
||||
{
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index c689880..de57d25 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -1281,12 +1281,20 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
|
||||
wined3d_texture_set_dirty(surface->container);
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void wined3d_surface_load_location(struct wined3d_resource *resource,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
+{
|
||||
+ ERR("Not yet implemented.\n");
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_resource_ops surface_resource_ops =
|
||||
{
|
||||
surface_resource_incref,
|
||||
surface_resource_decref,
|
||||
surface_unload,
|
||||
wined3d_surface_location_invalidated,
|
||||
+ wined3d_surface_load_location,
|
||||
};
|
||||
|
||||
static const struct wined3d_surface_ops surface_ops =
|
||||
@@ -4041,7 +4049,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
}
|
||||
|
||||
-static DWORD resource_access_from_location(DWORD location)
|
||||
+static DWORD surface_access_from_location(DWORD location)
|
||||
{
|
||||
switch (location)
|
||||
{
|
||||
@@ -4380,7 +4388,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
|
||||
if (WARN_ON(d3d_surface))
|
||||
{
|
||||
- DWORD required_access = resource_access_from_location(location);
|
||||
+ DWORD required_access = surface_access_from_location(location);
|
||||
if ((surface->resource.access_flags & required_access) != required_access)
|
||||
WARN("Operation requires %#x access, but surface only has %#x.\n",
|
||||
required_access, surface->resource.access_flags);
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 941d935..ea9eacc 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -989,12 +989,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r
|
||||
ERR("Should not be called on textures.\n");
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void wined3d_texture_load_location(struct wined3d_resource *resource,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
+{
|
||||
+ ERR("Should not be called on textures.\n");
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_resource_ops texture_resource_ops =
|
||||
{
|
||||
texture_resource_incref,
|
||||
texture_resource_decref,
|
||||
wined3d_texture_unload,
|
||||
wined3d_texture_load_location_invalidated,
|
||||
+ wined3d_texture_load_location,
|
||||
};
|
||||
|
||||
static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc,
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index 6921b87..c93a1ef 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -136,27 +136,6 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
|
||||
wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
-static DWORD volume_access_from_location(DWORD location)
|
||||
-{
|
||||
- switch (location)
|
||||
- {
|
||||
- case WINED3D_LOCATION_DISCARDED:
|
||||
- return 0;
|
||||
-
|
||||
- case WINED3D_LOCATION_SYSMEM:
|
||||
- return WINED3D_RESOURCE_ACCESS_CPU;
|
||||
-
|
||||
- case WINED3D_LOCATION_BUFFER:
|
||||
- case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
- case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
- return WINED3D_RESOURCE_ACCESS_GPU;
|
||||
-
|
||||
- default:
|
||||
- FIXME("Unhandled location %#x.\n", location);
|
||||
- return 0;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume,
|
||||
struct wined3d_context *context, BOOL dest_is_srgb)
|
||||
@@ -196,21 +175,17 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
+
|
||||
/* Context activation is done by the caller. */
|
||||
-static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
+static void wined3d_volume_load_location(struct wined3d_resource *resource,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
- DWORD required_access = volume_access_from_location(location);
|
||||
+ struct wined3d_volume *volume = volume_from_resource(resource);
|
||||
+ DWORD required_access = wined3d_resource_access_from_location(location);
|
||||
|
||||
TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location),
|
||||
wined3d_debug_location(volume->resource.locations));
|
||||
|
||||
- if ((volume->resource.locations & location) == location)
|
||||
- {
|
||||
- TRACE("Location(s) already up to date.\n");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
if ((volume->resource.access_flags & required_access) != required_access)
|
||||
{
|
||||
ERR("Operation requires %#x access, but volume only has %#x.\n",
|
||||
@@ -332,7 +307,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode)
|
||||
{
|
||||
wined3d_texture_prepare_texture(volume->container, context, srgb_mode);
|
||||
- wined3d_volume_load_location(volume, context,
|
||||
+ wined3d_resource_load_location(&volume->resource, context,
|
||||
srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
@@ -391,7 +366,7 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
if (volume_prepare_system_memory(volume))
|
||||
{
|
||||
context = context_acquire(device, NULL);
|
||||
- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM);
|
||||
context_release(context);
|
||||
wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
@@ -546,7 +521,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
if (flags & WINED3D_MAP_DISCARD)
|
||||
wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER);
|
||||
else
|
||||
- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER);
|
||||
+ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER);
|
||||
|
||||
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
|
||||
@@ -584,7 +559,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
{
|
||||
context = context_acquire(device, NULL);
|
||||
- wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM);
|
||||
context_release(context);
|
||||
}
|
||||
base_memory = volume->resource.heap_memory;
|
||||
@@ -699,6 +674,7 @@ static const struct wined3d_resource_ops volume_resource_ops =
|
||||
volume_resource_decref,
|
||||
volume_unload,
|
||||
wined3d_volume_location_invalidated,
|
||||
+ wined3d_volume_load_location,
|
||||
};
|
||||
|
||||
static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container,
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 52280a7..b1e4cb6 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2058,6 +2058,8 @@ struct wined3d_resource_ops
|
||||
ULONG (*resource_decref)(struct wined3d_resource *resource);
|
||||
void (*resource_unload)(struct wined3d_resource *resource);
|
||||
void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location);
|
||||
+ void (*resource_load_location)(struct wined3d_resource *resource,
|
||||
+ struct wined3d_context *context, DWORD location);
|
||||
};
|
||||
|
||||
struct wined3d_resource
|
||||
@@ -2108,15 +2110,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops,
|
||||
const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN;
|
||||
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
+DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
|
||||
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
|
||||
+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
+void wined3d_resource_load_location(struct wined3d_resource *resource,
|
||||
+ struct wined3d_context *context, DWORD location) 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;
|
||||
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
-void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Tests show that the start address of resources is 32 byte aligned */
|
||||
#define RESOURCE_ALIGNMENT 16
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,411 @@
|
||||
From a1e69a04b1cb46aa0d16b4bc4b696321e0698972 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 17 Nov 2013 20:33:17 +0100
|
||||
Subject: wined3d: Replace surface_load_location with resource_load_location.
|
||||
|
||||
FIXME: Check if this patch is complete enough to make sense.
|
||||
---
|
||||
dlls/wined3d/context.c | 2 +-
|
||||
dlls/wined3d/device.c | 2 +-
|
||||
dlls/wined3d/drawprim.c | 2 +-
|
||||
dlls/wined3d/surface.c | 113 +++++++++++++----------------------------
|
||||
dlls/wined3d/swapchain.c | 8 +--
|
||||
dlls/wined3d/texture.c | 2 +-
|
||||
dlls/wined3d/wined3d_private.h | 2 -
|
||||
7 files changed, 44 insertions(+), 87 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index 61c074f..cc60348 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -2215,7 +2215,7 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
|
||||
WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
|
||||
|
||||
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
|
||||
- surface_load_location(context->current_rt, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_load_location(&context->current_rt->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
swapchain->render_to_fbo = TRUE;
|
||||
swapchain_update_draw_bindings(swapchain);
|
||||
context_set_render_offscreen(context, TRUE);
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 70a30f0..565a92c 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -323,7 +323,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
|
||||
{
|
||||
struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]);
|
||||
if (rt)
|
||||
- surface_load_location(rt, context, rt->container->resource.draw_binding);
|
||||
+ wined3d_resource_load_location(&rt->resource, context, rt->container->resource.draw_binding);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
|
||||
index eef7e2c..62b7032 100644
|
||||
--- a/dlls/wined3d/drawprim.c
|
||||
+++ b/dlls/wined3d/drawprim.c
|
||||
@@ -625,7 +625,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
|
||||
struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]);
|
||||
if (target)
|
||||
{
|
||||
- surface_load_location(target, context, target->container->resource.draw_binding);
|
||||
+ wined3d_resource_load_location(&target->resource, context, target->container->resource.draw_binding);
|
||||
wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding);
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index de57d25..6154315 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -759,7 +759,7 @@ static void surface_unmap(struct wined3d_surface *surface)
|
||||
|
||||
if (device->d3d_initialized)
|
||||
context = context_acquire(device, surface);
|
||||
- surface_load_location(surface, context, surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->container->resource.draw_binding);
|
||||
if (context)
|
||||
context_release(context);
|
||||
}
|
||||
@@ -825,9 +825,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
|
||||
|
||||
/* Make sure the locations are up-to-date. Loading the destination
|
||||
* surface isn't required if the entire surface is overwritten. */
|
||||
- surface_load_location(src_surface, context, src_location);
|
||||
+ wined3d_resource_load_location(&src_surface->resource, context, src_location);
|
||||
if (!surface_is_full_rect(dst_surface, dst_rect))
|
||||
- surface_load_location(dst_surface, context, dst_location);
|
||||
+ wined3d_resource_load_location(&dst_surface->resource, context, dst_location);
|
||||
|
||||
gl_info = context->gl_info;
|
||||
|
||||
@@ -916,9 +916,9 @@ static void surface_blt_fbo(const struct wined3d_device *device,
|
||||
* surface isn't required if the entire surface is overwritten. (And is
|
||||
* in fact harmful if we're being called by surface_load_location() with
|
||||
* the purpose of loading the destination surface.) */
|
||||
- surface_load_location(src_surface, old_ctx, src_location);
|
||||
+ wined3d_resource_load_location(&src_surface->resource, old_ctx, src_location);
|
||||
if (!surface_is_full_rect(dst_surface, &dst_rect))
|
||||
- surface_load_location(dst_surface, old_ctx, dst_location);
|
||||
+ wined3d_resource_load_location(&dst_surface->resource, old_ctx, dst_location);
|
||||
|
||||
if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
|
||||
else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
|
||||
@@ -1236,7 +1236,7 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
else
|
||||
{
|
||||
surface_prepare_map_memory(surface);
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
|
||||
}
|
||||
|
||||
@@ -1281,22 +1281,6 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
|
||||
wined3d_texture_set_dirty(surface->container);
|
||||
}
|
||||
|
||||
-/* Context activation is done by the caller. */
|
||||
-static void wined3d_surface_load_location(struct wined3d_resource *resource,
|
||||
- struct wined3d_context *context, DWORD location)
|
||||
-{
|
||||
- ERR("Not yet implemented.\n");
|
||||
-}
|
||||
-
|
||||
-static const struct wined3d_resource_ops surface_resource_ops =
|
||||
-{
|
||||
- surface_resource_incref,
|
||||
- surface_resource_decref,
|
||||
- surface_unload,
|
||||
- wined3d_surface_location_invalidated,
|
||||
- wined3d_surface_load_location,
|
||||
-};
|
||||
-
|
||||
static const struct wined3d_surface_ops surface_ops =
|
||||
{
|
||||
surface_private_setup,
|
||||
@@ -1740,7 +1724,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
|
||||
if (update_w == dst_w && update_h == dst_h)
|
||||
wined3d_texture_prepare_texture(dst_surface->container, context, FALSE);
|
||||
else
|
||||
- surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
wined3d_texture_bind(dst_surface->container, context, FALSE);
|
||||
|
||||
surface_get_memory(src_surface, &data, src_surface->resource.locations);
|
||||
@@ -1883,7 +1867,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
|
||||
* the surface. Make sure we have it. */
|
||||
|
||||
surface_prepare_map_memory(surface);
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
|
||||
/* Switching color keying on / off may change the internal format. */
|
||||
if (ck_changed)
|
||||
@@ -1899,7 +1883,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
|
||||
return;
|
||||
}
|
||||
|
||||
- surface_load_location(surface, context, location);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, location);
|
||||
surface_evict_sysmem(surface);
|
||||
}
|
||||
|
||||
@@ -2673,7 +2657,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
|
||||
|
||||
if (surface->resource.device->d3d_initialized)
|
||||
context = context_acquire(surface->resource.device, NULL);
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
if (context)
|
||||
context_release(context);
|
||||
}
|
||||
@@ -2778,7 +2762,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
|
||||
{
|
||||
if (surface->flags & SFLAG_CLIENT)
|
||||
{
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM);
|
||||
surface_release_client_storage(surface);
|
||||
}
|
||||
hr = surface_create_dib_section(surface);
|
||||
@@ -2794,7 +2778,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
|
||||
surface->resource.map_binding = WINED3D_LOCATION_DIB;
|
||||
}
|
||||
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_DIB);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_DIB);
|
||||
wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB);
|
||||
|
||||
if (context)
|
||||
@@ -2843,7 +2827,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
|
||||
if (device->d3d_initialized)
|
||||
context = context_acquire(device, NULL);
|
||||
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB);
|
||||
if (context)
|
||||
context_release(context);
|
||||
@@ -3555,8 +3539,8 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
|
||||
gl_info = context->gl_info;
|
||||
|
||||
/* Make sure the surface is up-to-date. This should probably use
|
||||
- * surface_load_location() and worry about the destination surface too,
|
||||
- * unless we're overwriting it completely. */
|
||||
+ * wined3d_resource_load_location() and worry about the destination
|
||||
+ * surface too, unless we're overwriting it completely. */
|
||||
wined3d_texture_load(src_surface->container, context, FALSE);
|
||||
|
||||
/* Activate the destination context, set it up for blitting */
|
||||
@@ -4049,29 +4033,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
}
|
||||
|
||||
-static DWORD surface_access_from_location(DWORD location)
|
||||
-{
|
||||
- switch (location)
|
||||
- {
|
||||
- case WINED3D_LOCATION_SYSMEM:
|
||||
- case WINED3D_LOCATION_USER_MEMORY:
|
||||
- case WINED3D_LOCATION_DIB:
|
||||
- case WINED3D_LOCATION_BUFFER:
|
||||
- return WINED3D_RESOURCE_ACCESS_CPU;
|
||||
-
|
||||
- case WINED3D_LOCATION_DRAWABLE:
|
||||
- case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
- case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
- case WINED3D_LOCATION_RB_MULTISAMPLE:
|
||||
- case WINED3D_LOCATION_RB_RESOLVED:
|
||||
- return WINED3D_RESOURCE_ACCESS_GPU;
|
||||
-
|
||||
- default:
|
||||
- FIXME("Unhandled location %#x.\n", location);
|
||||
- return 0;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location)
|
||||
{
|
||||
struct wined3d_device *device = surface->resource.device;
|
||||
@@ -4121,7 +4082,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
}
|
||||
|
||||
if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
|
||||
/* Download the surface to system memory. */
|
||||
if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
@@ -4157,7 +4118,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
|
||||
}
|
||||
|
||||
surface_get_rect(surface, NULL, &r);
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
surface_blt_to_drawable(surface->resource.device, context,
|
||||
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
|
||||
|
||||
@@ -4230,7 +4191,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
/* Performance warning... */
|
||||
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
|
||||
surface_prepare_map_memory(surface);
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4241,7 +4202,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
/* Performance warning... */
|
||||
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
|
||||
surface_prepare_map_memory(surface);
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4250,7 +4211,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
|
||||
/* Lets hope we get it from somewhere... */
|
||||
surface_prepare_system_memory(surface);
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
wined3d_texture_prepare_texture(texture, context, srgb);
|
||||
@@ -4283,7 +4244,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
surface->resource.map_binding = WINED3D_LOCATION_SYSMEM;
|
||||
|
||||
surface_prepare_map_memory(surface);
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
surface_remove_pbo(surface, gl_info);
|
||||
}
|
||||
|
||||
@@ -4351,9 +4312,11 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
|
||||
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
|
||||
}
|
||||
|
||||
-/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
|
||||
-void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void wined3d_surface_load_location(struct wined3d_resource *resource,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
+ struct wined3d_surface *surface = surface_from_resource(resource);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
|
||||
@@ -4380,20 +4343,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
}
|
||||
}
|
||||
|
||||
- if (surface->resource.locations & location)
|
||||
- {
|
||||
- TRACE("Location already up to date.\n");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (WARN_ON(d3d_surface))
|
||||
- {
|
||||
- DWORD required_access = surface_access_from_location(location);
|
||||
- if ((surface->resource.access_flags & required_access) != required_access)
|
||||
- WARN("Operation requires %#x access, but surface only has %#x.\n",
|
||||
- required_access, surface->resource.access_flags);
|
||||
- }
|
||||
-
|
||||
if (!surface->resource.locations)
|
||||
{
|
||||
ERR("Surface %p does not have any up to date location.\n", surface);
|
||||
@@ -5482,7 +5431,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
|
||||
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
|
||||
{
|
||||
struct wined3d_context *context = context_acquire(device, dst_surface);
|
||||
- surface_load_location(dst_surface, context, dst_surface->container->resource.draw_binding);
|
||||
+ wined3d_resource_load_location(&dst_surface->resource, context,
|
||||
+ dst_surface->container->resource.draw_binding);
|
||||
context_release(context);
|
||||
}
|
||||
return WINED3D_OK;
|
||||
@@ -5557,6 +5507,15 @@ cpu:
|
||||
return surface_cpu_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, fx, filter);
|
||||
}
|
||||
|
||||
+static const struct wined3d_resource_ops surface_resource_ops =
|
||||
+{
|
||||
+ surface_resource_incref,
|
||||
+ surface_resource_decref,
|
||||
+ surface_unload,
|
||||
+ wined3d_surface_location_invalidated,
|
||||
+ wined3d_surface_load_location,
|
||||
+};
|
||||
+
|
||||
static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container,
|
||||
const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags)
|
||||
{
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index 17f1afe..e1a5b8a 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -309,7 +309,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
|
||||
if (backbuffer->resource.multisample_type)
|
||||
{
|
||||
location = WINED3D_LOCATION_RB_RESOLVED;
|
||||
- surface_load_location(backbuffer, context, location);
|
||||
+ wined3d_resource_load_location(&backbuffer->resource, context, location);
|
||||
}
|
||||
|
||||
context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location);
|
||||
@@ -511,14 +511,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
|
||||
*/
|
||||
if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
|
||||
{
|
||||
- surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_resource_load_location(&back_buffer->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
|
||||
swapchain->render_to_fbo = TRUE;
|
||||
swapchain_update_draw_bindings(swapchain);
|
||||
}
|
||||
else
|
||||
{
|
||||
- surface_load_location(back_buffer, context, back_buffer->container->resource.draw_binding);
|
||||
+ wined3d_resource_load_location(&back_buffer->resource, context, back_buffer->container->resource.draw_binding);
|
||||
}
|
||||
|
||||
if (swapchain->render_to_fbo)
|
||||
@@ -640,7 +640,7 @@ void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *r
|
||||
|
||||
TRACE("Copying surface %p to screen.\n", front);
|
||||
|
||||
- surface_load_location(front, NULL, WINED3D_LOCATION_DIB);
|
||||
+ wined3d_resource_load_location(&front->resource, NULL, WINED3D_LOCATION_DIB);
|
||||
|
||||
src_dc = front->hDC;
|
||||
window = swapchain->win_handle;
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index ea9eacc..48717d7 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -830,7 +830,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
|
||||
|
||||
surface_prepare_map_memory(surface);
|
||||
context = context_acquire(surface->resource.device, NULL);
|
||||
- surface_load_location(surface, context, surface->resource.map_binding);
|
||||
+ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding);
|
||||
context_release(context);
|
||||
wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index b1e4cb6..059310b 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2358,8 +2358,6 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
|
||||
void surface_load_ds_location(struct wined3d_surface *surface,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
-void surface_load_location(struct wined3d_surface *surface,
|
||||
- struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
|
||||
void surface_prepare_rb(struct wined3d_surface *surface,
|
||||
const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,213 @@
|
||||
From 6502ec68de4a38d59a2e6690eca2546e710b6cbc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 18 Sep 2013 22:30:57 +0200
|
||||
Subject: wined3d: Introduce helper functions for mapping volumes.
|
||||
|
||||
---
|
||||
dlls/wined3d/volume.c | 157 ++++++++++++++++++++++++++++++--------------------
|
||||
1 file changed, 96 insertions(+), 61 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index c93a1ef..ee64070 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -475,12 +475,67 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, struct wined3d_context *context)
|
||||
+{
|
||||
+ switch (volume->resource.map_binding)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ wined3d_volume_prepare_pbo(volume, context);
|
||||
+ return TRUE;
|
||||
+
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ return volume_prepare_system_memory(volume);
|
||||
+
|
||||
+ default:
|
||||
+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static BYTE *wined3d_volume_get_map_ptr(const struct wined3d_volume *volume,
|
||||
+ const struct wined3d_context *context, DWORD flags)
|
||||
+{
|
||||
+ const struct wined3d_gl_info *gl_info;
|
||||
+ BYTE *ptr;
|
||||
+
|
||||
+ switch (volume->resource.map_binding)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ gl_info = context->gl_info;
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
+
|
||||
+ if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
|
||||
+ {
|
||||
+ GLbitfield mapflags = wined3d_resource_gl_map_flags(flags);
|
||||
+ mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT;
|
||||
+ ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB,
|
||||
+ 0, volume->resource.size, mapflags));
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ GLenum access = wined3d_resource_gl_legacy_map_flags(flags);
|
||||
+ ptr = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access));
|
||||
+ }
|
||||
+
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
+ checkGLcall("Map PBO");
|
||||
+ return ptr;
|
||||
+
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ return volume->resource.heap_memory;
|
||||
+
|
||||
+ default:
|
||||
+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
|
||||
{
|
||||
struct wined3d_device *device = volume->resource.device;
|
||||
struct wined3d_context *context;
|
||||
- const struct wined3d_gl_info *gl_info;
|
||||
BYTE *base_memory;
|
||||
const struct wined3d_format *format = volume->resource.format;
|
||||
|
||||
@@ -512,58 +567,22 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
|
||||
flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags);
|
||||
|
||||
- if (volume->resource.map_binding == WINED3D_LOCATION_BUFFER)
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ if (!wined3d_volume_prepare_map_memory(volume, context))
|
||||
{
|
||||
- context = context_acquire(device, NULL);
|
||||
- gl_info = context->gl_info;
|
||||
-
|
||||
- wined3d_volume_prepare_pbo(volume, context);
|
||||
- if (flags & WINED3D_MAP_DISCARD)
|
||||
- wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER);
|
||||
- else
|
||||
- wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_BUFFER);
|
||||
-
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
-
|
||||
- if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
|
||||
- {
|
||||
- GLbitfield mapflags = wined3d_resource_gl_map_flags(flags);
|
||||
- mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT;
|
||||
- base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB,
|
||||
- 0, volume->resource.size, mapflags));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- GLenum access = wined3d_resource_gl_legacy_map_flags(flags);
|
||||
- base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access));
|
||||
- }
|
||||
-
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
- checkGLcall("Map PBO");
|
||||
-
|
||||
+ WARN("Out of memory.\n");
|
||||
+ map_desc->data = NULL;
|
||||
context_release(context);
|
||||
+ return E_OUTOFMEMORY;
|
||||
}
|
||||
+
|
||||
+ if (flags & WINED3D_MAP_DISCARD)
|
||||
+ wined3d_resource_validate_location(&volume->resource, volume->resource.map_binding);
|
||||
else
|
||||
- {
|
||||
- if (!volume_prepare_system_memory(volume))
|
||||
- {
|
||||
- WARN("Out of memory.\n");
|
||||
- map_desc->data = NULL;
|
||||
- return E_OUTOFMEMORY;
|
||||
- }
|
||||
+ wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding);
|
||||
|
||||
- if (flags & WINED3D_MAP_DISCARD)
|
||||
- {
|
||||
- wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
|
||||
- }
|
||||
- else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
- {
|
||||
- context = context_acquire(device, NULL);
|
||||
- wined3d_resource_load_location(&volume->resource, context, WINED3D_LOCATION_SYSMEM);
|
||||
- context_release(context);
|
||||
- }
|
||||
- base_memory = volume->resource.heap_memory;
|
||||
- }
|
||||
+ base_memory = wined3d_volume_get_map_ptr(volume, context, flags);
|
||||
+ context_release(context);
|
||||
|
||||
TRACE("Base memory pointer %p.\n", base_memory);
|
||||
|
||||
@@ -621,8 +640,34 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
|
||||
return volume_from_resource(resource);
|
||||
}
|
||||
|
||||
+static void wined3d_volume_release_map_ptr(const struct wined3d_volume *volume,
|
||||
+ const struct wined3d_context *context)
|
||||
+{
|
||||
+ const struct wined3d_gl_info *gl_info;
|
||||
+
|
||||
+ switch (volume->resource.map_binding)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ gl_info = context->gl_info;
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
+ GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB));
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
+ checkGLcall("Unmap PBO");
|
||||
+ return;
|
||||
+
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ return;
|
||||
+
|
||||
+ default:
|
||||
+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding));
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
|
||||
{
|
||||
+ struct wined3d_device *device = volume->resource.device;
|
||||
+ struct wined3d_context *context;
|
||||
TRACE("volume %p.\n", volume);
|
||||
|
||||
if (!volume->resource.map_count)
|
||||
@@ -631,19 +676,9 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
- if (volume->resource.map_binding == WINED3D_LOCATION_BUFFER)
|
||||
- {
|
||||
- struct wined3d_device *device = volume->resource.device;
|
||||
- struct wined3d_context *context = context_acquire(device, NULL);
|
||||
- const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
-
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
- GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB));
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
- checkGLcall("Unmap PBO");
|
||||
-
|
||||
- context_release(context);
|
||||
- }
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ wined3d_volume_release_map_ptr(volume, context);
|
||||
+ context_release(context);
|
||||
|
||||
volume->resource.map_count--;
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
@@ -0,0 +1,311 @@
|
||||
From b416ab9ae21fee5c8253969318c55156c1d5fc0a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 16 Jan 2014 22:07:17 +0100
|
||||
Subject: wined3d: Move volume PBO infrastructure into the resource.
|
||||
|
||||
---
|
||||
dlls/wined3d/resource.c | 64 +++++++++++++++++++++++++++++-
|
||||
dlls/wined3d/volume.c | 90 +++++++-----------------------------------
|
||||
dlls/wined3d/wined3d_private.h | 7 +++-
|
||||
3 files changed, 82 insertions(+), 79 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 63f8584..d904c36 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -292,7 +292,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags)
|
||||
+static GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags)
|
||||
{
|
||||
if (d3d_flags & WINED3D_MAP_READONLY)
|
||||
return GL_READ_ONLY_ARB;
|
||||
@@ -398,6 +398,68 @@ void wined3d_resource_load_location(struct wined3d_resource *resource,
|
||||
resource->resource_ops->resource_load_location(resource, context, location);
|
||||
}
|
||||
|
||||
+BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
|
||||
+ const struct wined3d_context *context, DWORD flags)
|
||||
+{
|
||||
+ const struct wined3d_gl_info *gl_info;
|
||||
+ BYTE *ptr;
|
||||
+
|
||||
+ switch (resource->map_binding)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ gl_info = context->gl_info;
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object));
|
||||
+
|
||||
+ if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
|
||||
+ {
|
||||
+ GLbitfield mapflags = wined3d_resource_gl_map_flags(flags);
|
||||
+ mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT;
|
||||
+ ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB,
|
||||
+ 0, resource->size, mapflags));
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ GLenum access = wined3d_resource_gl_legacy_map_flags(flags);
|
||||
+ ptr = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access));
|
||||
+ }
|
||||
+
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
+ checkGLcall("Map GL buffer");
|
||||
+ return ptr;
|
||||
+
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ return resource->heap_memory;
|
||||
+
|
||||
+ default:
|
||||
+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
|
||||
+ const struct wined3d_context *context)
|
||||
+{
|
||||
+ const struct wined3d_gl_info *gl_info;
|
||||
+
|
||||
+ switch (resource->map_binding)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ gl_info = context->gl_info;
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, resource->buffer_object));
|
||||
+ GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB));
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
+ checkGLcall("Unmap GL buffer");
|
||||
+ return;
|
||||
+
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ return;
|
||||
+
|
||||
+ default:
|
||||
+ ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding));
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
UINT *slice_pitch)
|
||||
{
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index ee64070..1e03097 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -215,7 +215,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource,
|
||||
}
|
||||
else if (volume->resource.locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
- struct wined3d_bo_address data = {volume->pbo, NULL};
|
||||
+ struct wined3d_bo_address data = {volume->resource.buffer_object, NULL};
|
||||
wined3d_volume_upload_data(volume, context, &data);
|
||||
}
|
||||
else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
@@ -269,7 +269,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource,
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
- if (!volume->pbo)
|
||||
+ if (!volume->resource.buffer_object)
|
||||
ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n");
|
||||
|
||||
if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
|
||||
@@ -279,7 +279,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource,
|
||||
}
|
||||
else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
- struct wined3d_bo_address data = {volume->pbo, NULL};
|
||||
+ struct wined3d_bo_address data = {volume->resource.buffer_object, NULL};
|
||||
|
||||
if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
|
||||
@@ -316,16 +316,16 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
- if (volume->pbo)
|
||||
+ if (volume->resource.buffer_object)
|
||||
return;
|
||||
|
||||
- GL_EXTCALL(glGenBuffersARB(1, &volume->pbo));
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
+ GL_EXTCALL(glGenBuffersARB(1, &volume->resource.buffer_object));
|
||||
+ GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.buffer_object));
|
||||
GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.size, NULL, GL_STREAM_DRAW_ARB));
|
||||
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
checkGLcall("Create PBO");
|
||||
|
||||
- TRACE("Created PBO %u for volume %p.\n", volume->pbo, volume);
|
||||
+ TRACE("Created PBO %u for volume %p.\n", volume->resource.buffer_object, volume);
|
||||
}
|
||||
|
||||
static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
|
||||
@@ -333,10 +333,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
|
||||
struct wined3d_context *context = context_acquire(volume->resource.device, NULL);
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
- TRACE("Deleting PBO %u belonging to volume %p.\n", volume->pbo, volume);
|
||||
- GL_EXTCALL(glDeleteBuffersARB(1, &volume->pbo));
|
||||
+ TRACE("Deleting PBO %u belonging to volume %p.\n", volume->resource.buffer_object, volume);
|
||||
+ GL_EXTCALL(glDeleteBuffersARB(1, &volume->resource.buffer_object));
|
||||
checkGLcall("glDeleteBuffersARB");
|
||||
- volume->pbo = 0;
|
||||
+ volume->resource.buffer_object = 0;
|
||||
context_release(context);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ void wined3d_volume_destroy(struct wined3d_volume *volume)
|
||||
{
|
||||
TRACE("volume %p.\n", volume);
|
||||
|
||||
- if (volume->pbo)
|
||||
+ if (volume->resource.buffer_object)
|
||||
wined3d_volume_free_pbo(volume);
|
||||
|
||||
resource_cleanup(&volume->resource);
|
||||
@@ -377,7 +377,7 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
- if (volume->pbo)
|
||||
+ if (volume->resource.buffer_object)
|
||||
{
|
||||
/* Should not happen because only dynamic default pool volumes
|
||||
* have a buffer, and those are not evicted by device_evit_managed_resources
|
||||
@@ -493,44 +493,6 @@ static BOOL wined3d_volume_prepare_map_memory(struct wined3d_volume *volume, str
|
||||
}
|
||||
}
|
||||
|
||||
-static BYTE *wined3d_volume_get_map_ptr(const struct wined3d_volume *volume,
|
||||
- const struct wined3d_context *context, DWORD flags)
|
||||
-{
|
||||
- const struct wined3d_gl_info *gl_info;
|
||||
- BYTE *ptr;
|
||||
-
|
||||
- switch (volume->resource.map_binding)
|
||||
- {
|
||||
- case WINED3D_LOCATION_BUFFER:
|
||||
- gl_info = context->gl_info;
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
-
|
||||
- if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
|
||||
- {
|
||||
- GLbitfield mapflags = wined3d_resource_gl_map_flags(flags);
|
||||
- mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT;
|
||||
- ptr = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB,
|
||||
- 0, volume->resource.size, mapflags));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- GLenum access = wined3d_resource_gl_legacy_map_flags(flags);
|
||||
- ptr = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access));
|
||||
- }
|
||||
-
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
- checkGLcall("Map PBO");
|
||||
- return ptr;
|
||||
-
|
||||
- case WINED3D_LOCATION_SYSMEM:
|
||||
- return volume->resource.heap_memory;
|
||||
-
|
||||
- default:
|
||||
- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding));
|
||||
- return NULL;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
|
||||
{
|
||||
@@ -581,7 +543,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
else
|
||||
wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding);
|
||||
|
||||
- base_memory = wined3d_volume_get_map_ptr(volume, context, flags);
|
||||
+ base_memory = wined3d_resource_get_map_ptr(&volume->resource, context, flags);
|
||||
context_release(context);
|
||||
|
||||
TRACE("Base memory pointer %p.\n", base_memory);
|
||||
@@ -640,30 +602,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
|
||||
return volume_from_resource(resource);
|
||||
}
|
||||
|
||||
-static void wined3d_volume_release_map_ptr(const struct wined3d_volume *volume,
|
||||
- const struct wined3d_context *context)
|
||||
-{
|
||||
- const struct wined3d_gl_info *gl_info;
|
||||
-
|
||||
- switch (volume->resource.map_binding)
|
||||
- {
|
||||
- case WINED3D_LOCATION_BUFFER:
|
||||
- gl_info = context->gl_info;
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
|
||||
- GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB));
|
||||
- GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||
- checkGLcall("Unmap PBO");
|
||||
- return;
|
||||
-
|
||||
- case WINED3D_LOCATION_SYSMEM:
|
||||
- return;
|
||||
-
|
||||
- default:
|
||||
- ERR("Unexpected map binding %s.\n", wined3d_debug_location(volume->resource.map_binding));
|
||||
- return;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
|
||||
{
|
||||
struct wined3d_device *device = volume->resource.device;
|
||||
@@ -677,7 +615,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
|
||||
}
|
||||
|
||||
context = context_acquire(device, NULL);
|
||||
- wined3d_volume_release_map_ptr(volume, context);
|
||||
+ wined3d_resource_release_map_ptr(&volume->resource, context);
|
||||
context_release(context);
|
||||
|
||||
volume->resource.map_count--;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 059310b..9285ab8 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2083,6 +2083,7 @@ struct wined3d_resource
|
||||
UINT size;
|
||||
DWORD priority;
|
||||
void *heap_memory, *user_memory, *bitmap_data;
|
||||
+ GLuint buffer_object;
|
||||
UINT custom_row_pitch, custom_slice_pitch;
|
||||
struct list resource_list_entry;
|
||||
DWORD locations;
|
||||
@@ -2113,12 +2114,15 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
+BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
|
||||
+ const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN;
|
||||
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
|
||||
-GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_load_location(struct wined3d_resource *resource,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
+void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
|
||||
+ const struct wined3d_context *context) 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;
|
||||
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
|
||||
@@ -2248,7 +2252,6 @@ struct wined3d_volume
|
||||
DWORD flags;
|
||||
GLint texture_level;
|
||||
DWORD download_count;
|
||||
- GLuint pbo;
|
||||
};
|
||||
|
||||
static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
|
||||
--
|
||||
2.1.3
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user