[PATCH 02/10] wined3d: Don't call wined3d_texture_prepare_location() with a NULL context in wined3d_texture_update_desc().
Henri Verbeet
hverbeet at codeweavers.com
Sun Aug 11 04:35:09 CDT 2019
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/wined3d/texture.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 705b725c4f1..467dd093a45 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1535,6 +1535,14 @@ void wined3d_texture_gl_set_compatible_renderbuffer(struct wined3d_texture_gl *t
checkGLcall("set compatible renderbuffer");
}
+static BOOL wined3d_texture_prepare_sysmem(struct wined3d_texture *texture)
+{
+ if (texture->resource.heap_memory)
+ return TRUE;
+
+ return wined3d_resource_allocate_sysmem(&texture->resource);
+}
+
HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT width, UINT height,
enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type,
UINT multisample_quality, void *mem, UINT pitch)
@@ -1657,7 +1665,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
}
else
{
- wined3d_texture_prepare_location(texture, 0, NULL, WINED3D_LOCATION_SYSMEM);
+ wined3d_texture_prepare_sysmem(texture);
valid_location = WINED3D_LOCATION_SYSMEM;
}
@@ -1832,12 +1840,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
switch (location)
{
case WINED3D_LOCATION_SYSMEM:
- if (texture->resource.heap_memory)
- return TRUE;
-
- if (!wined3d_resource_allocate_sysmem(&texture->resource))
- return FALSE;
- return TRUE;
+ return wined3d_texture_prepare_sysmem(texture);
case WINED3D_LOCATION_USER_MEMORY:
if (!texture->user_memory)
--
2.11.0
More information about the wine-devel
mailing list