wined3d-CSMT_Main: Sync trivial changes from the upstream repository.

This commit is contained in:
Sebastian Lackner
2015-09-04 12:06:48 +02:00
parent ef1d526974
commit 3cabc8a125
113 changed files with 1079 additions and 1038 deletions

View File

@@ -1,15 +1,15 @@
From fb1391dc1f2274d4336846720bb9869a3b751b0c Mon Sep 17 00:00:00 2001
From 0bff3caeafd1080f6fd6244abdf8a87ddff6c3d2 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.
---
dlls/wined3d/resource.c | 31 ++++++++++++++++
dlls/wined3d/surface.c | 81 ++++++++++++++++++++----------------------
dlls/wined3d/resource.c | 31 +++++++++++++++++
dlls/wined3d/surface.c | 78 ++++++++++++++++++++----------------------
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/volume.c | 28 ++-------------
dlls/wined3d/wined3d_private.h | 5 +--
5 files changed, 75 insertions(+), 72 deletions(-)
5 files changed, 74 insertions(+), 70 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 1891165..0968cd2 100644
@@ -51,7 +51,7 @@ index 1891165..0968cd2 100644
+ 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
index 2b5e734..c96c44c 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)
@@ -158,7 +158,7 @@ index 3b033db..bb2278d 100644
}
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,
@@ -2109,20 +2100,22 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
@@ -177,16 +177,15 @@ index 3b033db..bb2278d 100644
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->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,
@@ -2589,7 +2582,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
@@ -195,26 +194,26 @@ index 3b033db..bb2278d 100644
map_desc->slice_pitch = 0;
if (!rect)
@@ -2869,6 +2861,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2716,6 +2709,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;
+ DWORD slice_pitch, pitch;
surface_get_memory(surface, &data, dst_location);
@@ -2905,8 +2898,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2752,8 +2746,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);
+ wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch);
+ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, 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
@@ -2770,7 +2764,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. */
@@ -225,7 +224,7 @@ index 3b033db..bb2278d 100644
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -4107,7 +4102,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -3967,7 +3963,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;
@@ -234,7 +233,7 @@ index 3b033db..bb2278d 100644
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,
@@ -4055,7 +4051,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_bind_and_dirtify(texture, context, srgb);
width = surface->resource.width;
@@ -243,7 +242,7 @@ index 3b033db..bb2278d 100644
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,
@@ -4093,9 +4089,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
@@ -255,7 +254,7 @@ index 3b033db..bb2278d 100644
data.addr = mem;
}
else if (conversion)
@@ -4255,14 +4250,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4115,14 +4111,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
@@ -274,10 +273,10 @@ index 3b033db..bb2278d 100644
context_release(context);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 1e039e4..f4e77fb 100644
index b369809..3485ac2 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
@@ -1242,7 +1242,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;
@@ -287,7 +286,7 @@ index 1e039e4..f4e77fb 100644
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
index 4e1c415..eec1492 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume)
@@ -340,10 +339,10 @@ index 424938a..b672d4a 100644
if (!box)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5786db0..7f989dc 100644
index d1ba5e4..77463aa 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2162,6 +2162,7 @@ struct wined3d_resource
@@ -2164,6 +2164,7 @@ struct wined3d_resource
UINT size;
DWORD priority;
void *heap_memory;
@@ -351,7 +350,7 @@ index 5786db0..7f989dc 100644
struct list resource_list_entry;
void *parent;
@@ -2189,6 +2190,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2191,6 +2192,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;
@@ -360,7 +359,7 @@ index 5786db0..7f989dc 100644
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
@@ -2328,7 +2331,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;
@@ -368,7 +367,7 @@ index 5786db0..7f989dc 100644
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
@@ -2378,7 +2380,6 @@ struct wined3d_surface
DWORD flags;
@@ -377,5 +376,5 @@ index 5786db0..7f989dc 100644
UINT pow2Height;
--
2.4.5
2.5.1

View File

@@ -1,18 +1,18 @@
From f322a8e12cfa32650bcbb970f41a84c2430ac00e Mon Sep 17 00:00:00 2001
From 0f7f57e440a198c31920c7077a6c7b0661945039 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(-)
dlls/wined3d/surface.c | 41 +++++++++++++++++++++++++++++++++++------
1 file changed, 35 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 4e2063f..1f97857 100644
index 9351ab2..1b3def9 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3533,19 +3533,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW
@@ -3536,19 +3536,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW
rect->bottom = drawable_height - rect->bottom;
}
@@ -49,7 +49,7 @@ index 4e2063f..1f97857 100644
gl_info = context->gl_info;
/* Make sure the surface is up-to-date. This should probably use
@@ -3598,7 +3614,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
@@ -3601,7 +3617,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. */
@@ -63,7 +63,7 @@ index 4e2063f..1f97857 100644
}
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color)
@@ -4095,8 +4116,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
@@ -4101,8 +4122,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
surface, wined3d_debug_location(surface->locations));
}
@@ -74,7 +74,7 @@ index 4e2063f..1f97857 100644
{
RECT r;
@@ -4109,7 +4131,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
@@ -4115,7 +4137,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
surface_get_rect(surface, NULL, &r);
surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB);
@@ -83,7 +83,7 @@ index 4e2063f..1f97857 100644
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
return WINED3D_OK;
@@ -4367,7 +4389,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -4373,7 +4395,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
break;
case WINED3D_LOCATION_DRAWABLE:
@@ -95,13 +95,16 @@ index 4e2063f..1f97857 100644
return hr;
break;
@@ -4546,13 +4571,16 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -4547,6 +4572,8 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
struct wined3d_surface *dst_surface, const RECT *dst_rect,
const struct wined3d_color_key *color_key)
{
+ struct wined3d_context *context;
+
/* Blit from offscreen surface to render target */
struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key;
DWORD old_color_key_flags = src_surface->container->async.color_key_flags;
+ struct wined3d_context *context;
TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface);
@@ -4555,8 +4582,10 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter,
wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key);
@@ -114,5 +117,5 @@ index 4e2063f..1f97857 100644
/* Restore the color key parameters */
wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT,
--
2.3.5
2.5.1

View File

@@ -1,4 +1,4 @@
From ddfa60053cfc7b215fdf041cd0e0b8401bb1a86b Mon Sep 17 00:00:00 2001
From 42dbd273c1097c5dcd5fb13e94ee7950551db75d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 16 Sep 2013 22:44:33 +0200
Subject: wined3d: Introduce a function to retrieve resource memory.
@@ -51,7 +51,7 @@ index b756bf1..40267e7 100644
void wined3d_resource_load_location(struct wined3d_resource *resource,
struct wined3d_context *context, DWORD location)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cf21b54..a6b98f1 100644
index 4fe3d72..1f51116 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -479,39 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@@ -112,16 +112,16 @@ index cf21b54..a6b98f1 100644
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,
@@ -2865,7 +2832,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
@@ -2713,7 +2680,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
struct wined3d_bo_address data;
UINT row_pitch, slice_pitch;
DWORD slice_pitch, pitch;
- surface_get_memory(surface, &data, dst_location);
+ wined3d_resource_get_memory(&surface->resource, dst_location, &data);
/* Context_release does not restore the original context in case of
* nested context_acquire calls. Only read_from_framebuffer and
@@ -4007,8 +3974,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -3868,8 +3835,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
struct wined3d_bo_address dst, src;
UINT size = surface->resource.size;
@@ -132,7 +132,7 @@ index cf21b54..a6b98f1 100644
if (dst.buffer_object)
{
@@ -4220,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4081,7 +4048,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@@ -142,10 +142,10 @@ index cf21b54..a6b98f1 100644
{
/* This code is entered for texture formats which need a fixup. */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f28994d..a640145 100644
index f3ab20f..ab938f0 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2198,6 +2198,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE
@@ -2200,6 +2200,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE
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;
@@ -155,5 +155,5 @@ index f28994d..a640145 100644
UINT *slice_pitch) DECLSPEC_HIDDEN;
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
--
2.4.5
2.5.1

View File

@@ -1,4 +1,4 @@
From da397c28f35b9220eb4bf258a49b3a778732cd28 Mon Sep 17 00:00:00 2001
From 5b260f3eff9c924a8e6cc0b9496c2639dc52e9af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 14:55:00 +0200
Subject: wined3d: Move check_block_align to resource.c
@@ -6,15 +6,15 @@ Subject: wined3d: Move check_block_align to resource.c
---
dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++
dlls/wined3d/surface.c | 27 +++++++++++----------------
dlls/wined3d/volume.c | 31 ++-----------------------------
dlls/wined3d/volume.c | 30 +-----------------------------
dlls/wined3d/wined3d_private.h | 2 ++
4 files changed, 43 insertions(+), 45 deletions(-)
4 files changed, 42 insertions(+), 45 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 0ef2155..ddcfdad 100644
index 40267e7..c8bbf3d 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -618,3 +618,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
@@ -689,3 +689,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
return FALSE;
}
}
@@ -47,10 +47,10 @@ index 0ef2155..ddcfdad 100644
+ return TRUE;
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 178a949..0f58be1 100644
index a47f1fa..a728e7d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1475,23 +1475,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -1477,23 +1477,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect)
{
@@ -86,7 +86,7 @@ index 178a949..0f58be1 100644
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 1cfeb04..4d7b349 100644
index 4faa22d..b902b18 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -379,34 +379,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum
@@ -124,21 +124,20 @@ index 1cfeb04..4d7b349 100644
static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume,
const struct wined3d_box *box)
{
@@ -457,7 +429,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -457,7 +429,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
WARN("Map box is invalid.\n");
return WINED3DERR_INVALIDCALL;
}
- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box))
+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) &&
+ !wined3d_resource_check_block_align(&volume->resource, box))
+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !wined3d_resource_check_block_align(&volume->resource, box))
{
WARN("Map box is misaligned for %ux%u blocks.\n",
format->block_width, format->block_height);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 96cdac5..855375d 100644
index ff07e53..9dab51b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2155,6 +2155,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2197,6 +2197,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
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;
@@ -148,5 +147,5 @@ index 96cdac5..855375d 100644
BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN;
--
2.3.5
2.5.1

View File

@@ -1,4 +1,4 @@
From a1458d85e82bcde47262c579ef3be209a1ee1324 Mon Sep 17 00:00:00 2001
From 4e5db60def2e093e529a2f7b8c5c0c081fd48723 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 17:16:02 +0200
Subject: wined3d: Send light updates through the command stream
@@ -10,7 +10,7 @@ Subject: wined3d: Send light updates through the command stream
3 files changed, 174 insertions(+), 65 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 85bc039..cff6212 100644
index 434ce9a..562323e 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -63,7 +63,6 @@ enum wined3d_cs_op
@@ -63,7 +63,7 @@ index 85bc039..cff6212 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -996,35 +1004,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -997,35 +1005,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@@ -99,7 +99,7 @@ index 85bc039..cff6212 100644
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_shader_resource_view *op = data;
@@ -1584,6 +1563,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1585,6 +1564,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
@@ -132,12 +132,6 @@ index 85bc039..cff6212 100644
+ object->OriginalIndex = light_idx;
+ }
+
+ object->OriginalParms = op->light.OriginalParms;
+ memcpy(&object->position, &op->light.position, sizeof(object->position));
+ memcpy(&object->direction, &op->light.direction, sizeof(object->direction));
+ object->exponent = op->light.exponent;
+ object->cutoff = op->light.cutoff;
+
+ /* Update the live definitions if the light is currently assigned a glIndex. */
+ if (object->glIndex != -1)
+ {
@@ -146,6 +140,12 @@ index 85bc039..cff6212 100644
+ device_invalidate_state(cs->device, STATE_ACTIVELIGHT(object->glIndex));
+ }
+
+ object->OriginalParms = op->light.OriginalParms;
+ object->position = op->light.position;
+ object->direction = op->light.direction;
+ object->exponent = op->light.exponent;
+ object->cutoff = op->light.cutoff;
+
+ return sizeof(*op);
+}
+
@@ -252,7 +252,7 @@ index 85bc039..cff6212 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1613,7 +1738,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1614,7 +1739,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key,
/* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material,
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
@@ -260,7 +260,7 @@ index 85bc039..cff6212 100644
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b,
/* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i,
@@ -1623,6 +1747,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1624,6 +1748,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
/* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
@@ -270,10 +270,10 @@ index 85bc039..cff6212 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2a40538..de1bbfb 100644
index d2ce327..74bff19 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1470,14 +1470,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
@@ -1469,14 +1469,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n",
light->range, light->falloff, light->theta, light->phi);
@@ -288,7 +288,7 @@ index 2a40538..de1bbfb 100644
/* Save away the information. */
object->OriginalParms = *light;
@@ -1550,6 +1542,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
@@ -1556,6 +1548,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
FIXME("Unrecognized light type %#x.\n", light->type);
}
@@ -298,7 +298,7 @@ index 2a40538..de1bbfb 100644
return WINED3D_OK;
}
@@ -1622,12 +1617,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
@@ -1628,12 +1623,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
{
if (light_info->glIndex != -1)
{
@@ -311,7 +311,7 @@ index 2a40538..de1bbfb 100644
device->update_state->lights[light_info->glIndex] = NULL;
light_info->glIndex = -1;
}
@@ -1669,16 +1658,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
@@ -1675,16 +1664,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
WARN("Too many concurrently active lights\n");
return WINED3D_OK;
}
@@ -331,7 +331,7 @@ index 2a40538..de1bbfb 100644
return WINED3D_OK;
}
@@ -3405,7 +3390,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3395,7 +3380,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
return WINED3DERR_INVALIDCALL;
}
@@ -339,7 +339,7 @@ index 2a40538..de1bbfb 100644
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3440,8 +3424,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3430,8 +3414,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
return WINED3DERR_INVALIDCALL;
}
@@ -348,7 +348,7 @@ index 2a40538..de1bbfb 100644
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3453,7 +3435,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3443,7 +3425,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
device, start_idx, index_count, start_instance, instance_count);
@@ -357,10 +357,10 @@ index 2a40538..de1bbfb 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9eb612d..7b2eaec 100644
index 13e28d4..5862540 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2581,7 +2581,9 @@ struct wined3d_cs_block
@@ -2622,7 +2622,9 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@@ -371,7 +371,7 @@ index 9eb612d..7b2eaec 100644
};
struct wined3d_cs_ops
@@ -2626,8 +2628,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -2667,8 +2669,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
@@ -380,7 +380,7 @@ index 9eb612d..7b2eaec 100644
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs,
struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -2673,6 +2673,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
@@ -2714,6 +2714,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
UINT base_vertex_index) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
GLenum primitive_type) DECLSPEC_HIDDEN;
@@ -390,5 +390,5 @@ index 9eb612d..7b2eaec 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
--
2.3.5
2.5.1

View File

@@ -1,4 +1,4 @@
From 3783cc16737b9ebebc9b00d90e981207843bc01e Mon Sep 17 00:00:00 2001
From ff38f01388324b055bcda33d46929169f76ce3eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 29 Apr 2013 18:49:53 +0200
Subject: wined3d: Send blits through the command stream.
@@ -7,12 +7,12 @@ This needs more work. This patch breaks error handling, and the split
between surface_blt and surface_blt_ugly isn't particularly nice.
---
dlls/wined3d/cs.c | 50 +++++++
dlls/wined3d/surface.c | 307 ++++++++++++++++++++++-------------------
dlls/wined3d/surface.c | 309 +++++++++++++++++++++++------------------
dlls/wined3d/wined3d_private.h | 8 ++
3 files changed, 226 insertions(+), 139 deletions(-)
3 files changed, 228 insertions(+), 139 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 77bb485..b5b5ece 100644
index fcc5ed7..550206f 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -74,6 +74,7 @@ enum wined3d_cs_op
@@ -42,7 +42,7 @@ index 77bb485..b5b5ece 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -1506,6 +1519,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
@@ -1507,6 +1520,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
struct wined3d_device *device = cs->device;
struct wined3d_context *context;
@@ -52,7 +52,7 @@ index 77bb485..b5b5ece 100644
context = context_acquire(device, NULL);
context->gl_info->gl_ops.gl.p_glFinish();
context_release(context);
@@ -1717,6 +1733,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1718,6 +1734,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
cs->ops->submit(cs);
}
@@ -91,7 +91,7 @@ index 77bb485..b5b5ece 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1757,6 +1805,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1758,6 +1806,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
/* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light,
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
@@ -99,7 +99,7 @@ index 77bb485..b5b5ece 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1831,6 +1880,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
@@ -1832,6 +1881,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
TRACE("Started.\n");
@@ -108,10 +108,10 @@ index 77bb485..b5b5ece 100644
{
struct wined3d_cs_block *block;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0c25884..8883c9c 100644
index bd048c2..8cec730 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -5003,14 +5003,13 @@ const struct blit_shader cpu_blit = {
@@ -5002,14 +5002,13 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@@ -128,7 +128,7 @@ index 0c25884..8883c9c 100644
BOOL scale, convert;
static const DWORD simple_blit = WINEDDBLT_ASYNC
@@ -5021,111 +5020,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5020,111 +5019,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
| WINEDDBLT_DEPTHFILL
| WINEDDBLT_DONOTWAIT;
@@ -240,7 +240,7 @@ index 0c25884..8883c9c 100644
if (!device->d3d_initialized)
{
WARN("D3D not initialized, using fallback.\n");
@@ -5168,8 +5062,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5167,8 +5061,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
}
scale = src_surface
@@ -251,7 +251,7 @@ index 0c25884..8883c9c 100644
convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id;
dst_ds_flags = dst_surface->container->resource.format_flags
@@ -5189,22 +5083,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5188,22 +5082,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth))
@@ -279,7 +279,7 @@ index 0c25884..8883c9c 100644
}
}
else
@@ -5235,8 +5123,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5234,8 +5122,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
palette, fx->u5.dwFillColor, &color))
goto fallback;
@@ -290,7 +290,7 @@ index 0c25884..8883c9c 100644
}
else
{
@@ -5264,9 +5152,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5263,9 +5151,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Not doing upload because of format conversion.\n");
else
{
@@ -302,7 +302,7 @@ index 0c25884..8883c9c 100644
{
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
{
@@ -5275,7 +5163,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5274,7 +5162,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
dst_surface->container->resource.draw_binding);
context_release(context);
}
@@ -311,7 +311,7 @@ index 0c25884..8883c9c 100644
}
}
}
@@ -5299,50 +5187,191 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5298,50 +5186,193 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@@ -469,8 +469,10 @@ index 0c25884..8883c9c 100644
+ return WINEDDERR_INVALIDRECT;
+ }
+
+ dst_ds_flags = dst_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
+ src_ds_flags = src_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
+ dst_ds_flags = dst_surface->container->resource.format_flags
+ & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
+ src_ds_flags = src_surface->container->resource.format_flags
+ & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
+ if (src_ds_flags != dst_ds_flags)
+ {
+ WARN("Rejecting depth / stencil blit between incompatible formats.\n");
@@ -517,10 +519,10 @@ index 0c25884..8883c9c 100644
static const struct wined3d_resource_ops surface_resource_ops =
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ff3d49b..9fc2181 100644
index e153b0b..77317a5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2463,6 +2463,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@@ -2491,6 +2491,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
@@ -530,7 +532,7 @@ index ff3d49b..9fc2181 100644
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -2612,6 +2615,7 @@ struct wined3d_cs
@@ -2640,6 +2643,7 @@ struct wined3d_cs
struct wined3d_device *device;
struct wined3d_state state;
HANDLE thread;
@@ -538,7 +540,7 @@ index ff3d49b..9fc2181 100644
DWORD tls_idx;
struct wined3d_surface *onscreen_depth_stencil;
@@ -2690,6 +2694,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
@@ -2718,6 +2722,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
GLenum primitive_type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN;
@@ -550,5 +552,5 @@ index ff3d49b..9fc2181 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
--
2.4.2
2.5.1

View File

@@ -1,4 +1,4 @@
From b642658723b5728d3ea2384f6f40680436bcdeb0 Mon Sep 17 00:00:00 2001
From 6e1f3fcac566581cd786a66405633ed4a674793d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 20 Aug 2014 14:14:23 +0200
Subject: wined3d: Put update_surface checks back in place
@@ -6,16 +6,16 @@ Subject: wined3d: Put update_surface checks back in place
Unfortunately I can't remove the code from surface_update_from_surface
yet because blits depend on them.
---
dlls/wined3d/device.c | 66 ++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 68 ++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/surface.c | 2 +-
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 68 insertions(+), 1 deletion(-)
3 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 65a34a5..71be9eb 100644
index b95dfde..f0b2849 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3788,6 +3788,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device,
@@ -3773,6 +3773,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device,
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const POINT *dst_point)
{
@@ -29,7 +29,7 @@ index 65a34a5..71be9eb 100644
TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n",
device, src_surface, wine_dbgstr_rect(src_rect),
dst_surface, wine_dbgstr_point(dst_point));
@@ -3799,6 +3806,65 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device,
@@ -3784,6 +3791,67 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
@@ -79,14 +79,16 @@ index 65a34a5..71be9eb 100644
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ if ((src_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(src_surface, src_rect))
+ if ((src_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
+ && !surface_check_block_align(src_surface, src_rect))
+ {
+ WARN("Source rectangle not block-aligned.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ SetRect(&dst_rect, dst_point->x, dst_point->y, dst_point->x + update_w, dst_point->y + update_h);
+ if ((dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(dst_surface, &dst_rect))
+ if ((dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
+ && !surface_check_block_align(dst_surface, &dst_rect))
+ {
+ WARN("Destination rectangle not block-aligned.\n");
+ return WINED3DERR_INVALIDCALL;
@@ -96,7 +98,7 @@ index 65a34a5..71be9eb 100644
{
FIXME("Waiting for cs.\n");
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8883c9c..676200d 100644
index 8cec730..1376d97 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1366,7 +1366,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -109,10 +111,10 @@ index 8883c9c..676200d 100644
struct wined3d_box box;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9fc2181..5828bd3 100644
index 77317a5..e09927b6 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2466,6 +2466,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -2494,6 +2494,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -121,5 +123,5 @@ index 9fc2181..5828bd3 100644
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
--
2.4.2
2.5.1

View File

@@ -1,31 +0,0 @@
From b41844b91cb9817f378c3c666b3129c3c870d014 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 20:40:39 +0200
Subject: wined3d: Add cs waiting debug code
---
dlls/wined3d/texture.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index eb4996b..240e8fa 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -610,6 +610,14 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture,
return WINED3DERR_INVALIDCALL;
}
+ /*
+ if (wined3d_settings.cs_multithreaded)
+ {
+ FIXME("waiting for cs\n");
+ texture->resource.device->cs->ops->finish(texture->resource.device->cs);
+ }
+ */
+
wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key);
return WINED3D_OK;
--
2.3.5

View File

@@ -1,16 +1,16 @@
From 3c2152778b13105e423a33889692c3b12f58653b Mon Sep 17 00:00:00 2001
From 70b1167ff814efa7b8e397fdaa8fdfd9988a4868 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 6 Jul 2013 19:18:48 +0200
Subject: wined3d: Poll queries automatically in the CS
---
dlls/wined3d/cs.c | 76 ++++++--------
dlls/wined3d/query.c | 221 ++++++++++++++++++++++++++---------------
dlls/wined3d/query.c | 225 ++++++++++++++++++++++++++---------------
dlls/wined3d/wined3d_private.h | 7 +-
3 files changed, 178 insertions(+), 126 deletions(-)
3 files changed, 180 insertions(+), 128 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index d97ef5b..8256707 100644
index 0c8284e..29d963e 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -69,7 +69,6 @@ enum wined3d_cs_op
@@ -38,7 +38,7 @@ index d97ef5b..8256707 100644
static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -1822,8 +1811,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
@@ -1823,8 +1812,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
query->query_ops->query_issue(query, op->flags);
@@ -50,7 +50,7 @@ index d97ef5b..8256707 100644
return sizeof(*op);
}
@@ -1840,37 +1830,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1841,37 +1831,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
cs->ops->submit(cs, sizeof(*op));
}
@@ -88,7 +88,7 @@ index d97ef5b..8256707 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -1918,7 +1877,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1919,7 +1878,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map,
/* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap,
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
@@ -96,7 +96,7 @@ index d97ef5b..8256707 100644
};
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
@@ -2033,17 +1991,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
@@ -2034,17 +1992,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
wined3d_surface_incref(cs->onscreen_depth_stencil);
}
@@ -143,7 +143,7 @@ index d97ef5b..8256707 100644
{
continue;
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 9bdb35e..9f1f5ad 100644
index 9bdb35e..690903e 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -241,6 +241,15 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
@@ -406,10 +406,10 @@ index 9bdb35e..9f1f5ad 100644
GLuint available;
GLuint64 timestamp;
- HRESULT res;
-
- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
+ BOOL ret;
- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
-
- if (!tq->context)
- query->state = QUERY_CREATED;
-
@@ -468,7 +468,7 @@ index 9bdb35e..9f1f5ad 100644
}
static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags)
@@ -657,7 +709,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
@@ -657,15 +709,14 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
void *data, DWORD size, DWORD flags)
{
TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
@@ -476,6 +476,16 @@ index 9bdb35e..9f1f5ad 100644
if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT)
{
static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE};
if (query->state == QUERY_BUILDING)
{
- TRACE("Query is building, returning S_FALSE.\n");
- return S_FALSE;
+ TRACE("Query is building, returning S_FALSE.\n");
+ return S_FALSE;
}
fill_query_data(data, size, &disjoint_data, sizeof(disjoint_data));
@@ -679,6 +730,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
return S_OK;
}
@@ -526,10 +536,10 @@ index 9bdb35e..9f1f5ad 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 56d9b0c..4c4ee51 100644
index dd230d6..ebd928a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1090,6 +1090,7 @@ struct wined3d_occlusion_query
@@ -1101,6 +1101,7 @@ struct wined3d_occlusion_query
struct list entry;
GLuint id;
struct wined3d_context *context;
@@ -537,7 +547,7 @@ index 56d9b0c..4c4ee51 100644
};
union wined3d_gl_query_object
@@ -1125,6 +1126,7 @@ struct wined3d_timestamp_query
@@ -1136,6 +1137,7 @@ struct wined3d_timestamp_query
struct list entry;
GLuint id;
struct wined3d_context *context;
@@ -545,7 +555,7 @@ index 56d9b0c..4c4ee51 100644
};
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
@@ -2610,6 +2612,7 @@ struct wined3d_cs
@@ -2651,6 +2653,7 @@ struct wined3d_cs
struct wined3d_cs_queue queue;
LONG pending_presents;
@@ -553,7 +563,7 @@ index 56d9b0c..4c4ee51 100644
};
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN;
@@ -2705,6 +2708,7 @@ enum query_state {
@@ -2746,6 +2749,7 @@ enum query_state {
struct wined3d_query_ops
{
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
@@ -561,7 +571,7 @@ index 56d9b0c..4c4ee51 100644
void (*query_issue)(struct wined3d_query *query, DWORD flags);
};
@@ -2720,7 +2724,8 @@ struct wined3d_query
@@ -2761,7 +2765,8 @@ struct wined3d_query
DWORD data_size;
void *extendedData;
@@ -572,5 +582,5 @@ index 56d9b0c..4c4ee51 100644
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
--
2.3.7
2.5.1

Some files were not shown because too many files have changed in this diff Show More