Rebase against 5840ea47e6a0d761acbd45cd5a59fbcebfb86326.

This commit is contained in:
Sebastian Lackner 2016-06-02 23:10:47 +02:00
parent 3d1995983f
commit 64e8ae3a61
10 changed files with 322 additions and 299 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "03fa4cfaffd4c10f56a2f8bfd383f4eaf67d364c"
echo "5840ea47e6a0d761acbd45cd5a59fbcebfb86326"
}
# Show version information

View File

@ -1,4 +1,4 @@
From a58eff5fbda4ae465b17abacc29c7ca0a2c8129b Mon Sep 17 00:00:00 2001
From 1dfeb74eaa37d265531f48552a54ebc990bc9a0e Mon Sep 17 00:00:00 2001
From: Henri Verbeet <hverbeet@codeweavers.com>
Date: Sat, 8 Dec 2012 19:28:54 +0100
Subject: wined3d: Wait for resource updates to finish when using the
@ -17,10 +17,10 @@ then it's probably useful for debugging.
6 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 75ce927..ddd9de6 100644
index c333fa3..c15857b 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7964,8 +7964,11 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
@@ -7997,8 +7997,11 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
/* Leave the opengl state valid for blitting */
arbfp_blit_unset(context->gl_info);
@ -35,10 +35,10 @@ index 75ce927..ddd9de6 100644
context_release(context);
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 43920ac..054c67c 100644
index f322206..e851ec9 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1101,7 +1101,9 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer)
@@ -1092,7 +1092,9 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer)
}
GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint));
@ -50,7 +50,7 @@ index 43920ac..054c67c 100644
context_release(context);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 66e4b1e..42ffdb4 100644
index cf596a6..de07b9d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -514,7 +514,9 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@ -64,7 +64,7 @@ index 66e4b1e..42ffdb4 100644
&& target->container->swapchain && target->container->swapchain->front_buffer == target->container))
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
@@ -3355,7 +3357,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3406,7 +3408,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
context = context_acquire(device, NULL);
/* We only have to do this if we need to read the, swapbuffers performs a flush for us */
@ -77,12 +77,12 @@ index 66e4b1e..42ffdb4 100644
* fails. */
context_release(context);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 67d0fea..93c6d24 100644
index 18c7a3e..1d98bc0 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -583,7 +583,9 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
@@ -584,7 +584,9 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
for (i = 0; i < context->num_buffer_queries; ++i)
wined3d_event_query_issue(context->buffer_queries[i], device);
}
- if (wined3d_settings.strict_draw_ordering)
+ if (wined3d_settings.cs_multithreaded)
@ -92,7 +92,7 @@ index 67d0fea..93c6d24 100644
context_release(context);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ca394f7..c5504da 100644
index 7b55e25..33fcf34 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -491,7 +491,9 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
@ -118,7 +118,7 @@ index ca394f7..c5504da 100644
&& dst_texture->swapchain->front_buffer == dst_texture))
gl_info->gl_ops.gl.p_glFlush();
@@ -1077,7 +1082,9 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
@@ -1073,7 +1078,9 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
checkGLcall("glBindBuffer");
}
@ -129,7 +129,7 @@ index ca394f7..c5504da 100644
gl_info->gl_ops.gl.p_glFlush();
if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE)
@@ -2264,7 +2271,9 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
@@ -2413,7 +2420,9 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glDeleteTextures(1, &backup)");
}
@ -140,7 +140,7 @@ index ca394f7..c5504da 100644
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
context_release(context);
@@ -2374,8 +2383,11 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
@@ -2523,8 +2532,11 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
/* Leave the opengl state valid for blitting */
device->blitter->unset_shader(context->gl_info);
@ -154,7 +154,7 @@ index ca394f7..c5504da 100644
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
if (restore_rt)
@@ -2722,7 +2734,9 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win
@@ -2871,7 +2883,9 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win
context_invalidate_state(context, STATE_FRAMEBUFFER);
@ -165,7 +165,7 @@ index ca394f7..c5504da 100644
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
}
else if (location == WINED3D_LOCATION_DRAWABLE)
@@ -2739,7 +2753,9 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win
@@ -2888,7 +2902,9 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win
context_invalidate_state(context, STATE_FRAMEBUFFER);
@ -177,10 +177,10 @@ index ca394f7..c5504da 100644
}
else
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 31768cf..7b0f1ec 100644
index 92abd3b..9f37e70 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -573,8 +573,10 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
@@ -577,8 +577,10 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
swapchain_blit(swapchain, context, src_rect, dst_rect);
}

View File

@ -1,4 +1,4 @@
From 43a02fe2bac642fa17d1630bd678b9c31260e57e Mon Sep 17 00:00:00 2001
From c12e57d7e64c4701e6d940d47502d78f81fc1317 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Apr 2013 11:53:10 +0200
Subject: wined3d: Don't call glFinish after draws
@ -8,12 +8,12 @@ Subject: wined3d: Don't call glFinish after draws
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 93c6d24..67d0fea 100644
index 1d98bc0..18c7a3e 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -583,9 +583,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
@@ -584,9 +584,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
for (i = 0; i < context->num_buffer_queries; ++i)
wined3d_event_query_issue(context->buffer_queries[i], device);
}
- if (wined3d_settings.cs_multithreaded)
- gl_info->gl_ops.gl.p_glFinish();

View File

@ -1,4 +1,4 @@
From 9277f0a72356d1f9bfa2849fdf597ae7abf39bc8 Mon Sep 17 00:00:00 2001
From 4e89489b010072ddcd86bdd213efa01edc6aa12e 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
@ -9,7 +9,7 @@ Subject: wined3d: Replace the linked lists with a ringbuffer
2 files changed, 161 insertions(+), 222 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index e109406..7c032dc 100644
index 5397fc7..ae9ef50 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -22,20 +22,10 @@
@ -35,7 +35,7 @@ index e109406..7c032dc 100644
WINED3D_CS_OP_FENCE,
WINED3D_CS_OP_PRESENT,
WINED3D_CS_OP_CLEAR,
@@ -382,99 +372,30 @@ struct wined3d_cs_texture_unmap
@@ -383,99 +373,30 @@ struct wined3d_cs_texture_unmap
unsigned int sub_resource_idx;
};
@ -149,7 +149,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data)
@@ -495,14 +416,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled)
@@ -496,14 +417,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 e109406..7c032dc 100644
/* A busy wait should be fine, we're not supposed to have to wait very
* long. */
@@ -541,7 +462,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -542,7 +463,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
pending = InterlockedIncrement(&cs->pending_presents);
@ -175,7 +175,7 @@ index e109406..7c032dc 100644
while (pending > 1)
pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0);
@@ -567,8 +488,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -568,8 +489,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
struct wined3d_cs_clear *op;
@ -186,7 +186,7 @@ index e109406..7c032dc 100644
op->opcode = WINED3D_CS_OP_CLEAR;
op->flags = flags;
op->color = *color;
@@ -577,7 +498,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -578,7 +499,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
op->rect_count = rect_count;
memcpy(op->rects, rects, sizeof(*rects) * rect_count);
@ -195,7 +195,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -618,7 +539,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
@@ -619,7 +540,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
op->instance_count = instance_count;
op->indexed = indexed;
@ -204,7 +204,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data)
@@ -640,7 +561,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -641,7 +562,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
@@ -661,7 +582,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -662,7 +583,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data)
@@ -682,7 +603,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -683,7 +604,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data)
@@ -705,7 +626,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -706,7 +627,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data)
@@ -759,7 +680,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -760,7 +681,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data)
@@ -780,7 +701,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -781,7 +702,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data)
@@ -817,7 +738,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -818,7 +739,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data)
@@ -844,7 +765,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -845,7 +766,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data)
@@ -877,7 +798,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -878,7 +799,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
op->buffer = buffer;
op->offset = offset;
@ -285,16 +285,16 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data)
@@ -909,7 +830,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
op->buffer = buffer;
@@ -912,7 +833,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
op->format_id = format_id;
op->offset = offset;
- cs->ops->submit(cs);
+ cs->ops->submit(cs, sizeof(*op));
}
static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data)
@@ -940,7 +861,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -943,7 +864,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1032,7 +953,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1035,7 +956,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
@@ -1056,7 +977,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1059,7 +980,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1080,7 +1001,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1083,7 +1004,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1103,7 +1024,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1106,7 +1027,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 e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data)
@@ -1136,8 +1057,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1139,8 +1060,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;
@ -350,7 +350,7 @@ index e109406..7c032dc 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1161,7 +1083,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1164,7 +1086,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);
@ -359,7 +359,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
@@ -1183,8 +1105,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1186,8 +1108,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
op->state = state;
op->value = value;
@ -370,7 +370,7 @@ index e109406..7c032dc 100644
static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data)
{
@@ -1214,8 +1136,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1217,8 +1139,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;
@ -381,7 +381,7 @@ index e109406..7c032dc 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1239,7 +1162,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1242,7 +1165,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);
@ -390,7 +390,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data)
@@ -1270,8 +1193,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1273,8 +1196,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;
@ -401,7 +401,7 @@ index e109406..7c032dc 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1295,7 +1219,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
@@ -1298,7 +1222,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);
@ -410,7 +410,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
@@ -1319,7 +1243,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1322,7 +1246,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
op->state = state;
op->value = value;
@ -419,7 +419,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
@@ -1343,7 +1267,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1346,7 +1270,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
op->state = state;
op->value = value;
@ -428,7 +428,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data)
@@ -1367,7 +1291,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1370,7 +1294,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
op->state = state;
op->matrix = *matrix;
@ -437,7 +437,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data)
@@ -1389,7 +1313,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1392,7 +1316,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
op->plane_idx = plane_idx;
op->plane = *plane;
@ -446,7 +446,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data)
@@ -1474,7 +1398,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1477,7 +1401,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
else
op->set = 0;
@ -455,7 +455,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data)
@@ -1495,7 +1419,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1498,7 +1422,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;
@ -464,7 +464,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1519,7 +1443,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1522,7 +1446,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;
@ -473,7 +473,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
@@ -1545,7 +1469,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -1548,7 +1472,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_GLFINISH;
@ -482,7 +482,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data)
@@ -1567,7 +1491,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
@@ -1570,7 +1494,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;
@ -491,7 +491,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data)
@@ -1593,7 +1517,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1596,7 +1520,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;
@ -500,7 +500,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1650,7 +1574,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1653,7 +1577,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;
@ -509,7 +509,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -1739,7 +1663,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1742,7 +1666,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
op->idx = idx;
op->enable = enable;
@ -518,7 +518,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
@@ -1771,7 +1695,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1774,7 +1698,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
if (fx)
op->fx = *fx;
@ -527,7 +527,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
@@ -1804,7 +1728,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -1807,7 +1731,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
op->stencil = stencil;
op->blitter = blitter;
@ -536,7 +536,7 @@ index e109406..7c032dc 100644
}
static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data)
@@ -1829,12 +1753,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
@@ -1832,12 +1756,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
op->flags = flags;
op->mem = &ret;
@ -552,7 +552,7 @@ index e109406..7c032dc 100644
return ret;
}
@@ -1857,11 +1783,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
@@ -1860,11 +1786,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@ -567,7 +567,7 @@ index e109406..7c032dc 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,
@@ -1906,42 +1834,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1909,42 +1837,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
};
@ -650,7 +650,7 @@ index e109406..7c032dc 100644
};
/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an
@@ -1953,9 +1898,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
@@ -1956,9 +1901,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;
@ -690,7 +690,7 @@ index e109406..7c032dc 100644
void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{
@@ -1979,31 +1953,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
@@ -1982,31 +1956,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;
@ -737,7 +737,7 @@ index e109406..7c032dc 100644
}
done:
@@ -2028,25 +2003,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2031,25 +2006,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@ -763,7 +763,7 @@ index e109406..7c032dc 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@@ -2058,12 +2018,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2061,12 +2021,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
err:
if (cs)
@ -776,7 +776,7 @@ index e109406..7c032dc 100644
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -2082,17 +2037,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2085,17 +2040,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
CloseHandle(cs->thread);
if (ret != WAIT_OBJECT_0)
ERR("Wait failed (%#x).\n", ret);
@ -795,7 +795,7 @@ index e109406..7c032dc 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index fcc4fcf..4862e4e 100644
index 51eb280..e13880a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -31,6 +31,7 @@
@ -806,7 +806,7 @@ index fcc4fcf..4862e4e 100644
#include <stdarg.h>
#include <math.h>
#include <limits.h>
@@ -2871,19 +2872,17 @@ struct wined3d_cs_list
@@ -2898,19 +2899,17 @@ struct wined3d_cs_list
struct list blocks;
};
@ -831,7 +831,7 @@ index fcc4fcf..4862e4e 100644
void (*finish)(struct wined3d_cs *cs);
};
@@ -2894,14 +2893,9 @@ struct wined3d_cs
@@ -2921,14 +2920,9 @@ struct wined3d_cs
struct wined3d_state state;
HANDLE thread;
DWORD thread_id;

View File

@ -1,4 +1,4 @@
From 50911185e5ac185d72315264b0361f441cb2777b Mon Sep 17 00:00:00 2001
From 4c6235a73145d10a79c90304e89140c64a2f3c18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 2 Oct 2013 12:36:02 +0200
Subject: wined3d: Don't request the frontbuffer to create dummy textures.
@ -8,10 +8,10 @@ Subject: wined3d: Don't request the frontbuffer to create dummy textures.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 47bd8c9..3ea4508 100644
index ad1795d..357da3c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1032,7 +1032,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -1044,7 +1044,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
device->swapchains[0] = swapchain;
device_init_swapchain_state(device, swapchain);
@ -19,7 +19,7 @@ index 47bd8c9..3ea4508 100644
+ context = context_acquire(device, NULL);
create_dummy_textures(device, context);
create_default_sampler(device);
create_default_samplers(device);
--
2.8.0

View File

@ -1,4 +1,4 @@
From 7caccd824631bc26892ad9c9f9e9f97b689a1450 Mon Sep 17 00:00:00 2001
From 3088a7530fb33a12a44cba688a5d14ea86f55590 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 10 Oct 2013 16:29:42 +0200
Subject: wined3d: Create dummy textures through the CS.
@ -12,7 +12,7 @@ crash.
3 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index d5b5715..d3bd368 100644
index 83eb233..a7dde00 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -89,6 +89,7 @@ enum wined3d_cs_op
@ -23,7 +23,7 @@ index d5b5715..d3bd368 100644
WINED3D_CS_OP_STOP,
};
@@ -529,6 +530,11 @@ struct wined3d_cs_get_release_dc
@@ -530,6 +531,11 @@ struct wined3d_cs_get_release_dc
unsigned int sub_resource_idx;
};
@ -35,7 +35,7 @@ index d5b5715..d3bd368 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);
@@ -2654,6 +2660,28 @@ void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *t
@@ -2657,6 +2663,28 @@ void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *t
cs->ops->finish(cs);
}
@ -64,7 +64,7 @@ index d5b5715..d3bd368 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2721,6 +2749,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2724,6 +2752,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SRV_DESTROY */ wined3d_cs_exec_shader_resource_view_destroy,
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
@ -73,7 +73,7 @@ index d5b5715..d3bd368 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7000cd0..9483e49 100644
index bc2ffd8..2c93215 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -664,7 +664,7 @@ out:
@ -85,7 +85,7 @@ index 7000cd0..9483e49 100644
{
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -1036,17 +1036,15 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -1044,17 +1044,15 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
device->swapchains[0] = swapchain;
device_init_swapchain_state(device, swapchain);
@ -93,7 +93,7 @@ index 7000cd0..9483e49 100644
context = context_acquire(device, NULL);
-
- create_dummy_textures(device, context);
create_default_sampler(device);
create_default_samplers(device);
+ context_release(context);
device->contexts[0]->last_was_rhw = 0;
@ -111,14 +111,14 @@ index 7000cd0..9483e49 100644
swapchain->num_contexts = 1;
- create_dummy_textures(device, context);
+ device_create_dummy_textures(device, context);
create_default_sampler(device);
create_default_samplers(device);
context_release(context);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5363027..113ed8b 100644
index f61681d..41de5fb 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2406,7 +2406,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT
@@ -2417,7 +2417,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT
GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN;
void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo,
const struct wined3d_context *context) DECLSPEC_HIDDEN;
@ -127,7 +127,7 @@ index 5363027..113ed8b 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3085,6 +3085,7 @@ void wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *textu
@@ -3096,6 +3096,7 @@ void wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *textu
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 1a83dc9c72ae949e6d5a2e068a7ed0c4732ad3d6 Mon Sep 17 00:00:00 2001
From 9cf15a571fd8e6eb8ae5cbb7769827a09f6f7ff6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 10 Oct 2013 18:40:04 +0200
Subject: wined3d: Recreate ctx and dummy textures through the CS after resets.
@ -8,10 +8,10 @@ Subject: wined3d: Recreate ctx and dummy textures through the CS after resets.
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c36db50..32eb155 100644
index 2c93215..ed1bba1 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4522,7 +4522,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
@@ -4561,7 +4561,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
struct wined3d_context *context;
@ -19,7 +19,7 @@ index c36db50..32eb155 100644
HRESULT hr;
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
@@ -4539,29 +4538,17 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
@@ -4578,29 +4577,17 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
return hr;
}
@ -51,7 +51,7 @@ index c36db50..32eb155 100644
- device_create_dummy_textures(device, context);
+ wined3d_cs_emit_create_dummy_textures(device->cs);
+ context = context_acquire(device, NULL);
create_default_sampler(device);
create_default_samplers(device);
context_release(context);
--

View File

@ -1,43 +1,50 @@
From e88cf7ce51212f9001e4c4c92f0bf22b1e7e8015 Mon Sep 17 00:00:00 2001
From e55823e0bef6e6d5d9ff1bce222bc5b7853f18a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
Date: Sat, 7 May 2016 21:16:47 +0100
Subject: wined3d: Call create_default_sampler from create_dummy_textures.
I should really rename it, don't feel like it now.
---
dlls/wined3d/device.c | 62 +++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 34 deletions(-)
dlls/wined3d/device.c | 76 ++++++++++++++++++++++++---------------------------
1 file changed, 35 insertions(+), 41 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c58668e..938c56f 100644
index ed1bba1..2449d77 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -664,6 +664,32 @@ out:
@@ -664,6 +664,39 @@ out:
}
/* Context activation is done by the caller. */
+static void create_default_sampler(struct wined3d_device *device)
+static void create_default_samplers(struct wined3d_device *device)
+{
+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
+
+ /*
+ * In SM4+ shaders there is a separation between resources and samplers. Some shader
+ * instructions allow access to resources without using samplers.
+ * In GLSL, resources are always accessed through sampler or image variables. The default
+ * sampler object is used to emulate the direct resource access when there is no sampler state
+ * to use.
+ */
+ if (gl_info->supported[ARB_SAMPLER_OBJECTS])
+ {
+ /* In SM4+ shaders there is a separation between resources and samplers. Some shader
+ * instructions allow access to resources without using samplers.
+ * In GLSL, resources are always accessed through sampler or image variables. The default
+ * sampler object is used to emulate the direct resource access when there is no sampler state
+ * to use.
+ */
+ GL_EXTCALL(glGenSamplers(1, &device->default_sampler));
+ checkGLcall("glGenSamplers");
+ GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
+ GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST));
+ checkGLcall("glSamplerParameteri");
+ checkGLcall("Create default sampler");
+
+ /* In D3D10+, a NULL sampler maps to the default sampler state. */
+ GL_EXTCALL(glGenSamplers(1, &device->null_sampler));
+ GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR));
+ GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
+ GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
+ GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE));
+ checkGLcall("Create null sampler");
+ }
+ else
+ {
+ device->default_sampler = 0;
+ device->null_sampler = 0;
+ }
+}
+
@ -45,49 +52,56 @@ index c58668e..938c56f 100644
void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context)
{
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
@@ -756,6 +782,8 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_
@@ -756,6 +789,8 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_
checkGLcall("glTexImage3D");
}
}
+
+ create_default_sampler(device);
+ create_default_samplers(device);
}
/* Context activation is done by the caller. */
@@ -798,32 +826,6 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w
@@ -798,39 +833,6 @@ static void destroy_dummy_textures(struct wined3d_device *device, const struct w
}
/* Context activation is done by the caller. */
-static void create_default_sampler(struct wined3d_device *device)
-static void create_default_samplers(struct wined3d_device *device)
-{
- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
-
- /*
- * In SM4+ shaders there is a separation between resources and samplers. Some shader
- * instructions allow access to resources without using samplers.
- * In GLSL, resources are always accessed through sampler or image variables. The default
- * sampler object is used to emulate the direct resource access when there is no sampler state
- * to use.
- */
- if (gl_info->supported[ARB_SAMPLER_OBJECTS])
- {
- /* In SM4+ shaders there is a separation between resources and samplers. Some shader
- * instructions allow access to resources without using samplers.
- * In GLSL, resources are always accessed through sampler or image variables. The default
- * sampler object is used to emulate the direct resource access when there is no sampler state
- * to use.
- */
- GL_EXTCALL(glGenSamplers(1, &device->default_sampler));
- checkGLcall("glGenSamplers");
- GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
- GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST));
- checkGLcall("glSamplerParameteri");
- checkGLcall("Create default sampler");
-
- /* In D3D10+, a NULL sampler maps to the default sampler state. */
- GL_EXTCALL(glGenSamplers(1, &device->null_sampler));
- GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR));
- GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
- GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
- GL_EXTCALL(glSamplerParameteri(device->null_sampler, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE));
- checkGLcall("Create null sampler");
- }
- else
- {
- device->default_sampler = 0;
- device->null_sampler = 0;
- }
-}
-
-/* Context activation is done by the caller. */
static void destroy_default_sampler(struct wined3d_device *device)
static void destroy_default_samplers(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -977,7 +979,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -986,7 +988,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
{
static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
struct wined3d_swapchain *swapchain = NULL;
@ -95,17 +109,17 @@ index c58668e..938c56f 100644
DWORD clear_flags = 0;
HRESULT hr;
@@ -1036,9 +1037,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
@@ -1045,9 +1046,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
device_init_swapchain_state(device, swapchain);
wined3d_cs_emit_create_dummy_textures(device->cs);
- context = context_acquire(device, NULL);
- create_default_sampler(device);
- create_default_samplers(device);
- context_release(context);
device->contexts[0]->last_was_rhw = 0;
@@ -4546,7 +4544,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
@@ -4560,7 +4558,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
@ -113,12 +127,12 @@ index c58668e..938c56f 100644
HRESULT hr;
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
@@ -4573,9 +4570,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
@@ -4587,9 +4584,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
}
wined3d_cs_emit_create_dummy_textures(device->cs);
- context = context_acquire(device, NULL);
- create_default_sampler(device);
- create_default_samplers(device);
- context_release(context);
return WINED3D_OK;

View File

@ -1,4 +1,4 @@
From 935568ea47c8b7f316f0b03e816bebbc054230a5 Mon Sep 17 00:00:00 2001
From 64af5e64f6a40fd7ac7236476e19bd3dcd2a7ea0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 11 Oct 2013 10:17:42 +0200
Subject: wined3d: Delete GL contexts through the CS in uninit_3d.
@ -8,10 +8,10 @@ Subject: wined3d: Delete GL contexts through the CS in uninit_3d.
1 file changed, 3 insertions(+), 30 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 42afb1b..78b508f 100644
index 31421d3..6af2755 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1111,8 +1111,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context)
@@ -1122,8 +1122,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context)
HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
{
struct wined3d_resource *resource, *cursor;
@ -20,7 +20,7 @@ index 42afb1b..78b508f 100644
struct wined3d_surface *surface;
UINT i;
@@ -1124,12 +1122,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1135,12 +1133,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
if (wined3d_settings.cs_multithreaded)
device->cs->ops->finish(device->cs);
@ -33,7 +33,7 @@ index 42afb1b..78b508f 100644
if (device->logo_texture)
wined3d_texture_decref(device->logo_texture);
if (device->cursor_texture)
@@ -1161,31 +1153,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1172,31 +1164,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
TRACE("Unloading resource %p.\n", resource);
wined3d_cs_emit_evict_resource(device->cs, resource);
}
@ -55,7 +55,7 @@ index 42afb1b..78b508f 100644
- device->blitter->free_private(device);
- device->shader_backend->shader_free_private(device);
- destroy_dummy_textures(device, gl_info);
- destroy_default_sampler(device);
- destroy_default_samplers(device);
-
- /* Release the context again as soon as possible. In particular,
- * releasing the render target views below may release the last reference
@ -67,7 +67,7 @@ index 42afb1b..78b508f 100644
if (device->back_buffer_view)
{
@@ -4506,6 +4478,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine
@@ -4545,6 +4517,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->context = NULL;

File diff suppressed because it is too large Load Diff