[PATCH 1/5] wined3d: Support custom pitches in wined3d_surface_update_desc (try 3).
Stefan Dösinger
stefan at codeweavers.com
Tue Jan 7 15:12:12 CST 2014
Try 3: Fix the size calculation, use height * pitch.
Try 2: Drop the first patch and always calculate the surface size based
on width, height and format to make sure a format with a non-zero size
is set.
---
dlls/wined3d/surface.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 2fca299..7b96a21 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2861,7 +2861,10 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.format = format;
surface->resource.multisample_type = multisample_type;
surface->resource.multisample_quality = multisample_quality;
- surface->resource.size = resource_size;
+ if (surface->pitch)
+ surface->resource.size = height * surface->pitch;
+ else
+ surface->resource.size = resource_size;
if (create_dib)
{
--
1.8.3.2
More information about the wine-patches
mailing list