mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against cc9c18a46d1ce7e2834bae0fa65a6ed7904820dd.
This commit is contained in:
parent
970dc74e89
commit
a0cb1797f4
@ -51,7 +51,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "38f3d59ed694afba7913b4992d13cb044a09126c"
|
||||
echo "cc9c18a46d1ce7e2834bae0fa65a6ed7904820dd"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -7400,10 +7400,7 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
patch_apply wined3d-CSMT_Main/0088-wined3d-Create-buffers-before-mapping-them.patch
|
||||
patch_apply wined3d-CSMT_Main/0090-wined3d-Remove-another-glFinish.patch
|
||||
patch_apply wined3d-CSMT_Main/0093-wined3d-Create-VBOs-through-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0094-wined3d-Clean-up-resource-data-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0095-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0096-Swapchain-waits.patch
|
||||
patch_apply wined3d-CSMT_Main/0097-wined3d-Clean-up-textures-through-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0098-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch
|
||||
patch_apply wined3d-CSMT_Main/0099-wined3d-Unload-resources-through-the-CS-in-device_re.patch
|
||||
patch_apply wined3d-CSMT_Main/0100-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch
|
||||
@ -7529,10 +7526,7 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Create buffers before mapping them.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Remove another glFinish.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Create VBOs through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Clean up resource data through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Clean up buffer resource data through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "Swapchain waits.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Clean up textures through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in uninit_3d.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in device_reset.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t glFinish after a depth buffer blit.", 1 },';
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 46b7d05ee6b1ff14469c78be3f2b9c1fd0192996 Mon Sep 17 00:00:00 2001
|
||||
From 6dab3b97a20b3b51219c2158309a303cd98898cb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 3 Apr 2013 18:01:34 +0200
|
||||
Subject: wined3d: Wait for the cs before destroying objects
|
||||
@ -13,23 +13,6 @@ the CS.
|
||||
dlls/wined3d/wined3d_private.h | 1 +
|
||||
4 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index edecdbe..66e13cb 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -565,6 +565,12 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ {
|
||||
+ FIXME("Waiting for cs.\n");
|
||||
+ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs);
|
||||
+ }
|
||||
+
|
||||
if (buffer->buffer_object)
|
||||
{
|
||||
context = context_acquire(buffer->resource.device, NULL);
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 3bcbf19..185def9 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
@ -49,28 +32,11 @@ index 3bcbf19..185def9 100644
|
||||
};
|
||||
|
||||
/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index cdb7636..ecabc60 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -479,6 +479,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
|
||||
TRACE("texture %p.\n", texture);
|
||||
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ {
|
||||
+ FIXME("Waiting for cs.\n");
|
||||
+ texture->resource.device->cs->ops->finish(texture->resource.device->cs);
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < sub_count; ++i)
|
||||
{
|
||||
if (!(buffer_object = texture->sub_resources[i].buffer_object))
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 1b6077d..dfb3cca 100644
|
||||
index cedb36d..e88f172 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2969,6 +2969,7 @@ struct wined3d_cs_ops
|
||||
@@ -2981,6 +2981,7 @@ struct wined3d_cs_ops
|
||||
{
|
||||
void *(*require_space)(struct wined3d_cs *cs, size_t size);
|
||||
void (*submit)(struct wined3d_cs *cs);
|
||||
|
@ -1,19 +1,18 @@
|
||||
From 7af03f1c752ad8e933f75f73841f3deeeeb5ebdb Mon Sep 17 00:00:00 2001
|
||||
From 1eb816c58ca5ed8999d8914e2c5dee650e0bb2a4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 20 Aug 2014 18:01:36 +0200
|
||||
Subject: wined3d: Introduce resource fencing.
|
||||
|
||||
FIXME: The buffer part doesn't really make sense without dynamic buffer maps.
|
||||
---
|
||||
dlls/wined3d/cs.c | 19 +++++++++++++++++++
|
||||
dlls/wined3d/wined3d_private.h | 16 ++++++++++++++++
|
||||
2 files changed, 35 insertions(+)
|
||||
dlls/wined3d/cs.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 766dbad..0f8a03f 100644
|
||||
index f33cfa8..f196f72 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -553,6 +553,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
@@ -554,6 +554,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
struct wined3d_state *state = &cs->state;
|
||||
const struct wined3d_cs_draw *op = data;
|
||||
const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
|
||||
@ -21,22 +20,22 @@ index 766dbad..0f8a03f 100644
|
||||
|
||||
if (op->indexed && !gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX])
|
||||
{
|
||||
@@ -578,6 +579,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
@@ -579,6 +580,14 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
draw_primitive(cs->device, state, op->base_vertex_idx, op->start_idx,
|
||||
op->index_count, op->start_instance, op->instance_count, op->indexed);
|
||||
|
||||
+ if (op->indexed)
|
||||
+ wined3d_resource_dec_fence(&cs->state.index_buffer->resource);
|
||||
+ wined3d_resource_release(&cs->state.index_buffer->resource);
|
||||
+ for (i = 0; i < sizeof(cs->state.streams) / sizeof(*cs->state.streams); i++)
|
||||
+ {
|
||||
+ if (cs->state.streams[i].buffer)
|
||||
+ wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource);
|
||||
+ wined3d_resource_release(&cs->state.streams[i].buffer->resource);
|
||||
+ }
|
||||
+
|
||||
return sizeof(*op);
|
||||
}
|
||||
|
||||
@@ -585,6 +594,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
@@ -586,6 +595,8 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed)
|
||||
{
|
||||
struct wined3d_cs_draw *op;
|
||||
@ -45,55 +44,21 @@ index 766dbad..0f8a03f 100644
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op));
|
||||
op->opcode = WINED3D_CS_OP_DRAW;
|
||||
@@ -595,6 +606,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
@@ -596,6 +607,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
op->instance_count = instance_count;
|
||||
op->indexed = indexed;
|
||||
|
||||
+ if (indexed)
|
||||
+ wined3d_resource_inc_fence(&state->index_buffer->resource);
|
||||
+ wined3d_resource_acquire(&state->index_buffer->resource);
|
||||
+ for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++)
|
||||
+ {
|
||||
+ if (state->streams[i].buffer)
|
||||
+ wined3d_resource_inc_fence(&state->streams[i].buffer->resource);
|
||||
+ wined3d_resource_acquire(&state->streams[i].buffer->resource);
|
||||
+ }
|
||||
+
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index c9e467b..a70d88f 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2468,6 +2468,7 @@ struct wined3d_resource
|
||||
DWORD priority;
|
||||
void *heap_memory;
|
||||
struct list resource_list_entry;
|
||||
+ LONG access_fence;
|
||||
|
||||
void *parent;
|
||||
const struct wined3d_parent_ops *parent_ops;
|
||||
@@ -2500,6 +2501,21 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H
|
||||
DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
|
||||
+static inline void wined3d_resource_inc_fence(struct wined3d_resource *resource)
|
||||
+{
|
||||
+ InterlockedIncrement(&resource->access_fence);
|
||||
+}
|
||||
+
|
||||
+static inline void wined3d_resource_dec_fence(struct wined3d_resource *resource)
|
||||
+{
|
||||
+ InterlockedDecrement(&resource->access_fence);
|
||||
+}
|
||||
+
|
||||
+static inline void wined3d_resource_wait_fence(struct wined3d_resource *resource)
|
||||
+{
|
||||
+ while(InterlockedCompareExchange(&resource->access_fence, 0, 0));
|
||||
+}
|
||||
+
|
||||
/* Tests show that the start address of resources is 32 byte aligned */
|
||||
#define RESOURCE_ALIGNMENT 16
|
||||
|
||||
--
|
||||
2.8.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From c83ea283c1bb0d04bdfb2b5bc49f054b392b79e5 Mon Sep 17 00:00:00 2001
|
||||
From 3f09055fac1731ff05bc260ee2f6215ba40bb2cf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 30 Aug 2013 10:41:42 +0200
|
||||
Subject: wined3d: Fence update_texture calls
|
||||
@ -9,38 +9,38 @@ Subject: wined3d: Fence update_texture calls
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 3991111..34f1444 100644
|
||||
index f196f72..ff559de 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -1962,6 +1962,9 @@ static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
|
||||
@@ -1971,6 +1971,9 @@ static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
|
||||
device_exec_update_texture(context, op->src, op->dst);
|
||||
context_release(context);
|
||||
|
||||
+ wined3d_resource_dec_fence(&op->src->resource);
|
||||
+ wined3d_resource_dec_fence(&op->dst->resource);
|
||||
+ wined3d_resource_release(&op->src->resource);
|
||||
+ wined3d_resource_release(&op->dst->resource);
|
||||
+
|
||||
return sizeof(*op);
|
||||
}
|
||||
|
||||
@@ -1975,6 +1978,9 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
|
||||
@@ -1984,6 +1987,9 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
|
||||
op->src = src;
|
||||
op->dst = dst;
|
||||
|
||||
+ wined3d_resource_inc_fence(&op->src->resource);
|
||||
+ wined3d_resource_inc_fence(&op->dst->resource);
|
||||
+ wined3d_resource_acquire(&op->src->resource);
|
||||
+ wined3d_resource_acquire(&op->dst->resource);
|
||||
+
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index fac20c9..541e3c2 100644
|
||||
index 98d1177..13e8a26 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1691,6 +1691,8 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
@@ -1765,6 +1765,8 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
|
||||
flags = wined3d_resource_sanitize_map_flags(resource, flags);
|
||||
|
||||
+ wined3d_resource_wait_fence(&texture->resource);
|
||||
+ wined3d_resource_wait_idle(&texture->resource);
|
||||
+
|
||||
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 9eeb22d9a97118d07e92f47d8aeae1d795c5d40b Mon Sep 17 00:00:00 2001
|
||||
From 3fc3a3051fe8fc5ec3c06432b00754c8ec81158d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 30 Aug 2013 22:42:33 +0200
|
||||
Subject: wined3d: Fence texture reads in draws
|
||||
@ -21,29 +21,29 @@ sRGB_decode isn't.
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 34f1444..f4bfbd1 100644
|
||||
index ff559de..ffd5d72 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -573,6 +573,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
@@ -587,6 +587,11 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
if (cs->state.streams[i].buffer)
|
||||
wined3d_resource_dec_fence(&cs->state.streams[i].buffer->resource);
|
||||
wined3d_resource_release(&cs->state.streams[i].buffer->resource);
|
||||
}
|
||||
+ for (i = 0; i < sizeof(cs->state.textures) / sizeof(*cs->state.textures); i++)
|
||||
+ {
|
||||
+ if (cs->state.textures[i])
|
||||
+ wined3d_resource_dec_fence(&cs->state.textures[i]->resource);
|
||||
+ wined3d_resource_release(&cs->state.textures[i]->resource);
|
||||
+ }
|
||||
|
||||
return sizeof(*op);
|
||||
}
|
||||
@@ -599,6 +604,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
|
||||
@@ -614,6 +619,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
if (state->streams[i].buffer)
|
||||
wined3d_resource_inc_fence(&state->streams[i].buffer->resource);
|
||||
wined3d_resource_acquire(&state->streams[i].buffer->resource);
|
||||
}
|
||||
+ for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++)
|
||||
+ {
|
||||
+ if (state->textures[i])
|
||||
+ wined3d_resource_inc_fence(&state->textures[i]->resource);
|
||||
+ wined3d_resource_acquire(&state->textures[i]->resource);
|
||||
+ }
|
||||
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 8c882adc2b2b5858126a6d07e0dd2e04fbe986de Mon Sep 17 00:00:00 2001
|
||||
From fa13f4317b9d869fd8a3847926bf5f2edc40b479 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 16:55:58 +0200
|
||||
Subject: wined3d: Fence render targets and depth stencils
|
||||
@ -8,10 +8,10 @@ Subject: wined3d: Fence render targets and depth stencils
|
||||
1 file changed, 38 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 5adc3f8..8a79516 100644
|
||||
index ffd5d72..329cdce 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -548,6 +548,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
@@ -549,6 +549,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
cs->ops->submit(cs, size);
|
||||
}
|
||||
|
||||
@ -42,31 +42,31 @@ index 5adc3f8..8a79516 100644
|
||||
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
struct wined3d_state *state = &cs->state;
|
||||
@@ -591,6 +615,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
@@ -592,6 +616,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
if (cs->state.textures[i])
|
||||
wined3d_resource_dec_fence(&cs->state.textures[i]->resource);
|
||||
wined3d_resource_release(&cs->state.textures[i]->resource);
|
||||
}
|
||||
+ for (i = 0; i < gl_info->limits.buffers; i++)
|
||||
+ {
|
||||
+ if (cs->state.fb.render_targets[i] && wined3d_cs_colorwrite_enabled(&cs->state, i))
|
||||
+ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource);
|
||||
+ wined3d_resource_release(cs->state.fb.render_targets[i]->resource);
|
||||
+ }
|
||||
+ if (cs->state.fb.depth_stencil && wined3d_cs_depth_stencil_enabled(&cs->state))
|
||||
+ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource);
|
||||
+ wined3d_resource_release(cs->state.fb.depth_stencil->resource);
|
||||
|
||||
return sizeof(*op);
|
||||
}
|
||||
@@ -623,6 +654,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
@@ -624,6 +655,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
if (state->textures[i])
|
||||
wined3d_resource_inc_fence(&state->textures[i]->resource);
|
||||
wined3d_resource_acquire(&state->textures[i]->resource);
|
||||
}
|
||||
+ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++)
|
||||
+ {
|
||||
+ if (state->fb.render_targets[i] && wined3d_cs_colorwrite_enabled(state, i))
|
||||
+ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource);
|
||||
+ wined3d_resource_acquire(state->fb.render_targets[i]->resource);
|
||||
+ }
|
||||
+ if (state->fb.depth_stencil && wined3d_cs_depth_stencil_enabled(state))
|
||||
+ wined3d_resource_inc_fence(state->fb.depth_stencil->resource);
|
||||
+ wined3d_resource_acquire(state->fb.depth_stencil->resource);
|
||||
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 26566a78da3e11952e265a4999d55279c595162a Mon Sep 17 00:00:00 2001
|
||||
From 67a6d3fc2dff7be59c88fdbb9bc4199f20b691b3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 16:57:01 +0200
|
||||
Subject: wined3d: Fence blit operations.
|
||||
@ -8,27 +8,27 @@ Subject: wined3d: Fence blit operations.
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 98072e2..f34a642 100644
|
||||
index 329cdce..68c104e 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -1792,6 +1792,10 @@ static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
|
||||
@@ -1824,6 +1824,10 @@ static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
|
||||
op->src_surface, &op->src_rect,
|
||||
op->flags, &op->fx, op->filter);
|
||||
|
||||
+ wined3d_resource_dec_fence(&op->dst_surface->container->resource);
|
||||
+ wined3d_resource_release(&op->dst_surface->container->resource);
|
||||
+ if (op->src_surface && op->src_surface != op->dst_surface)
|
||||
+ wined3d_resource_dec_fence(&op->src_surface->container->resource);
|
||||
+ wined3d_resource_release(&op->src_surface->container->resource);
|
||||
+
|
||||
return sizeof(*op);
|
||||
}
|
||||
|
||||
@@ -1813,6 +1817,10 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
|
||||
@@ -1845,6 +1849,10 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
|
||||
if (fx)
|
||||
op->fx = *fx;
|
||||
|
||||
+ wined3d_resource_inc_fence(&dst_surface->container->resource);
|
||||
+ wined3d_resource_acquire(&dst_surface->container->resource);
|
||||
+ if (src_surface && src_surface != dst_surface)
|
||||
+ wined3d_resource_inc_fence(&src_surface->container->resource);
|
||||
+ wined3d_resource_acquire(&src_surface->container->resource);
|
||||
+
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 440209519eb18ae97a46fd5ee046d3d93f2dd99a Mon Sep 17 00:00:00 2001
|
||||
From e7897ceec2a6eb091a1877df85471037bae120b7 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 16:58:13 +0200
|
||||
Subject: wined3d: Fence color_fill operations.
|
||||
@ -8,23 +8,23 @@ Subject: wined3d: Fence color_fill operations.
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index f34a642..77afbe5 100644
|
||||
index 68c104e..af10384 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -1834,6 +1834,8 @@ static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
|
||||
@@ -1866,6 +1866,8 @@ static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
|
||||
else
|
||||
op->blitter->depth_fill(device, op->view, &op->rect, op->flags, op->depth, op->stencil);
|
||||
|
||||
+ wined3d_resource_dec_fence(op->view->resource);
|
||||
+ wined3d_resource_release(op->view->resource);
|
||||
+
|
||||
return sizeof(*op);
|
||||
}
|
||||
|
||||
@@ -1854,6 +1856,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
|
||||
@@ -1886,6 +1888,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
|
||||
op->stencil = stencil;
|
||||
op->blitter = blitter;
|
||||
|
||||
+ wined3d_resource_inc_fence(view->resource);
|
||||
+ wined3d_resource_acquire(view->resource);
|
||||
+
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From c927f5ec0f74ffda987c7ac713baf2d1020b31ac Mon Sep 17 00:00:00 2001
|
||||
From cccdf39d6f6cc952455a999d466fe868b4640d91 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 17:04:47 +0200
|
||||
Subject: wined3d: Fence clear calls.
|
||||
@ -8,10 +8,10 @@ Subject: wined3d: Fence clear calls.
|
||||
1 file changed, 26 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 77afbe5..9330327 100644
|
||||
index af10384..60ae4a3 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -516,6 +516,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
@@ -522,6 +522,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
struct wined3d_device *device;
|
||||
RECT draw_rect;
|
||||
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[op->rect_count]);
|
||||
@ -19,7 +19,7 @@ index 77afbe5..9330327 100644
|
||||
|
||||
device = cs->device;
|
||||
wined3d_get_draw_rect(&cs->state, &draw_rect);
|
||||
@@ -523,6 +524,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
@@ -529,6 +530,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
&cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags,
|
||||
&op->color, op->depth, op->stencil);
|
||||
|
||||
@ -28,16 +28,16 @@ index 77afbe5..9330327 100644
|
||||
+ for (i = 0; i < device->adapter->gl_info.limits.buffers; i++)
|
||||
+ {
|
||||
+ if (cs->state.fb.render_targets[i])
|
||||
+ wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource);
|
||||
+ wined3d_resource_release(cs->state.fb.render_targets[i]->resource);
|
||||
+ }
|
||||
+ }
|
||||
+ if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
|
||||
+ wined3d_resource_dec_fence(cs->state.fb.depth_stencil->resource);
|
||||
+ wined3d_resource_release(cs->state.fb.depth_stencil->resource);
|
||||
+
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -531,6 +543,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
@@ -537,6 +549,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
{
|
||||
struct wined3d_cs_clear *op;
|
||||
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[rect_count]);
|
||||
@ -47,7 +47,7 @@ index 77afbe5..9330327 100644
|
||||
op = cs->ops->require_space(cs, size);
|
||||
op->opcode = WINED3D_CS_OP_CLEAR;
|
||||
op->flags = flags;
|
||||
@@ -540,6 +555,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
@@ -546,6 +561,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
op->rect_count = rect_count;
|
||||
memcpy(op->rects, rects, sizeof(*rects) * rect_count);
|
||||
|
||||
@ -56,11 +56,11 @@ index 77afbe5..9330327 100644
|
||||
+ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++)
|
||||
+ {
|
||||
+ if (state->fb.render_targets[i])
|
||||
+ wined3d_resource_inc_fence(state->fb.render_targets[i]->resource);
|
||||
+ wined3d_resource_acquire(state->fb.render_targets[i]->resource);
|
||||
+ }
|
||||
+ }
|
||||
+ if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
|
||||
+ wined3d_resource_inc_fence(state->fb.depth_stencil->resource);
|
||||
+ wined3d_resource_acquire(state->fb.depth_stencil->resource);
|
||||
+
|
||||
cs->ops->submit(cs, size);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 854a8836679c80071b74977c0c28b566daa9e1bf Mon Sep 17 00:00:00 2001
|
||||
From 5231563b7294c2c8d00cd28be3c7a6974af9de0c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 17:55:35 +0200
|
||||
Subject: wined3d: Fence present calls.
|
||||
@ -8,10 +8,10 @@ Subject: wined3d: Fence present calls.
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 9330327..9d017e0 100644
|
||||
index 60ae4a3..139d0c2 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -476,6 +476,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
@@ -482,6 +482,7 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_present *op = data;
|
||||
struct wined3d_swapchain *swapchain;
|
||||
@ -19,18 +19,18 @@ index 9330327..9d017e0 100644
|
||||
|
||||
swapchain = op->swapchain;
|
||||
wined3d_swapchain_set_window(swapchain, op->dst_window_override);
|
||||
@@ -485,6 +486,10 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
@@ -491,6 +492,10 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
|
||||
InterlockedDecrement(&cs->pending_presents);
|
||||
|
||||
+ wined3d_resource_dec_fence(&swapchain->front_buffer->resource);
|
||||
+ wined3d_resource_release(&swapchain->front_buffer->resource);
|
||||
+ for (i = 0; i < swapchain->desc.backbuffer_count; i++)
|
||||
+ wined3d_resource_dec_fence(&swapchain->back_buffers[i]->resource);
|
||||
+ wined3d_resource_release(&swapchain->back_buffers[i]->resource);
|
||||
+
|
||||
return sizeof(*op);
|
||||
}
|
||||
|
||||
@@ -493,6 +498,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
@@ -499,6 +504,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
{
|
||||
struct wined3d_cs_present *op;
|
||||
LONG pending;
|
||||
@ -38,13 +38,13 @@ index 9330327..9d017e0 100644
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op));
|
||||
op->opcode = WINED3D_CS_OP_PRESENT;
|
||||
@@ -502,6 +508,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
@@ -508,6 +514,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
op->dst_rect = *dst_rect;
|
||||
op->flags = flags;
|
||||
|
||||
+ wined3d_resource_inc_fence(&swapchain->front_buffer->resource);
|
||||
+ wined3d_resource_acquire(&swapchain->front_buffer->resource);
|
||||
+ for (i = 0; i < swapchain->desc.backbuffer_count; i++)
|
||||
+ wined3d_resource_inc_fence(&swapchain->back_buffers[i]->resource);
|
||||
+ wined3d_resource_acquire(&swapchain->back_buffers[i]->resource);
|
||||
+
|
||||
pending = InterlockedIncrement(&cs->pending_presents);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From ba4847164d9db1bd92f8853e46414c7320e026b6 Mon Sep 17 00:00:00 2001
|
||||
From 0a4289bbeaf2981f822c11efeb4322ae7d4a14fc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 17:58:25 +0200
|
||||
Subject: wined3d: Make resource maps and unmaps a priority command.
|
||||
@ -9,10 +9,10 @@ Subject: wined3d: Make resource maps and unmaps a priority command.
|
||||
2 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 9d017e0..5ec5fc5 100644
|
||||
index 139d0c2..1b2378b 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -1912,20 +1912,16 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
|
||||
@@ -1944,20 +1944,16 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
|
||||
struct wined3d_cs_texture_map *op;
|
||||
void *ret;
|
||||
|
||||
@ -36,7 +36,7 @@ index 9d017e0..5ec5fc5 100644
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1944,12 +1940,12 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
|
||||
@@ -1976,12 +1972,12 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
|
||||
{
|
||||
struct wined3d_cs_texture_unmap *op;
|
||||
|
||||
@ -52,10 +52,10 @@ index 9d017e0..5ec5fc5 100644
|
||||
|
||||
static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 165330e..82f7aa0 100644
|
||||
index f918797..7b5e344 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1691,6 +1691,10 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
@@ -1765,6 +1765,10 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
|
||||
flags = wined3d_resource_sanitize_map_flags(resource, flags);
|
||||
|
||||
@ -63,7 +63,7 @@ index 165330e..82f7aa0 100644
|
||||
+ {
|
||||
+ FIXME("Dynamic resource map is inefficient\n");
|
||||
+ }
|
||||
wined3d_resource_wait_fence(&texture->resource);
|
||||
wined3d_resource_wait_idle(&texture->resource);
|
||||
|
||||
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
|
||||
--
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b1c886fedd3ccfca93fe0b33f62ddf7bea7b7c56 Mon Sep 17 00:00:00 2001
|
||||
From 70af66f5937a43b642abf38920ef206a9348d45c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 19:06:41 +0200
|
||||
Subject: wined3d: Implement DISCARD texture maps with PBOs.
|
||||
@ -10,10 +10,10 @@ Subject: wined3d: Implement DISCARD texture maps with PBOs.
|
||||
3 files changed, 43 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index ee83438..94298af 100644
|
||||
index 75dd990..d30c449 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -381,6 +381,7 @@ struct wined3d_cs_texture_changed
|
||||
@@ -393,6 +393,7 @@ struct wined3d_cs_texture_changed
|
||||
enum wined3d_cs_op opcode;
|
||||
struct wined3d_texture *texture;
|
||||
unsigned int sub_resource_idx;
|
||||
@ -21,7 +21,7 @@ index ee83438..94298af 100644
|
||||
};
|
||||
|
||||
struct wined3d_cs_skip
|
||||
@@ -1919,13 +1920,13 @@ static UINT wined3d_cs_exec_texture_changed(struct wined3d_cs *cs, const void *d
|
||||
@@ -1951,13 +1952,13 @@ static UINT wined3d_cs_exec_texture_changed(struct wined3d_cs *cs, const void *d
|
||||
{
|
||||
const struct wined3d_cs_texture_changed *op = data;
|
||||
|
||||
@ -37,7 +37,7 @@ index ee83438..94298af 100644
|
||||
{
|
||||
struct wined3d_cs_texture_changed *op;
|
||||
|
||||
@@ -1933,6 +1934,7 @@ void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_textu
|
||||
@@ -1965,6 +1966,7 @@ void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_textu
|
||||
op->opcode = WINED3D_CS_OP_TEXTURE_CHANGED;
|
||||
op->texture = texture;
|
||||
op->sub_resource_idx = sub_resource_idx;
|
||||
@ -46,10 +46,10 @@ index ee83438..94298af 100644
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index ad4e93f..2cc4014 100644
|
||||
index ab7127b..43bcb51 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1599,10 +1599,26 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
@@ -1673,10 +1673,26 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
|
||||
if (flags & WINED3D_MAP_DISCARD)
|
||||
{
|
||||
@ -78,7 +78,7 @@ index ad4e93f..2cc4014 100644
|
||||
wined3d_texture_validate_location(texture, sub_resource_idx, texture->resource.map_binding);
|
||||
}
|
||||
else
|
||||
@@ -1698,11 +1714,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
@@ -1772,11 +1788,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
|
||||
flags = wined3d_resource_sanitize_map_flags(resource, flags);
|
||||
|
||||
@ -86,16 +86,16 @@ index ad4e93f..2cc4014 100644
|
||||
- {
|
||||
- FIXME("Dynamic resource map is inefficient\n");
|
||||
- }
|
||||
- wined3d_resource_wait_fence(&texture->resource);
|
||||
- wined3d_resource_wait_idle(&texture->resource);
|
||||
+ if (flags & WINED3D_MAP_NOOVERWRITE)
|
||||
+ FIXME("WINED3D_MAP_NOOVERWRITE is not implemented yet.\n");
|
||||
+
|
||||
+ if (!(flags & WINED3D_MAP_DISCARD) || texture->resource.map_binding != WINED3D_LOCATION_BUFFER)
|
||||
+ wined3d_resource_wait_fence(&texture->resource);
|
||||
+ wined3d_resource_wait_idle(&texture->resource);
|
||||
|
||||
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
|
||||
|
||||
@@ -1776,8 +1792,20 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1850,8 +1866,20 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ index ad4e93f..2cc4014 100644
|
||||
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
|
||||
}
|
||||
|
||||
@@ -1805,7 +1833,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
|
||||
@@ -1879,7 +1907,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
|
||||
|
||||
if (sub_resource->unmap_dirtify)
|
||||
{
|
||||
@ -127,10 +127,10 @@ index ad4e93f..2cc4014 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 611b8b0..4d6721d 100644
|
||||
index 4fd8892..e3b6ff8 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2626,7 +2626,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
|
||||
@@ -2733,7 +2733,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
|
||||
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
|
||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_changed(struct wined3d_texture *texture,
|
||||
@ -139,7 +139,7 @@ index 611b8b0..4d6721d 100644
|
||||
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
|
||||
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
|
||||
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
@@ -3014,7 +3014,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
|
||||
@@ -3118,7 +3118,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
|
||||
const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
|
||||
const struct blit_shader *blitter) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_texture *texture,
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 10d588d723446311832d7b4a6ccf37ba85003a18 Mon Sep 17 00:00:00 2001
|
||||
From bd07c044ca2439da5464de6f88f4e001e13a0dc2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 19:24:21 +0200
|
||||
Subject: wined3d: Implement DISCARD resource maps with heap memory.
|
||||
@ -12,7 +12,7 @@ Subject: wined3d: Implement DISCARD resource maps with heap memory.
|
||||
5 files changed, 51 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 92a0cab..bd1a2c2 100644
|
||||
index 314415c..a841f6b 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -496,6 +496,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *c
|
||||
@ -24,7 +24,7 @@ index 92a0cab..bd1a2c2 100644
|
||||
buffer_bind(buffer, context);
|
||||
GL_EXTCALL(glGetBufferSubData(buffer->buffer_type_hint, 0, buffer->resource.size, buffer->resource.heap_memory));
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 595520a..640a5f8 100644
|
||||
index d30c449..2325138 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -394,6 +394,7 @@ struct wined3d_cs_texture_changed
|
||||
@ -60,7 +60,7 @@ index 595520a..640a5f8 100644
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index e10921a..75a3dd5 100644
|
||||
index 7f80957..1029f12 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -213,6 +213,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
@ -77,9 +77,9 @@ index e10921a..75a3dd5 100644
|
||||
wined3d_resource_free_sysmem(resource);
|
||||
+ resource->map_heap_memory = NULL;
|
||||
context_resource_released(resource->device, resource, resource->type);
|
||||
wined3d_resource_release(resource);
|
||||
}
|
||||
|
||||
@@ -340,7 +342,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
|
||||
@@ -342,7 +344,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
|
||||
p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1;
|
||||
*p = mem;
|
||||
|
||||
@ -89,7 +89,7 @@ index e10921a..75a3dd5 100644
|
||||
return TRUE;
|
||||
}
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index de2d135..d810267 100644
|
||||
index 43bcb51..15d27a5 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -104,6 +104,7 @@ static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
|
||||
@ -112,7 +112,7 @@ index de2d135..d810267 100644
|
||||
data->addr += sub_resource->offset;
|
||||
data->buffer_object = 0;
|
||||
return;
|
||||
@@ -1105,6 +1109,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1137,6 +1141,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
}
|
||||
|
||||
wined3d_resource_free_sysmem(&texture->resource);
|
||||
@ -120,7 +120,7 @@ index de2d135..d810267 100644
|
||||
|
||||
if ((texture->row_pitch = pitch))
|
||||
texture->slice_pitch = height * pitch;
|
||||
@@ -1299,6 +1304,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
@@ -1331,6 +1336,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
ERR("Failed to allocate system memory.\n");
|
||||
return FALSE;
|
||||
}
|
||||
@ -128,7 +128,7 @@ index de2d135..d810267 100644
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_USER_MEMORY:
|
||||
@@ -1656,6 +1662,12 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
@@ -1686,6 +1692,12 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
ret = !!sub_resource->map_buffer;
|
||||
break;
|
||||
|
||||
@ -141,7 +141,7 @@ index de2d135..d810267 100644
|
||||
default:
|
||||
ret = wined3d_texture_prepare_location(texture, sub_resource_idx,
|
||||
context, texture->resource.map_binding);
|
||||
@@ -1761,7 +1773,21 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
@@ -1791,7 +1803,21 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
if (flags & WINED3D_MAP_NOOVERWRITE)
|
||||
FIXME("WINED3D_MAP_NOOVERWRITE is not implemented yet.\n");
|
||||
|
||||
@ -157,14 +157,14 @@ index de2d135..d810267 100644
|
||||
+ default:
|
||||
+ FIXME("Implement discard maps with %s map binding.\n",
|
||||
+ wined3d_debug_location(texture->resource.map_binding));
|
||||
+ wined3d_resource_wait_fence(&texture->resource);
|
||||
+ wined3d_resource_wait_idle(&texture->resource);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
wined3d_resource_wait_fence(&texture->resource);
|
||||
wined3d_resource_wait_idle(&texture->resource);
|
||||
|
||||
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
|
||||
@@ -1837,7 +1863,7 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1867,7 +1893,7 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
|
||||
void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
@ -173,7 +173,7 @@ index de2d135..d810267 100644
|
||||
{
|
||||
struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
|
||||
@@ -1850,6 +1876,12 @@ void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_r
|
||||
@@ -1880,6 +1906,12 @@ void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_r
|
||||
sub_resource->buffer = swap_buffer;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ index de2d135..d810267 100644
|
||||
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
|
||||
}
|
||||
|
||||
@@ -1877,7 +1909,8 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
|
||||
@@ -1907,7 +1939,8 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
|
||||
|
||||
if (sub_resource->unmap_dirtify)
|
||||
{
|
||||
@ -196,7 +196,7 @@ index de2d135..d810267 100644
|
||||
sub_resource->unmap_dirtify = FALSE;
|
||||
}
|
||||
|
||||
@@ -2332,6 +2365,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
@@ -2348,6 +2381,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
if (wined3d_texture_use_pbo(texture, gl_info))
|
||||
{
|
||||
wined3d_resource_free_sysmem(&texture->resource);
|
||||
@ -205,7 +205,7 @@ index de2d135..d810267 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 1b125d5..50c0854 100644
|
||||
index e3b6ff8..de30dd4 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2536,7 +2536,7 @@ struct wined3d_resource
|
||||
@ -215,7 +215,7 @@ index 1b125d5..50c0854 100644
|
||||
- void *heap_memory;
|
||||
+ void *heap_memory, *map_heap_memory;
|
||||
struct list resource_list_entry;
|
||||
LONG access_fence;
|
||||
LONG access_count;
|
||||
|
||||
@@ -2733,7 +2733,8 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
|
||||
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 6dea1a91cc8a00d2c8e24e3511fefe017d76d9c7 Mon Sep 17 00:00:00 2001
|
||||
From 95ab414f54e4b6b157593c001a7bf047f74566a5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Tue, 30 Jul 2013 22:17:10 +0200
|
||||
Subject: wined3d: Separate GL buffer discard control from ignoring
|
||||
@ -18,7 +18,7 @@ There are some problems left:
|
||||
3 files changed, 28 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index ff5ecd0..1602ff1 100644
|
||||
index e3659b2..f939c57 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||
@ -30,7 +30,7 @@ index ff5ecd0..1602ff1 100644
|
||||
#define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */
|
||||
#define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */
|
||||
|
||||
@@ -920,7 +920,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -931,7 +931,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
* previous contents of the buffer. The r600g driver only does this when
|
||||
* the buffer is currently in use, while the proprietary NVIDIA driver
|
||||
* appears to do this unconditionally. */
|
||||
@ -39,7 +39,7 @@ index ff5ecd0..1602ff1 100644
|
||||
flags &= ~WINED3D_MAP_DISCARD;
|
||||
count = ++buffer->resource.map_count;
|
||||
|
||||
@@ -1001,10 +1001,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1009,10 +1009,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
context_release(context);
|
||||
}
|
||||
}
|
||||
@ -59,7 +59,7 @@ index ff5ecd0..1602ff1 100644
|
||||
buffer->flags |= WINED3D_BUFFER_SYNC;
|
||||
}
|
||||
|
||||
@@ -1013,6 +1018,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1021,6 +1026,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||
if (flags & WINED3D_MAP_DISCARD && !swvp)
|
||||
{
|
||||
@ -67,7 +67,7 @@ index ff5ecd0..1602ff1 100644
|
||||
wined3d_resource_allocate_sysmem(&buffer->resource);
|
||||
wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory);
|
||||
}
|
||||
@@ -1449,3 +1455,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size,
|
||||
@@ -1459,3 +1465,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size,
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@ -79,28 +79,28 @@ index ff5ecd0..1602ff1 100644
|
||||
+ buffer->flags |= WINED3D_BUFFER_DISCARD;
|
||||
+}
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 688d933a..0c735bf 100644
|
||||
index 9044495..4833fda 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -711,11 +711,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
|
||||
@@ -723,11 +723,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
|
||||
op->indexed = indexed;
|
||||
|
||||
if (indexed)
|
||||
+ {
|
||||
wined3d_resource_inc_fence(&state->index_buffer->resource);
|
||||
wined3d_resource_acquire(&state->index_buffer->resource);
|
||||
+ state->index_buffer->ignore_discard = FALSE;
|
||||
+ }
|
||||
for (i = 0; i < sizeof(state->streams) / sizeof(*state->streams); i++)
|
||||
{
|
||||
if (state->streams[i].buffer)
|
||||
+ {
|
||||
wined3d_resource_inc_fence(&state->streams[i].buffer->resource);
|
||||
wined3d_resource_acquire(&state->streams[i].buffer->resource);
|
||||
+ state->streams[i].buffer->ignore_discard = FALSE;
|
||||
+ }
|
||||
}
|
||||
for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++)
|
||||
{
|
||||
@@ -2255,8 +2261,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d
|
||||
@@ -2270,8 +2276,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d
|
||||
const struct wined3d_cs_buffer_swap_mem *op = data;
|
||||
struct wined3d_buffer *buffer = op->buffer;
|
||||
|
||||
@ -111,10 +111,10 @@ index 688d933a..0c735bf 100644
|
||||
if (!buffer->buffer_object && buffer->resource.bind_count)
|
||||
{
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index d13e8db..451b941 100644
|
||||
index 748546f..2d8a2e6 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3121,6 +3121,7 @@ struct wined3d_buffer
|
||||
@@ -3200,6 +3200,7 @@ struct wined3d_buffer
|
||||
GLenum buffer_object_usage;
|
||||
GLenum buffer_type_hint;
|
||||
DWORD flags;
|
||||
@ -122,7 +122,7 @@ index d13e8db..451b941 100644
|
||||
void *map_ptr;
|
||||
|
||||
struct wined3d_map_range *maps;
|
||||
@@ -3150,6 +3151,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
|
||||
@@ -3229,6 +3230,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
|
||||
HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer,
|
||||
const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN;
|
||||
void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;
|
||||
|
@ -1,58 +0,0 @@
|
||||
From f63385f0d8260f11819bad1b075af20c98bb3bd4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 2 Oct 2013 22:38:51 +0200
|
||||
Subject: wined3d: Clean up resource data through the CS.
|
||||
|
||||
---
|
||||
dlls/wined3d/buffer.c | 7 +++++++
|
||||
dlls/wined3d/texture.c | 2 ++
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 86395c4..90a707c 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -586,6 +586,9 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
|
||||
}
|
||||
|
||||
resource_cleanup(&buffer->resource);
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs);
|
||||
+
|
||||
buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, buffer->maps);
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
@@ -1355,6 +1358,8 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
|
||||
ERR("Out of memory.\n");
|
||||
buffer_unload(&buffer->resource);
|
||||
resource_cleanup(&buffer->resource);
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
buffer->maps_size = 1;
|
||||
@@ -1365,6 +1370,8 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
|
||||
buffer_unload(&buffer->resource);
|
||||
resource_cleanup(&buffer->resource);
|
||||
HeapFree(GetProcessHeap(), 0, buffer->maps);
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ buffer->resource.device->cs->ops->finish(buffer->resource.device->cs);
|
||||
return hr;
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index d810267..53dfea6 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -521,6 +521,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
texture->texture_ops->texture_cleanup_sub_resources(texture);
|
||||
wined3d_texture_unload_gl_texture(texture);
|
||||
resource_cleanup(&texture->resource);
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ texture->resource.device->cs->ops->finish(texture->resource.device->cs);
|
||||
}
|
||||
|
||||
void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain)
|
||||
--
|
||||
2.8.0
|
||||
|
@ -1,75 +0,0 @@
|
||||
From 21d28bbc7a9c79e5b99241f729130c0a1480212a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 2 Oct 2013 22:50:08 +0200
|
||||
Subject: wined3d: Clean up buffer resource data through the CS.
|
||||
|
||||
---
|
||||
dlls/wined3d/buffer.c | 40 +++++++++++++++++++++-------------------
|
||||
1 file changed, 21 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 90a707c..ce25f69 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -561,37 +561,39 @@ static void wined3d_buffer_drop_bo(struct wined3d_buffer *buffer)
|
||||
device_invalidate_state(device, STATE_STREAMSRC);
|
||||
}
|
||||
|
||||
+static void wined3d_buffer_destroy_object(void *object)
|
||||
+{
|
||||
+ struct wined3d_buffer *buffer = object;
|
||||
+ struct wined3d_context *context;
|
||||
+ struct wined3d_device *device = buffer->resource.device;
|
||||
+
|
||||
+ if (buffer->buffer_object)
|
||||
+ {
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ delete_gl_buffer(buffer, context->gl_info);
|
||||
+ context_release(context);
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer->conversion_map);
|
||||
+ }
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer->maps);
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+}
|
||||
+
|
||||
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
|
||||
{
|
||||
ULONG refcount = InterlockedDecrement(&buffer->resource.ref);
|
||||
- struct wined3d_context *context;
|
||||
|
||||
TRACE("%p decreasing refcount to %u.\n", buffer, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
- if (wined3d_settings.cs_multithreaded)
|
||||
- {
|
||||
- FIXME("Waiting for cs.\n");
|
||||
- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs);
|
||||
- }
|
||||
-
|
||||
- if (buffer->buffer_object)
|
||||
- {
|
||||
- context = context_acquire(buffer->resource.device, NULL);
|
||||
- delete_gl_buffer(buffer, context->gl_info);
|
||||
- context_release(context);
|
||||
-
|
||||
- HeapFree(GetProcessHeap(), 0, buffer->conversion_map);
|
||||
- }
|
||||
+ struct wined3d_device *device = buffer->resource.device;
|
||||
|
||||
resource_cleanup(&buffer->resource);
|
||||
- if (wined3d_settings.cs_multithreaded)
|
||||
- buffer->resource.device->cs->ops->finish(buffer->resource.device->cs);
|
||||
|
||||
buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent);
|
||||
- HeapFree(GetProcessHeap(), 0, buffer->maps);
|
||||
- HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ wined3d_cs_emit_destroy_object(device->cs, wined3d_buffer_destroy_object, buffer);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
--
|
||||
2.8.0
|
||||
|
@ -1,315 +0,0 @@
|
||||
From 70d900c4a460e27e5b6da3de623df8fffa0b9b68 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
|
||||
Date: Sat, 7 May 2016 13:02:33 +0100
|
||||
Subject: wined3d: Clean up textures through the command stream.
|
||||
|
||||
FIXME: This HeapFree stuff when creation fails is ugly.
|
||||
---
|
||||
dlls/wined3d/texture.c | 82 +++++++++++++++++++++++++++-----------------------
|
||||
1 file changed, 44 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 53dfea6..18e71ff 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -479,8 +479,9 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture)
|
||||
resource_unload(&texture->resource);
|
||||
}
|
||||
|
||||
-static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
+static void wined3d_texture_destroy_object(void *object)
|
||||
{
|
||||
+ struct wined3d_texture *texture = object;
|
||||
unsigned int sub_count = texture->level_count * texture->layer_count;
|
||||
struct wined3d_device *device = texture->resource.device;
|
||||
struct wined3d_context *context = NULL;
|
||||
@@ -489,12 +490,6 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
|
||||
TRACE("texture %p.\n", texture);
|
||||
|
||||
- if (wined3d_settings.cs_multithreaded)
|
||||
- {
|
||||
- FIXME("Waiting for cs.\n");
|
||||
- texture->resource.device->cs->ops->finish(texture->resource.device->cs);
|
||||
- }
|
||||
-
|
||||
for (i = 0; i < sub_count; ++i)
|
||||
{
|
||||
if (texture->sub_resources[i].buffer != texture->sub_resources[i].map_buffer)
|
||||
@@ -506,7 +501,7 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
|
||||
TRACE("Deleting buffer object %u.\n", buffer->name);
|
||||
|
||||
- /* We may not be able to get a context in wined3d_texture_cleanup() in
|
||||
+ /* We may not be able to get a context in wined3d_texture_destroy_object() in
|
||||
* general, but if a buffer object was previously created we can. */
|
||||
if (!context)
|
||||
context = context_acquire(device, NULL);
|
||||
@@ -520,9 +515,7 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
|
||||
texture->texture_ops->texture_cleanup_sub_resources(texture);
|
||||
wined3d_texture_unload_gl_texture(texture);
|
||||
- resource_cleanup(&texture->resource);
|
||||
- if (wined3d_settings.cs_multithreaded)
|
||||
- texture->resource.device->cs->ops->finish(texture->resource.device->cs);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
}
|
||||
|
||||
void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain)
|
||||
@@ -816,6 +809,23 @@ ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
|
||||
return refcount;
|
||||
}
|
||||
|
||||
+static void wined3d_texture_cleanup_main(struct wined3d_texture *texture)
|
||||
+{
|
||||
+ struct wined3d_device *device = texture->resource.device;
|
||||
+ unsigned int sub_count = texture->level_count * texture->layer_count;
|
||||
+ struct wined3d_texture_sub_resource *sub_resource;
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < sub_count; ++i) {
|
||||
+ sub_resource = &texture->sub_resources[i];
|
||||
+ if (sub_resource->parent_ops && sub_resource->parent)
|
||||
+ sub_resource->parent_ops->wined3d_object_destroyed(sub_resource->parent);
|
||||
+ }
|
||||
+
|
||||
+ resource_cleanup(&texture->resource);
|
||||
+ wined3d_cs_emit_destroy_object(device->cs, wined3d_texture_destroy_object, texture);
|
||||
+}
|
||||
+
|
||||
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
|
||||
{
|
||||
ULONG refcount;
|
||||
@@ -830,9 +840,8 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
- wined3d_texture_cleanup(texture);
|
||||
texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent);
|
||||
- HeapFree(GetProcessHeap(), 0, texture);
|
||||
+ wined3d_texture_cleanup_main(texture);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
@@ -1546,8 +1555,6 @@ static void texture2d_cleanup_sub_resources(struct wined3d_texture *texture)
|
||||
list_remove(&overlay->overlay_entry);
|
||||
overlay->overlay_dest = NULL;
|
||||
}
|
||||
-
|
||||
- sub_resource->parent_ops->wined3d_object_destroyed(sub_resource->parent);
|
||||
}
|
||||
if (context)
|
||||
context_release(context);
|
||||
@@ -1947,6 +1954,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
&& !gl_info->supported[EXT_TEXTURE_ARRAY])
|
||||
{
|
||||
WARN("OpenGL implementation does not support array textures.\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@@ -1955,6 +1963,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
if (WINED3DFMT_UNKNOWN >= desc->format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@@ -1977,6 +1986,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
if (desc->pool != WINED3D_POOL_SCRATCH)
|
||||
{
|
||||
WARN("Attempted to create a mipmapped/cube/array NPOT texture without unconditional NPOT support.\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@@ -1994,6 +2004,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
{
|
||||
FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n",
|
||||
desc->width, desc->height);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
@@ -2025,6 +2036,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
if (desc->pool == WINED3D_POOL_DEFAULT || desc->pool == WINED3D_POOL_MANAGED)
|
||||
{
|
||||
WARN("Dimensions (%ux%u) exceed the maximum texture size.\n", pow2_width, pow2_height);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
@@ -2038,12 +2050,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
|
||||
{
|
||||
WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (level_count != 1)
|
||||
{
|
||||
WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
}
|
||||
@@ -2052,6 +2066,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
flags, device, parent, parent_ops, &texture_resource_ops)))
|
||||
{
|
||||
WARN("Failed to initialize texture, returning %#x.\n", hr);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -2093,7 +2108,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
if (level_count > ~(SIZE_T)0 / layer_count
|
||||
|| !(surfaces = wined3d_calloc(level_count * layer_count, sizeof(*surfaces))))
|
||||
{
|
||||
- wined3d_texture_cleanup(texture);
|
||||
+ wined3d_texture_cleanup_main(texture);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -2136,7 +2151,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
texture, idx, &sub_resource->parent, &sub_resource->parent_ops)))
|
||||
{
|
||||
WARN("Failed to create surface parent, hr %#x.\n", hr);
|
||||
- wined3d_texture_cleanup(texture);
|
||||
+ wined3d_texture_cleanup_main(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -2147,7 +2162,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
if (((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D))
|
||||
&& FAILED(hr = wined3d_surface_create_dc(surface)))
|
||||
{
|
||||
- wined3d_texture_cleanup(texture);
|
||||
+ wined3d_texture_cleanup_main(texture);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
@@ -2215,21 +2230,6 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi
|
||||
|
||||
static void texture3d_cleanup_sub_resources(struct wined3d_texture *texture)
|
||||
{
|
||||
- unsigned int sub_count = texture->level_count * texture->layer_count;
|
||||
- struct wined3d_texture_sub_resource *sub_resource;
|
||||
- struct wined3d_volume *volume;
|
||||
- unsigned int i;
|
||||
-
|
||||
- for (i = 0; i < sub_count; ++i)
|
||||
- {
|
||||
- sub_resource = &texture->sub_resources[i];
|
||||
- if ((volume = sub_resource->u.volume))
|
||||
- {
|
||||
- TRACE("volume %p.\n", volume);
|
||||
-
|
||||
- sub_resource->parent_ops->wined3d_object_destroyed(sub_resource->parent);
|
||||
- }
|
||||
- }
|
||||
HeapFree(GetProcessHeap(), 0, texture->sub_resources[0].u.volume);
|
||||
}
|
||||
|
||||
@@ -2283,6 +2283,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
if (layer_count != 1)
|
||||
{
|
||||
ERR("Invalid layer count for volume texture.\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
@@ -2291,12 +2292,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
if (WINED3DFMT_UNKNOWN >= desc->format)
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (!gl_info->supported[EXT_TEXTURE3D])
|
||||
{
|
||||
WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@@ -2306,12 +2309,14 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
|
||||
{
|
||||
WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
if (level_count != 1)
|
||||
{
|
||||
WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
}
|
||||
@@ -2320,6 +2325,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
|| desc->pool == WINED3D_POOL_SCRATCH))
|
||||
{
|
||||
WARN("Attempted to create a DYNAMIC texture in pool %s.\n", debug_d3dpool(desc->pool));
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@@ -2346,6 +2352,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
{
|
||||
WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n",
|
||||
desc->width, desc->height, desc->depth);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
}
|
||||
@@ -2355,6 +2362,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
0, device, parent, parent_ops, &texture_resource_ops)))
|
||||
{
|
||||
WARN("Failed to initialize texture, returning %#x.\n", hr);
|
||||
+ HeapFree(GetProcessHeap(), 0, texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -2373,7 +2381,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
|
||||
if (!(volumes = wined3d_calloc(level_count, sizeof(*volumes))))
|
||||
{
|
||||
- wined3d_texture_cleanup(texture);
|
||||
+ wined3d_texture_cleanup_main(texture);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -2395,7 +2403,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
texture, i, &sub_resource->parent, &sub_resource->parent_ops)))
|
||||
{
|
||||
WARN("Failed to create volume parent, hr %#x.\n", hr);
|
||||
- wined3d_texture_cleanup(texture);
|
||||
+ wined3d_texture_cleanup_main(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -2692,7 +2700,6 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize texture, returning %#x.\n", hr);
|
||||
- HeapFree(GetProcessHeap(), 0, object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -2700,8 +2707,7 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
|
||||
* in this case. */
|
||||
if (data && FAILED(hr = wined3d_texture_upload_data(object, data)))
|
||||
{
|
||||
- wined3d_texture_cleanup(object);
|
||||
- HeapFree(GetProcessHeap(), 0, object);
|
||||
+ wined3d_texture_cleanup_main(object);
|
||||
return hr;
|
||||
}
|
||||
|
||||
--
|
||||
2.8.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 40d19156ee555d3efed58f5b36bc9e370003c02f Mon Sep 17 00:00:00 2001
|
||||
From cc220792b08daaa61bd558028e07ef872483cd6e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 24 Oct 2013 22:38:26 +0200
|
||||
Subject: wined3d: Fence preload operations.
|
||||
@ -27,41 +27,41 @@ online) preloads a texture right before mapping it...
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index e7e8a22..1af5827 100644
|
||||
index 1b8cb90..1593157 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -2159,6 +2159,8 @@ static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *d
|
||||
@@ -2126,6 +2126,8 @@ static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *d
|
||||
wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB);
|
||||
context_release(context);
|
||||
|
||||
+ wined3d_resource_dec_fence(&texture->resource);
|
||||
+ wined3d_resource_release(&texture->resource);
|
||||
+
|
||||
return sizeof(*op);
|
||||
}
|
||||
|
||||
@@ -2170,6 +2172,8 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
|
||||
@@ -2137,6 +2139,8 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
|
||||
op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD;
|
||||
op->texture = texture;
|
||||
|
||||
+ wined3d_resource_inc_fence(&texture->resource);
|
||||
+ wined3d_resource_acquire(&texture->resource);
|
||||
+
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
@@ -2375,6 +2379,8 @@ static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *da
|
||||
@@ -2342,6 +2346,8 @@ static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *da
|
||||
buffer_internal_preload(op->buffer, context, NULL);
|
||||
context_release(context);
|
||||
|
||||
+ wined3d_resource_dec_fence(&op->buffer->resource);
|
||||
+ wined3d_resource_release(&op->buffer->resource);
|
||||
+
|
||||
return sizeof(*op);
|
||||
}
|
||||
|
||||
@@ -2386,6 +2392,8 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer
|
||||
@@ -2353,6 +2359,8 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer
|
||||
op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD;
|
||||
op->buffer = buffer;
|
||||
|
||||
+ wined3d_resource_inc_fence(&buffer->resource);
|
||||
+ wined3d_resource_acquire(&buffer->resource);
|
||||
+
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b1349ec4fb7eba7b699d5d519f7fcdc0218db8b2 Mon Sep 17 00:00:00 2001
|
||||
From 9d42514d2eb64b4e60838d3ac37c6fe54496912b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 22 Aug 2014 15:52:50 +0200
|
||||
Subject: wined3d: Wait only for the buffer to be idle.
|
||||
@ -9,16 +9,16 @@ This got lost somewhere during the patch reordering.
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index c4d9740..5eb8659 100644
|
||||
index 666479a..c9d0477 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -1057,8 +1057,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1045,8 +1045,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
}
|
||||
else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)))
|
||||
{
|
||||
- FIXME("waiting for cs, flags 0x%04x.\n", flags);
|
||||
- device->cs->ops->finish(device->cs);
|
||||
+ wined3d_resource_wait_fence(&buffer->resource);
|
||||
+ wined3d_resource_wait_idle(&buffer->resource);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From c3698fef626f57c8e8dfc973551901086cde355e Mon Sep 17 00:00:00 2001
|
||||
From a52c3441a2f5956f5e841f56dbe189a6f91c1852 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 29 Aug 2014 18:52:22 +0200
|
||||
Subject: wined3d: Put GL_APPLE_flush_buffer_range syncing back in place.
|
||||
@ -8,10 +8,10 @@ Subject: wined3d: Put GL_APPLE_flush_buffer_range syncing back in place.
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 5eb8659..e4fcb73 100644
|
||||
index c9d0477..5b18a36 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -681,6 +681,12 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined
|
||||
@@ -686,6 +686,12 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined
|
||||
GL_EXTCALL(glBufferData(This->buffer_type_hint, This->resource.size, NULL, GL_STREAM_DRAW));
|
||||
checkGLcall("glBufferData");
|
||||
}
|
||||
@ -24,7 +24,7 @@ index 5eb8659..e4fcb73 100644
|
||||
|
||||
while (This->modified_areas)
|
||||
{
|
||||
@@ -1041,9 +1047,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1029,9 +1035,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
buffer->flags |= WINED3D_BUFFER_DISCARD;
|
||||
buffer->ignore_discard = TRUE;
|
||||
}
|
||||
@ -36,10 +36,10 @@ index 5eb8659..e4fcb73 100644
|
||||
}
|
||||
|
||||
if (wined3d_settings.cs_multithreaded && count == 1)
|
||||
@@ -1058,6 +1064,10 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1046,6 +1052,10 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)))
|
||||
{
|
||||
wined3d_resource_wait_fence(&buffer->resource);
|
||||
wined3d_resource_wait_idle(&buffer->resource);
|
||||
+ /* Writing to the (otherwise worker thread controlled)
|
||||
+ * flags field is OK here since the wait_fence call made
|
||||
+ * sure the buffer is idle. */
|
||||
|
@ -1,30 +1,42 @@
|
||||
From 025efa13f043ec294bea8f5efac0c39782d4f774 Mon Sep 17 00:00:00 2001
|
||||
From f893866b12daa27f420b50ed001fae189151020c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 3 Sep 2014 20:20:39 +0200
|
||||
Subject: wined3d: Wait for the resource to be idle when destroying user memory
|
||||
surfaces.
|
||||
|
||||
---
|
||||
dlls/wined3d/texture.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
dlls/wined3d/texture.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index c075b3c..2f57373 100644
|
||||
index cecdfcd..d20322d 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -822,6 +822,12 @@ static void wined3d_texture_cleanup_main(struct wined3d_texture *texture)
|
||||
sub_resource->parent_ops->wined3d_object_destroyed(sub_resource->parent);
|
||||
}
|
||||
|
||||
+ /* Wait for the CS to finish operations on this texture when user memory was in use.
|
||||
+ * The application is allowed to free the memory after texture / surface destruction
|
||||
+ * returns. */
|
||||
@@ -828,6 +828,10 @@ ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
|
||||
static void wined3d_texture_cleanup_sync(struct wined3d_texture *texture)
|
||||
{
|
||||
wined3d_texture_sub_resources_destroyed(texture);
|
||||
+
|
||||
+ if (texture->resource.map_binding == WINED3D_LOCATION_USER_MEMORY)
|
||||
+ wined3d_resource_wait_fence(&texture->resource);
|
||||
+ wined3d_resource_wait_idle(&texture->resource);
|
||||
+
|
||||
resource_cleanup(&texture->resource);
|
||||
wined3d_cs_emit_destroy_object(device->cs, wined3d_texture_destroy_object, texture);
|
||||
}
|
||||
wined3d_resource_wait_idle(&texture->resource);
|
||||
wined3d_texture_cleanup(texture);
|
||||
@@ -855,6 +859,13 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
|
||||
{
|
||||
wined3d_texture_sub_resources_destroyed(texture);
|
||||
texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent);
|
||||
+
|
||||
+ /* Wait for the CS to finish operations on this texture when user memory was in use.
|
||||
+ * The application is allowed to free the memory after texture / surface destruction
|
||||
+ * returns. */
|
||||
+ if (texture->resource.map_binding == WINED3D_LOCATION_USER_MEMORY)
|
||||
+ wined3d_resource_wait_idle(&texture->resource);
|
||||
+
|
||||
resource_cleanup(&texture->resource);
|
||||
wined3d_cs_emit_destroy_object(texture->resource.device->cs, wined3d_texture_destroy_object, texture);
|
||||
}
|
||||
--
|
||||
2.8.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From e4821778be958e4747f2b45002b19b4f2b4efa19 Mon Sep 17 00:00:00 2001
|
||||
From e8b88c5d57a48fcd909f94bdffdc2df24b0d9307 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Mon, 8 Sep 2014 14:53:57 +0200
|
||||
Subject: wined3d: Don't sync on redundant discard calls.
|
||||
@ -8,17 +8,17 @@ Subject: wined3d: Don't sync on redundant discard calls.
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index e4fcb73..6b01a0a 100644
|
||||
index 5b18a36..b53ec9b 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -1061,7 +1061,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1049,7 +1049,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
wined3d_resource_allocate_sysmem(&buffer->resource);
|
||||
wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory);
|
||||
}
|
||||
- else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)))
|
||||
+ else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard)
|
||||
{
|
||||
wined3d_resource_wait_fence(&buffer->resource);
|
||||
wined3d_resource_wait_idle(&buffer->resource);
|
||||
/* Writing to the (otherwise worker thread controlled)
|
||||
--
|
||||
2.8.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 9d85621f58aec2c3e6b5da5ea412d434d0132aa6 Mon Sep 17 00:00:00 2001
|
||||
From 9c0006a6708a8b5aa7f0f202f7bca4a483385313 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 16 Jan 2015 19:19:05 +0100
|
||||
Subject: wined3d: Only discard buffers that are in use.
|
||||
@ -9,17 +9,17 @@ No need to mess around with memory if it is idle.
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 6df5554..1d785c5 100644
|
||||
index ab64f66..1375561 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -1063,9 +1063,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1051,9 +1051,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||
if (flags & WINED3D_MAP_DISCARD && !swvp)
|
||||
{
|
||||
- buffer->ignore_discard = TRUE;
|
||||
- wined3d_resource_allocate_sysmem(&buffer->resource);
|
||||
- wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory);
|
||||
+ if (buffer->resource.access_fence)
|
||||
+ if (buffer->resource.access_count)
|
||||
+ {
|
||||
+ buffer->ignore_discard = TRUE;
|
||||
+ wined3d_resource_allocate_sysmem(&buffer->resource);
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 30c2a0ff87ec71e48c3f2358708dac4ff3ab4cda Mon Sep 17 00:00:00 2001
|
||||
From 64a1d858b61ca163234d2c387fb26555b6843257 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
|
||||
Date: Sat, 7 May 2016 22:31:28 +0100
|
||||
Subject: wined3d: Create initial DCs through the CS.
|
||||
@ -10,7 +10,7 @@ Subject: wined3d: Create initial DCs through the CS.
|
||||
3 files changed, 19 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index d6e116f..794e8d9 100644
|
||||
index 0db879f..0258510 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -3539,6 +3539,9 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str
|
||||
@ -24,10 +24,10 @@ index d6e116f..794e8d9 100644
|
||||
current_context = NULL;
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index d59ffb7..5a86b7c 100644
|
||||
index acf2ae0..b5ccf07 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -2877,6 +2877,9 @@ static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t s
|
||||
@@ -2666,6 +2666,9 @@ static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t s
|
||||
struct wined3d_cs_queue *queue = prio ? &cs->prio_queue : &cs->queue;
|
||||
size_t queue_size = sizeof(queue->data) / sizeof(*queue->data);
|
||||
|
||||
@ -37,7 +37,7 @@ index d59ffb7..5a86b7c 100644
|
||||
if (queue_size - size < queue->head)
|
||||
{
|
||||
struct wined3d_cs_skip *skip;
|
||||
@@ -2949,18 +2952,6 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
|
||||
@@ -2738,18 +2741,6 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
|
||||
static void wined3d_cs_mt_finish(struct wined3d_cs *cs)
|
||||
{
|
||||
BOOL fence;
|
||||
@ -57,10 +57,10 @@ index d59ffb7..5a86b7c 100644
|
||||
|
||||
/* A busy wait should be fine, we're not supposed to have to wait very
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 9be152d..0f0bdf2 100644
|
||||
index 42f0ba7..372559a 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1110,7 +1110,11 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1205,7 +1205,11 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
wined3d_texture_invalidate_location(texture, 0, ~valid_location);
|
||||
|
||||
if (create_dib)
|
||||
@ -73,7 +73,7 @@ index 9be152d..0f0bdf2 100644
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -2130,11 +2134,15 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
@@ -2188,11 +2192,15 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
|
||||
TRACE("Created surface level %u, layer %u @ %p.\n", i, j, surface);
|
||||
|
||||
@ -81,12 +81,12 @@ index 9be152d..0f0bdf2 100644
|
||||
- && FAILED(hr = wined3d_surface_create_dc(surface)))
|
||||
+ if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D))
|
||||
{
|
||||
- wined3d_texture_cleanup_main(texture);
|
||||
- wined3d_texture_cleanup_sync(texture);
|
||||
- return hr;
|
||||
+ HDC dc;
|
||||
+ if (FAILED(hr = wined3d_texture_get_dc(texture, idx, &dc)))
|
||||
+ {
|
||||
+ wined3d_texture_cleanup_main(texture);
|
||||
+ wined3d_texture_cleanup_sync(texture);
|
||||
+ return hr;
|
||||
+ }
|
||||
+ wined3d_texture_release_dc(texture, idx, dc);
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user