Rebase against 30cdd1fb8cea410cb9e363b16278528669e2c19a.

This commit is contained in:
Sebastian Lackner 2016-08-26 17:53:38 +02:00
parent deb73bfa7c
commit 43a640f8fd
25 changed files with 578 additions and 944 deletions

View File

@ -1,4 +1,4 @@
From bdc7f21350a4dd7bc639bc6be69243bb6dd5dbf5 Mon Sep 17 00:00:00 2001
From d14f1523f3694d7bc2c7c79b6b7bd6f2a354bfb7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 28 Sep 2014 23:39:51 +0200
Subject: ntdll: OutputDebugString should throw the exception a second time, if
@ -38,10 +38,10 @@ index a277f93..2fb9c73 100644
if (!mutex_inited)
{
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 3e22bed..3dab0bd 100644
index 7462024..151b67a 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -1903,7 +1903,7 @@ static LONG CALLBACK outputdebugstring_vectored_handler(EXCEPTION_POINTERS *Exce
@@ -2063,7 +2063,7 @@ static LONG CALLBACK outputdebugstring_vectored_handler(EXCEPTION_POINTERS *Exce
return EXCEPTION_CONTINUE_SEARCH;
}
@ -50,7 +50,7 @@ index 3e22bed..3dab0bd 100644
{
PVOID vectored_handler;
@@ -1919,7 +1919,6 @@ static void test_outputdebugstring(DWORD numexc, BOOL todo)
@@ -2079,7 +2079,6 @@ static void test_outputdebugstring(DWORD numexc, BOOL todo)
outputdebugstring_exceptions = 0;
OutputDebugStringA("Hello World");
@ -58,7 +58,7 @@ index 3e22bed..3dab0bd 100644
ok(outputdebugstring_exceptions == numexc, "OutputDebugStringA generated %d exceptions, expected %d\n",
outputdebugstring_exceptions, numexc);
@@ -2359,9 +2358,9 @@ START_TEST(exception)
@@ -2522,9 +2521,9 @@ START_TEST(exception)
run_rtlraiseexception_test(EXCEPTION_BREAKPOINT);
run_rtlraiseexception_test(EXCEPTION_INVALID_HANDLE);
test_stage = 3;
@ -70,7 +70,7 @@ index 3e22bed..3dab0bd 100644
test_stage = 5;
test_ripevent(0);
test_stage = 6;
@@ -2390,7 +2389,7 @@ START_TEST(exception)
@@ -2553,7 +2552,7 @@ START_TEST(exception)
test_exceptions();
test_rtlraiseexception();
test_debug_registers();
@ -79,8 +79,8 @@ index 3e22bed..3dab0bd 100644
test_ripevent(1);
test_debug_service(1);
test_breakpoint(1);
@@ -2415,7 +2414,7 @@ START_TEST(exception)
"__C_specific_handler" );
@@ -2586,7 +2585,7 @@ START_TEST(exception)
"_setjmp" );
test_debug_registers();
- test_outputdebugstring(1, FALSE);

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "839995d5e9afcbcdcd084eac3a8e6e48a2173eda"
echo "30cdd1fb8cea410cb9e363b16278528669e2c19a"
}
# Show version information
@ -7326,7 +7326,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t poll queries that failed to start.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove restated queries from the poll list.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Put this into the query poll patch.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send texture preloads through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t access device state in clears.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Avoid destroying views in color and depth fills.", 1 },';
echo '+ { "Matteo Bruni", "wined3d: Avoid calling wined3d_surface_blt() from surface_upload_from_surface().", 1 },';
@ -7354,7 +7353,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
echo '+ { "Stefan Dösinger", "wined3d: Accelerate READONLY buffer maps.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Access the buffer dirty areas through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Ignore buffer->resource.map_count in the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send buffer preloads through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use glBufferSubData instead of glMapBufferRange.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Separate GL buffer discard control from ignoring MAP_DISCARD.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Create buffers before mapping them.", 1 },';
@ -7367,7 +7365,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
echo '+ { "Stefan Dösinger", "wined3d: Use surface_blt_ugly in swapchain_gl_present.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Invoke surface_unload through the CS in wined3d_surface_update_desc.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use an event to block the worker thread when it is idle.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence preload operations.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Set map_heap_memory = NULL when allocating a PBO.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Wait only for the buffer to be idle.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Put GL_APPLE_flush_buffer_range syncing back in place.", 1 },';

View File

@ -1,16 +1,16 @@
From 086e024e36bde8a490e128bfe552129eb51396d5 Mon Sep 17 00:00:00 2001
From 6e78f864b5f4c377f49483ea35859db2429917c3 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/cs.c | 373 +++++++++++++++++++++++++++++++++++++----
dlls/wined3d/cs.c | 377 +++++++++++++++++++++++++++++++++++++----
dlls/wined3d/wined3d_main.c | 9 +
dlls/wined3d/wined3d_private.h | 18 ++
3 files changed, 369 insertions(+), 31 deletions(-)
3 files changed, 372 insertions(+), 32 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index b9d7e87..2789726 100644
index 0beb6c2..b25aab3 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -24,8 +24,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@ -33,9 +33,9 @@ index b9d7e87..2789726 100644
WINED3D_CS_OP_PRESENT,
WINED3D_CS_OP_CLEAR,
WINED3D_CS_OP_DRAW,
@@ -56,6 +67,18 @@ enum wined3d_cs_op
WINED3D_CS_OP_DESTROY_OBJECT,
@@ -57,6 +68,18 @@ enum wined3d_cs_op
WINED3D_CS_OP_QUERY_ISSUE,
WINED3D_CS_OP_PRELOAD_RESOURCE,
WINED3D_CS_OP_UNLOAD_RESOURCE,
+ WINED3D_CS_OP_STOP,
+};
@ -52,7 +52,7 @@ index b9d7e87..2789726 100644
};
struct wined3d_cs_present
@@ -282,7 +305,134 @@ struct wined3d_cs_unload_resource
@@ -289,7 +312,134 @@ struct wined3d_cs_unload_resource
struct wined3d_resource *resource;
};
@ -188,7 +188,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain;
@@ -298,6 +448,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -305,6 +455,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
{
wined3d_resource_release(&swapchain->back_buffers[i]->resource);
}
@ -197,7 +197,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
@@ -323,13 +475,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -330,13 +482,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
cs->ops->submit(cs);
}
@ -213,7 +213,7 @@ index b9d7e87..2789726 100644
device = cs->device;
state = &device->state;
@@ -348,6 +501,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -355,6 +508,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
}
if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
wined3d_resource_release(state->fb.depth_stencil->resource);
@ -222,7 +222,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
@@ -380,7 +535,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -387,7 +542,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
cs->ops->submit(cs);
}
@ -231,7 +231,7 @@ index b9d7e87..2789726 100644
{
struct wined3d_state *state = &cs->device->state;
struct wined3d_shader_sampler_map_entry *entry;
@@ -439,6 +594,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -446,6 +601,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
wined3d_resource_release(view->resource);
}
}
@ -240,7 +240,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx,
@@ -504,12 +661,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
@@ -511,12 +668,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
cs->ops->submit(cs);
}
@ -256,7 +256,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value)
@@ -524,12 +683,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -531,12 +690,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
cs->ops->submit(cs);
}
@ -272,7 +272,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport)
@@ -543,12 +704,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -550,12 +711,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
cs->ops->submit(cs);
}
@ -288,7 +288,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -562,12 +725,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -569,12 +732,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
cs->ops->submit(cs);
}
@ -304,7 +304,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx,
@@ -583,7 +748,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -590,7 +755,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
cs->ops->submit(cs);
}
@ -313,7 +313,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_set_depth_stencil_view *op = data;
struct wined3d_device *device = cs->device;
@@ -622,6 +787,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -629,6 +794,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
device_invalidate_state(device, STATE_FRAMEBUFFER);
@ -322,7 +322,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view)
@@ -635,12 +802,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -642,12 +809,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -338,7 +338,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration)
@@ -654,7 +823,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -661,7 +830,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -347,7 +347,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_set_stream_source *op = data;
struct wined3d_stream_state *stream;
@@ -672,6 +841,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
@@ -679,6 +848,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_STREAMSRC);
@ -356,7 +356,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -689,7 +860,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -696,7 +867,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -365,7 +365,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_set_stream_source_freq *op = data;
struct wined3d_stream_state *stream;
@@ -699,6 +870,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
@@ -706,6 +877,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
stream->flags = op->flags;
device_invalidate_state(cs->device, STATE_STREAMSRC);
@ -374,7 +374,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags)
@@ -714,7 +887,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -721,7 +894,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
cs->ops->submit(cs);
}
@ -383,7 +383,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_set_stream_output *op = data;
struct wined3d_stream_output *stream;
@@ -729,6 +902,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
@@ -736,6 +909,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
InterlockedIncrement(&op->buffer->resource.bind_count);
if (prev)
InterlockedDecrement(&prev->resource.bind_count);
@ -392,7 +392,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -745,7 +920,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -752,7 +927,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -401,7 +401,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_set_index_buffer *op = data;
struct wined3d_buffer *prev;
@@ -761,6 +936,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
@@ -768,6 +943,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_INDEXBUFFER);
@ -410,7 +410,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -777,7 +954,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -784,7 +961,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
cs->ops->submit(cs);
}
@ -419,7 +419,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_set_constant_buffer *op = data;
struct wined3d_buffer *prev;
@@ -791,6 +968,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
@@ -798,6 +975,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type));
@ -427,7 +427,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -807,7 +985,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -814,7 +992,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
cs->ops->submit(cs);
}
@ -436,7 +436,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info;
@@ -884,6 +1062,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -891,6 +1069,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
if (new_use_color_key)
device_invalidate_state(cs->device, STATE_COLOR_KEY);
@ -445,7 +445,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture)
@@ -898,12 +1078,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -905,12 +1085,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -461,7 +461,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -920,12 +1102,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -927,12 +1109,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
cs->ops->submit(cs);
}
@ -477,7 +477,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -942,13 +1126,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -949,13 +1133,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -494,7 +494,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader)
@@ -963,12 +1149,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -970,12 +1156,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -510,7 +510,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -983,12 +1171,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -990,12 +1178,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -526,7 +526,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value)
@@ -1003,12 +1193,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1010,12 +1200,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
cs->ops->submit(cs);
}
@ -542,7 +542,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1025,12 +1217,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1032,12 +1224,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
cs->ops->submit(cs);
}
@ -558,7 +558,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1047,13 +1241,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1054,13 +1248,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
cs->ops->submit(cs);
}
@ -575,7 +575,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state,
@@ -1069,12 +1265,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1076,12 +1272,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
cs->ops->submit(cs);
}
@ -591,7 +591,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane)
@@ -1089,7 +1287,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1096,7 +1294,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
cs->ops->submit(cs);
}
@ -600,7 +600,7 @@ index b9d7e87..2789726 100644
{
const struct wined3d_cs_set_color_key *op = data;
struct wined3d_texture *texture = op->texture;
@@ -1150,6 +1348,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
@@ -1157,6 +1355,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
break;
}
}
@ -609,7 +609,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -1172,12 +1372,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1179,12 +1379,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs);
}
@ -625,7 +625,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material)
@@ -1191,7 +1393,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1198,7 +1400,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
cs->ops->submit(cs);
}
@ -634,7 +634,7 @@ index b9d7e87..2789726 100644
{
struct wined3d_adapter *adapter = cs->device->adapter;
HRESULT hr;
@@ -1201,6 +1403,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1208,6 +1410,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize CS state, hr %#x.\n", hr);
@ -643,7 +643,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1213,11 +1417,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1220,11 +1424,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
cs->ops->submit(cs);
}
@ -658,7 +658,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object)
@@ -1232,12 +1438,14 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
@@ -1239,12 +1445,14 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
cs->ops->submit(cs);
}
@ -674,7 +674,24 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1252,13 +1460,15 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1259,13 +1467,15 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
cs->ops->submit(cs);
}
-static void wined3d_cs_exec_preload_resource(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_preload_resource(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_preload_resource *op = data;
struct wined3d_resource *resource = op->resource;
resource->resource_ops->resource_preload(resource);
wined3d_resource_release(resource);
+
+ return sizeof(*op);
}
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1281,13 +1491,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -691,7 +708,7 @@ index b9d7e87..2789726 100644
}
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1274,8 +1484,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1303,8 +1515,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -702,7 +719,7 @@ index b9d7e87..2789726 100644
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
/* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw,
@@ -1338,6 +1549,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -1368,6 +1581,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -761,7 +778,7 @@ index b9d7e87..2789726 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -1364,12 +1627,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1394,12 +1659,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -850,7 +867,7 @@ index 1dd6a8b..f573dcb 100644
if (appkey) RegCloseKey( appkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 54f3f93..be51bba 100644
index eca8601..481f384 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -310,6 +310,7 @@ struct wined3d_settings
@ -861,7 +878,7 @@ index 54f3f93..be51bba 100644
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -3029,6 +3030,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl
@@ -3033,6 +3034,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl
const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN;
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -880,7 +897,7 @@ index 54f3f93..be51bba 100644
struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
@@ -3040,9 +3053,14 @@ struct wined3d_cs
@@ -3044,9 +3057,14 @@ struct wined3d_cs
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;
struct wined3d_state state;

View File

@ -1,4 +1,4 @@
From c035e4e85a946c3da7299aa483d5e219bdbbcb1f Mon Sep 17 00:00:00 2001
From eea4abcc9b804a74839b49364f0218402d2a6f8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 15:30:26 +0200
Subject: wined3d: Give the cs its own state
@ -10,18 +10,18 @@ Subject: wined3d: Give the cs its own state
3 files changed, 81 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 187cb96..43ec54d 100644
index 2aef776..be77b79 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -67,6 +67,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_DESTROY_OBJECT,
@@ -68,6 +68,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_QUERY_ISSUE,
WINED3D_CS_OP_PRELOAD_RESOURCE,
WINED3D_CS_OP_UNLOAD_RESOURCE,
+ WINED3D_CS_OP_STATEBLOCK,
WINED3D_CS_OP_STOP,
};
@@ -305,6 +306,12 @@ struct wined3d_cs_unload_resource
@@ -312,6 +313,12 @@ struct wined3d_cs_unload_resource
struct wined3d_resource *resource;
};
@ -34,7 +34,7 @@ index 187cb96..43ec54d 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -485,7 +492,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -492,7 +499,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[op->rect_count]);
device = cs->device;
@ -43,7 +43,7 @@ index 187cb96..43ec54d 100644
wined3d_get_draw_rect(state, &draw_rect);
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
&cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags,
@@ -537,7 +544,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -544,7 +551,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{
@ -52,7 +52,7 @@ index 187cb96..43ec54d 100644
struct wined3d_shader_sampler_map_entry *entry;
struct wined3d_shader_resource_view *view;
const struct wined3d_cs_draw *op = data;
@@ -1074,6 +1081,55 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1081,6 +1088,55 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@ -108,15 +108,15 @@ index 187cb96..43ec54d 100644
cs->ops->submit(cs);
}
@@ -1514,6 +1570,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_DESTROY_OBJECT */ wined3d_cs_exec_destroy_object,
@@ -1549,6 +1605,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
/* WINED3D_CS_OP_PRELOAD_RESOURCE */ wined3d_cs_exec_preload_resource,
/* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource,
+ /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1603,7 +1660,7 @@ done:
@@ -1638,7 +1695,7 @@ done:
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@ -125,7 +125,7 @@ index 187cb96..43ec54d 100644
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@@ -1611,8 +1668,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1646,8 +1703,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
{
@ -135,7 +135,7 @@ index 187cb96..43ec54d 100644
}
cs->ops = &wined3d_cs_st_ops;
@@ -1621,17 +1677,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1656,17 +1712,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->data_size = WINED3D_INITIAL_CS_SIZE;
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
{
@ -155,7 +155,7 @@ index 187cb96..43ec54d 100644
}
if (wined3d_settings.cs_multithreaded)
@@ -1644,15 +1696,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1679,15 +1731,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@ -184,7 +184,7 @@ index 187cb96..43ec54d 100644
void wined3d_cs_destroy(struct wined3d_cs *cs)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 27b32e1..8ae932f 100644
index ae8bfad..dda5a03 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3554,6 +3554,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@ -212,10 +212,10 @@ index 27b32e1..8ae932f 100644
start_idx, index_count, start_instance, instance_count, TRUE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4d5fc99..9055230 100644
index 3af4f8f..2a45171 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3039,7 +3039,7 @@ struct wined3d_cs_block
@@ -3043,7 +3043,7 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -224,7 +224,7 @@ index 4d5fc99..9055230 100644
};
struct wined3d_cs_ops
@@ -3083,6 +3083,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -3088,6 +3088,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From f3fea3385811f1aa0ce48a65f0b33f9b5aebc695 Mon Sep 17 00:00:00 2001
From 1aa13f4e60130ae9ed48192ada3e6d5333543745 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 20 Aug 2013 15:12:26 +0200
Subject: wined3d: Send float constant updates through the command stream
@ -10,11 +10,11 @@ Subject: wined3d: Send float constant updates through the command stream
3 files changed, 77 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 43ec54d..92c251c 100644
index be77b79..020c1a3 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -68,6 +68,8 @@ enum wined3d_cs_op
WINED3D_CS_OP_QUERY_ISSUE,
@@ -69,6 +69,8 @@ enum wined3d_cs_op
WINED3D_CS_OP_PRELOAD_RESOURCE,
WINED3D_CS_OP_UNLOAD_RESOURCE,
WINED3D_CS_OP_STATEBLOCK,
+ WINED3D_CS_OP_SET_VS_CONSTS_F,
@ -22,7 +22,7 @@ index 43ec54d..92c251c 100644
WINED3D_CS_OP_STOP,
};
@@ -312,6 +314,14 @@ struct wined3d_cs_stateblock
@@ -319,6 +321,14 @@ struct wined3d_cs_stateblock
struct wined3d_state state;
};
@ -37,7 +37,7 @@ index 43ec54d..92c251c 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -1096,11 +1106,9 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
@@ -1103,11 +1113,9 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b));
memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i));
@ -49,7 +49,7 @@ index 43ec54d..92c251c 100644
memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights));
@@ -1121,11 +1129,9 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
@@ -1128,11 +1136,9 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b));
memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i));
@ -61,7 +61,7 @@ index 43ec54d..92c251c 100644
/* FIXME: This is not ideal. CS is still running synchronously, so this is ok.
* It will go away soon anyway. */
@@ -1227,6 +1233,65 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1234,6 +1240,65 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -127,8 +127,8 @@ index 43ec54d..92c251c 100644
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_render_state *op = data;
@@ -1571,6 +1636,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
@@ -1606,6 +1671,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_PRELOAD_RESOURCE */ wined3d_cs_exec_preload_resource,
/* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource,
/* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
+ /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
@ -137,7 +137,7 @@ index 43ec54d..92c251c 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 8ae932f..7006c62 100644
index dda5a03..8da60ad 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2553,7 +2553,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
@ -161,10 +161,10 @@ index 8ae932f..7006c62 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9055230..ebdb49e 100644
index 2a45171..ca58fec 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3083,6 +3083,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -3088,6 +3088,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;

View File

@ -1,19 +1,19 @@
From 3f4145a66ef9173bf608b12c4e210ee0f0369436 Mon Sep 17 00:00:00 2001
From b420f43ff0cb17ce349423ac26792ea5087052d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Apr 2013 11:50:09 +0200
Subject: wined3d: Request a glFinish before modifying resources outside the cs
---
dlls/wined3d/buffer.c | 18 +++++++++++++++++-
dlls/wined3d/buffer.c | 8 ++++++++
dlls/wined3d/cs.c | 30 ++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 27 +++++++++++++++++++++++++++
dlls/wined3d/surface.c | 7 +++++++
dlls/wined3d/texture.c | 14 ++++++++++++++
dlls/wined3d/wined3d_private.h | 1 +
6 files changed, 96 insertions(+), 1 deletion(-)
6 files changed, 87 insertions(+)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 9cc8ee0..85886bf 100644
index 9cc8ee0..2cb5db5 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -939,9 +939,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@ -34,29 +34,11 @@ index 9cc8ee0..85886bf 100644
flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags);
/* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture
* fill rate test seems to depend on this. When we map a buffer with
@@ -1222,8 +1230,16 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource)
static void buffer_resource_preload(struct wined3d_resource *resource)
{
struct wined3d_context *context;
+ struct wined3d_device *device = resource->device;
- context = context_acquire(resource->device, NULL);
+ if (wined3d_settings.cs_multithreaded)
+ {
+ FIXME("Waiting for cs.\n");
+ wined3d_cs_emit_glfinish(device->cs);
+ device->cs->ops->finish(device->cs);
+ }
+
+ context = context_acquire(device, NULL);
buffer_internal_preload(buffer_from_resource(resource), context, NULL);
context_release(context);
}
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index bf1d3d7..3a066d2 100644
index 020c1a3..69f60d6 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -70,6 +70,7 @@ enum wined3d_cs_op
@@ -71,6 +71,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_STATEBLOCK,
WINED3D_CS_OP_SET_VS_CONSTS_F,
WINED3D_CS_OP_SET_PS_CONSTS_F,
@ -64,7 +46,7 @@ index bf1d3d7..3a066d2 100644
WINED3D_CS_OP_STOP,
};
@@ -322,6 +323,11 @@ struct wined3d_cs_set_consts_f
@@ -329,6 +330,11 @@ struct wined3d_cs_set_consts_f
struct wined3d_vec4 constants[1];
};
@ -76,7 +58,7 @@ index bf1d3d7..3a066d2 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -1605,6 +1611,29 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1636,6 +1642,29 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -106,7 +88,7 @@ index bf1d3d7..3a066d2 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1641,6 +1670,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1673,6 +1702,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f,
@ -115,7 +97,7 @@ index bf1d3d7..3a066d2 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 6ad0a83..77fbb61 100644
index 8da60ad..cf375ea 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2949,6 +2949,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
@ -160,7 +142,7 @@ index 6ad0a83..77fbb61 100644
if (blit_op == WINED3D_BLIT_OP_COLOR_FILL)
return blitter->color_fill(device, view, rect, color);
else
@@ -4682,6 +4703,12 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4683,6 +4704,12 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n",
device, swapchain_desc, mode, callback, reset_state);
@ -174,10 +156,10 @@ index 6ad0a83..77fbb61 100644
{
ERR("Failed to get the first implicit swapchain.\n");
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c63578a..5601804 100644
index a2d2106..7618bf2 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4208,6 +4208,13 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4210,6 +4210,13 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
flags &= ~WINED3D_BLT_DO_NOT_WAIT;
}
@ -224,17 +206,17 @@ index 1e34cd7..e804ac2 100644
context = context_acquire(device, NULL);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 243cc29..234b33d 100644
index ca58fec..7044b97 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3074,6 +3074,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
@@ -3077,6 +3077,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
--
2.9.0

View File

@ -1,4 +1,4 @@
From d72ba7f4c8842b750e822fe95d91274f0c5e6d51 Mon Sep 17 00:00:00 2001
From 866ef0e0247fe28814e59268885ce97630750023 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 17:16:02 +0200
Subject: wined3d: Send light updates through the command stream
@ -10,18 +10,18 @@ Subject: wined3d: Send light updates through the command stream
3 files changed, 174 insertions(+), 64 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 2f422ba..d03dd1c 100644
index 22e9bb8..2f3b33d 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -67,7 +67,6 @@ enum wined3d_cs_op
WINED3D_CS_OP_DESTROY_OBJECT,
@@ -68,7 +68,6 @@ enum wined3d_cs_op
WINED3D_CS_OP_QUERY_ISSUE,
WINED3D_CS_OP_PRELOAD_RESOURCE,
WINED3D_CS_OP_UNLOAD_RESOURCE,
- WINED3D_CS_OP_STATEBLOCK,
WINED3D_CS_OP_SET_VS_CONSTS_F,
WINED3D_CS_OP_SET_VS_CONSTS_B,
WINED3D_CS_OP_SET_VS_CONSTS_I,
@@ -77,6 +76,8 @@ enum wined3d_cs_op
@@ -78,6 +77,8 @@ enum wined3d_cs_op
WINED3D_CS_OP_GLFINISH,
WINED3D_CS_OP_SET_BASE_VERTEX_INDEX,
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
@ -30,7 +30,7 @@ index 2f422ba..d03dd1c 100644
WINED3D_CS_OP_STOP,
};
@@ -315,12 +316,6 @@ struct wined3d_cs_unload_resource
@@ -322,12 +323,6 @@ struct wined3d_cs_unload_resource
struct wined3d_resource *resource;
};
@ -43,7 +43,7 @@ index 2f422ba..d03dd1c 100644
struct wined3d_cs_set_consts_f
{
enum wined3d_cs_op opcode;
@@ -362,6 +357,19 @@ struct wined3d_cs_set_primitive_type
@@ -369,6 +364,19 @@ struct wined3d_cs_set_primitive_type
GLenum gl_primitive_type;
};
@ -63,7 +63,7 @@ index 2f422ba..d03dd1c 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -1150,35 +1158,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1157,35 +1165,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -99,7 +99,7 @@ index 2f422ba..d03dd1c 100644
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_shader_resource_view *op = data;
@@ -1826,6 +1805,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1860,6 +1839,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
@ -252,15 +252,15 @@ index 2f422ba..d03dd1c 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1859,7 +1984,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_DESTROY_OBJECT */ wined3d_cs_exec_destroy_object,
@@ -1894,7 +2019,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
/* WINED3D_CS_OP_PRELOAD_RESOURCE */ wined3d_cs_exec_preload_resource,
/* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource,
- /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b,
/* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i,
@@ -1869,6 +1993,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1904,6 +2028,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
/* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
@ -270,7 +270,7 @@ index 2f422ba..d03dd1c 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 c0f8dc8..ee197af 100644
index 9db2365..c7226ae 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1610,14 +1610,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
@ -356,10 +356,10 @@ index c0f8dc8..ee197af 100644
start_idx, index_count, start_instance, instance_count, TRUE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ae13efb..4c57f7b 100644
index c29a4a1..77d4ac3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3035,7 +3035,9 @@ struct wined3d_cs_block
@@ -3039,7 +3039,9 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -370,7 +370,7 @@ index ae13efb..4c57f7b 100644
};
struct wined3d_cs_ops
@@ -3091,12 +3093,12 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
@@ -3096,12 +3098,12 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
unsigned int count, const struct wined3d_vec4 *constants, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
unsigned int count, const struct wined3d_ivec4 *constants, enum wined3d_shader_type type) DECLSPEC_HIDDEN;

View File

@ -1,15 +1,15 @@
From 6494b85657fd270879356f5fcb81225f12acdd1c Mon Sep 17 00:00:00 2001
From a636b8ad1d800fe7f288838c93e09a5c96358e55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 23:33:14 +0200
Subject: wined3d: Replace the linked lists with a ringbuffer
---
dlls/wined3d/cs.c | 371 ++++++++++++++++++-----------------------
dlls/wined3d/cs.c | 373 ++++++++++++++++++-----------------------
dlls/wined3d/wined3d_private.h | 20 +--
2 files changed, 165 insertions(+), 226 deletions(-)
2 files changed, 166 insertions(+), 227 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 23579c4..4ebb988 100644
index 880cecc..d8cc7e0 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -22,20 +22,10 @@
@ -35,7 +35,7 @@ index 23579c4..4ebb988 100644
WINED3D_CS_OP_FENCE,
WINED3D_CS_OP_PRESENT,
WINED3D_CS_OP_CLEAR,
@@ -414,99 +404,30 @@ struct wined3d_cs_texture_unmap
@@ -421,99 +411,30 @@ struct wined3d_cs_texture_unmap
unsigned int sub_resource_idx;
};
@ -149,7 +149,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data)
@@ -527,14 +448,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled)
@@ -534,14 +455,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_FENCE;
op->signalled = signalled;
@ -166,7 +166,7 @@ index 23579c4..4ebb988 100644
/* A busy wait should be fine, we're not supposed to have to wait very
* long. */
@@ -587,7 +508,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -594,7 +515,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
pending = InterlockedIncrement(&cs->pending_presents);
@ -175,7 +175,7 @@ index 23579c4..4ebb988 100644
/* D3D10 documentation suggests that Windows allows the game to run
* 3 frames ahead of the GPU. Increasing this above 1 causes uneven
@@ -637,8 +558,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -644,8 +565,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
const struct wined3d_state *state = &cs->device->state;
struct wined3d_cs_clear *op;
unsigned int i;
@ -186,7 +186,7 @@ index 23579c4..4ebb988 100644
op->opcode = WINED3D_CS_OP_CLEAR;
op->flags = flags;
op->color = *color;
@@ -658,7 +579,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -665,7 +586,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
wined3d_resource_acquire(state->fb.depth_stencil->resource);
@ -195,7 +195,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -799,7 +720,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
@@ -806,7 +727,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
}
}
@ -204,7 +204,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data)
@@ -821,7 +742,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -828,7 +749,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
op->predicate = predicate;
op->value = value;
@ -213,7 +213,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
@@ -842,7 +763,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -849,7 +770,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
op->viewport = *viewport;
@ -222,7 +222,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data)
@@ -863,7 +784,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -870,7 +791,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT;
op->rect = *rect;
@ -231,7 +231,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data)
@@ -886,7 +807,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -893,7 +814,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
op->view_idx = view_idx;
op->view = view;
@ -240,7 +240,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data)
@@ -940,7 +861,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -947,7 +868,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW;
op->view = view;
@ -249,7 +249,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data)
@@ -961,7 +882,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -968,7 +889,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION;
op->declaration = declaration;
@ -258,7 +258,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data)
@@ -998,7 +919,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1005,7 +926,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
op->offset = offset;
op->stride = stride;
@ -267,7 +267,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data)
@@ -1025,7 +946,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1032,7 +953,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
op->frequency = frequency;
op->flags = flags;
@ -276,7 +276,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data)
@@ -1058,7 +979,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1065,7 +986,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
op->buffer = buffer;
op->offset = offset;
@ -285,7 +285,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data)
@@ -1092,7 +1013,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1099,7 +1020,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
op->format_id = format_id;
op->offset = offset;
@ -294,7 +294,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data)
@@ -1123,7 +1044,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1130,7 +1051,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
op->cb_idx = cb_idx;
op->buffer = buffer;
@ -303,7 +303,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1215,7 +1136,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1222,7 +1143,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@ -312,7 +312,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
@@ -1239,7 +1160,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1246,7 +1167,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
op->view_idx = view_idx;
op->view = view;
@ -321,7 +321,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1263,7 +1184,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1270,7 +1191,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
op->sampler_idx = sampler_idx;
op->sampler = sampler;
@ -330,7 +330,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1286,7 +1207,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1293,7 +1214,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
op->type = type;
op->shader = shader;
@ -339,7 +339,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_rasterizer_state(struct wined3d_cs *cs, const void *data)
@@ -1308,7 +1229,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1315,7 +1236,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE;
op->state = rasterizer_state;
@ -348,7 +348,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data)
@@ -1341,8 +1262,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1348,8 +1269,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
const struct wined3d_vec4 *constants, enum wined3d_shader_type type)
{
struct wined3d_cs_set_consts_f *op;
@ -359,7 +359,7 @@ index 23579c4..4ebb988 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1367,7 +1289,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1374,7 +1296,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
op->count = count;
memcpy(op->constants, constants, sizeof(op->constants[0]) * count);
@ -368,7 +368,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
@@ -1389,8 +1311,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1396,8 +1318,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
op->state = state;
op->value = value;
@ -379,7 +379,7 @@ index 23579c4..4ebb988 100644
static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data)
{
@@ -1420,8 +1342,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1427,8 +1349,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx,
unsigned int count, const BOOL *constants, enum wined3d_shader_type type)
{
struct wined3d_cs_set_consts_b *op;
@ -390,7 +390,7 @@ index 23579c4..4ebb988 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1446,7 +1369,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1453,7 +1376,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx,
op->count = count;
memcpy(op->constants, constants, sizeof(op->constants[0]) * count);
@ -399,7 +399,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data)
@@ -1477,8 +1400,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1484,8 +1407,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
const struct wined3d_ivec4 *constants, enum wined3d_shader_type type)
{
struct wined3d_cs_set_consts_i *op;
@ -410,7 +410,7 @@ index 23579c4..4ebb988 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1503,7 +1427,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1510,7 +1434,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
op->count = count;
memcpy(op->constants, constants, sizeof(op->constants[0]) * count);
@ -419,7 +419,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
@@ -1527,7 +1451,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1534,7 +1458,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
op->state = state;
op->value = value;
@ -428,7 +428,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
@@ -1551,7 +1475,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1558,7 +1482,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
op->state = state;
op->value = value;
@ -437,7 +437,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data)
@@ -1575,7 +1499,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1582,7 +1506,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
op->state = state;
op->matrix = *matrix;
@ -446,7 +446,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data)
@@ -1597,7 +1521,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1604,7 +1528,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
op->plane_idx = plane_idx;
op->plane = *plane;
@ -455,7 +455,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data)
@@ -1682,7 +1606,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1689,7 +1613,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
else
op->set = 0;
@ -464,7 +464,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data)
@@ -1703,7 +1627,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1710,7 +1634,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@ -473,7 +473,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1727,7 +1651,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1734,7 +1658,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_RESET_STATE;
@ -482,7 +482,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_destroy_object(struct wined3d_cs *cs, const void *data)
@@ -1748,7 +1672,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
@@ -1755,7 +1679,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void
op->callback = callback;
op->object = object;
@ -491,16 +491,25 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
@@ -1770,7 +1694,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1777,7 +1701,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
op->query = query;
op->flags = flags;
- cs->ops->submit(cs);
+ cs->ops->submit(cs, sizeof(*op));
}
static UINT wined3d_cs_exec_preload_resource(struct wined3d_cs *cs, const void *data)
@@ -1801,7 +1725,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
wined3d_resource_acquire(resource);
- cs->ops->submit(cs);
+ cs->ops->submit(cs, sizeof(*op));
}
static UINT wined3d_cs_exec_unload_resource(struct wined3d_cs *cs, const void *data)
@@ -1794,7 +1718,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1825,7 +1749,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
wined3d_resource_acquire(resource);
@ -509,7 +518,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
@@ -1820,7 +1744,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -1851,7 +1775,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_GLFINISH;
@ -518,7 +527,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data)
@@ -1842,7 +1766,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
@@ -1873,7 +1797,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX;
op->base_vertex_index = base_vertex_index;
@ -527,7 +536,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data)
@@ -1868,7 +1792,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1899,7 +1823,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
op->gl_primitive_type = primitive_type;
@ -536,7 +545,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1925,7 +1849,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1956,7 +1880,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@ -545,7 +554,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -2014,7 +1938,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -2045,7 +1969,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
op->idx = idx;
op->enable = enable;
@ -554,7 +563,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
@@ -2046,7 +1970,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -2077,7 +2001,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
if (fx)
op->fx = *fx;
@ -563,7 +572,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
@@ -2079,7 +2003,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -2110,7 +2034,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
op->stencil = stencil;
op->blitter = blitter;
@ -572,7 +581,7 @@ index 23579c4..4ebb988 100644
}
static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data)
@@ -2104,12 +2028,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
@@ -2135,12 +2059,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
op->flags = flags;
op->mem = &ret;
@ -588,7 +597,7 @@ index 23579c4..4ebb988 100644
return ret;
}
@@ -2132,11 +2058,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
@@ -2163,11 +2089,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@ -603,7 +612,7 @@ index 23579c4..4ebb988 100644
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
@@ -2185,42 +2113,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2217,42 +2145,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
};
@ -686,7 +695,7 @@ index 23579c4..4ebb988 100644
};
/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an
@@ -2232,9 +2177,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
@@ -2264,9 +2209,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
op = wined3d_cs_mt_require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_STOP;
@ -726,7 +735,7 @@ index 23579c4..4ebb988 100644
void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{
@@ -2258,31 +2232,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
@@ -2290,31 +2264,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
static DWORD WINAPI wined3d_cs_run(void *thread_param)
{
struct wined3d_cs *cs = thread_param;
@ -773,7 +782,7 @@ index 23579c4..4ebb988 100644
}
done:
@@ -2307,25 +2282,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2339,25 +2314,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@ -799,7 +808,7 @@ index 23579c4..4ebb988 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@@ -2337,12 +2297,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2369,12 +2329,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
err:
if (cs)
@ -812,7 +821,7 @@ index 23579c4..4ebb988 100644
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -2361,17 +2316,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2393,17 +2348,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
CloseHandle(cs->thread);
if (ret != WAIT_OBJECT_0)
ERR("Wait failed (%#x).\n", ret);
@ -831,7 +840,7 @@ index 23579c4..4ebb988 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d9c33c6..c1150a6 100644
index f3912a1..24c54b2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -31,6 +31,7 @@
@ -842,7 +851,7 @@ index d9c33c6..c1150a6 100644
#include <stdarg.h>
#include <math.h>
#include <limits.h>
@@ -3038,19 +3039,17 @@ struct wined3d_cs_list
@@ -3042,19 +3043,17 @@ struct wined3d_cs_list
struct list blocks;
};
@ -867,7 +876,7 @@ index d9c33c6..c1150a6 100644
void (*finish)(struct wined3d_cs *cs);
};
@@ -3061,14 +3060,9 @@ struct wined3d_cs
@@ -3065,14 +3064,9 @@ struct wined3d_cs
struct wined3d_state state;
HANDLE thread;
DWORD thread_id;

View File

@ -1,108 +0,0 @@
From 378cf53090eb9cd3f4ba691671913e1c9ba36872 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 1 Aug 2013 00:10:40 +0200
Subject: wined3d: Send texture preloads through the CS
---
dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++
dlls/wined3d/texture.c | 7 ++-----
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index a36d205..b7c33ab 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -72,6 +72,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_CLEAR_RTV,
WINED3D_CS_OP_TEXTURE_MAP,
WINED3D_CS_OP_TEXTURE_UNMAP,
+ WINED3D_CS_OP_TEXTURE_PRELOAD,
WINED3D_CS_OP_STOP,
};
@@ -410,6 +411,12 @@ struct wined3d_cs_skip
DWORD size;
};
+struct wined3d_cs_texture_preload
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_texture *texture;
+};
+
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2098,6 +2105,30 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs, sizeof(*op));
}
+static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_texture_preload *op = data;
+ struct wined3d_context *context;
+ struct wined3d_texture *texture = op->texture;
+
+ context = context_acquire(cs->device, NULL);
+ wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB);
+ context_release(context);
+
+ return sizeof(*op);
+}
+
+void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture)
+{
+ struct wined3d_cs_texture_preload *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_TEXTURE_PRELOAD;
+ op->texture = texture;
+
+ cs->ops->submit(cs, sizeof(*op));
+}
+
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2148,6 +2179,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
+ /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
};
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index b391afd..4c8856d 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1684,11 +1684,8 @@ static ULONG texture_resource_decref(struct wined3d_resource *resource)
static void texture_resource_preload(struct wined3d_resource *resource)
{
struct wined3d_texture *texture = texture_from_resource(resource);
- struct wined3d_context *context;
-
- context = context_acquire(resource->device, NULL);
- wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB);
- context_release(context);
+ const struct wined3d_device *device = texture->resource.device;
+ wined3d_cs_emit_texture_preload(device->cs, texture);
}
static void wined3d_texture_unload(struct wined3d_resource *resource)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 784a622..fc825a9 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3154,6 +3154,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD flags) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
--
2.9.0

View File

@ -1,4 +1,4 @@
From ac1a9cc75bab361113fd4cb1b3bcda0a9aadeb71 Mon Sep 17 00:00:00 2001
From a7ae79e550f236f00a348b8cfdad719f69a0323c 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
@ -11,19 +11,19 @@ FIXME: This logic duplication is ugly.
3 files changed, 137 insertions(+), 82 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 908f416..84adcb4 100644
index 87763b5..40d7c91 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -73,6 +73,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_CLEAR_RTV,
WINED3D_CS_OP_TEXTURE_MAP,
WINED3D_CS_OP_TEXTURE_UNMAP,
WINED3D_CS_OP_TEXTURE_PRELOAD,
+ WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_STOP,
};
@@ -417,6 +418,12 @@ struct wined3d_cs_texture_preload
struct wined3d_texture *texture;
@@ -417,6 +418,12 @@ struct wined3d_cs_skip
DWORD size;
};
+struct wined3d_cs_update_texture
@ -35,7 +35,7 @@ index 908f416..84adcb4 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2118,6 +2125,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
@@ -2129,6 +2136,31 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs, sizeof(*op));
}
@ -67,16 +67,16 @@ index 908f416..84adcb4 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2169,6 +2201,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2180,6 +2212,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
+ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
};
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 58f1669..7255804 100644
index ad2da77..aa6d796 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3567,34 +3567,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@ -319,10 +319,10 @@ index 58f1669..7255804 100644
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b904a7d..156cb71 100644
index bd3bebf..7ba4fd3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2536,6 +2536,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
@@ -2539,6 +2539,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
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;
void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN;
@ -331,7 +331,7 @@ index b904a7d..156cb71 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3157,6 +3159,8 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
@@ -3161,6 +3163,8 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 15daab6805322dd6a81a83a4ee162703a23013b4 Mon Sep 17 00:00:00 2001
From 7abb510db81a0a2b0d0bc5fe31897d624c5fedf0 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 42a0567..64533ef 100644
index 647f1de..5375f04 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2076,20 +2076,16 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
@@ -2132,20 +2132,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 42a0567..64533ef 100644
return ret;
}
@@ -2108,12 +2104,12 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
@@ -2164,12 +2160,12 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
{
struct wined3d_cs_texture_unmap *op;
@ -50,12 +50,12 @@ index 42a0567..64533ef 100644
+ cs->ops->submit_prio(cs, sizeof(*op));
}
static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *data)
static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 3c739fa..5145de0 100644
index 87a0ae5..a63647c 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1731,6 +1731,10 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
@@ -1864,6 +1864,10 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
flags = wined3d_resource_sanitize_map_flags(resource, flags);

View File

@ -1,4 +1,4 @@
From a2672003445240c74f636792ceffd135bf2a06f3 Mon Sep 17 00:00:00 2001
From 3831f30d2549855400978627d4912ea6b28e4333 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 4 Sep 2015 15:22:49 +0200
Subject: wined3d: Send update_sub_resource calls through the command stream.
@ -10,12 +10,12 @@ Subject: wined3d: Send update_sub_resource calls through the command stream.
3 files changed, 105 insertions(+), 46 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index fcb4081..befc742 100644
index 5375f04..6857e8c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -74,6 +74,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_TEXTURE_MAP,
WINED3D_CS_OP_TEXTURE_UNMAP,
WINED3D_CS_OP_TEXTURE_PRELOAD,
WINED3D_CS_OP_UPDATE_TEXTURE,
+ WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_STOP,
@ -37,7 +37,7 @@ index fcb4081..befc742 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2196,6 +2206,90 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2199,6 +2209,90 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
cs->ops->submit(cs, sizeof(*op));
}
@ -128,16 +128,16 @@ index fcb4081..befc742 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2248,6 +2342,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2251,6 +2345,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
+ /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
};
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5aecf4e..f2f0d7b 100644
index 2597aa2..a8403b6 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4117,14 +4117,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@ -221,10 +221,10 @@ index 5aecf4e..f2f0d7b 100644
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 1571657..c0829a1 100644
index c3f104e..9db3cf1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3160,6 +3160,9 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
@@ -3164,6 +3164,9 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 004a1700d1b40a0127bf22de9ed706e1092a38c0 Mon Sep 17 00:00:00 2001
From 661c601c3bb9c52f9a1d26f4df709586beb3b0d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
Date: Sun, 24 Apr 2016 15:07:54 +0100
Subject: wined3d: Dirtify changed textures through the command stream.
@ -14,18 +14,18 @@ FIXME: The lost unmap_dirtify = FALSE is unfortunate.
3 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index fcc4504..efc05b8 100644
index 6857e8c..609963a 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -70,6 +70,7 @@ enum wined3d_cs_op
@@ -71,6 +71,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_LIGHT_ENABLE,
WINED3D_CS_OP_BLT,
WINED3D_CS_OP_CLEAR_RTV,
+ WINED3D_CS_OP_TEXTURE_CHANGED,
WINED3D_CS_OP_TEXTURE_MAP,
WINED3D_CS_OP_TEXTURE_UNMAP,
WINED3D_CS_OP_TEXTURE_PRELOAD,
@@ -407,6 +408,13 @@ struct wined3d_cs_texture_unmap
WINED3D_CS_OP_UPDATE_TEXTURE,
@@ -413,6 +414,13 @@ struct wined3d_cs_texture_unmap
unsigned int sub_resource_idx;
};
@ -39,7 +39,7 @@ index fcc4504..efc05b8 100644
struct wined3d_cs_skip
{
enum wined3d_cs_op opcode;
@@ -2100,6 +2108,28 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -2127,6 +2135,28 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
cs->ops->submit(cs, sizeof(*op));
}
@ -68,19 +68,19 @@ index fcc4504..efc05b8 100644
static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_texture_map *op = data;
@@ -2338,6 +2368,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2342,6 +2372,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
/* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
+ /* WINED3D_CS_OP_TEXTURE_CHANGED */ wined3d_cs_exec_texture_changed,
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index fa7488b..a676167 100644
index a63647c..64f1c1a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1913,7 +1913,6 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
@@ -1917,7 +1917,6 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned int sub_resource_idx)
{
@ -88,7 +88,7 @@ index fa7488b..a676167 100644
struct wined3d_context *context = NULL;
struct wined3d_bo_address data;
@@ -1937,12 +1936,11 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
@@ -1941,12 +1940,11 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
{
FIXME("Depth / stencil buffer locking is not implemented.\n");
}
@ -105,7 +105,7 @@ index fa7488b..a676167 100644
}
static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
@@ -1967,6 +1965,12 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
@@ -1971,6 +1969,12 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
wined3d_cs_emit_texture_unmap(device->cs, texture, sub_resource_idx);
@ -119,10 +119,10 @@ index fa7488b..a676167 100644
if (!--resource->map_count && texture->update_map_binding)
wined3d_texture_update_map_binding(texture);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ba50966..540bc1d 100644
index 9db3cf1..a8a590e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2777,6 +2777,8 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
@@ -2781,6 +2781,8 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
@ -131,7 +131,7 @@ index ba50966..540bc1d 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;
@@ -3154,6 +3156,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -3159,6 +3161,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
@ -139,7 +139,7 @@ index ba50966..540bc1d 100644
+ unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture,
--
2.9.0

View File

@ -1,4 +1,4 @@
From db8659a79fde86ef104d3972077eeac1d1659749 Mon Sep 17 00:00:00 2001
From d5da431c7c24dac7ba5a9f14cb370d1e49efc16b 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 efc05b8..1f288e0 100644
index 609963a..9790251 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -413,6 +413,7 @@ struct wined3d_cs_texture_changed
@@ -419,6 +419,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 efc05b8..1f288e0 100644
};
struct wined3d_cs_skip
@@ -2112,13 +2113,13 @@ static UINT wined3d_cs_exec_texture_changed(struct wined3d_cs *cs, const void *d
@@ -2139,13 +2140,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 efc05b8..1f288e0 100644
{
struct wined3d_cs_texture_changed *op;
@@ -2126,6 +2127,7 @@ void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_textu
@@ -2153,6 +2154,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 efc05b8..1f288e0 100644
cs->ops->submit(cs, sizeof(*op));
}
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 6eb36e2..df0cd21 100644
index a290b54..b9b6c75 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1768,10 +1768,26 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
@@ -1772,10 +1772,26 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
if (flags & WINED3D_MAP_DISCARD)
{
@ -78,7 +78,7 @@ index 6eb36e2..df0cd21 100644
wined3d_texture_validate_location(texture, sub_resource_idx, texture->resource.map_binding);
}
else
@@ -1867,11 +1883,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
@@ -1871,11 +1887,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
flags = wined3d_resource_sanitize_map_flags(resource, flags);
@ -95,7 +95,7 @@ index 6eb36e2..df0cd21 100644
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
@@ -1945,8 +1961,20 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
@@ -1949,8 +1965,20 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
}
}
@ -117,7 +117,7 @@ index 6eb36e2..df0cd21 100644
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
}
@@ -1974,7 +2002,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
@@ -1978,7 +2006,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
if (sub_resource->unmap_dirtify)
{
@ -127,10 +127,10 @@ index 6eb36e2..df0cd21 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 396a753..7899487 100644
index 83e7e98..112815c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2791,7 +2791,7 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
@@ -2795,7 +2795,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 396a753..7899487 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;
@@ -3170,7 +3170,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
@@ -3175,7 +3175,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_texture *texture,
@ -147,7 +147,7 @@ index 396a753..7899487 100644
+ unsigned int sub_resource_idx, struct wined3d_gl_bo *swap_buffer) DECLSPEC_HIDDEN;
void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture,
--
2.9.0

View File

@ -1,4 +1,4 @@
From 490b534e7c3bb675d447aa86ddaa019c0eed28d8 Mon Sep 17 00:00:00 2001
From 37186996496abcd7e33fd881dfb009a22ae2faf7 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 9a5d6c5..5b684cb 100644
index 668e049..9d13d31 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -499,6 +499,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *c
@ -24,10 +24,10 @@ index 9a5d6c5..5b684cb 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 1f288e0..3fc1fce 100644
index 9790251..ac7e774 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -414,6 +414,7 @@ struct wined3d_cs_texture_changed
@@ -420,6 +420,7 @@ struct wined3d_cs_texture_changed
struct wined3d_texture *texture;
unsigned int sub_resource_idx;
struct wined3d_gl_bo *swap_buffer;
@ -35,7 +35,7 @@ index 1f288e0..3fc1fce 100644
};
struct wined3d_cs_skip
@@ -2113,13 +2114,13 @@ static UINT wined3d_cs_exec_texture_changed(struct wined3d_cs *cs, const void *d
@@ -2140,13 +2141,13 @@ static UINT wined3d_cs_exec_texture_changed(struct wined3d_cs *cs, const void *d
{
const struct wined3d_cs_texture_changed *op = data;
@ -51,7 +51,7 @@ index 1f288e0..3fc1fce 100644
{
struct wined3d_cs_texture_changed *op;
@@ -2128,6 +2129,7 @@ void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_textu
@@ -2155,6 +2156,7 @@ void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_textu
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
op->swap_buffer = swap_buffer;
@ -60,7 +60,7 @@ index 1f288e0..3fc1fce 100644
cs->ops->submit(cs, sizeof(*op));
}
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 7f80957..1029f12 100644
index 5690e42..b9d50d8 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 *
@ -79,7 +79,7 @@ index 7f80957..1029f12 100644
context_resource_released(resource->device, resource, resource->type);
wined3d_resource_release(resource);
}
@@ -342,7 +344,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
@@ -347,7 +349,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 7f80957..1029f12 100644
return TRUE;
}
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index df0cd21..bf142b4 100644
index b9b6c75..cb9c3ec 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 df0cd21..bf142b4 100644
data->addr += sub_resource->offset;
data->buffer_object = 0;
return;
@@ -1262,6 +1266,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -1256,6 +1260,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
}
wined3d_resource_free_sysmem(&texture->resource);
@ -120,7 +120,7 @@ index df0cd21..bf142b4 100644
if ((texture->row_pitch = pitch))
texture->slice_pitch = height * pitch;
@@ -1456,6 +1461,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -1450,6 +1455,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 df0cd21..bf142b4 100644
return TRUE;
case WINED3D_LOCATION_USER_MEMORY:
@@ -1781,6 +1787,12 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
@@ -1785,6 +1791,12 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
ret = !!sub_resource->map_buffer;
break;
@ -141,7 +141,7 @@ index df0cd21..bf142b4 100644
default:
ret = wined3d_texture_prepare_location(texture, sub_resource_idx,
context, texture->resource.map_binding);
@@ -1886,7 +1898,21 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
@@ -1890,7 +1902,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");
@ -164,7 +164,7 @@ index df0cd21..bf142b4 100644
wined3d_resource_wait_idle(&texture->resource);
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
@@ -1962,7 +1988,7 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
@@ -1966,7 +1992,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 df0cd21..bf142b4 100644
{
struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
@@ -1975,6 +2001,12 @@ void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_r
@@ -1979,6 +2005,12 @@ void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_r
sub_resource->buffer = swap_buffer;
}
@ -186,7 +186,7 @@ index df0cd21..bf142b4 100644
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
}
@@ -2002,7 +2034,8 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
@@ -2006,7 +2038,8 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
if (sub_resource->unmap_dirtify)
{
@ -196,7 +196,7 @@ index df0cd21..bf142b4 100644
sub_resource->unmap_dirtify = FALSE;
}
@@ -2644,6 +2677,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
@@ -2649,6 +2682,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,10 +205,10 @@ index df0cd21..bf142b4 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7899487..c690d2c 100644
index 112815c..9314cba 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2594,7 +2594,7 @@ struct wined3d_resource
@@ -2598,7 +2598,7 @@ struct wined3d_resource
UINT depth;
UINT size;
DWORD priority;
@ -217,7 +217,7 @@ index 7899487..c690d2c 100644
struct list resource_list_entry;
LONG access_count;
@@ -2791,7 +2791,8 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
@@ -2795,7 +2795,8 @@ 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,
@ -227,7 +227,7 @@ index 7899487..c690d2c 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;
@@ -3170,7 +3171,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
@@ -3175,7 +3176,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_texture *texture,
@ -236,7 +236,7 @@ index 7899487..c690d2c 100644
+ void *swap_heap_memory) DECLSPEC_HIDDEN;
void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture,
--
2.9.0

View File

@ -1,4 +1,4 @@
From 2c66c9febb6c4f93bcc52d426d18005059fc76c8 Mon Sep 17 00:00:00 2001
From 59f330a07534746e422a053c0caf931e9a926fad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 6 Jul 2013 16:14:16 +0200
Subject: wined3d: Accelerate DISCARD buffer maps
@ -13,10 +13,10 @@ TODO3: Clean up the map_mem allocation mess.
3 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 8352972..76cc5f3 100644
index c4b0eee..382d6f7 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1056,10 +1056,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -1039,10 +1039,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
buffer->flags |= WINED3D_BUFFER_SYNC;
}
@ -40,18 +40,18 @@ index 8352972..76cc5f3 100644
base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index b416a39..3d68c71 100644
index ac7e774..923acfc 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -73,6 +73,7 @@ enum wined3d_cs_op
@@ -74,6 +74,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_TEXTURE_CHANGED,
WINED3D_CS_OP_TEXTURE_MAP,
WINED3D_CS_OP_TEXTURE_UNMAP,
+ WINED3D_CS_OP_BUFFER_SWAP_MEM,
WINED3D_CS_OP_TEXTURE_PRELOAD,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
@@ -417,6 +418,13 @@ struct wined3d_cs_texture_changed
WINED3D_CS_OP_STOP,
@@ -423,6 +424,13 @@ struct wined3d_cs_texture_changed
void *swap_heap_memory;
};
@ -65,7 +65,7 @@ index b416a39..3d68c71 100644
struct wined3d_cs_skip
{
enum wined3d_cs_op opcode;
@@ -2324,6 +2332,34 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2327,6 +2335,34 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
cs->ops->finish(cs);
}
@ -100,19 +100,19 @@ index b416a39..3d68c71 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2375,6 +2411,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2379,6 +2415,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_CHANGED */ wined3d_cs_exec_texture_changed,
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
+ /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
};
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7990862..6858059 100644
index 9314cba..abfc720 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3102,6 +3102,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -3106,6 +3106,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
const RECT *dst_rect, struct wined3d_surface *src_surface,
const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx,
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From a836152c841dc2929ada3eece3466a8b1741ef05 Mon Sep 17 00:00:00 2001
From cc1374ebfaf017e31f54caf45bcfdb43f84b5fb6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 6 Jul 2013 17:05:12 +0200
Subject: wined3d: Access the buffer dirty areas through the CS
@ -27,7 +27,7 @@ be protected by locks.
3 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 3307fd4..d7ea6ee 100644
index 9cfb9cc..78b8d8b 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@ -39,7 +39,7 @@ index 3307fd4..d7ea6ee 100644
{
if (!offset && (!size || size == buffer->resource.size))
goto invalidate_all;
@@ -982,9 +982,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -965,9 +965,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
* being uploaded in that case. Two such applications are Port Royale
* and Darkstar One. */
if (flags & WINED3D_MAP_DISCARD)
@ -52,18 +52,18 @@ index 3307fd4..d7ea6ee 100644
if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER))
{
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 3d68c71..9e8539d 100644
index 923acfc..bad0ba3 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -74,6 +74,7 @@ enum wined3d_cs_op
@@ -75,6 +75,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_TEXTURE_MAP,
WINED3D_CS_OP_TEXTURE_UNMAP,
WINED3D_CS_OP_BUFFER_SWAP_MEM,
+ WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE,
WINED3D_CS_OP_TEXTURE_PRELOAD,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
@@ -425,6 +426,13 @@ struct wined3d_cs_buffer_swap_mem
WINED3D_CS_OP_STOP,
@@ -431,6 +432,13 @@ struct wined3d_cs_buffer_swap_mem
BYTE *mem;
};
@ -77,7 +77,7 @@ index 3d68c71..9e8539d 100644
struct wined3d_cs_skip
{
enum wined3d_cs_op opcode;
@@ -2360,6 +2368,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe
@@ -2363,6 +2371,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe
cs->ops->submit(cs, sizeof(*op));
}
@ -106,19 +106,19 @@ index 3d68c71..9e8539d 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2412,6 +2442,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2416,6 +2446,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
/* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
+ /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
};
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6858059..f23efe7 100644
index abfc720..4f249d6 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3102,6 +3102,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -3106,6 +3106,8 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
const RECT *dst_rect, struct wined3d_surface *src_surface,
const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx,
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@ -127,7 +127,7 @@ index 6858059..f23efe7 100644
void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
BYTE *mem) DECLSPEC_HIDDEN;
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
@@ -3240,6 +3242,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
@@ -3244,6 +3246,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
struct wined3d_buffer *src_buffer, unsigned int src_offset, unsigned int size) DECLSPEC_HIDDEN;
HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer,
const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 7c04fd95e744e6c5108828ee35e6074ed3e20bf9 Mon Sep 17 00:00:00 2001
From baa97e78450e50c136330d533f284e1cdfdb8b94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 6 Jul 2013 22:52:06 +0200
Subject: wined3d: Ignore buffer->resource.map_count in the CS
@ -14,7 +14,7 @@ incrementing map_count.
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index b154c24..6ea1e5e 100644
index 78b8d8b..d754bc9 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -464,7 +464,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co
@ -40,9 +40,9 @@ index b154c24..6ea1e5e 100644
buffer_mark_used(buffer);
if (!buffer->buffer_object)
@@ -1246,6 +1241,12 @@ static void buffer_resource_preload(struct wined3d_resource *resource)
@@ -1245,6 +1240,12 @@ static void buffer_resource_preload(struct wined3d_resource *resource)
{
struct wined3d_context *context;
struct wined3d_device *device = resource->device;
+ if (resource->map_count)
+ {
@ -50,9 +50,9 @@ index b154c24..6ea1e5e 100644
+ return;
+ }
+
if (wined3d_settings.cs_multithreaded)
{
FIXME("Waiting for cs.\n");
context = context_acquire(resource->device, NULL);
buffer_internal_preload(buffer_from_resource(resource), context, NULL);
context_release(context);
--
2.9.0

View File

@ -1,122 +0,0 @@
From 9718a2a0fb3ca81fc32a5ffc97522ae448363a9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 7 Jul 2013 12:02:59 +0200
Subject: wined3d: Send buffer preloads through the CS
Think about making this a fast command. Might help if the driver
supports async data transfer, but synchronization side effects, esp. wrt
the dirty area list, have to be considered.
---
dlls/wined3d/buffer.c | 12 +-----------
dlls/wined3d/cs.c | 31 +++++++++++++++++++++++++++++++
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6ea1e5e..2625d9d 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1238,7 +1238,6 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource)
static void buffer_resource_preload(struct wined3d_resource *resource)
{
- struct wined3d_context *context;
struct wined3d_device *device = resource->device;
if (resource->map_count)
@@ -1247,16 +1246,7 @@ static void buffer_resource_preload(struct wined3d_resource *resource)
return;
}
- if (wined3d_settings.cs_multithreaded)
- {
- FIXME("Waiting for cs.\n");
- wined3d_cs_emit_glfinish(device->cs);
- device->cs->ops->finish(device->cs);
- }
-
- context = context_acquire(device, NULL);
- buffer_internal_preload(buffer_from_resource(resource), context, NULL);
- context_release(context);
+ wined3d_cs_emit_buffer_preload(device->cs, buffer_from_resource(resource));
}
static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index aee2f60..f24a37d 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -75,6 +75,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_TEXTURE_UNMAP,
WINED3D_CS_OP_BUFFER_SWAP_MEM,
WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE,
+ WINED3D_CS_OP_BUFFER_PRELOAD,
WINED3D_CS_OP_TEXTURE_PRELOAD,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
@@ -460,6 +461,12 @@ struct wined3d_cs_update_sub_resource
const void *data;
};
+struct wined3d_cs_buffer_preload
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_buffer *buffer;
+};
+
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2393,6 +2400,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
cs->ops->submit(cs, sizeof(*op));
}
+static UINT wined3d_cs_exec_buffer_preload(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_buffer_preload *op = data;
+ struct wined3d_context *context;
+
+ context = context_acquire(cs->device, NULL);
+ buffer_internal_preload(op->buffer, context, NULL);
+ context_release(context);
+
+ return sizeof(*op);
+}
+
+void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer)
+{
+ struct wined3d_cs_buffer_preload *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_BUFFER_PRELOAD;
+ op->buffer = buffer;
+
+ cs->ops->submit(cs, sizeof(*op));
+}
+
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2446,6 +2476,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
/* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
/* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range,
+ /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 14585d1..4c64b9a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3105,6 +3105,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
BYTE *mem) DECLSPEC_HIDDEN;
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
--
2.9.0

View File

@ -1,4 +1,4 @@
From 6e1451770f45f6e635f49956e5756d9e7c0f167b Mon Sep 17 00:00:00 2001
From 70ac363172221646e6139f1f1ad6a8691f2ee2da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 2 Oct 2013 21:47:08 +0200
Subject: wined3d: Create VBOs through the command stream.
@ -11,7 +11,7 @@ A stop-gap solution to make fglrx happier until buffers are updated.
3 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 47155ed..b69f8a3 100644
index ff6c0ac..9765c4e 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -122,7 +122,7 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g
@ -32,7 +32,7 @@ index 47155ed..b69f8a3 100644
This->buffer_object_usage = gl_usage;
@@ -936,9 +934,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -929,9 +927,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
* on buffer creation won't work either. */
if (!buffer->buffer_object && buffer->flags & WINED3D_BUFFER_USE_BO)
{
@ -44,19 +44,19 @@ index 47155ed..b69f8a3 100644
flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags);
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 24e9a74..826d6ec 100644
index 93beab0..391c6f1 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -79,6 +79,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_TEXTURE_PRELOAD,
@@ -78,6 +78,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
+ WINED3D_CS_OP_CREATE_VBO,
WINED3D_CS_OP_STOP,
};
@@ -467,6 +468,12 @@ struct wined3d_cs_buffer_preload
struct wined3d_buffer *buffer;
@@ -460,6 +461,12 @@ struct wined3d_cs_update_sub_resource
const void *data;
};
+struct wined3d_cs_create_vbo
@ -68,7 +68,7 @@ index 24e9a74..826d6ec 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2425,6 +2432,30 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer
@@ -2398,6 +2405,30 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
cs->ops->submit(cs, sizeof(*op));
}
@ -99,8 +99,8 @@ index 24e9a74..826d6ec 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2482,6 +2513,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
@@ -2454,6 +2485,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
+ /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo,
@ -108,10 +108,10 @@ index 24e9a74..826d6ec 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 718afab..486f8d9 100644
index a4e24aa..c93ce68 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3112,6 +3112,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -3115,6 +3115,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
const struct blit_shader *blitter) DECLSPEC_HIDDEN;
@ -119,7 +119,7 @@ index 718afab..486f8d9 100644
void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
@@ -3246,6 +3247,8 @@ HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer,
@@ -3249,6 +3250,8 @@ 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;
void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN;

View File

@ -1,71 +0,0 @@
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.
Otherwise texture data might get lost, thanks to surface/volume_evict_sysmem:
1) preload(texture)
2) map(texture)
-> Loads sysmem / sets it with discard map.
3) unmap(texture)
-> enqueues a resource_changed operation
4) preload is executed.
-> Uploads data written in 3. Discards sysmem. Questionable if
DISCARD was passed, but without it, no harm done.
-> texture is only up to date location.
5) resource_changed executed.
-> Discards texture.
And data is lost. This patch prevents that by stalling the map until the
PreLoad is done.
What's left open is finding out why anyone (I'm looking at you EVE
online) preloads a texture right before mapping it...
---
dlls/wined3d/cs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 1b8cb90..1593157 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -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_release(&texture->resource);
+
return sizeof(*op);
}
@@ -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_acquire(&texture->resource);
+
cs->ops->submit(cs, sizeof(*op));
}
@@ -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_release(&op->buffer->resource);
+
return sizeof(*op);
}
@@ -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_acquire(&buffer->resource);
+
cs->ops->submit(cs, sizeof(*op));
}
--
2.8.0

View File

@ -1,4 +1,4 @@
From 65fdec5a37a115c8c9a4c3b70d99fac6b243cf24 Mon Sep 17 00:00:00 2001
From aeddfd65c5edc947405f6640b9465c8b8e640d58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 16 Mar 2014 14:13:42 +0100
Subject: wined3d: Send getdc and releasedc through the command stream.
@ -11,10 +11,10 @@ Another hacky patch to avoid using GL outside the worker thread.
3 files changed, 113 insertions(+), 34 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index c011bf1..0089911 100644
index 4570983..2958609 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -80,6 +80,8 @@ enum wined3d_cs_op
@@ -81,6 +81,8 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_CREATE_VBO,
@ -23,7 +23,7 @@ index c011bf1..0089911 100644
WINED3D_CS_OP_STOP,
};
@@ -474,6 +476,13 @@ struct wined3d_cs_create_vbo
@@ -481,6 +483,13 @@ struct wined3d_cs_create_vbo
struct wined3d_buffer *buffer;
};
@ -37,7 +37,7 @@ index c011bf1..0089911 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2478,6 +2487,52 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu
@@ -2504,6 +2513,52 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu
cs->ops->finish_prio(cs);
}
@ -90,7 +90,7 @@ index c011bf1..0089911 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2536,6 +2591,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2563,6 +2618,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo,
@ -100,10 +100,10 @@ index c011bf1..0089911 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index d69dfc1..a90391c 100644
index f4d3363..f00c06a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -3057,13 +3057,39 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
@@ -3058,13 +3058,39 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
return WINED3D_OK;
}
@ -145,7 +145,7 @@ index d69dfc1..a90391c 100644
TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc);
@@ -3081,35 +3107,30 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
@@ -3082,35 +3108,30 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
return WINED3DERR_INVALIDCALL;
@ -200,7 +200,7 @@ index d69dfc1..a90391c 100644
}
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
@@ -3140,14 +3161,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
@@ -3141,14 +3162,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
return WINED3DERR_INVALIDCALL;
}
@ -217,10 +217,10 @@ index d69dfc1..a90391c 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d370367..a524314 100644
index e976ffa..4ab138f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2702,6 +2702,7 @@ struct wined3d_texture
@@ -2706,6 +2706,7 @@ struct wined3d_texture
DWORD flags;
GLenum target;
DWORD update_map_binding;
@ -228,7 +228,7 @@ index d370367..a524314 100644
GLuint rb_multisample;
GLuint rb_resolved;
@@ -2795,6 +2796,7 @@ void wined3d_texture_changed(struct wined3d_texture *texture,
@@ -2799,6 +2800,7 @@ void wined3d_texture_changed(struct wined3d_texture *texture,
void *swap_heap_memory) DECLSPEC_HIDDEN;
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
@ -236,7 +236,7 @@ index d370367..a524314 100644
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_bo_address *data, DWORD locations, BOOL map) DECLSPEC_HIDDEN;
@@ -2814,6 +2816,8 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
@@ -2818,6 +2820,8 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
DWORD flags) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
@ -245,13 +245,14 @@ index d370367..a524314 100644
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@@ -3122,10 +3126,14 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
@@ -3126,11 +3130,15 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
+ unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 261adc11a7e5c6a0445575f5d53213c7a08f31d7 Mon Sep 17 00:00:00 2001
From 9015c6fda2f38e2552ee7056b7f97ad994d75310 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 10 Oct 2013 16:43:19 +0200
Subject: wined3d: Create the initial context through the CS.
@ -11,10 +11,10 @@ Very hacky.
3 files changed, 103 insertions(+), 54 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 2aa43d6..dc5a878 100644
index cf11c3c..230c04d 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -83,6 +83,7 @@ enum wined3d_cs_op
@@ -84,6 +84,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_GET_DC,
WINED3D_CS_OP_RELEASE_DC,
WINED3D_CS_OP_CREATE_DUMMY_TEXTURES,
@ -22,7 +22,7 @@ index 2aa43d6..dc5a878 100644
WINED3D_CS_OP_STOP,
};
@@ -489,6 +490,13 @@ struct wined3d_cs_create_dummy_textures
@@ -496,6 +497,13 @@ struct wined3d_cs_create_dummy_textures
enum wined3d_cs_op opcode;
};
@ -36,7 +36,7 @@ index 2aa43d6..dc5a878 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2561,6 +2569,31 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs)
@@ -2587,6 +2595,31 @@ void wined3d_cs_emit_create_dummy_textures(struct wined3d_cs *cs)
cs->ops->finish(cs);
}
@ -68,7 +68,7 @@ index 2aa43d6..dc5a878 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2622,6 +2655,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2649,6 +2682,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
/* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures,
@ -77,7 +77,7 @@ index 2aa43d6..dc5a878 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index f238563..2356571 100644
index 256f9db..eac171b 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -817,6 +817,69 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s
@ -170,7 +170,9 @@ index f238563..2356571 100644
- {
- ERR("Failed to create the context array.\n");
- hr = E_OUTOFMEMORY;
- goto err;
+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
+ if (FAILED(hr))
goto err;
- }
- swapchain->num_contexts = 1;
-
@ -198,9 +200,7 @@ index f238563..2356571 100644
- {
- WARN("Failed to create context.\n");
- hr = WINED3DERR_NOTAVAILABLE;
+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
+ if (FAILED(hr))
goto err;
- goto err;
- }
-
- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@ -215,10 +215,10 @@ index f238563..2356571 100644
if (swapchain->desc.backbuffer_count > 0)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b8b597d..afe7fe0 100644
index a635118..f18858b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3122,6 +3122,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -3126,6 +3126,8 @@ 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_create_dummy_textures(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
@ -227,7 +227,7 @@ index b8b597d..afe7fe0 100644
void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
@@ -3362,6 +3364,8 @@ struct wined3d_swapchain
@@ -3367,6 +3369,8 @@ struct wined3d_swapchain
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 6fac21d0265b08214e7c229466514279c3297427 Mon Sep 17 00:00:00 2001
From 1b283458b05894d2bb53a33bd5485178d641c973 Mon Sep 17 00:00:00 2001
From: Nils Kuhnhenn <nils@volafile.io>
Date: Fri, 5 Aug 2016 20:28:46 +0200
Subject: wined3d: Fix context_acquire not being called from the command thread
@ -11,18 +11,18 @@ Subject: wined3d: Fix context_acquire not being called from the command thread
3 files changed, 53 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index ddd5703..0b15565 100644
index de3db6f..d4f527c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -73,6 +73,7 @@ enum wined3d_cs_op
@@ -74,6 +74,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_TEXTURE_CHANGED,
WINED3D_CS_OP_TEXTURE_MAP,
WINED3D_CS_OP_TEXTURE_UNMAP,
+ WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
WINED3D_CS_OP_BUFFER_SWAP_MEM,
WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE,
WINED3D_CS_OP_BUFFER_PRELOAD,
@@ -419,6 +420,13 @@ struct wined3d_cs_texture_unmap
WINED3D_CS_OP_UPDATE_TEXTURE,
@@ -424,6 +425,13 @@ struct wined3d_cs_texture_unmap
unsigned int sub_resource_idx;
};
@ -36,7 +36,7 @@ index ddd5703..0b15565 100644
struct wined3d_cs_texture_changed
{
enum wined3d_cs_op opcode;
@@ -2274,6 +2282,47 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
@@ -2294,6 +2302,47 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit_prio(cs, sizeof(*op));
}
@ -81,22 +81,22 @@ index ddd5703..0b15565 100644
+ cs->ops->submit(cs, sizeof(*op));
+}
+
static UINT wined3d_cs_exec_texture_preload(struct wined3d_cs *cs, const void *data)
static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_texture_preload *op = data;
@@ -2723,6 +2772,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
const struct wined3d_cs_update_texture *op = data;
@@ -2689,6 +2738,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_CHANGED */ wined3d_cs_exec_texture_changed,
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
+ /* WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION */ wined3d_cs_exec_texture_add_dirty_region,
/* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
/* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range,
/* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 9730148..b1fc1e5 100644
index 5c80a38..df9229a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1551,7 +1551,6 @@ struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct win
@@ -1545,7 +1545,6 @@ struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct win
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
UINT layer, const struct wined3d_box *dirty_region)
{
@ -104,7 +104,7 @@ index 9730148..b1fc1e5 100644
unsigned int sub_resource_idx;
TRACE("texture %p, layer %u, dirty_region %s.\n", texture, layer, debug_box(dirty_region));
@@ -1563,19 +1562,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
@@ -1557,19 +1556,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
}
sub_resource_idx = layer * texture->level_count;
@ -126,10 +126,10 @@ index 9730148..b1fc1e5 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0822b2e..b930a6a 100644
index db67853..d5cc991 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3201,6 +3201,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -3205,6 +3205,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;

File diff suppressed because it is too large Load Diff