Commit 5e89689b authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Make format conversion functions work on volumes.

parent bb172d2a
......@@ -5524,7 +5524,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
format.convert(surface->resource.allocatedMemory, mem, src_pitch, dst_pitch, width, height);
format.convert(surface->resource.allocatedMemory, mem, src_pitch, src_pitch * height,
dst_pitch, dst_pitch * height, width, height, 1);
format.byte_count = format.conv_byte_count;
src_pitch = dst_pitch;
}
......
......@@ -104,7 +104,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
const struct wined3d_format *format = volume->resource.format;
UINT width = volume->resource.width;
UINT height = volume->resource.height;
UINT depth = volume->resource.depth, z;
UINT depth = volume->resource.depth;
BYTE *mem = data->addr;
TRACE("volume %p, context %p, level %u, format %s (%#x).\n",
......@@ -129,9 +129,8 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
wined3d_volume_get_pitch(volume, &src_row_pitch, &src_slice_pitch);
mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth);
for (z = 0; z < depth; z++)
format->convert(data->addr + z * src_slice_pitch, mem + z * dst_slice_pitch,
src_row_pitch, dst_row_pitch, width, height);
format->convert(data->addr, mem, src_row_pitch, src_slice_pitch,
dst_row_pitch, dst_slice_pitch, width, height, depth);
}
if (data->buffer_object)
......
......@@ -2970,7 +2970,8 @@ struct wined3d_format
unsigned int flags;
struct wined3d_rational height_scale;
struct color_fixup_desc color_fixup;
void (*convert)(const BYTE *src, BYTE *dst, UINT src_pitch, UINT dst_pitch, UINT width, UINT height);
void (*convert)(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch,
UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth);
};
const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl_info,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment