Rebase against 36b38b8a203c2cca77b101810770afe952f7164a.

This commit is contained in:
Sebastian Lackner 2016-02-05 18:18:04 +01:00
parent 31fe5d3167
commit 661976a145
10 changed files with 155 additions and 167 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "46317e0cb1af2f0b2a07532903677dd412bde3c4"
echo "36b38b8a203c2cca77b101810770afe952f7164a"
}
# Show version information

View File

@ -1,4 +1,4 @@
From 15d68401bf24f7ba0face4f18b90a708fd33545a Mon Sep 17 00:00:00 2001
From cfcfa390db417008fc6824074bc396e0cfa85190 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 13:30:59 +0100
Subject: wined3d: Use resource buffer mapping facilities in surfaces.
@ -9,7 +9,7 @@ Subject: wined3d: Use resource buffer mapping facilities in surfaces.
2 files changed, 23 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 869c42f..642e907 100644
index 98653cd..3d5b574 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -570,6 +570,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
@ -35,7 +35,7 @@ index 869c42f..642e907 100644
default:
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b94d7a2..3e27544 100644
index 043e257..9b96625 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -692,36 +692,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
@ -75,7 +75,7 @@ index b94d7a2..3e27544 100644
if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))
{
TRACE("Not dirtified, nothing to do.\n");
@@ -2569,6 +2543,8 @@ do { \
@@ -2585,6 +2559,8 @@ do { \
HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
{
@ -84,7 +84,7 @@ index b94d7a2..3e27544 100644
TRACE("surface %p.\n", surface);
if (!surface->resource.map_count)
@@ -2578,6 +2554,12 @@ HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
@@ -2594,6 +2570,12 @@ HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
}
--surface->resource.map_count;
@ -97,7 +97,7 @@ index b94d7a2..3e27544 100644
surface->surface_ops->surface_unmap(surface);
return WINED3D_OK;
@@ -2589,8 +2571,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
@@ -2605,8 +2587,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
const struct wined3d_format *format = surface->resource.format;
unsigned int fmt_flags = surface->container->resource.format_flags;
struct wined3d_device *device = surface->resource.device;
@ -106,8 +106,8 @@ index b94d7a2..3e27544 100644
+ struct wined3d_context *context = NULL;
BYTE *base_memory;
TRACE("surface %p, map_desc %p, box %p, flags %#x.\n",
@@ -2632,6 +2613,9 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
TRACE("surface %p, map_desc %p, box %s, flags %#x.\n",
@@ -2648,6 +2629,9 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
}
}
@ -117,7 +117,7 @@ index b94d7a2..3e27544 100644
surface_prepare_map_memory(surface);
if (flags & WINED3D_MAP_DISCARD)
{
@@ -2641,51 +2625,19 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
@@ -2657,51 +2641,19 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
}
else
{

View File

@ -1,4 +1,4 @@
From 412b76a791b762e2ce9b5da8587a1595f3137c0f Mon Sep 17 00:00:00 2001
From e7bd14cde60905b56bce90d9ec660b560f67a2fc 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
@ -11,10 +11,10 @@ Subject: wined3d: Move check_block_align to resource.c
4 files changed, 32 insertions(+), 46 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 5e46b84..b47536a 100644
index 01070a6..b95e17a 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -705,3 +705,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
@@ -715,3 +715,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru
return FALSE;
}
}
@ -47,10 +47,10 @@ index 5e46b84..b47536a 100644
+ return TRUE;
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6630ce5..7ac4867 100644
index 84975ba..0aa8115 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1448,29 +1448,13 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -1472,29 +1472,13 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box)
{
@ -82,7 +82,7 @@ index 6630ce5..7ac4867 100644
static BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index ce702d2..fde518a 100644
index b0bcd16..e598e1b 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -343,34 +343,6 @@ static void volume_unload(struct wined3d_resource *resource)
@ -127,13 +127,13 @@ index ce702d2..fde518a 100644
- 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))
{
WARN("Map box is misaligned for %ux%u blocks.\n",
format->block_width, format->block_height);
WARN("Map box %s is misaligned for %ux%u blocks.\n",
debug_box(box), format->block_width, format->block_height);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6402c42..8d49949 100644
index 8b88406..7c3b82f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2241,6 +2241,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2308,6 +2308,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;
@ -143,5 +143,5 @@ index 6402c42..8d49949 100644
BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource,
const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN;
--
2.6.4
2.7.0

View File

@ -1,4 +1,4 @@
From fe66d6b8129533d88849527339ca52a19e343509 Mon Sep 17 00:00:00 2001
From 50d846247350c8fbc9823769337016e6f800064e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 17:51:38 +0200
Subject: wined3d: Move most of volume_map to resource.c
@ -7,16 +7,16 @@ The CPU access check can be moved once surfaces don't have to lock for
sysmem blits. Surfaces and volume have different block alignment and
boundary check behaviours.
---
dlls/wined3d/resource.c | 115 +++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/volume.c | 101 +++---------------------------------
dlls/wined3d/resource.c | 111 +++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/volume.c | 97 +++--------------------------------
dlls/wined3d/wined3d_private.h | 3 ++
3 files changed, 124 insertions(+), 95 deletions(-)
3 files changed, 120 insertions(+), 91 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 2e06f21..e5af445 100644
index 2a73c0e..a08631f 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -765,3 +765,118 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource,
@@ -791,3 +791,114 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource,
return TRUE;
}
@ -30,8 +30,8 @@ index 2e06f21..e5af445 100644
+ const struct wined3d_format *format = resource->format;
+ const unsigned int fmt_flags = resource->format->flags[WINED3D_GL_RES_TYPE_TEX_2D];
+
+ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n",
+ resource, map_desc, box, flags);
+ TRACE("resource %p, map_desc %p, box %s, flags %#x.\n",
+ resource, map_desc, debug_box(box), flags);
+
+ if (resource->map_count)
+ {
@ -76,14 +76,10 @@ index 2e06f21..e5af445 100644
+
+ if (!box)
+ {
+ TRACE("No box supplied - all is ok\n");
+ map_desc->data = base_memory;
+ }
+ else
+ {
+ TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n",
+ box, box->left, box->top, box->right, box->bottom, box->front, box->back);
+
+ if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
+ {
+ /* Compressed textures are block based, so calculate the offset of
@ -136,10 +132,10 @@ index 2e06f21..e5af445 100644
+ return WINED3D_OK;
+}
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 38fe516..08dbecb 100644
index e598e1b..925c833 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -392,26 +392,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
@@ -368,26 +368,16 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
HRESULT wined3d_volume_map(struct wined3d_volume *volume,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
@ -150,8 +146,8 @@ index 38fe516..08dbecb 100644
const struct wined3d_format *format = volume->resource.format;
const unsigned int fmt_flags = volume->container->resource.format_flags;
- TRACE("volume %p, map_desc %p, box %p, flags %#x.\n",
- volume, map_desc, box, flags);
- TRACE("volume %p, map_desc %p, box %s, flags %#x.\n",
- volume, map_desc, debug_box(box), flags);
-
map_desc->data = NULL;
if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
@ -167,7 +163,7 @@ index 38fe516..08dbecb 100644
if (!wined3d_volume_check_box_dimensions(volume, box))
{
WARN("Map box is invalid.\n");
@@ -424,95 +414,16 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
@@ -400,91 +390,16 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
return WINED3DERR_INVALIDCALL;
}
@ -204,14 +200,10 @@ index 38fe516..08dbecb 100644
-
- if (!box)
- {
- TRACE("No box supplied - all is ok\n");
- map_desc->data = base_memory;
- }
- else
- {
- TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n",
- box, box->left, box->top, box->right, box->bottom, box->front, box->back);
-
- if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
- {
- /* Compressed textures are block based, so calculate the offset of
@ -269,10 +261,10 @@ index 38fe516..08dbecb 100644
static ULONG volume_resource_incref(struct wined3d_resource *resource)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 949b27b..ac6cd4e 100644
index 647abec..4fc4784 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2218,12 +2218,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
@@ -2323,12 +2323,15 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_load_location(struct wined3d_resource *resource,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
@ -289,5 +281,5 @@ index 949b27b..ac6cd4e 100644
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
--
2.6.0
2.7.0

View File

@ -1,4 +1,4 @@
From 3b13285f9a78d467d8e3a52ae5d497c268d6ac3e Mon Sep 17 00:00:00 2001
From 90e387618c439a928d4a7cebc299415f4d1e381e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 18:00:23 +0200
Subject: wined3d: Use resource_map for surface_map.
@ -10,10 +10,10 @@ Subject: wined3d: Use resource_map for surface_map.
3 files changed, 18 insertions(+), 90 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 9b5445d..ba0e1c9 100644
index a08631f..8d372b9 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -893,7 +893,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
@@ -889,7 +889,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
if (!resource->map_count)
{
WARN("Trying to unlock an unlocked resource %p.\n", resource);
@ -23,10 +23,10 @@ index 9b5445d..ba0e1c9 100644
if (device->d3d_initialized)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5b22643..627e1c7 100644
index 8392614..4d3b47f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2365,28 +2365,18 @@ do { \
@@ -2381,28 +2381,18 @@ do { \
HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
{
@ -60,7 +60,7 @@ index 5b22643..627e1c7 100644
}
HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc,
@@ -2394,18 +2384,6 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
@@ -2410,18 +2400,6 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
{
const struct wined3d_format *format = surface->resource.format;
unsigned int fmt_flags = surface->container->resource.format_flags;
@ -68,8 +68,8 @@ index 5b22643..627e1c7 100644
- struct wined3d_context *context = NULL;
- BYTE *base_memory;
-
- TRACE("surface %p, map_desc %p, box %p, flags %#x.\n",
- surface, map_desc, box, flags);
- TRACE("surface %p, map_desc %p, box %s, flags %#x.\n",
- surface, map_desc, debug_box(box), flags);
-
- if (surface->resource.map_count)
- {
@ -79,7 +79,7 @@ index 5b22643..627e1c7 100644
if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box
&& !surface_check_block_align(surface, box))
@@ -2417,11 +2395,6 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
@@ -2433,11 +2411,6 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
return WINED3DERR_INVALIDCALL;
}
@ -91,7 +91,7 @@ index 5b22643..627e1c7 100644
/* Performance optimization: Count how often a surface is mapped, if it is
* mapped regularly do not throw away the system memory copy. This avoids
* the need to download the surface from OpenGL all the time. The surface
@@ -2437,72 +2410,22 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
@@ -2453,72 +2426,22 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
}
}
@ -171,7 +171,7 @@ index 5b22643..627e1c7 100644
static void read_from_framebuffer(struct wined3d_surface *surface,
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 5180b56..f59ff5912 100644
index 925c833..fc43958 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -399,7 +399,12 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,

View File

@ -1,4 +1,4 @@
From 84bfd1772cafbfdfba4f0fa02703c24fba74c3bb Mon Sep 17 00:00:00 2001
From fb342d2c58b51885f224b1e4a8a9805fa319fbe6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 26 Sep 2013 16:41:00 +0200
Subject: wined3d: send resource maps through the command stream
@ -11,7 +11,7 @@ Slow version only. Good enough to dodge some Nvidia bugs in the ddraw tests.
3 files changed, 120 insertions(+), 33 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 6ade585..5e96859 100644
index 636ff0d..a5d5bde 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -76,6 +76,8 @@ enum wined3d_cs_op
@ -112,10 +112,10 @@ index 6ade585..5e96859 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 8594992..a2fdefb 100644
index fb84a0f..e1ae8d4 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -766,32 +766,11 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource,
@@ -792,32 +792,11 @@ BOOL wined3d_resource_check_block_align(const struct wined3d_resource *resource,
return TRUE;
}
@ -129,8 +129,8 @@ index 8594992..a2fdefb 100644
- const struct wined3d_format *format = resource->format;
- const unsigned int fmt_flags = resource->format->flags[WINED3D_GL_RES_TYPE_TEX_2D];
-
- TRACE("resource %p, map_desc %p, box %p, flags %#x.\n",
- resource, map_desc, box, flags);
- TRACE("resource %p, map_desc %p, box %s, flags %#x.\n",
- resource, map_desc, debug_box(box), flags);
-
- if (resource->map_count)
- {
@ -150,7 +150,7 @@ index 8594992..a2fdefb 100644
if (device->d3d_initialized)
context = context_acquire(device, NULL);
@@ -799,9 +778,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
@@ -825,9 +804,8 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
if (!wined3d_resource_prepare_map_memory(resource, context))
{
WARN("Out of memory.\n");
@ -161,7 +161,7 @@ index 8594992..a2fdefb 100644
}
if (flags & WINED3D_MAP_DISCARD)
@@ -809,11 +787,40 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
@@ -835,11 +813,40 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
else
wined3d_resource_load_location(resource, context, resource->map_binding);
@ -182,8 +182,8 @@ index 8594992..a2fdefb 100644
+ const struct wined3d_format *format = resource->format;
+ const unsigned int fmt_flags = resource->format->flags[WINED3D_GL_RES_TYPE_TEX_2D];
+
+ TRACE("resource %p, map_desc %p, box %p, flags %#x.\n",
+ resource, map_desc, box, flags);
+ TRACE("resource %p, map_desc %p, box %s, flags %#x.\n",
+ resource, map_desc, debug_box(box), flags);
+
+ if (resource->map_count)
+ {
@ -203,7 +203,7 @@ index 8594992..a2fdefb 100644
TRACE("Base memory pointer %p.\n", base_memory);
if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
@@ -865,10 +872,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
@@ -887,10 +894,21 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
return WINED3D_OK;
}
@ -226,7 +226,7 @@ index 8594992..a2fdefb 100644
TRACE("resource %p.\n", resource);
if (!resource->map_count)
@@ -877,12 +895,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
@@ -899,12 +917,7 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
return WINEDDERR_NOTLOCKED;
}
@ -241,10 +241,10 @@ index 8594992..a2fdefb 100644
return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index aa7b47b..3592bcc 100644
index 18fae74..bbbccdd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2239,6 +2239,7 @@ void wined3d_resource_load_location(struct wined3d_resource *resource,
@@ -2350,6 +2350,7 @@ void wined3d_resource_load_location(struct wined3d_resource *resource,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
HRESULT wined3d_resource_map(struct wined3d_resource *resource, struct wined3d_map_desc *map_desc,
const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN;
@ -252,7 +252,7 @@ index aa7b47b..3592bcc 100644
BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource,
struct wined3d_context *context) DECLSPEC_HIDDEN;
BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@@ -2246,6 +2247,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
@@ -2357,6 +2358,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource,
const struct wined3d_context *context) DECLSPEC_HIDDEN;
DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN;
HRESULT wined3d_resource_unmap(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -260,7 +260,7 @@ index aa7b47b..3592bcc 100644
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
@@ -2728,6 +2730,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -2844,6 +2846,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN;
@ -271,5 +271,5 @@ index aa7b47b..3592bcc 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.5.1
2.7.0

View File

@ -1,4 +1,4 @@
From f23d42ca6a96a3d257fc57dbae8d5ebd3620e4b7 Mon Sep 17 00:00:00 2001
From 8b94a2168e87d63b4def608b239fc4cc4b1075d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 23 Sep 2014 22:18:56 +0200
Subject: wined3d: Render target lock hack
@ -10,12 +10,12 @@ Subject: wined3d: Render target lock hack
3 files changed, 25 insertions(+)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index cd60356..dc36dd5 100644
index dd58302..5bc7d9a 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -777,6 +777,17 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
TRACE("resource %p, map_desc %p, box %p, flags %#x.\n",
resource, map_desc, box, flags);
@@ -887,6 +887,17 @@ HRESULT wined3d_resource_map(struct wined3d_resource *resource,
TRACE("resource %p, map_desc %p, box %s, flags %#x.\n",
resource, map_desc, debug_box(box), flags);
+ if (resource->usage & WINED3DUSAGE_RENDERTARGET && wined3d_settings.ignore_rt_map)
+ {
@ -31,7 +31,7 @@ index cd60356..dc36dd5 100644
if (resource->map_count)
{
WARN("Volume is already mapped.\n");
@@ -880,6 +891,12 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
@@ -986,6 +997,12 @@ HRESULT wined3d_resource_unmap(struct wined3d_resource *resource)
struct wined3d_device *device = resource->device;
TRACE("resource %p.\n", resource);
@ -45,10 +45,10 @@ index cd60356..dc36dd5 100644
{
WARN("Trying to unlock an unlocked resource %p.\n", resource);
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index e6dc444..a1e4e6c 100644
index 7b4fc40..0bc1120 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -86,6 +86,7 @@ struct wined3d_settings wined3d_settings =
@@ -87,6 +87,7 @@ struct wined3d_settings wined3d_settings =
~0U, /* No PS shader model limit by default. */
FALSE, /* 3D support enabled by default. */
FALSE, /* No multithreaded CS by default. */
@ -56,7 +56,7 @@ index e6dc444..a1e4e6c 100644
};
struct wined3d * CDECL wined3d_create(DWORD flags)
@@ -311,6 +312,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
@@ -321,6 +322,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
TRACE("Enabling multithreaded command stream.\n");
wined3d_settings.cs_multithreaded = TRUE;
}
@ -70,10 +70,10 @@ index e6dc444..a1e4e6c 100644
if (appkey) RegCloseKey( appkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 88329e5..dd06525 100644
index 9a1c94d..d0453f1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -281,6 +281,7 @@ struct wined3d_settings
@@ -296,6 +296,7 @@ struct wined3d_settings
unsigned int max_sm_ps;
BOOL no_3d;
BOOL cs_multithreaded;
@ -82,5 +82,5 @@ index 88329e5..dd06525 100644
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
--
2.1.3
2.7.0

View File

@ -1,4 +1,4 @@
From 6e0637c6122e1cb792ae028ab60d45b91fb4d3a2 Mon Sep 17 00:00:00 2001
From ccca792636064c789f2f5b8f9b333f6591f275a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 4 Sep 2015 15:22:49 +0200
Subject: wined3d: Send update_sub_resource calls through the command stream.
@ -10,10 +10,10 @@ Subject: wined3d: Send update_sub_resource calls through the command stream.
3 files changed, 95 insertions(+), 42 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 01c4ba3..277291b 100644
index 707f00d..e99a54d 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -94,6 +94,7 @@ enum wined3d_cs_op
@@ -93,6 +93,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_GETDC,
WINED3D_CS_OP_RELEASEDC,
WINED3D_CS_OP_SAMPLER_DESTROY,
@ -21,7 +21,7 @@ index 01c4ba3..277291b 100644
WINED3D_CS_OP_STOP,
};
@@ -564,6 +565,15 @@ struct wined3d_cs_sampler_destroy
@@ -557,6 +558,15 @@ struct wined3d_cs_sampler_destroy
struct wined3d_sampler *sampler;
};
@ -37,7 +37,7 @@ index 01c4ba3..277291b 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2785,6 +2795,86 @@ void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampl
@@ -2752,6 +2762,86 @@ void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampl
cs->ops->submit(cs, sizeof(*op));
}
@ -124,7 +124,7 @@ index 01c4ba3..277291b 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2857,6 +2947,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2823,6 +2913,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc,
/* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc,
/* WINED3D_CS_OP_SAMPLER_DESTROY */ wined3d_cs_exec_sampler_destroy,
@ -133,10 +133,10 @@ index 01c4ba3..277291b 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a6766e5..93498d8 100644
index 6602fc3..a46f944 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3934,13 +3934,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4019,13 +4019,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
unsigned int depth_pitch)
{
struct wined3d_resource *sub_resource;
@ -148,9 +148,9 @@ index a6766e5..93498d8 100644
- POINT dst_point;
- RECT src_rect;
TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n",
device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
@@ -3957,10 +3951,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n",
device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch);
@@ -4059,10 +4053,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
return;
}
@ -161,8 +161,8 @@ index a6766e5..93498d8 100644
if (box)
{
if (box->left >= box->right || box->right > sub_resource->width
@@ -3970,41 +3961,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
box->left, box->top, box->front, box->right, box->bottom, box->back);
@@ -4072,41 +4063,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
WARN("Invalid box %s specified.\n", debug_box(box));
return;
}
-
@ -205,10 +205,10 @@ index a6766e5..93498d8 100644
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9125336..d9dd839 100644
index f73c482..3789c55 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2823,6 +2823,9 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs,
@@ -2939,6 +2939,9 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs,
void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN;
@ -219,5 +219,5 @@ index 9125336..d9dd839 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.5.1
2.7.0

View File

@ -3105,7 +3105,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
void CDECL wined3d_device_copy_resource(struct wined3d_device *device,
@@ -4044,7 +4478,17 @@
@@ -4042,7 +4476,17 @@
unsigned int depth_pitch)
{
struct wined3d_resource *sub_resource;
@ -3121,9 +3121,9 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
+ RECT src_rect;
+#endif /* STAGING_CSMT */
TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n",
device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
@@ -4078,7 +4522,14 @@
TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n",
device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch);
@@ -4076,7 +4520,14 @@
WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
return;
}
@ -3138,8 +3138,8 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (box)
{
if (box->left >= box->right || box->right > sub_resource->width
@@ -4089,9 +4540,47 @@
box->left, box->top, box->front, box->right, box->bottom, box->back);
@@ -4086,9 +4537,47 @@
WARN("Invalid box %s specified.\n", debug_box(box));
return;
}
+#if defined(STAGING_CSMT)
@ -3186,7 +3186,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
@@ -4122,8 +4611,14 @@
@@ -4119,8 +4608,14 @@
rect = &r;
}
@ -3201,7 +3201,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
@@ -4137,6 +4632,7 @@
@@ -4134,6 +4629,7 @@
return NULL;
}
@ -3209,7 +3209,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return device->state.fb.render_targets[view_idx];
}
@@ -4152,6 +4648,22 @@
@@ -4149,6 +4645,22 @@
{
struct wined3d_rendertarget_view *prev;
struct wined3d_fb_state *fb = &device->state.fb;
@ -3232,7 +3232,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4191,6 +4703,7 @@
@@ -4188,6 +4700,7 @@
}
@ -3240,7 +3240,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
prev = fb->render_targets[view_idx];
if (view == prev)
return WINED3D_OK;
@@ -4198,6 +4711,15 @@
@@ -4195,6 +4708,15 @@
if (view)
wined3d_rendertarget_view_incref(view);
fb->render_targets[view_idx] = view;
@ -3256,7 +3256,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
@@ -4209,6 +4731,7 @@
@@ -4206,6 +4728,7 @@
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -3264,7 +3264,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_fb_state *fb = &device->state.fb;
struct wined3d_rendertarget_view *prev;
@@ -4226,6 +4749,66 @@
@@ -4223,6 +4746,66 @@
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
wined3d_rendertarget_view_decref(prev);
@ -3331,7 +3331,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device,
@@ -4246,6 +4829,14 @@
@@ -4243,6 +4826,14 @@
cursor_image = surface_from_resource(sub_resource);
@ -3346,7 +3346,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM)
{
WARN("Surface %p has an invalid format %s.\n",
@@ -4273,6 +4864,13 @@
@@ -4270,6 +4861,13 @@
* release it after setting the cursor image. Windows doesn't
* addref the set surface, so we can't do this either without
* creating circular refcount dependencies. */
@ -3360,7 +3360,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32)
{
@@ -4377,6 +4975,12 @@
@@ -4374,6 +4972,12 @@
else
SetCursor(NULL);
}
@ -3373,7 +3373,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return oldVisible;
}
@@ -4387,8 +4991,10 @@
@@ -4384,8 +4988,10 @@
TRACE("device %p.\n", device);
@ -3384,7 +3384,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Checking resource %p for eviction.\n", resource);
@@ -4396,6 +5002,7 @@
@@ -4393,6 +4999,7 @@
if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count)
{
TRACE("Evicting %p.\n", resource);
@ -3392,7 +3392,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_evict_resource(device->cs, resource);
}
}
@@ -4414,6 +5021,37 @@
@@ -4411,6 +5018,37 @@
context = context_acquire(device, NULL);
gl_info = context->gl_info;
@ -3430,7 +3430,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (device->depth_blt_texture)
{
@@ -4435,6 +5073,7 @@
@@ -4432,6 +5070,7 @@
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->context = NULL;
@ -3438,7 +3438,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
swapchain->num_contexts = 0;
}
@@ -4454,6 +5093,14 @@
@@ -4451,6 +5090,14 @@
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
@ -3453,7 +3453,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
HRESULT hr;
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
@@ -4470,6 +5117,7 @@
@@ -4467,6 +5114,7 @@
return hr;
}
@ -3461,7 +3461,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
if (FAILED(hr))
{
@@ -4480,6 +5128,35 @@
@@ -4477,6 +5125,35 @@
}
wined3d_cs_emit_create_dummy_textures(device->cs);
@ -3497,7 +3497,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -4499,9 +5176,11 @@
@@ -4496,9 +5173,11 @@
TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n",
device, swapchain_desc, mode, callback, reset_state);
@ -3509,7 +3509,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!(swapchain = wined3d_device_get_swapchain(device, 0)))
{
ERR("Failed to get the first implicit swapchain.\n");
@@ -4516,9 +5195,21 @@
@@ -4513,9 +5192,21 @@
wined3d_texture_decref(device->logo_texture);
device->logo_texture = NULL;
}
@ -3531,7 +3531,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4527,6 +5218,7 @@
@@ -4524,6 +5215,7 @@
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -3539,7 +3539,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (reset_state)
{
state_unbind_resources(&device->state);
@@ -4536,6 +5228,12 @@
@@ -4533,6 +5225,12 @@
{
wined3d_texture_decref(device->cs->onscreen_depth_stencil->container);
device->cs->onscreen_depth_stencil = NULL;
@ -3552,7 +3552,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
if (reset_state)
@@ -4548,6 +5246,7 @@
@@ -4545,6 +5243,7 @@
}
}
@ -3560,7 +3560,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Free implicit resources and wait for the command stream before modifying
* swapchain parameters. After modifying the swapchain parameters a new GL
* context may be acquired by the worker thread. This causes problems in the
@@ -4569,6 +5268,7 @@
@@ -4566,6 +5265,7 @@
}
device->cs->ops->finish(device->cs);
@ -3568,7 +3568,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("New params:\n");
TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width);
TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height);
@@ -4695,6 +5395,13 @@
@@ -4692,6 +5392,13 @@
swapchain_desc->multisample_type, swapchain_desc->multisample_quality)))
return hr;
@ -3582,7 +3582,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.enable_auto_depth_stencil)
{
struct wined3d_resource_desc texture_desc;
@@ -4736,6 +5443,13 @@
@@ -4733,6 +5440,13 @@
wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view);
}
@ -3596,7 +3596,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.backbuffer_count)
{
view_desc.format_id = swapchain_desc->backbuffer_format;
@@ -4762,12 +5476,20 @@
@@ -4759,12 +5473,20 @@
}
wined3d_cs_emit_reset_state(device->cs);
state_cleanup(&device->state);
@ -3617,7 +3617,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize device state, hr %#x.\n", hr);
device->update_state = &device->state;
@@ -4776,6 +5498,7 @@
@@ -4773,6 +5495,7 @@
}
else if (device->back_buffer_view)
{
@ -3625,7 +3625,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_state *state = &device->state;
wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE);
@@ -4791,6 +5514,24 @@
@@ -4788,6 +5511,24 @@
state->scissor_rect.left = 0;
state->scissor_rect.right = swapchain->desc.backbuffer_width;
state->scissor_rect.bottom = swapchain->desc.backbuffer_height;
@ -3650,7 +3650,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -4866,6 +5607,10 @@
@@ -4863,6 +5604,10 @@
TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
@ -3661,7 +3661,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
switch (type)
{
case WINED3D_RTYPE_SURFACE:
@@ -4876,6 +5621,7 @@
@@ -4873,6 +5618,7 @@
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -3669,7 +3669,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface)
{
ERR("Surface %p is still in use as render target %u.\n", surface, i);
@@ -4887,6 +5633,19 @@
@@ -4884,6 +5630,19 @@
{
ERR("Surface %p is still in use as depth/stencil buffer.\n", surface);
device->state.fb.depth_stencil = NULL;
@ -3689,7 +3689,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
}
break;
@@ -5048,7 +5807,11 @@
@@ -5045,7 +5804,11 @@
device->blitter = adapter->blitter;
@ -3701,7 +3701,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
{
ERR("Failed to initialize device state, hr %#x.\n", hr);
@@ -5147,6 +5910,7 @@
@@ -5144,6 +5907,7 @@
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@ -3709,7 +3709,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Context activation is done by the caller */
struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage,
@@ -5200,3 +5964,4 @@
@@ -5197,3 +5961,4 @@
wined3d_device_destroy_bo(device, context, bo);
}
@ -4627,7 +4627,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
UINT *slice_pitch)
@@ -1050,3 +1069,4 @@
@@ -1046,3 +1065,4 @@
wined3d_resource_invalidate_location(resource, ~resource->map_binding);
}
@ -5933,8 +5933,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
+ const struct wined3d_gl_info *gl_info;
+ BYTE *base_memory;
+
+ TRACE("surface %p, map_desc %p, box %p, flags %#x.\n",
+ surface, map_desc, box, flags);
+ TRACE("surface %p, map_desc %p, box %s, flags %#x.\n",
+ surface, map_desc, debug_box(box), flags);
+
+ if (surface->resource.map_count)
+ {
@ -8255,7 +8255,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3815,7 +3815,11 @@
@@ -3824,7 +3824,11 @@
float y_offset = context->render_offscreen
? (center_offset - (2.0f * y) - h) / h
: (center_offset - (2.0f * y) - h) / -h;
@ -8267,7 +8267,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE;
float z_scale = zenable ? 2.0f : 0.0f;
float z_offset = zenable ? -1.0f : 0.0f;
@@ -3938,6 +3942,7 @@
@@ -3947,6 +3951,7 @@
/* case WINED3D_TTFF_COUNT1: Won't ever get here. */
case WINED3D_TTFF_COUNT2:
mat._13 = mat._23 = mat._33 = mat._43 = 0.0f;
@ -8275,7 +8275,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
/* OpenGL divides the first 3 vertex coord by the 4th by default,
* which is essentially the same as D3DTTFF_PROJECTED. Make sure that
* the 4th coord evaluates to 1.0 to eliminate that.
@@ -3950,6 +3955,20 @@
@@ -3959,6 +3964,20 @@
* A more serious problem occurs if the app passes 4 coordinates in, and the
* 4th is != 1.0(opengl default). This would have to be fixed in draw_strided_slow
* or a replacement shader. */
@ -8296,7 +8296,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
default:
mat._14 = mat._24 = mat._34 = 0.0f; mat._44 = 1.0f;
}
@@ -4396,7 +4415,11 @@
@@ -4405,7 +4424,11 @@
unsigned int i;
DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
@ -8798,7 +8798,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
HRESULT hr;
const struct wined3d_format *format = volume->resource.format;
const unsigned int fmt_flags = volume->container->resource.format_flags;
@@ -410,6 +683,177 @@
@@ -410,6 +683,173 @@
if (hr == WINEDDERR_NOTLOCKED)
return WINED3DERR_INVALIDCALL;
return hr;
@ -8810,8 +8810,8 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
+ const struct wined3d_format *format = volume->resource.format;
+ const unsigned int fmt_flags = volume->container->resource.format_flags;
+
+ TRACE("volume %p, map_desc %p, box %p, flags %#x.\n",
+ volume, map_desc, box, flags);
+ TRACE("volume %p, map_desc %p, box %s, flags %#x.\n",
+ volume, map_desc, debug_box(box), flags);
+
+ map_desc->data = NULL;
+ if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
@ -8831,8 +8831,8 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
+ }
+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box))
+ {
+ WARN("Map box is misaligned for %ux%u blocks.\n",
+ format->block_width, format->block_height);
+ WARN("Map box %s is misaligned for %ux%u blocks.\n",
+ debug_box(box), format->block_width, format->block_height);
+ return WINED3DERR_INVALIDCALL;
+ }
+
@ -8905,14 +8905,10 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
+
+ if (!box)
+ {
+ TRACE("No box supplied - all is ok\n");
+ map_desc->data = base_memory;
+ }
+ else
+ {
+ TRACE("Lock Box (%p) = l %u, t %u, r %u, b %u, fr %u, ba %u\n",
+ box, box->left, box->top, box->right, box->bottom, box->front, box->back);
+
+ if ((fmt_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS)
+ {
+ /* Compressed textures are block based, so calculate the offset of
@ -8976,7 +8972,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
}
static ULONG volume_resource_incref(struct wined3d_resource *resource)
@@ -420,11 +864,13 @@
@@ -420,11 +860,13 @@
return wined3d_texture_incref(volume->container);
}
@ -8990,7 +8986,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
static ULONG volume_resource_decref(struct wined3d_resource *resource)
{
struct wined3d_volume *volume = volume_from_resource(resource);
@@ -446,6 +892,7 @@
@@ -446,6 +888,7 @@
return WINED3DERR_INVALIDCALL;
}
@ -8998,7 +8994,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location)
{
struct wined3d_volume *volume = volume_from_resource(resource);
@@ -454,6 +901,7 @@
@@ -454,6 +897,7 @@
wined3d_texture_set_dirty(volume->container);
}
@ -9006,7 +9002,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
static const struct wined3d_resource_ops volume_resource_ops =
{
volume_resource_incref,
@@ -461,8 +909,10 @@
@@ -461,8 +905,10 @@
volume_unload,
volume_resource_sub_resource_map,
volume_resource_sub_resource_unmap,
@ -9017,7 +9013,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
};
static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container,
@@ -494,7 +944,11 @@
@@ -494,7 +940,11 @@
}
volume->texture_level = level;
@ -9029,7 +9025,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC
&& gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]
@@ -502,7 +956,9 @@
@@ -502,7 +952,9 @@
{
wined3d_resource_free_sysmem(&volume->resource);
volume->resource.map_binding = WINED3D_LOCATION_BUFFER;
@ -9677,7 +9673,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/*****************************************************************************
* Utility function prototypes
@@ -3326,7 +3556,9 @@
@@ -3327,7 +3557,9 @@
void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 8a4931be2728787f751461a2482c33ff722808ee Mon Sep 17 00:00:00 2001
From 93ac240a91cc8c02bafe7207ffdb64fe9f9945f9 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 4 Nov 2015 19:31:30 +0100
Subject: wined3d: Rename wined3d_resource_(un)map to
@ -225,7 +225,7 @@ index 923a935..409fa32 100644
if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 73250ec..c1079ba 100644
index a4936cf..44cdb43 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -305,7 +305,7 @@ void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, st
@ -236,7 +236,7 @@ index 73250ec..c1079ba 100644
+HRESULT CDECL wined3d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %p, flags %#x.\n",
TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n",
@@ -314,7 +314,7 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
return resource->resource_ops->resource_sub_resource_map(resource, sub_resource_idx, map_desc, box, flags);
}