Rebase against 1cc93e3f05bce5ae9758fad44f69f44e1462d81b.

This commit is contained in:
Sebastian Lackner
2017-02-23 14:23:18 +01:00
parent 4136b55f1c
commit 5b58419a0e
12 changed files with 536 additions and 655 deletions

View File

@@ -1,4 +1,4 @@
From cb83d4886548b66c4c4fd0c006c3eca43d134067 Mon Sep 17 00:00:00 2001
From 06958496811f70af6507c8de08347d3aac61057b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 29 Apr 2013 18:49:53 +0200
Subject: wined3d: Send blits through the command stream.
@@ -13,7 +13,7 @@ between surface_blt and surface_blt_ugly isn't particularly nice.
4 files changed, 228 insertions(+), 97 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 130478e8882..420a2cc8327 100644
index 9934b74e150..b563dfbd080 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -67,6 +67,7 @@ enum wined3d_cs_op
@@ -43,7 +43,7 @@ index 130478e8882..420a2cc8327 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1792,6 +1805,44 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1799,6 +1812,44 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
@@ -88,7 +88,7 @@ index 130478e8882..420a2cc8327 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1835,6 +1886,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1842,6 +1893,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
@@ -97,10 +97,10 @@ index 130478e8882..420a2cc8327 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 0b1b389af0b..6195122ff10 100644
index 335ff016cf3..f4cdb5d9c10 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4016,6 +4016,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4032,6 +4032,7 @@ 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;
@@ -108,7 +108,7 @@ index 0b1b389af0b..6195122ff10 100644
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",
@@ -4103,6 +4104,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4119,6 +4120,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
if (src_box)
{
@@ -123,7 +123,7 @@ index 0b1b389af0b..6195122ff10 100644
SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
}
else
@@ -4116,6 +4125,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4132,6 +4141,23 @@ 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));
@@ -148,10 +148,10 @@ index 0b1b389af0b..6195122ff10 100644
src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
WARN("Failed to blit, hr %#x.\n", hr);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 19d6aa74373..5b8434d63b8 100644
index 87cf6727cf5..8c5624c8787 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3794,7 +3794,7 @@ const struct blit_shader cpu_blit = {
@@ -3775,7 +3775,7 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@@ -160,7 +160,7 @@ index 19d6aa74373..5b8434d63b8 100644
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
{
@@ -3804,9 +3804,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3785,9 +3785,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_device *device = dst_texture->resource.device;
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
@@ -172,7 +172,7 @@ index 19d6aa74373..5b8434d63b8 100644
DWORD src_ds_flags, dst_ds_flags;
BOOL scale, convert;
@@ -3819,84 +3818,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3800,84 +3799,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
| WINED3D_BLT_DO_NOT_WAIT
| WINED3D_BLT_ALPHA_TEST;
@@ -262,7 +262,7 @@ index 19d6aa74373..5b8434d63b8 100644
}
if (!device->d3d_initialized)
@@ -3921,11 +3853,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3902,11 +3834,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
}
@@ -274,14 +274,14 @@ index 19d6aa74373..5b8434d63b8 100644
dst_swapchain = dst_texture->swapchain;
/* This isn't strictly needed. FBO blits for example could deal with
@@ -3961,22 +3888,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3942,22 +3869,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->fill_color, &depth))
if (!wined3d_format_convert_color_to_float(dst_texture->resource.format, NULL, fx->fill_color, &color))
- return WINED3DERR_INVALIDCALL;
+ return;
if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth)))
if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, color.r)))
- return WINED3D_OK;
+ return;
}
@@ -300,7 +300,7 @@ index 19d6aa74373..5b8434d63b8 100644
}
}
else
@@ -4012,7 +3933,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3993,7 +3914,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color)))
@@ -309,7 +309,7 @@ index 19d6aa74373..5b8434d63b8 100644
}
else
{
@@ -4056,7 +3977,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4037,7 +3958,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
context, dst_texture->resource.draw_binding);
context_release(context);
}
@@ -318,7 +318,7 @@ index 19d6aa74373..5b8434d63b8 100644
}
}
}
@@ -4080,7 +4001,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4061,7 +3982,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@@ -327,7 +327,7 @@ index 19d6aa74373..5b8434d63b8 100644
}
if (fbo_blit_supported(&device->adapter->gl_info, blit_op,
@@ -4101,7 +4022,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4082,7 +4003,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx,
~dst_texture->resource.draw_binding);
@@ -336,7 +336,7 @@ index 19d6aa74373..5b8434d63b8 100644
}
blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
@@ -4111,7 +4032,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4092,7 +4013,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
{
blitter->blit_surface(device, blit_op, filter, src_surface,
src_rect, dst_surface, dst_rect, color_key);
@@ -345,7 +345,7 @@ index 19d6aa74373..5b8434d63b8 100644
}
}
}
@@ -4119,9 +4040,134 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4100,9 +4021,134 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
fallback:
/* Special cases for render targets. */
if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter)))
@@ -483,10 +483,10 @@ index 19d6aa74373..5b8434d63b8 100644
+ return WINED3D_OK;
+}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b04d2f502bf..be01b6f3b6a 100644
index 6fcfdcbe05c..a2663a10b82 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3038,6 +3038,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -3047,6 +3047,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
@@ -496,7 +496,7 @@ index b04d2f502bf..be01b6f3b6a 100644
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -3190,6 +3193,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID
@@ -3199,6 +3202,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;

View File

@@ -1,4 +1,4 @@
From a1ebeac4b7804415c3b1fd48f79fcf574576c645 Mon Sep 17 00:00:00 2001
From 966ef73fc86a013fafb0ed3491d6347e4224b504 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 30 Aug 2013 17:00:35 +0200
Subject: wined3d: Wrap GL BOs in a structure
@@ -13,10 +13,10 @@ them for DISCARD maps.
4 files changed, 92 insertions(+), 34 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3e4a1790946..bd3a132c496 100644
index 1c424d517bb..18695774bc8 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5154,3 +5154,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -5169,3 +5169,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@@ -74,10 +74,10 @@ index 3e4a1790946..bd3a132c496 100644
+ wined3d_device_destroy_bo(device, context, bo);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5b8434d63b8..33a0ecf0327 100644
index 8c5624c8787..e641dcc8b80 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2809,7 +2809,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -2801,7 +2801,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
/* Don't use PBOs for converted surfaces. During PBO conversion we look at
* WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is
* getting called. */
@@ -87,7 +87,7 @@ index 5b8434d63b8..33a0ecf0327 100644
TRACE("Removing the pbo attached to surface %p.\n", surface);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index de118e4d564..bff7452e773 100644
index 7dc0f096f77..2d3d51f0489 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -337,7 +337,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
@@ -167,7 +167,7 @@ index de118e4d564..bff7452e773 100644
}
if (context)
context_release(context);
@@ -1325,22 +1321,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -1327,22 +1323,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
/* Context activation is done by the caller. */
static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
@@ -195,7 +195,7 @@ index de118e4d564..bff7452e773 100644
}
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
@@ -1466,7 +1459,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -1468,7 +1461,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
return TRUE;
case WINED3D_LOCATION_BUFFER:
@@ -204,7 +204,7 @@ index de118e4d564..bff7452e773 100644
return TRUE;
case WINED3D_LOCATION_TEXTURE_RGB:
@@ -1766,7 +1759,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1768,7 +1761,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
@@ -213,7 +213,7 @@ index de118e4d564..bff7452e773 100644
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
@@ -1811,7 +1804,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1813,7 +1806,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
case WINED3D_LOCATION_BUFFER:
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
@@ -222,7 +222,7 @@ index de118e4d564..bff7452e773 100644
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -2105,8 +2098,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
@@ -2107,8 +2100,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
}
@@ -233,7 +233,7 @@ index de118e4d564..bff7452e773 100644
if (resource->type == WINED3D_RTYPE_TEXTURE_2D)
{
@@ -2904,7 +2897,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -2906,7 +2899,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
@@ -242,7 +242,7 @@ index de118e4d564..bff7452e773 100644
wined3d_texture_bind_and_dirtify(texture, context,
location == WINED3D_LOCATION_TEXTURE_SRGB);
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
@@ -2950,7 +2943,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -2952,7 +2945,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
case WINED3D_LOCATION_BUFFER:
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
@@ -252,10 +252,10 @@ index de118e4d564..bff7452e773 100644
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7cabc276a0b..e4474a7b2c5 100644
index 834a681f6a4..6204fc3915d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2560,6 +2560,14 @@ struct wined3d_state
@@ -2571,6 +2571,14 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};
@@ -267,10 +267,10 @@ index 7cabc276a0b..e4474a7b2c5 100644
+ UINT size;
+};
+
#define WINED3D_UNMAPPED_STAGE ~0U
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -2673,6 +2681,10 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -2684,6 +2692,10 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN;
@@ -281,7 +281,7 @@ index 7cabc276a0b..e4474a7b2c5 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2863,7 +2875,7 @@ struct wined3d_texture
@@ -2874,7 +2886,7 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;

View File

@@ -1,4 +1,4 @@
From 5d3ab1ff100c046961cbe2ccc7da231b845a1b5b Mon Sep 17 00:00:00 2001
From a6f17f1f44e34d5a4658aa6d772e6c6283f5d98e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 20 Dec 2012 13:09:17 +0100
Subject: wined3d: Move the framebuffer into wined3d_state
@@ -19,7 +19,7 @@ Subject: wined3d: Move the framebuffer into wined3d_state
12 files changed, 182 insertions(+), 126 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 24dcb05d341..b5aa1037d77 100644
index 18721005bc6..7879c6a2f7f 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -701,7 +701,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
@@ -31,7 +31,7 @@ index 24dcb05d341..b5aa1037d77 100644
/* Load DirectX 9 float constants for pixel shader */
priv->highest_dirty_ps_const = shader_arb_load_constants_f(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB,
@@ -4610,7 +4610,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
@@ -4608,7 +4608,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
}
else
{
@@ -41,7 +41,7 @@ index 24dcb05d341..b5aa1037d77 100644
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 0115f1ba6da..bb65538ad7b 100644
index 511b1bd4216..8aa2a77a171 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1720,6 +1720,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
@@ -56,23 +56,23 @@ index 0115f1ba6da..bb65538ad7b 100644
/* Initialize the texture unit mapping to a 1:1 mapping */
for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s)
{
@@ -2028,6 +2033,7 @@ out:
if (hdc) wined3d_release_dc(swapchain->win_handle, hdc);
@@ -2032,6 +2037,7 @@ out:
device->shader_backend->shader_free_context_data(ret);
device->adapter->fragment_pipe->free_context_data(ret);
HeapFree(GetProcessHeap(), 0, ret->texture_type);
+ HeapFree(GetProcessHeap(), 0, ret->current_fb.render_targets);
HeapFree(GetProcessHeap(), 0, ret->free_event_queries);
HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries);
HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries);
@@ -2075,6 +2081,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
device->shader_backend->shader_free_context_data(context);
@@ -2080,6 +2086,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
device->adapter->fragment_pipe->free_context_data(context);
HeapFree(GetProcessHeap(), 0, context->texture_type);
HeapFree(GetProcessHeap(), 0, context->fbo_key);
+ HeapFree(GetProcessHeap(), 0, context->current_fb.render_targets);
HeapFree(GetProcessHeap(), 0, context->draw_buffers);
HeapFree(GetProcessHeap(), 0, context->blit_targets);
device_context_remove(device, context);
@@ -2637,7 +2644,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2642,7 +2649,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
DWORD rt_mask = 0, *cur_mask;
UINT i;
@@ -81,7 +81,7 @@ index 0115f1ba6da..bb65538ad7b 100644
|| rt_count != gl_info->limits.buffers)
{
if (!context_validate_rt_config(rt_count, rts, dsv))
@@ -2682,6 +2689,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2687,6 +2694,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
rt_mask = context_generate_rt_mask_no_fbo(context,
rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL);
}
@@ -90,7 +90,7 @@ index 0115f1ba6da..bb65538ad7b 100644
}
else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
&& (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource)))
@@ -2738,7 +2747,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
@@ -2743,7 +2752,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state)
{
@@ -99,7 +99,7 @@ index 0115f1ba6da..bb65538ad7b 100644
struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL];
DWORD rt_mask, rt_mask_bits;
unsigned int i;
@@ -2768,7 +2777,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
@@ -2773,7 +2782,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const
void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
DWORD rt_mask = find_draw_buffers_mask(context, state);
@@ -108,7 +108,7 @@ index 0115f1ba6da..bb65538ad7b 100644
DWORD *cur_mask;
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
@@ -3057,6 +3066,8 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d
@@ -3056,6 +3065,8 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d
context_apply_draw_buffers(context, rt_mask);
*cur_mask = rt_mask;
}
@@ -117,17 +117,17 @@ index 0115f1ba6da..bb65538ad7b 100644
}
static BOOL fixed_get_input(BYTE usage, BYTE usage_idx, unsigned int *regnum)
@@ -3501,7 +3512,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context,
const struct wined3d_device *device, const struct wined3d_state *state)
@@ -3528,7 +3539,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context,
{
const struct StateEntry *state_table = context->state_table;
const struct wined3d_gl_info *gl_info = context->gl_info;
- const struct wined3d_fb_state *fb = state->fb;
+ const struct wined3d_fb_state *fb = &state->fb;
unsigned int i;
WORD map;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 381b7ca30ac..54b81f74f64 100644
index a6ee6dda110..5606c73c10b 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -510,7 +510,7 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -238,7 +238,7 @@ index 381b7ca30ac..54b81f74f64 100644
if (!prev != !op->view)
{
@@ -1561,11 +1561,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1650,11 +1650,13 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
{
struct wined3d_adapter *adapter = cs->device->adapter;
@@ -254,7 +254,7 @@ index 381b7ca30ac..54b81f74f64 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -2356,15 +2358,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2362,15 +2364,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@@ -272,7 +272,7 @@ index 381b7ca30ac..54b81f74f64 100644
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@@ -2372,7 +2372,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2378,7 +2378,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
{
state_cleanup(&cs->state);
@@ -280,7 +280,7 @@ index 381b7ca30ac..54b81f74f64 100644
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -2383,7 +2382,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2389,7 +2388,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
void wined3d_cs_destroy(struct wined3d_cs *cs)
{
state_cleanup(&cs->state);
@@ -289,7 +289,7 @@ index 381b7ca30ac..54b81f74f64 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 625357e4407..62abafd4125 100644
index 914b99c3d29..78ba0435323 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -957,7 +957,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
@@ -376,7 +376,7 @@ index 625357e4407..62abafd4125 100644
device->d3d_initialized = FALSE;
return WINED3D_OK;
@@ -1950,7 +1925,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
@@ -1949,7 +1924,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
|| !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH))
return;
@@ -385,7 +385,7 @@ index 625357e4407..62abafd4125 100644
return;
if (src_view->resource->type == WINED3D_RTYPE_BUFFER)
{
@@ -3472,6 +3447,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3487,6 +3462,8 @@ 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)
{
@@ -394,7 +394,7 @@ index 625357e4407..62abafd4125 100644
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);
@@ -3483,7 +3460,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3498,7 +3475,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
{
@@ -403,7 +403,7 @@ index 625357e4407..62abafd4125 100644
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3492,8 +3469,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3507,8 +3484,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
}
else if (flags & WINED3DCLEAR_TARGET)
{
@@ -414,7 +414,7 @@ index 625357e4407..62abafd4125 100644
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3843,8 +3820,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
@@ -3858,8 +3835,8 @@ 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])
{
@@ -425,7 +425,7 @@ index 625357e4407..62abafd4125 100644
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -4279,20 +4256,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
@@ -4294,20 +4271,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
return NULL;
}
@@ -449,7 +449,7 @@ index 625357e4407..62abafd4125 100644
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4329,13 +4307,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4344,13 +4322,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
}
@@ -465,7 +465,7 @@ index 625357e4407..62abafd4125 100644
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. */
@@ -4347,18 +4325,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4362,18 +4340,19 @@ 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)
{
@@ -487,7 +487,7 @@ index 625357e4407..62abafd4125 100644
wined3d_rendertarget_view_incref(view);
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
@@ -4624,10 +4603,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4639,10 +4618,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_texture_decref(device->cursor_texture);
device->cursor_texture = NULL;
}
@@ -499,7 +499,7 @@ index 625357e4407..62abafd4125 100644
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4638,6 +4616,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4653,6 +4631,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (reset_state)
{
@@ -511,7 +511,7 @@ index 625357e4407..62abafd4125 100644
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Enumerating resource %p.\n", resource);
@@ -4806,27 +4789,28 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4821,27 +4804,28 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (device->d3d_initialized)
wined3d_device_delete_opengl_contexts(device);
@@ -547,7 +547,7 @@ index 625357e4407..62abafd4125 100644
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -4918,11 +4902,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -4933,11 +4917,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -561,7 +561,7 @@ index 625357e4407..62abafd4125 100644
ERR("Resource %p is still in use as depth/stencil buffer.\n", resource);
}
@@ -5048,8 +5032,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
@@ -5063,8 +5047,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device->blitter = adapter->blitter;
@@ -590,7 +590,7 @@ index 48421ef545e..d8f2ad17f2e 100644
struct wined3d_event_query *ib_query = NULL;
struct wined3d_rendertarget_view *dsv, *rtv;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 16cdd28a18d..b5d64421b42 100644
index e503d224655..ad3ef2672cf 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1630,7 +1630,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -603,10 +603,10 @@ index 16cdd28a18d..b5d64421b42 100644
0.0f,
0.0f,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 6f012cd8953..7bb43754279 100644
index 519d0293357..7230ab6453f 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -3267,7 +3267,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
@@ -3271,7 +3271,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
UINT i;
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
@@ -616,7 +616,7 @@ index 6f012cd8953..7bb43754279 100644
static unsigned int warned = 0;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 0d6d83af7c3..dad58208c79 100644
index 04a1c84b203..dff3d050b10 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -152,7 +152,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
@@ -679,7 +679,7 @@ index 0d6d83af7c3..dad58208c79 100644
float scale;
union
@@ -4637,8 +4637,8 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
@@ -4635,8 +4635,8 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@@ -690,7 +690,7 @@ index 0d6d83af7c3..dad58208c79 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
unsigned int width, height;
@@ -4677,8 +4677,8 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine
@@ -4675,8 +4675,8 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine
static void viewport_miscpart_cc(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id)
{
@@ -701,7 +701,7 @@ index 0d6d83af7c3..dad58208c79 100644
float pixel_center_offset = context->d3d_info->wined3d_creation_flags
& WINED3D_PIXEL_CENTER_INTEGER ? 0.5f : 0.0f;
const struct wined3d_gl_info *gl_info = context->gl_info;
@@ -4873,7 +4873,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
@@ -4871,7 +4871,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
}
else
{
@@ -710,7 +710,7 @@ index 0d6d83af7c3..dad58208c79 100644
UINT height;
UINT width;
@@ -4949,7 +4949,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
@@ -4947,7 +4947,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
@@ -820,10 +820,10 @@ index ad347082c4d..a823ccb3168 100644
if (type == WINED3D_SBT_RECORDED)
return WINED3D_OK;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 33a0ecf0327..8d8142204ca 100644
index e641dcc8b80..086bd2d7403 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2518,7 +2518,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
@@ -2487,7 +2487,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
{
struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_device *device = dst_texture->resource.device;
@@ -833,10 +833,10 @@ index 33a0ecf0327..8d8142204ca 100644
struct wined3d_texture *src_texture;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 48879bcd6a0..4b737ade91b 100644
index 04ff2f7b50e..cd210b9f9b7 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4640,7 +4640,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
@@ -4642,7 +4642,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
float y_offset = flip
? (center_offset - (2.0f * y) - h) / h
: (center_offset - (2.0f * y) - h) / -h;
@@ -845,7 +845,7 @@ index 48879bcd6a0..4b737ade91b 100644
state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE;
float z_scale = zenable ? clip_control ? 1.0f : 2.0f : 0.0f;
float z_offset = zenable ? clip_control ? 0.0f : -1.0f : 0.0f;
@@ -5439,7 +5439,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
@@ -5454,7 +5454,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
break;
}
}
@@ -855,10 +855,10 @@ index 48879bcd6a0..4b737ade91b 100644
|| !state->render_states[WINED3D_RS_CLIPPLANEENABLE])
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2b7b658a162..7d921011577 100644
index f384e6b7ae5..c9b40b190db 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1555,6 +1555,36 @@ struct wined3d_timestamp_query
@@ -1560,6 +1560,36 @@ struct wined3d_timestamp_query
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
@@ -895,7 +895,7 @@ index 2b7b658a162..7d921011577 100644
struct wined3d_context
{
const struct wined3d_gl_info *gl_info;
@@ -1570,6 +1600,7 @@ struct wined3d_context
@@ -1575,6 +1605,7 @@ struct wined3d_context
DWORD numDirtyEntries;
DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */
unsigned int dirty_compute_states[STATE_COMPUTE_COUNT / (sizeof(unsigned int) * CHAR_BIT) + 1];
@@ -903,7 +903,7 @@ index 2b7b658a162..7d921011577 100644
struct wined3d_device *device;
struct wined3d_swapchain *swapchain;
@@ -1683,12 +1714,6 @@ struct wined3d_context
@@ -1689,12 +1720,6 @@ struct wined3d_context
GLuint dummy_arbfp_prog;
};
@@ -916,7 +916,7 @@ index 2b7b658a162..7d921011577 100644
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
struct StateEntry
@@ -2512,7 +2537,7 @@ struct wined3d_stream_state
@@ -2523,7 +2548,7 @@ struct wined3d_stream_state
struct wined3d_state
{
DWORD flags;
@@ -925,7 +925,7 @@ index 2b7b658a162..7d921011577 100644
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2626,7 +2651,6 @@ struct wined3d_device
@@ -2637,7 +2662,6 @@ struct wined3d_device
struct wine_rb_tree samplers;
/* Render Target Support */
@@ -933,7 +933,7 @@ index 2b7b658a162..7d921011577 100644
struct wined3d_rendertarget_view *auto_depth_stencil_view;
/* Cursor management */
@@ -3171,9 +3195,8 @@ void wined3d_state_enable_light(struct wined3d_state *state, const struct wined3
@@ -3182,9 +3206,8 @@ void wined3d_state_enable_light(struct wined3d_state *state, const struct wined3
struct wined3d_light_info *light_info, BOOL enable) DECLSPEC_HIDDEN;
struct wined3d_light_info *wined3d_state_get_light(const struct wined3d_state *state,
unsigned int idx) DECLSPEC_HIDDEN;
@@ -945,7 +945,7 @@ index 2b7b658a162..7d921011577 100644
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
enum wined3d_push_constants
@@ -3197,7 +3220,6 @@ struct wined3d_cs
@@ -3208,7 +3231,6 @@ struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;

File diff suppressed because it is too large Load Diff