Rebase against 23a64ca074021bfda46f6287aaa529d6e8f66774.

This commit is contained in:
Sebastian Lackner 2016-08-31 21:51:53 +02:00
parent 6b3228a788
commit 938ffad317
3 changed files with 59 additions and 59 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "002af352fac43d170aad216bf15098b27555539a"
echo "23a64ca074021bfda46f6287aaa529d6e8f66774"
}
# Show version information

View File

@ -1,4 +1,4 @@
From b420f43ff0cb17ce349423ac26792ea5087052d5 Mon Sep 17 00:00:00 2001
From b755a1895117b41fdc6146151609f1f093f42d9f 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
@ -97,12 +97,12 @@ index 020c1a3..69f60d6 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 8da60ad..cf375ea 100644
index 76749cd..f70a6e0 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
return hr;
@@ -2982,6 +2982,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
}
dest_ptr = map_desc.data;
+ if (wined3d_settings.cs_multithreaded)
+ {
@ -114,7 +114,7 @@ index 8da60ad..cf375ea 100644
wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat);
wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat);
wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat);
@@ -3715,6 +3722,13 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3748,6 +3755,13 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
++src_skip_levels;
}
@ -128,7 +128,7 @@ index 8da60ad..cf375ea 100644
/* Make sure that the destination texture is loaded. */
context = context_acquire(device, NULL);
wined3d_texture_load(dst_texture, context, FALSE);
@@ -4245,6 +4259,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
@@ -4278,6 +4292,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
return WINED3DERR_INVALIDCALL;
}
@ -142,7 +142,7 @@ index 8da60ad..cf375ea 100644
if (blit_op == WINED3D_BLIT_OP_COLOR_FILL)
return blitter->color_fill(device, view, rect, color);
else
@@ -4683,6 +4704,12 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4716,6 +4737,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 +174,10 @@ index a2d2106..7618bf2 100644
{
WARN("D3D not initialized, using fallback.\n");
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 1e34cd7..e804ac2 100644
index c8b181b..a9e46c1 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1803,6 +1803,13 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
@@ -2146,6 +2146,13 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
return WINED3DERR_INVALIDCALL;
}
@ -191,7 +191,7 @@ index 1e34cd7..e804ac2 100644
flags = wined3d_resource_sanitize_map_flags(resource, flags);
if (device->d3d_initialized)
@@ -2962,6 +2969,13 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
@@ -3429,6 +3436,13 @@ 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;
@ -206,10 +206,10 @@ index 1e34cd7..e804ac2 100644
context = context_acquire(device, NULL);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ca58fec..7044b97 100644
index 1e1bd5d..b664b50 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3077,6 +3077,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
@@ -3079,6 +3079,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;

View File

@ -66,7 +66,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader
shader_arb_ps_local_constants(compiled, context, state, rt_height);
}
@@ -8017,8 +8041,16 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
@@ -7999,8 +8023,16 @@ 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);
@ -3988,9 +3988,9 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -2982,6 +3179,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
return hr;
@@ -2987,6 +3184,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
}
dest_ptr = map_desc.data;
+#if defined(STAGING_CSMT)
+ if (wined3d_settings.cs_multithreaded)
@ -4004,7 +4004,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat);
wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat);
wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat);
@@ -3543,8 +3749,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
@@ -3548,8 +3754,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
{
@ -4015,7 +4015,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p.\n", device);
if (!device->inScene)
@@ -3553,6 +3761,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3558,6 +3766,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
return WINED3DERR_INVALIDCALL;
}
@ -4023,7 +4023,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
context = context_acquire(device, NULL);
/* We only have to do this if we need to read the, swapbuffers performs a flush for us */
context->gl_info->gl_ops.gl.p_glFlush();
@@ -3560,6 +3769,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3565,6 +3774,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
* fails. */
context_release(context);
@ -4031,7 +4031,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->inScene = FALSE;
return WINED3D_OK;
}
@@ -3567,6 +3777,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3572,6 +3782,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
@ -4042,7 +4042,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n",
device, rect_count, rects, flags, debug_color(color), depth, stencil);
@@ -3578,7 +3792,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3583,7 +3797,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
{
@ -4054,7 +4054,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3587,8 +3805,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3592,8 +3810,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
}
else if (flags & WINED3DCLEAR_TARGET)
{
@ -4068,7 +4068,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3634,7 +3857,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
@@ -3639,7 +3862,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
enum wined3d_primitive_type primitive_type)
{
GLenum gl_primitive_type, prev;
@ -4078,7 +4078,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type));
gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
@@ -3642,8 +3867,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
@@ -3647,8 +3872,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
device->update_state->gl_primitive_type = gl_primitive_type;
if (device->recording)
device->recording->changed.primitive_type = TRUE;
@ -4092,7 +4092,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device,
@@ -3703,10 +3933,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3708,10 +3938,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
start_idx, index_count, start_instance, instance_count, TRUE);
}
@ -4109,7 +4109,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_const_bo_address data;
struct wined3d_context *context;
struct wined3d_map_desc src;
@@ -3731,6 +3967,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@@ -3736,6 +3972,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
}
context = context_acquire(device, NULL);
@ -4124,7 +4124,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Only a prepare, since we're uploading entire volumes. */
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
@@ -3738,6 +3982,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@@ -3743,6 +3987,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
for (i = 0; i < level_count; ++i)
{
@ -4132,7 +4132,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (FAILED(hr = wined3d_resource_map(&src_texture->resource,
src_level + i, &src, NULL, WINED3D_MAP_READONLY)))
goto done;
@@ -3754,16 +3999,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@@ -3759,16 +4004,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
done:
context_release(context);
return hr;
@ -4227,7 +4227,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
@@ -3800,6 +4123,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3805,6 +4128,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
@ -4235,7 +4235,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
level_count = min(wined3d_texture_get_level_count(src_texture),
wined3d_texture_get_level_count(dst_texture));
@@ -3822,9 +4146,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3827,9 +4151,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
context_release(context);
/* Update every surface level of the texture. */
@ -4257,7 +4257,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
unsigned int src_levels = src_texture->level_count;
unsigned int dst_levels = dst_texture->level_count;
@@ -3857,6 +4193,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3862,6 +4198,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
FIXME("Unsupported texture type %#x.\n", type);
return WINED3DERR_INVALIDCALL;
}
@ -4296,7 +4296,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
@@ -3904,8 +4272,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
@@ -3909,8 +4277,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
@ -4310,7 +4310,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -4094,6 +4467,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4099,6 +4472,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
struct wined3d_texture *dst_texture, *src_texture;
RECT dst_rect, src_rect;
HRESULT hr;
@ -4320,7 +4320,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, "
"src_resource %p, src_sub_resource_idx %u, src_box %s.\n",
@@ -4181,6 +4557,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4186,6 +4562,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
if (src_box)
{
@ -4337,7 +4337,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
}
else
@@ -4194,6 +4580,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4199,6 +4585,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left),
dst_y + (src_rect.bottom - src_rect.top));
@ -4363,7 +4363,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect,
src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
WARN("Failed to blit, hr %#x.\n", hr);
@@ -4206,6 +4611,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4211,6 +4616,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
unsigned int depth_pitch)
{
struct wined3d_texture_sub_resource *sub_resource;
@ -4371,7 +4371,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
const struct wined3d_gl_info *gl_info;
struct wined3d_const_bo_address addr;
unsigned int width, height, level;
@@ -4214,6 +4620,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4219,6 +4625,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
struct wined3d_surface *surface;
POINT dst_point;
RECT src_rect;
@ -4381,7 +4381,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n",
device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch);
@@ -4247,6 +4656,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4252,6 +4661,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
return;
}
@ -4389,7 +4389,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
surface = sub_resource->u.surface;
level = sub_resource_idx % texture->level_count;
@@ -4257,6 +4667,17 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4262,6 +4672,17 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
src_rect.top = 0;
if (box)
{
@ -4407,7 +4407,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (box->left >= box->right || box->right > width
|| box->top >= box->bottom || box->bottom > height
|| box->front >= box->back)
@@ -4264,6 +4685,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4269,6 +4690,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
WARN("Invalid box %s specified.\n", debug_box(box));
return;
}
@ -4415,7 +4415,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
src_rect.right = box->right - box->left;
src_rect.bottom = box->bottom - box->top;
@@ -4298,6 +4720,11 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4303,6 +4725,11 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
@ -4427,7 +4427,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
@@ -4306,8 +4733,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
@@ -4311,8 +4738,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
{
const struct blit_shader *blitter;
struct wined3d_resource *resource;
@ -4441,7 +4441,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n",
device, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil);
@@ -4346,10 +4778,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
@@ -4351,10 +4783,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
return WINED3DERR_INVALIDCALL;
}
@ -4457,7 +4457,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
@@ -4363,20 +4800,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
@@ -4368,20 +4805,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
return NULL;
}
@ -4489,7 +4489,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4413,13 +4861,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4418,13 +4866,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
}
@ -4511,7 +4511,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
@@ -4431,18 +4887,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4436,18 +4892,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -4541,7 +4541,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_rendertarget_view_incref(view);
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
@@ -4676,19 +5143,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
@@ -4681,19 +5148,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
}
}
@ -4568,7 +4568,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry)
{
device->shader_backend->shader_destroy(shader);
@@ -4717,12 +5191,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
@@ -4722,12 +5196,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->context = NULL;
@ -4599,7 +4599,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
HRESULT hr;
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
@@ -4739,6 +5231,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
@@ -4744,6 +5236,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
return hr;
}
@ -4607,7 +4607,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Recreate the primary swapchain's context */
swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context));
if (!swapchain->context)
@@ -4751,10 +5244,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
@@ -4756,10 +5249,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer;
if (!(context = context_create(swapchain, target, swapchain->ds_format)))
@ -4623,7 +4623,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
HeapFree(GetProcessHeap(), 0, swapchain->context);
return E_FAIL;
}
@@ -4764,6 +5262,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
@@ -4769,6 +5267,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
create_dummy_textures(device, context);
create_default_samplers(device);
context_release(context);
@ -4636,7 +4636,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -4782,6 +5286,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4787,6 +5291,14 @@ 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);
@ -4651,7 +4651,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!(swapchain = wined3d_device_get_swapchain(device, 0)))
{
ERR("Failed to get the first implicit swapchain.\n");
@@ -4800,10 +5312,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4805,10 +5317,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_texture_decref(device->cursor_texture);
device->cursor_texture = NULL;
}
@ -4668,7 +4668,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4812,10 +5330,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4817,10 +5335,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -4691,7 +4691,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
if (reset_state)
@@ -4980,27 +5510,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4985,27 +5515,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (device->d3d_initialized)
delete_opengl_contexts(device, swapchain);
@ -4740,7 +4740,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -5008,7 +5559,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -5013,7 +5564,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
{
if (reset_state)
hr = create_primary_opengl_context(device, swapchain);
@ -4752,7 +4752,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
/* All done. There is no need to reload resources or shaders, this will happen automatically on the
@@ -5090,11 +5645,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -5095,11 +5650,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -4772,7 +4772,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
ERR("Resource %p is still in use as depth/stencil buffer.\n", resource);
switch (type)
@@ -5231,8 +5794,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
@@ -5232,8 +5795,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device->blitter = adapter->blitter;
@ -4790,7 +4790,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->update_state = &device->state;
if (!(device->cs = wined3d_cs_create(device)))
@@ -5326,3 +5898,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -5327,3 +5899,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}