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
wined3d-CSMT_Helper: Move 'Merge get_pitch' patch into CSMT_Main.
This commit is contained in:
@@ -0,0 +1,381 @@
|
||||
From fb1391dc1f2274d4336846720bb9869a3b751b0c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 19 Sep 2013 14:22:24 +0200
|
||||
Subject: wined3d: Merge get_pitch functions. (v2)
|
||||
|
||||
---
|
||||
dlls/wined3d/resource.c | 31 ++++++++++++++++
|
||||
dlls/wined3d/surface.c | 81 ++++++++++++++++++++----------------------
|
||||
dlls/wined3d/texture.c | 2 +-
|
||||
dlls/wined3d/volume.c | 28 ++-------------
|
||||
dlls/wined3d/wined3d_private.h | 5 +--
|
||||
5 files changed, 75 insertions(+), 72 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 1891165..0968cd2 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -414,3 +414,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
|
||||
else
|
||||
resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
|
||||
}
|
||||
+
|
||||
+void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
+ UINT *slice_pitch)
|
||||
+{
|
||||
+ unsigned int alignment;
|
||||
+ const struct wined3d_format *format = resource->format;
|
||||
+
|
||||
+ if (resource->custom_row_pitch)
|
||||
+ {
|
||||
+ *row_pitch = resource->custom_row_pitch;
|
||||
+ *slice_pitch = resource->custom_slice_pitch;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ alignment = resource->device->surface_alignment;
|
||||
+ *row_pitch = wined3d_format_calculate_pitch(resource->format, resource->width);
|
||||
+ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
|
||||
+ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS)
|
||||
+ {
|
||||
+ /* Since compressed formats are block based, pitch means the amount of
|
||||
+ * bytes to the next row of block rather than the next row of pixels. */
|
||||
+ UINT slice_block_count = (resource->height + format->block_height - 1) / format->block_height;
|
||||
+ *slice_pitch = *row_pitch * slice_block_count;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *slice_pitch = *row_pitch * resource->height;
|
||||
+ }
|
||||
+
|
||||
+ TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
|
||||
+}
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 3b033db..bb2278d 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
|
||||
BITMAPINFO *b_info;
|
||||
int extraline = 0;
|
||||
DWORD *masks;
|
||||
+ UINT row_pitch, slice_pitch;
|
||||
|
||||
TRACE("surface %p.\n", surface);
|
||||
|
||||
@@ -409,10 +410,11 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
|
||||
|
||||
b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
/* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */
|
||||
- b_info->bmiHeader.biWidth = wined3d_surface_get_pitch(surface) / format->byte_count;
|
||||
+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch);
|
||||
+ b_info->bmiHeader.biWidth = row_pitch / format->byte_count;
|
||||
b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline;
|
||||
b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline)
|
||||
- * wined3d_surface_get_pitch(surface);
|
||||
+ * row_pitch;
|
||||
b_info->bmiHeader.biPlanes = 1;
|
||||
b_info->bmiHeader.biBitCount = format->byte_count * 8;
|
||||
|
||||
@@ -1305,14 +1307,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
|
||||
void *mem;
|
||||
GLenum gl_format = format->glFormat;
|
||||
GLenum gl_type = format->glType;
|
||||
- int src_pitch = 0;
|
||||
- int dst_pitch = 0;
|
||||
+ UINT src_pitch = 0;
|
||||
+ UINT dst_row_pitch, dst_slice_pitch;
|
||||
|
||||
if (surface->flags & SFLAG_NONPOW2)
|
||||
{
|
||||
unsigned char alignment = surface->resource.device->surface_alignment;
|
||||
src_pitch = format->byte_count * surface->pow2Width;
|
||||
- dst_pitch = wined3d_surface_get_pitch(surface);
|
||||
+ wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch);
|
||||
src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1);
|
||||
mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height);
|
||||
}
|
||||
@@ -1399,12 +1401,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
|
||||
* won't be released, and doesn't have to be re-read. */
|
||||
src_data = mem;
|
||||
dst_data = data.addr;
|
||||
- TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_pitch);
|
||||
+ TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_row_pitch);
|
||||
for (y = 0; y < surface->resource.height; ++y)
|
||||
{
|
||||
- memcpy(dst_data, src_data, dst_pitch);
|
||||
+ memcpy(dst_data, src_data, dst_row_pitch);
|
||||
src_data += src_pitch;
|
||||
- dst_data += dst_pitch;
|
||||
+ dst_data += dst_row_pitch;
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, mem);
|
||||
@@ -1559,7 +1561,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
|
||||
UINT update_w, update_h;
|
||||
UINT dst_w, dst_h;
|
||||
RECT r, dst_rect;
|
||||
- UINT src_pitch;
|
||||
+ UINT src_row_pitch, src_slice_pitch;
|
||||
POINT p;
|
||||
|
||||
TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n",
|
||||
@@ -1647,10 +1649,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
|
||||
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
|
||||
|
||||
surface_get_memory(src_surface, &data, src_surface->locations);
|
||||
- src_pitch = wined3d_surface_get_pitch(src_surface);
|
||||
+ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
|
||||
|
||||
wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect,
|
||||
- src_pitch, dst_point, FALSE, wined3d_const_bo_address(&data));
|
||||
+ src_row_pitch, dst_point, FALSE, wined3d_const_bo_address(&data));
|
||||
|
||||
context_release(context);
|
||||
|
||||
@@ -1933,21 +1935,10 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
|
||||
|
||||
DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
|
||||
{
|
||||
- unsigned int alignment;
|
||||
- DWORD pitch;
|
||||
-
|
||||
- TRACE("surface %p.\n", surface);
|
||||
-
|
||||
- if (surface->pitch)
|
||||
- return surface->pitch;
|
||||
-
|
||||
- alignment = surface->resource.device->surface_alignment;
|
||||
- pitch = wined3d_format_calculate_pitch(surface->resource.format, surface->resource.width);
|
||||
- pitch = (pitch + alignment - 1) & ~(alignment - 1);
|
||||
-
|
||||
- TRACE("Returning %u.\n", pitch);
|
||||
-
|
||||
- return pitch;
|
||||
+ UINT row_pitch, slice_pitch;
|
||||
+ const struct wined3d_resource *resource = &surface->resource;
|
||||
+ wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch);
|
||||
+ return row_pitch;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y)
|
||||
@@ -2109,20 +2100,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
|
||||
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
|
||||
valid_location = WINED3D_LOCATION_USER_MEMORY;
|
||||
}
|
||||
- surface->pitch = pitch;
|
||||
+ surface->resource.custom_row_pitch = pitch;
|
||||
+ surface->resource.custom_slice_pitch = pitch * surface->resource.height;
|
||||
surface->resource.format = texture_resource->format;
|
||||
surface->resource.multisample_type = texture_resource->multisample_type;
|
||||
surface->resource.multisample_quality = texture_resource->multisample_quality;
|
||||
- if (surface->pitch)
|
||||
+ if (surface->resource.custom_row_pitch)
|
||||
{
|
||||
- surface->resource.size = height * surface->pitch;
|
||||
+ surface->resource.size = height * surface->resource.custom_row_pitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* User memory surfaces don't have the regular surface alignment. */
|
||||
- surface->resource.size = wined3d_format_calculate_size(texture_resource->format,
|
||||
- 1, width, height, 1);
|
||||
- surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
|
||||
+ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1);
|
||||
+ surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
|
||||
+ surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */
|
||||
}
|
||||
|
||||
/* The format might be changed to a format that needs conversion.
|
||||
@@ -2742,7 +2734,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
|
||||
if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
|
||||
map_desc->row_pitch = surface->resource.width * format->byte_count;
|
||||
else
|
||||
- map_desc->row_pitch = wined3d_surface_get_pitch(surface);
|
||||
+ wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
|
||||
map_desc->slice_pitch = 0;
|
||||
|
||||
if (!rect)
|
||||
@@ -2869,6 +2861,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
|
||||
int i;
|
||||
BOOL srcIsUpsideDown;
|
||||
struct wined3d_bo_address data;
|
||||
+ UINT row_pitch, slice_pitch;
|
||||
|
||||
surface_get_memory(surface, &data, dst_location);
|
||||
|
||||
@@ -2905,8 +2898,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
|
||||
}
|
||||
|
||||
/* Setup pixel store pack state -- to glReadPixels into the correct place */
|
||||
- gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH,
|
||||
- wined3d_surface_get_pitch(surface) / surface->resource.format->byte_count);
|
||||
+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch);
|
||||
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count);
|
||||
checkGLcall("glPixelStorei");
|
||||
|
||||
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
|
||||
@@ -2923,7 +2916,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
|
||||
{
|
||||
/* glReadPixels returns the image upside down, and there is no way to prevent this.
|
||||
* Flip the lines in software. */
|
||||
- UINT pitch = wined3d_surface_get_pitch(surface);
|
||||
+ UINT pitch, slice_pitch;
|
||||
+
|
||||
+ wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch);
|
||||
|
||||
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
|
||||
goto error;
|
||||
@@ -4107,7 +4102,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
const struct wined3d_color_key_conversion *conversion;
|
||||
struct wined3d_texture *texture = surface->container;
|
||||
struct wined3d_context *context;
|
||||
- UINT width, src_pitch, dst_pitch;
|
||||
+ UINT width, src_row_pitch, src_slice_pitch, dst_pitch;
|
||||
struct wined3d_bo_address data;
|
||||
struct wined3d_format format;
|
||||
POINT dst_point = {0, 0};
|
||||
@@ -4195,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
wined3d_texture_bind_and_dirtify(texture, context, srgb);
|
||||
|
||||
width = surface->resource.width;
|
||||
- src_pitch = wined3d_surface_get_pitch(surface);
|
||||
+ wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch);
|
||||
|
||||
format = *texture->resource.format;
|
||||
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
|
||||
@@ -4233,9 +4228,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
context_release(context);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
- format.convert(data.addr, mem, src_pitch, src_pitch * height,
|
||||
+ format.convert(data.addr, mem, src_row_pitch, src_row_pitch * height,
|
||||
dst_pitch, dst_pitch * height, width, height, 1);
|
||||
- src_pitch = dst_pitch;
|
||||
+ src_row_pitch = dst_pitch;
|
||||
data.addr = mem;
|
||||
}
|
||||
else if (conversion)
|
||||
@@ -4255,14 +4250,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
}
|
||||
if (texture->swapchain && texture->swapchain->palette)
|
||||
palette = texture->swapchain->palette;
|
||||
- conversion->convert(data.addr, src_pitch, mem, dst_pitch,
|
||||
+ conversion->convert(data.addr, src_row_pitch, mem, dst_pitch,
|
||||
width, height, palette, &texture->async.gl_color_key);
|
||||
- src_pitch = dst_pitch;
|
||||
+ src_row_pitch = dst_pitch;
|
||||
data.addr = mem;
|
||||
}
|
||||
|
||||
wined3d_surface_upload_data(surface, gl_info, &format, &src_rect,
|
||||
- src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
|
||||
+ src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
|
||||
|
||||
context_release(context);
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 1e039e4..f4e77fb 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1233,7 +1233,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso
|
||||
struct wined3d_const_bo_address addr;
|
||||
unsigned int row_pitch, slice_pitch;
|
||||
|
||||
- wined3d_volume_get_pitch(volume, &row_pitch, &slice_pitch);
|
||||
+ wined3d_resource_get_pitch(sub_resource, &row_pitch, &slice_pitch);
|
||||
if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch)
|
||||
FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch);
|
||||
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index 424938a..b672d4a 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch)
|
||||
-{
|
||||
- const struct wined3d_format *format = volume->resource.format;
|
||||
-
|
||||
- if (volume->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
|
||||
- {
|
||||
- /* Since compressed formats are block based, pitch means the amount of
|
||||
- * bytes to the next row of block rather than the next row of pixels. */
|
||||
- UINT row_block_count = (volume->resource.width + format->block_width - 1) / format->block_width;
|
||||
- UINT slice_block_count = (volume->resource.height + format->block_height - 1) / format->block_height;
|
||||
- *row_pitch = row_block_count * format->block_byte_count;
|
||||
- *slice_pitch = *row_pitch * slice_block_count;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- unsigned char alignment = volume->resource.device->surface_alignment;
|
||||
- *row_pitch = format->byte_count * volume->resource.width; /* Bytes / row */
|
||||
- *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
|
||||
- *slice_pitch = *row_pitch * volume->resource.height;
|
||||
- }
|
||||
-
|
||||
- TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
|
||||
-}
|
||||
-
|
||||
/* This call just uploads data, the caller is responsible for binding the
|
||||
* correct texture. */
|
||||
/* Context activation is done by the caller. */
|
||||
@@ -95,7 +71,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
|
||||
dst_row_pitch = width * format->conv_byte_count;
|
||||
dst_slice_pitch = dst_row_pitch * height;
|
||||
|
||||
- wined3d_volume_get_pitch(volume, &src_row_pitch, &src_slice_pitch);
|
||||
+ wined3d_resource_get_pitch(&volume->resource, &src_row_pitch, &src_slice_pitch);
|
||||
|
||||
converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth);
|
||||
format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch,
|
||||
@@ -643,7 +619,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
}
|
||||
else
|
||||
{
|
||||
- wined3d_volume_get_pitch(volume, &map_desc->row_pitch, &map_desc->slice_pitch);
|
||||
+ wined3d_resource_get_pitch(&volume->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
|
||||
}
|
||||
|
||||
if (!box)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 5786db0..7f989dc 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2162,6 +2162,7 @@ struct wined3d_resource
|
||||
UINT size;
|
||||
DWORD priority;
|
||||
void *heap_memory;
|
||||
+ UINT custom_row_pitch, custom_slice_pitch;
|
||||
struct list resource_list_entry;
|
||||
|
||||
void *parent;
|
||||
@@ -2189,6 +2190,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
+void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
+ UINT *slice_pitch) 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;
|
||||
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
@@ -2326,7 +2329,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN
|
||||
HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
|
||||
unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN;
|
||||
void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN;
|
||||
-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) 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;
|
||||
@@ -2376,7 +2378,6 @@ struct wined3d_surface
|
||||
|
||||
DWORD flags;
|
||||
|
||||
- UINT pitch;
|
||||
UINT pow2Width;
|
||||
UINT pow2Height;
|
||||
|
||||
--
|
||||
2.4.5
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 680c99d5fb4ab94a37f934c66bf9c22a326b0dd2 Mon Sep 17 00:00:00 2001
|
||||
From 0dd2ded31943d0729f811330cc2afa0d3b050dc8 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.
|
||||
@@ -16,7 +16,7 @@ and downloading from textures will be delegated to surfaces / volumes.
|
||||
6 files changed, 91 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 5931232..2386410 100644
|
||||
index 727e8be..3470a89 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
|
||||
@@ -41,10 +41,10 @@ index 5931232..2386410 100644
|
||||
|
||||
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 a63eab8..7f283f5 100644
|
||||
index 35a1a14..39df397 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -378,3 +378,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
|
||||
@@ -461,3 +461,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
|
||||
|
||||
resource->resource_ops->resource_location_invalidated(resource, location);
|
||||
}
|
||||
@@ -99,10 +99,10 @@ index a63eab8..7f283f5 100644
|
||||
+ resource->resource_ops->resource_load_location(resource, context, location);
|
||||
+}
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index b9d8968..5f6a0c2 100644
|
||||
index a59e401..9e46545 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
|
||||
@@ -1227,12 +1227,20 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
|
||||
wined3d_texture_set_dirty(surface->container);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ index b9d8968..5f6a0c2 100644
|
||||
};
|
||||
|
||||
static const struct wined3d_surface_ops surface_ops =
|
||||
@@ -4195,7 +4203,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
@@ -4062,7 +4070,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
surface->ds_current_size.cy = surface->resource.height;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ index b9d8968..5f6a0c2 100644
|
||||
{
|
||||
switch (location)
|
||||
{
|
||||
@@ -4535,7 +4543,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
@@ -4394,7 +4402,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
|
||||
if (WARN_ON(d3d_surface))
|
||||
{
|
||||
@@ -142,10 +142,10 @@ index b9d8968..5f6a0c2 100644
|
||||
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 6d82ce6..fc0f6d6 100644
|
||||
index fe7936d..89f94f3 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1039,12 +1039,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r
|
||||
@@ -950,12 +950,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r
|
||||
ERR("Should not be called on textures.\n");
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ index 6d82ce6..fc0f6d6 100644
|
||||
|
||||
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 6b685bd..e2c9d4a 100644
|
||||
index 94eb77e..f82347d 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -137,27 +137,6 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
|
||||
@@ -224,7 +224,7 @@ index 6b685bd..e2c9d4a 100644
|
||||
if ((volume->resource.access_flags & required_access) != required_access)
|
||||
{
|
||||
ERR("Operation requires %#x access, but volume only has %#x.\n",
|
||||
@@ -333,7 +308,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
@@ -337,7 +312,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);
|
||||
@@ -233,7 +233,7 @@ index 6b685bd..e2c9d4a 100644
|
||||
srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
@@ -392,7 +367,7 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
@@ -396,7 +371,7 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
if (volume_prepare_system_memory(volume))
|
||||
{
|
||||
context = context_acquire(device, NULL);
|
||||
@@ -242,7 +242,7 @@ index 6b685bd..e2c9d4a 100644
|
||||
context_release(context);
|
||||
wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
@@ -547,7 +522,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
@@ -552,7 +527,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
|
||||
@@ -251,7 +251,7 @@ index 6b685bd..e2c9d4a 100644
|
||||
|
||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo));
|
||||
|
||||
@@ -585,7 +560,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
@@ -590,7 +565,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
||||
else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
|
||||
{
|
||||
context = context_acquire(device, NULL);
|
||||
@@ -260,7 +260,7 @@ index 6b685bd..e2c9d4a 100644
|
||||
context_release(context);
|
||||
}
|
||||
base_memory = volume->resource.heap_memory;
|
||||
@@ -700,6 +675,7 @@ static const struct wined3d_resource_ops volume_resource_ops =
|
||||
@@ -705,6 +680,7 @@ static const struct wined3d_resource_ops volume_resource_ops =
|
||||
volume_resource_decref,
|
||||
volume_unload,
|
||||
wined3d_volume_location_invalidated,
|
||||
@@ -269,10 +269,10 @@ index 6b685bd..e2c9d4a 100644
|
||||
|
||||
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 b533108..4db209a 100644
|
||||
index 936950f..e1e490e 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2069,6 +2069,8 @@ struct wined3d_resource_ops
|
||||
@@ -2138,6 +2138,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);
|
||||
@@ -281,13 +281,15 @@ index b533108..4db209a 100644
|
||||
};
|
||||
|
||||
struct wined3d_resource
|
||||
@@ -2119,15 +2121,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
@@ -2190,17 +2192,20 @@ 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;
|
||||
void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
|
||||
UINT *slice_pitch) 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;
|
||||
@@ -302,5 +304,5 @@ index b533108..4db209a 100644
|
||||
/* Tests show that the start address of resources is 32 byte aligned */
|
||||
#define RESOURCE_ALIGNMENT 16
|
||||
--
|
||||
2.2.1
|
||||
2.4.5
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user