Rebase against 61a1a266faa9fa7c959136b0ab0b5d7e01326878.

This commit is contained in:
Sebastian Lackner 2017-04-11 05:15:20 +02:00
parent fbc61357d3
commit e5d2247213
5 changed files with 531 additions and 302 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "0128e1a18f25848e6f47146580a8f0db69687dd6"
echo "61a1a266faa9fa7c959136b0ab0b5d7e01326878"
}
# Show version information

View File

@ -1,17 +1,17 @@
From 2a7eaa9e87e874b19ee60afa4cdf9c6bf23a0dd6 Mon Sep 17 00:00:00 2001
From a8f6de27d548772a55d15580bdab50b3658628d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 1 Aug 2013 00:33:48 +0200
Subject: wined3d: Send update_texture calls through the CS
FIXME: This logic duplication is ugly.
---
dlls/wined3d/cs.c | 37 +++++++++
dlls/wined3d/device.c | 175 +++++++++++++++++++++++------------------
dlls/wined3d/cs.c | 37 ++++++++
dlls/wined3d/device.c | 190 +++++++++++++++++++++++------------------
dlls/wined3d/wined3d_private.h | 4 +
3 files changed, 141 insertions(+), 75 deletions(-)
3 files changed, 147 insertions(+), 84 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 811a8af1ce..1c67ab0f1c 100644
index 1b9c199e91..b6c56ca164 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -68,6 +68,7 @@ enum wined3d_cs_op
@ -35,7 +35,7 @@ index 811a8af1ce..1c67ab0f1c 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1999,6 +2006,35 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -2078,6 +2085,35 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@ -71,7 +71,7 @@ index 811a8af1ce..1c67ab0f1c 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2043,6 +2079,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2122,6 +2158,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
@ -80,10 +80,10 @@ index 811a8af1ce..1c67ab0f1c 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 bac505d3a8..acc1916747 100644
index 62ea164dfd..5bd7f1075d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3656,34 +3656,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3656,28 +3656,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
start_idx, index_count, start_instance, instance_count, TRUE);
}
@ -102,12 +102,6 @@ index bac505d3a8..acc1916747 100644
- TRACE("device %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n",
- device, src_texture, src_level, dst_texture, level_count);
-
- if (src_texture->resource.format != dst_texture->resource.format)
- {
- WARN("Source and destination formats do not match.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
- if (wined3d_texture_get_level_width(src_texture, src_level) != dst_texture->resource.width
- || wined3d_texture_get_level_height(src_texture, src_level) != dst_texture->resource.height
- || wined3d_texture_get_level_depth(src_texture, src_level) != dst_texture->resource.depth)
@ -122,7 +116,7 @@ index bac505d3a8..acc1916747 100644
/* Only a prepare, since we're uploading entire volumes. */
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
@@ -3691,32 +3674,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@@ -3685,81 +3674,34 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
for (i = 0; i < level_count; ++i)
{
@ -142,129 +136,197 @@ index bac505d3a8..acc1916747 100644
+ if (FAILED(wined3d_resource_unmap(&src_texture->resource, src_level + i)))
+ return;
}
+}
-
-done:
- context_release(context);
- return hr;
}
-HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
- struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
+/* Context activation is done by the caller */
+void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
+ struct wined3d_texture *dst_texture)
+{
+ unsigned int src_size, dst_size, src_skip_levels = 0;
+ unsigned int level_count, i, j;
+
+ level_count = min(wined3d_texture_get_level_count(src_texture),
+ wined3d_texture_get_level_count(dst_texture));
+
+ src_size = max(src_texture->resource.width, src_texture->resource.height);
+ dst_size = max(dst_texture->resource.width, dst_texture->resource.height);
+ if (dst_texture->resource.type == WINED3D_RTYPE_TEXTURE_3D)
+ {
+ src_size = max(src_size, src_texture->resource.depth);
+ dst_size = max(dst_size, dst_texture->resource.depth);
+ }
+ while (src_size > dst_size)
+ {
+ src_size >>= 1;
+ ++src_skip_levels;
+ }
+
+ /* Make sure that the destination texture is loaded. */
+ wined3d_texture_load(dst_texture, context, FALSE);
+
+ /* Update every surface level of the texture. */
+ switch (dst_texture->resource.type)
+ {
+ case WINED3D_RTYPE_TEXTURE_2D:
+ {
+ unsigned int src_levels = src_texture->level_count;
+ unsigned int dst_levels = dst_texture->level_count;
+ struct wined3d_surface *src_surface;
+ struct wined3d_surface *dst_surface;
+
+ for (i = 0; i < src_texture->layer_count; ++i)
+ {
+ for (j = 0; j < level_count; ++j)
+ {
+ HRESULT hr;
+ src_surface = src_texture->sub_resources[i * src_levels + j + src_skip_levels].u.surface;
+ dst_surface = dst_texture->sub_resources[i * dst_levels + j].u.surface;
+ if (FAILED(hr = surface_upload_from_surface(dst_surface, NULL, src_surface, NULL)))
+ {
+ WARN("Failed to update surface, hr %#x.\n", hr);
+ return;
+ }
+ }
+ }
+ break;
+ }
+
+ case WINED3D_RTYPE_TEXTURE_3D:
+ wined3d_device_update_texture_3d(context,
+ src_texture, src_skip_levels, dst_texture, level_count);
+ break;
+
+ default:
+ FIXME("Unsupported texture type %#x.\n", dst_texture->resource.type);
+ }
}
HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
{
unsigned int src_size, dst_size, src_skip_levels = 0;
- unsigned int layer_count, level_count, i, j;
+ unsigned int layer_count;
enum wined3d_resource_type type;
- enum wined3d_resource_type type;
- HRESULT hr;
- struct wined3d_context *context;
+ unsigned int level_count, i, j;
RECT r;
TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
@@ -3753,63 +3793,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
- level_count = min(wined3d_texture_get_level_count(src_texture),
- wined3d_texture_get_level_count(dst_texture));
- TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
-
- src_size = max(src_texture->resource.width, src_texture->resource.height);
- dst_size = max(dst_texture->resource.width, dst_texture->resource.height);
- if (type == WINED3D_RTYPE_TEXTURE_3D)
- /* Verify that the source and destination textures are non-NULL. */
- if (!src_texture || !dst_texture)
- {
- src_size = max(src_size, src_texture->resource.depth);
- dst_size = max(dst_size, dst_texture->resource.depth);
- WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
- while (src_size > dst_size)
+ /* FIXME: This isn't necessary for 2D textures, but currently surface_upload_from_surface
+ * rejects mismatching formats, and we can't report the error back after dispatching the
+ * call. */
+ if (src_texture->resource.format != dst_texture->resource.format)
-
- if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM)
- {
- WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
- if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT)
- {
- WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
- /* Verify that the source and destination textures are the same type. */
- type = src_texture->resource.type;
- if (dst_texture->resource.type != type)
- {
- WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
- layer_count = src_texture->layer_count;
- if (layer_count != dst_texture->layer_count)
- {
- WARN("Source and destination have different layer counts.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
- if (src_texture->resource.format != dst_texture->resource.format)
- {
- WARN("Source and destination formats do not match.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
level_count = min(wined3d_texture_get_level_count(src_texture),
wined3d_texture_get_level_count(dst_texture));
src_size = max(src_texture->resource.width, src_texture->resource.height);
dst_size = max(dst_texture->resource.width, dst_texture->resource.height);
- if (type == WINED3D_RTYPE_TEXTURE_3D)
+ if (dst_texture->resource.type == WINED3D_RTYPE_TEXTURE_3D)
{
- src_size >>= 1;
- ++src_skip_levels;
+ WARN("Source and destination formats do not match.\n");
+ return WINED3DERR_INVALIDCALL;
src_size = max(src_size, src_texture->resource.depth);
dst_size = max(dst_size, dst_texture->resource.depth);
@@ -3771,12 +3713,10 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
}
- /* Make sure that the destination texture is loaded. */
/* Make sure that the destination texture is loaded. */
- context = context_acquire(device, NULL, 0);
- wined3d_texture_load(dst_texture, context, FALSE);
wined3d_texture_load(dst_texture, context, FALSE);
- context_release(context);
-
- /* Update every surface level of the texture. */
switch (type)
/* Update every surface level of the texture. */
- switch (type)
+ switch (dst_texture->resource.type)
{
case WINED3D_RTYPE_TEXTURE_2D:
- {
- unsigned int src_levels = src_texture->level_count;
- unsigned int dst_levels = dst_texture->level_count;
- struct wined3d_surface *src_surface;
- struct wined3d_surface *dst_surface;
+ break;
{
@@ -3785,12 +3725,13 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
struct wined3d_surface *src_surface;
struct wined3d_surface *dst_surface;
- for (i = 0; i < layer_count; ++i)
+ for (i = 0; i < src_texture->layer_count; ++i)
{
for (j = 0; j < level_count; ++j)
{
unsigned int src_sub_resource_idx = i * src_levels + j + src_skip_levels;
unsigned int dst_sub_resource_idx = i * dst_levels + j;
+ HRESULT hr;
/* Use wined3d_texture_blt() instead of uploading directly if we need conversion. */
if (dst_texture->resource.format->convert
@@ -3802,7 +3743,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
src_texture, src_sub_resource_idx, &r, 0, NULL, WINED3D_TEXF_POINT)))
{
WARN("Failed to update surface, hr %#x.\n", hr);
- return hr;
+ return;
}
continue;
}
@@ -3812,25 +3753,106 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
if (FAILED(hr = surface_upload_from_surface(dst_surface, NULL, src_surface, NULL)))
{
WARN("Failed to update surface, hr %#x.\n", hr);
- return hr;
+ return;
}
}
}
- return WINED3D_OK;
+ break;
}
case WINED3D_RTYPE_TEXTURE_3D:
- if (FAILED(hr = wined3d_device_update_texture_3d(device,
- src_texture, src_skip_levels, dst_texture, level_count)))
- WARN("Failed to update 3D texture, hr %#x.\n", hr);
- return hr;
+ wined3d_device_update_texture_3d(context,
+ src_texture, src_skip_levels, dst_texture, level_count);
+ break;
default:
- FIXME("Unsupported texture type %#x.\n", type);
- return WINED3DERR_INVALIDCALL;
+ FIXME("Unsupported texture type %#x.\n", dst_texture->resource.type);
}
}
+HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
+ struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
+{
+ unsigned int src_size, dst_size, src_skip_levels = 0;
+ unsigned int layer_count;
+ enum wined3d_resource_type type;
+
+ TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
+
+ /* Verify that the source and destination textures are non-NULL. */
+ if (!src_texture || !dst_texture)
+ {
+ WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM)
+ {
+ WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+ if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT)
+ {
+ WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ /* Verify that the source and destination textures are the same type. */
+ type = src_texture->resource.type;
+ if (dst_texture->resource.type != type)
+ {
+ WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ layer_count = src_texture->layer_count;
+ if (layer_count != dst_texture->layer_count)
+ {
+ WARN("Source and destination have different layer counts.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ if (src_texture->resource.format != dst_texture->resource.format)
+ {
+ WARN("Source and destination formats do not match.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ switch (type)
+ {
+ case WINED3D_RTYPE_TEXTURE_2D:
+ break;
+
+ case WINED3D_RTYPE_TEXTURE_3D:
+ src_size = max(src_texture->resource.width, src_texture->resource.height);
+ src_size = max(src_size, src_texture->resource.depth);
@ -272,28 +334,11 @@ index bac505d3a8..acc1916747 100644
+ dst_size = max(dst_size, dst_texture->resource.depth);
+
+ while (src_size > dst_size)
{
- for (j = 0; j < level_count; ++j)
- {
- src_surface = src_texture->sub_resources[i * src_levels + j + src_skip_levels].u.surface;
- dst_surface = dst_texture->sub_resources[i * dst_levels + j].u.surface;
- if (FAILED(hr = surface_upload_from_surface(dst_surface, NULL, src_surface, NULL)))
- {
- WARN("Failed to update surface, hr %#x.\n", hr);
- return hr;
- }
- }
+ {
+ src_size >>= 1;
+ ++src_skip_levels;
}
- return WINED3D_OK;
- }
- case WINED3D_RTYPE_TEXTURE_3D:
- if (FAILED(hr = wined3d_device_update_texture_3d(device,
- src_texture, src_skip_levels, dst_texture, level_count)))
- WARN("Failed to update 3D texture, hr %#x.\n", hr);
- return hr;
+ }
+
+ if (wined3d_texture_get_level_width(src_texture, src_skip_levels) != dst_texture->resource.width
+ || wined3d_texture_get_level_height(src_texture, src_skip_levels) != dst_texture->resource.height
+ || wined3d_texture_get_level_depth(src_texture, src_skip_levels) != dst_texture->resource.depth)
@ -302,24 +347,24 @@ index bac505d3a8..acc1916747 100644
+ return WINED3DERR_INVALIDCALL;
+ }
+ break;
default:
- FIXME("Unsupported texture type %#x.\n", type);
- return WINED3DERR_INVALIDCALL;
+
+ default:
+ break;
}
+ }
+
+ wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture);
+
+ return WINED3D_OK;
}
+}
+
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
{
const struct wined3d_state *state = &device->state;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d5bc41defb..b9839e6c41 100644
index 04f2fdf1b8..e021012dac 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2715,6 +2715,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2725,6 +2725,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
@ -328,7 +373,7 @@ index d5bc41defb..b9839e6c41 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3302,6 +3304,8 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -3313,6 +3315,8 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
unsigned int slice_pitch) DECLSPEC_HIDDEN;

View File

@ -1,21 +1,21 @@
From 18746e1192dc09909f0e2478d35667e526230371 Mon Sep 17 00:00:00 2001
From 6b760fb77f50a2f5632656c048f4fb3c2f015cf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 14:31:56 +0200
Subject: wined3d: Hackily introduce a multithreaded command stream
---
dlls/wined3d/context.c | 3 +
dlls/wined3d/cs.c | 428 ++++++++++++++++++++++++++++++++++++-----
dlls/wined3d/cs.c | 441 +++++++++++++++++++++++++++++++++++------
dlls/wined3d/device.c | 2 +-
dlls/wined3d/wined3d_main.c | 10 +
dlls/wined3d/wined3d_private.h | 33 +++-
5 files changed, 419 insertions(+), 57 deletions(-)
dlls/wined3d/wined3d_private.h | 33 ++-
5 files changed, 426 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 71c683d119..2db127af3a 100644
index 6b05c0a71c..cbf63fdac7 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3787,6 +3787,9 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device,
@@ -3841,6 +3841,9 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device,
TRACE("device %p, texture %p, sub_resource_idx %u.\n", device, texture, sub_resource_idx);
@ -26,7 +26,7 @@ index 71c683d119..2db127af3a 100644
current_context = NULL;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index e380f9edcb..81695b7b14 100644
index db84f087dd..cdf71e7c3c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -18,6 +18,7 @@
@ -791,7 +791,63 @@ index e380f9edcb..81695b7b14 100644
{
const struct wined3d_cs_blt_sub_resource *op = data;
@@ -1895,6 +1985,8 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
@@ -1896,14 +1986,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
{
FIXME("Flags %#x not implemented for %s resources.\n",
op->flags, debug_d3dresourcetype(op->dst_resource->type));
- return;
+ goto done;
}
if (op->src_resource->format != op->dst_resource->format)
{
FIXME("Format conversion not implemented for %s resources.\n",
debug_d3dresourcetype(op->dst_resource->type));
- return;
+ goto done;
}
update_w = op->dst_box.right - op->dst_box.left;
@@ -1915,14 +2005,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
{
FIXME("Stretching not implemented for %s resources.\n",
debug_d3dresourcetype(op->dst_resource->type));
- return;
+ goto done;
}
if (op->src_box.left || op->src_box.top || op->src_box.front)
{
FIXME("Source box %s not supported for %s resources.\n",
debug_box(&op->src_box), debug_d3dresourcetype(op->dst_resource->type));
- return;
+ goto done;
}
dst_texture = texture_from_resource(op->dst_resource);
@@ -1936,7 +2026,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
ERR("Failed to load source sub-resource into %s.\n",
wined3d_debug_location(src_texture->resource.map_binding));
context_release(context);
- return;
+ goto done;
}
level = op->dst_sub_resource_idx % dst_texture->level_count;
@@ -1951,7 +2041,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
{
ERR("Failed to load destination sub-resource.\n");
context_release(context);
- return;
+ goto done;
}
wined3d_texture_get_memory(src_texture, op->src_sub_resource_idx, &addr, src_texture->resource.map_binding);
@@ -1971,9 +2061,12 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type));
}
+done:
if (op->src_resource)
wined3d_resource_release(op->src_resource);
wined3d_resource_release(op->dst_resource);
@ -800,7 +856,7 @@ index e380f9edcb..81695b7b14 100644
}
void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource,
@@ -1924,7 +2016,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -2003,7 +2096,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -809,7 +865,7 @@ index e380f9edcb..81695b7b14 100644
{
const struct wined3d_cs_update_sub_resource *op = data;
const struct wined3d_box *box = &op->box;
@@ -1974,6 +2066,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
@@ -2053,6 +2146,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
done:
wined3d_resource_release(op->resource);
@ -817,7 +873,7 @@ index e380f9edcb..81695b7b14 100644
}
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -2018,10 +2111,11 @@ push_constant_info[] =
@@ -2097,10 +2191,11 @@ push_constant_info[] =
{FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B},
};
@ -830,7 +886,7 @@ index e380f9edcb..81695b7b14 100644
unsigned int context_count;
unsigned int i;
size_t offset;
@@ -2037,6 +2131,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da
@@ -2116,6 +2211,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da
{
device->contexts[i]->constant_update_mask |= push_constant_info[op->p].mask;
}
@ -839,7 +895,7 @@ index e380f9edcb..81695b7b14 100644
}
void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
@@ -2054,7 +2150,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -2133,7 +2230,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@ -848,7 +904,7 @@ index e380f9edcb..81695b7b14 100644
{
const struct wined3d_cs_update_texture *op = data;
struct wined3d_context *context;
@@ -2065,6 +2161,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
@@ -2144,6 +2241,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
wined3d_resource_release(&op->src->resource);
wined3d_resource_release(&op->dst->resource);
@ -857,7 +913,7 @@ index e380f9edcb..81695b7b14 100644
}
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
@@ -2083,11 +2181,13 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2162,11 +2261,13 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
cs->ops->submit(cs);
}
@ -872,7 +928,7 @@ index e380f9edcb..81695b7b14 100644
}
void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
@@ -2101,7 +2201,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2180,7 +2281,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
cs->ops->submit_and_wait(cs);
}
@ -881,7 +937,7 @@ index e380f9edcb..81695b7b14 100644
{
const struct wined3d_cs_texture_add_dirty_region *op = data;
struct wined3d_texture *texture = op->texture;
@@ -2119,6 +2219,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
@@ -2198,6 +2299,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
context_release(context);
wined3d_resource_release(&texture->resource);
@ -890,7 +946,7 @@ index e380f9edcb..81695b7b14 100644
}
void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2140,7 +2242,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2219,7 +2322,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -899,7 +955,7 @@ index e380f9edcb..81695b7b14 100644
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
@@ -2241,6 +2343,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -2320,6 +2423,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -1101,7 +1157,7 @@ index e380f9edcb..81695b7b14 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -2270,12 +2567,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2349,12 +2647,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -1144,7 +1200,7 @@ index e380f9edcb..81695b7b14 100644
HeapFree(GetProcessHeap(), 0, cs->data);
HeapFree(GetProcessHeap(), 0, cs);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6a07197eb7..7cebd54adc 100644
index fff869d863..37d1272f78 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1307,7 +1307,7 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device
@ -1187,7 +1243,7 @@ index 1ce5937f17..4ef747ca89 100644
if (hkey) RegCloseKey( hkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7cef5c4dcb..99f598f4fe 100644
index 40b1e8753a..2699ee33b5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -390,6 +390,7 @@ struct wined3d_settings
@ -1198,7 +1254,7 @@ index 7cef5c4dcb..99f598f4fe 100644
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -2805,11 +2806,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
@@ -2816,11 +2817,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
InterlockedDecrement(&resource->access_count);
}
@ -1210,7 +1266,7 @@ index 7cef5c4dcb..99f598f4fe 100644
void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device,
enum wined3d_resource_type type, const struct wined3d_format *format,
@@ -3221,6 +3217,21 @@ enum wined3d_push_constants
@@ -3232,6 +3228,21 @@ enum wined3d_push_constants
WINED3D_PUSH_CONSTANTS_PS_B,
};
@ -1232,7 +1288,7 @@ index 7cef5c4dcb..99f598f4fe 100644
struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
@@ -3238,9 +3249,21 @@ struct wined3d_cs
@@ -3249,9 +3260,21 @@ struct wined3d_cs
size_t data_size, start, end;
void *data;

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 31990eb50ee15e12d709efcf1e21d3a9a2c20fb9 Mon Sep 17 00:00:00 2001
From 0e6a390ce17ae3d5d7fd05fb904b430ef3f6afaa Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Tue, 4 Nov 2014 22:41:45 +0100
Subject: wined3d: Improve DXTn support and export conversion functions for
@ -13,7 +13,7 @@ Subject: wined3d: Improve DXTn support and export conversion functions for
5 files changed, 161 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/dxtn.c b/dlls/wined3d/dxtn.c
index ce98949..77f7d55 100644
index ce989490ef..77f7d550a5 100644
--- a/dlls/wined3d/dxtn.c
+++ b/dlls/wined3d/dxtn.c
@@ -25,6 +25,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@ -153,10 +153,10 @@ index ce98949..77f7d55 100644
#undef LOAD_FUNCPTR
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 3668c25..1e9e02c 100644
index a9b24419f9..26c75b6d88 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1709,6 +1709,30 @@ static void convert_dxt1_x8r8g8b8(const BYTE *src, BYTE *dst,
@@ -1269,6 +1269,30 @@ static void convert_dxt1_x8r8g8b8(const BYTE *src, BYTE *dst,
wined3d_dxt1_decode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8X8_UNORM, w, h);
}
@ -187,7 +187,7 @@ index 3668c25..1e9e02c 100644
static void convert_a8r8g8b8_dxt1(const BYTE *src, BYTE *dst,
DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
{
@@ -1775,8 +1799,15 @@ static const struct d3dfmt_converter_desc converters[] =
@@ -1335,8 +1359,15 @@ static const struct d3dfmt_converter_desc converters[] =
static const struct d3dfmt_converter_desc dxtn_converters[] =
{
@ -204,10 +204,10 @@ index 3668c25..1e9e02c 100644
{WINED3DFMT_B8G8R8X8_UNORM, WINED3DFMT_DXT1, convert_x8r8g8b8_dxt1},
{WINED3DFMT_B5G5R5A1_UNORM, WINED3DFMT_DXT1, convert_a1r5g5b5_dxt1},
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 21cb0db..b7bf46d 100644
index 12246122f0..ed943dcf69 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -269,3 +269,11 @@
@@ -295,3 +295,11 @@
@ cdecl wined3d_vertex_declaration_decref(ptr)
@ cdecl wined3d_vertex_declaration_get_parent(ptr)
@ cdecl wined3d_vertex_declaration_incref(ptr)
@ -220,10 +220,10 @@ index 21cb0db..b7bf46d 100644
+@ cdecl wined3d_dxt5_decode(ptr ptr long long long long long)
+@ cdecl wined3d_dxt5_encode(ptr ptr long long long long long)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e14786c..e0696e1 100644
index 0ee4c9dc38..b88d89105e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3483,17 +3483,7 @@ static inline struct wined3d_surface *context_get_rt_surface(const struct wined3
@@ -4007,17 +4007,7 @@ static inline struct wined3d_surface *context_get_rt_surface(const struct wined3
return texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
}
@ -242,11 +242,11 @@ index e14786c..e0696e1 100644
/* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index cb057ab..baad228 100644
index 25c75f251a..bb85326a90 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2514,4 +2514,18 @@ static inline unsigned int wined3d_log2i(unsigned int x)
#endif
@@ -2679,4 +2679,18 @@ static inline void wined3d_box_set(struct wined3d_box *box, unsigned int left, u
box->back = back;
}
+BOOL wined3d_dxt1_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out,
@ -265,5 +265,5 @@ index cb057ab..baad228 100644
+
#endif /* __WINE_WINED3D_H */
--
2.7.1
2.11.0