Rebase against ca9001d6bda3084ab9bc80baa7d6e5533252c797.

This commit is contained in:
Sebastian Lackner 2015-12-13 00:19:03 +01:00
parent 42da4b38cc
commit 84730be30e
8 changed files with 190 additions and 183 deletions

View File

@ -34,11 +34,6 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [1]:**
* Fix regression caused by blacklisting supported OpenGL extensions ([Wine Bug #39769](https://bugs.winehq.org/show_bug.cgi?id=39769))
**Bug fixes and features in Wine Staging 1.8-rc3 [269]:**
*Note: The following list only contains features and bug fixes which are not

View File

@ -1,21 +1,19 @@
From 95821cbad0ce5df59fcb591e5aab9459a388321e Mon Sep 17 00:00:00 2001
From 2db198094888b7de074fcac0f27758364d07ef55 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 10 Apr 2015 08:17:22 +0200
Subject: Revert "opengl32: Return a NULL pointer for functions requiring
unsupported or disabled extensions."
This reverts commit bfd4836867d6d90eaeae6ccbc02e37678b59b8f1 and
5c9ddc55dcf6e64d747b1a8ab01e408d4b8d55e1 and
e44f8eaa0fce02032e6c3f43052821f40eaba53b.
This reverts commit bfd4836867d6d90eaeae6ccbc02e37678b59b8f1 and following changes.
---
dlls/opengl32/wgl.c | 16 ----------------
1 file changed, 16 deletions(-)
dlls/opengl32/wgl.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 3b817a4..75d3796 100644
index f3f78ef..75d3796 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -877,23 +877,7 @@ PROC WINAPI wglGetProcAddress( LPCSTR name )
@@ -877,24 +877,7 @@ PROC WINAPI wglGetProcAddress( LPCSTR name )
void *driver_func = funcs->wgl.p_wglGetProcAddress( name );
if (!is_extension_supported(ext_ret->extension))
@ -23,18 +21,19 @@ index 3b817a4..75d3796 100644
- unsigned int i;
- static const struct { const char *name, *alt; } alternatives[] =
- {
- { "glCopyTexSubImage3DEXT", "glCopyTexSubImage3D" }, /* needed by RuneScape */
- { "glCopyTexSubImage3DEXT", "glCopyTexSubImage3D" }, /* needed by RuneScape */
- { "glVertexAttribDivisor", "glVertexAttribDivisorARB"}, /* needed by Caffeine */
- };
-
WARN("Extension %s required for %s not supported\n", ext_ret->extension, name);
- driver_func = NULL;
-
- for (i = 0; i < sizeof(alternatives)/sizeof(alternatives[0]) && !driver_func; i++)
- for (i = 0; i < sizeof(alternatives)/sizeof(alternatives[0]); i++)
- {
- if (strcmp( name, alternatives[i].name )) continue;
- WARN("Trying alternative %s for %s\n", alternatives[i].alt, name );
- driver_func = wglGetProcAddress( alternatives[i].alt );
- WARN("Extension %s required for %s not supported, trying %s\n",
- ext_ret->extension, name, alternatives[i].alt );
- return wglGetProcAddress( alternatives[i].alt );
- }
WARN("Extension %s required for %s not supported\n", ext_ret->extension, name);
- return NULL;
- }
if (driver_func == NULL)

View File

@ -1,2 +1 @@
Fixes: [39769] Fix regression caused by blacklisting supported OpenGL extensions
Category: stable

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "97ac9d410fdd612db863fdccc538d8dd8d94d91a"
echo "ca9001d6bda3084ab9bc80baa7d6e5533252c797"
}
# Show version information
@ -4797,9 +4797,6 @@ fi
# Patchset opengl32-Revert_Disable_Ext
# |
# | This patchset fixes the following Wine bugs:
# | * [#39769] Fix regression caused by blacklisting supported OpenGL extensions
# |
# | Modified files:
# | * dlls/opengl32/wgl.c
# |

View File

@ -1,4 +1,4 @@
From 295469bf469171a96412e3b336a960b86d639b94 Mon Sep 17 00:00:00 2001
From 5fd25633a2e78ad336af898e466f4afc2e2ab1a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 12:22:30 +0100
Subject: wined3d: Move surface locations into the resource.
@ -12,10 +12,10 @@ Subject: wined3d: Move surface locations into the resource.
5 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 2af9845..e8526d8 100644
index 6851620..28939c0 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7851,7 +7851,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
@@ -7844,7 +7844,7 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@ -60,7 +60,7 @@ index 3761830..943a829 100644
else
SetRectEmpty(&current_rect);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6490235..50282c0 100644
index 94934a5..c971031 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
@ -391,7 +391,7 @@ index 6490235..50282c0 100644
surface_evict_sysmem(surface);
return;
@@ -5372,8 +5373,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5382,8 +5383,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
@ -402,9 +402,9 @@ index 6490235..50282c0 100644
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5413,8 +5414,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
color_key = &src_surface->container->async.src_blt_color_key;
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY;
@@ -5427,8 +5428,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
{
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST;
}
- else if ((src_surface->locations & WINED3D_LOCATION_SYSMEM)
- && !(dst_surface->locations & WINED3D_LOCATION_SYSMEM))
@ -414,10 +414,10 @@ index 6490235..50282c0 100644
/* Upload */
if (scale)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6c6a3d3..87cd0d0 100644
index 93ede78..91a5495 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2407,7 +2407,6 @@ struct wined3d_surface
@@ -2409,7 +2409,6 @@ struct wined3d_surface
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
void *user_memory;

View File

@ -1,4 +1,4 @@
From d1aad2f4c1a9f299baf205228da8028aa1ae3883 Mon Sep 17 00:00:00 2001
From eb73b6b42378386ce8af3594094ad61cd2c61754 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,10 +13,10 @@ between surface_blt and surface_blt_ugly isn't particularly nice.
4 files changed, 229 insertions(+), 140 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index d49d3b2..e08d739 100644
index 120d688..fadba7b 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -1164,7 +1164,7 @@ static void color_fill_test(void)
@@ -1339,7 +1339,7 @@ static void color_fill_test(void)
* result on Wine.
* {D3DFMT_YUY2, "D3DFMT_YUY2", BLOCKS, 0},
* {D3DFMT_UYVY, "D3DFMT_UYVY", BLOCKS, 0}, */
@ -26,7 +26,7 @@ index d49d3b2..e08d739 100644
* supported as offscreen plain surfaces and do not support D3DUSAGE_RENDERTARGET
* when created as texture. */
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index fcc5ed7..550206f 100644
index de9fc9b..9fc92cf 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -74,6 +74,7 @@ enum wined3d_cs_op
@ -122,10 +122,10 @@ index fcc5ed7..550206f 100644
{
struct wined3d_cs_block *block;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5e44494..31c1a29 100644
index 3c1ba32..c437fb3 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4891,14 +4891,13 @@ const struct blit_shader cpu_blit = {
@@ -4846,14 +4846,13 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@ -142,9 +142,9 @@ index 5e44494..31c1a29 100644
BOOL scale, convert;
static const DWORD simple_blit = WINEDDBLT_ASYNC
@@ -4909,111 +4908,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
| WINEDDBLT_DEPTHFILL
| WINEDDBLT_DONOTWAIT;
@@ -4865,111 +4864,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
| WINEDDBLT_DONOTWAIT
| WINEDDBLT_ALPHATEST;
- TRACE("dst_surface %p, dst_rect_in %s, src_surface %p, src_rect_in %s, flags %#x, fx %p, filter %s.\n",
- dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in),
@ -254,7 +254,7 @@ index 5e44494..31c1a29 100644
if (!device->d3d_initialized)
{
WARN("D3D not initialized, using fallback.\n");
@@ -5056,8 +4950,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5012,8 +4906,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
}
scale = src_surface
@ -265,7 +265,7 @@ index 5e44494..31c1a29 100644
convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id;
dst_ds_flags = dst_surface->container->resource.format_flags
@@ -5077,22 +4971,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5033,22 +4927,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth))
@ -293,7 +293,7 @@ index 5e44494..31c1a29 100644
}
}
else
@@ -5123,8 +5011,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5079,8 +4967,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
palette, fx->u5.dwFillColor, &color))
goto fallback;
@ -304,7 +304,7 @@ index 5e44494..31c1a29 100644
}
else
{
@@ -5152,9 +5040,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5112,9 +5000,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Not doing upload because of format conversion.\n");
else
{
@ -316,7 +316,7 @@ index 5e44494..31c1a29 100644
{
if (!wined3d_resource_is_offscreen(&dst_surface->container->resource))
{
@@ -5163,7 +5051,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5123,7 +5011,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
dst_surface->container->resource.draw_binding);
context_release(context);
}
@ -325,7 +325,7 @@ index 5e44494..31c1a29 100644
}
}
}
@@ -5187,50 +5075,193 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
@@ -5147,51 +5035,194 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@ -364,9 +364,10 @@ index 5e44494..31c1a29 100644
+ dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format);
if (blitter)
{
- blitter->blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key);
blitter->blit_surface(device, blit_op, filter, src_surface,
- &src_rect, dst_surface, &dst_rect, color_key);
- return WINED3D_OK;
+ blitter->blit_surface(device, filter, src_surface, src_rect, dst_surface, dst_rect, color_key);
+ src_rect, dst_surface, dst_rect, color_key);
+ return;
}
}
@ -533,10 +534,10 @@ index 5e44494..31c1a29 100644
static const struct wined3d_resource_ops surface_resource_ops =
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4010e4d..80c9880 100644
index 9979cb0..cca82ab 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2490,6 +2490,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@@ -2522,6 +2522,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
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;
@ -546,7 +547,7 @@ index 4010e4d..80c9880 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;
@@ -2638,6 +2641,7 @@ struct wined3d_cs
@@ -2669,6 +2672,7 @@ struct wined3d_cs
struct wined3d_device *device;
struct wined3d_state state;
HANDLE thread;
@ -554,7 +555,7 @@ index 4010e4d..80c9880 100644
DWORD tls_idx;
struct wined3d_surface *onscreen_depth_stencil;
@@ -2716,6 +2720,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
@@ -2747,6 +2751,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
GLenum primitive_type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN;
@ -566,5 +567,5 @@ index 4010e4d..80c9880 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
--
2.5.1
2.6.2

View File

@ -1,4 +1,4 @@
From b306273dc9e8ef9cdc53affc64098399bad4e65c Mon Sep 17 00:00:00 2001
From 649e5b815399a26eb4f3ace31d604310771a9eac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 3 Oct 2013 19:23:24 +0200
Subject: wined3d: Remove software cursor support.
@ -9,15 +9,15 @@ in the main thread.
FIXME: Make sure wined3d_device_show_cursor returns the correct value if a software cursor is set.
---
dlls/wined3d/device.c | 64 ------------------------------------------
dlls/wined3d/swapchain.c | 21 --------------
dlls/wined3d/swapchain.c | 29 -------------------
dlls/wined3d/wined3d_private.h | 1 -
3 files changed, 86 deletions(-)
3 files changed, 94 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b44d304..e8871b2 100644
index 70fb2cb..e9ef79f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1039,8 +1039,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1073,8 +1073,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
if (device->logo_texture)
wined3d_texture_decref(device->logo_texture);
@ -26,7 +26,7 @@ index b44d304..e8871b2 100644
/* Release the buffers (with sanity checks).
* FIXME: Move this move into a separate patch. I think the idea
@@ -4144,48 +4142,6 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device,
@@ -4181,48 +4179,6 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device,
wined3d_rendertarget_view_decref(prev);
}
@ -75,7 +75,7 @@ index b44d304..e8871b2 100644
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device,
UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx)
{
@@ -4204,12 +4160,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
@@ -4241,12 +4197,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
cursor_image = surface_from_resource(sub_resource);
@ -88,7 +88,7 @@ index b44d304..e8871b2 100644
if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM)
{
WARN("Surface %p has an invalid format %s.\n",
@@ -4237,11 +4187,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
@@ -4274,11 +4224,6 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
* release it after setting the cursor image. Windows doesn't
* addref the set surface, so we can't do this either without
* creating circular refcount dependencies. */
@ -100,7 +100,7 @@ index b44d304..e8871b2 100644
if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32)
{
@@ -4346,10 +4291,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show)
@@ -4383,10 +4328,6 @@ BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show)
else
SetCursor(NULL);
}
@ -111,7 +111,7 @@ index b44d304..e8871b2 100644
return oldVisible;
}
@@ -4504,11 +4445,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4541,11 +4482,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_texture_decref(device->logo_texture);
device->logo_texture = NULL;
}
@ -124,10 +124,10 @@ index b44d304..e8871b2 100644
if (device->state.fb.render_targets)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 5ded5d0..94ca18f 100644
index 77eb532..d0c7c54 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -455,27 +455,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
@@ -455,35 +455,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
NULL, WINED3D_TEXF_POINT);
}
@ -143,23 +143,31 @@ index 5ded5d0..94ca18f 100644
- swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot,
- swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot,
- };
- RECT src_rect =
- {
- 0, 0,
- swapchain->device->cursor_texture->resource.width,
- swapchain->device->cursor_texture->resource.height
- };
- const RECT clip_rect = {0, 0, back_buffer->resource.width, back_buffer->resource.height};
-
- TRACE("Rendering the software cursor.\n");
-
- if (swapchain->desc.windowed)
- MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&destRect, 2);
- wined3d_surface_blt(back_buffer, &destRect, cursor, NULL, WINEDDBLT_ALPHATEST,
- NULL, WINED3D_TEXF_POINT);
- if (wined3d_clip_blit(&clip_rect, &destRect, &src_rect))
- wined3d_surface_blt(back_buffer, &destRect, cursor, &src_rect, WINEDDBLT_ALPHATEST,
- NULL, WINED3D_TEXF_POINT);
- }
-
TRACE("Presenting HDC %p.\n", context->hdc);
render_to_fbo = swapchain->render_to_fbo;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5f29243..f51a6d4 100644
index 9450bdc..27a4a87 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2137,7 +2137,6 @@ struct wined3d_device
@@ -2151,7 +2151,6 @@ struct wined3d_device
UINT xScreenSpace;
UINT yScreenSpace;
UINT cursorWidth, cursorHeight;
@ -168,5 +176,5 @@ index 5f29243..f51a6d4 100644
/* The Wine logo texture */
--
2.6.1
2.6.2

View File

@ -36,7 +36,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
struct wined3d_surface *front;
@@ -460,6 +472,29 @@
@@ -460,6 +472,37 @@
NULL, WINED3D_TEXF_POINT);
}
@ -53,20 +53,28 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
+ swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot,
+ swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot,
+ };
+ RECT src_rect =
+ {
+ 0, 0,
+ swapchain->device->cursor_texture->resource.width,
+ swapchain->device->cursor_texture->resource.height
+ };
+ const RECT clip_rect = {0, 0, back_buffer->resource.width, back_buffer->resource.height};
+
+ TRACE("Rendering the software cursor.\n");
+
+ if (swapchain->desc.windowed)
+ MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&destRect, 2);
+ wined3d_surface_blt(back_buffer, &destRect, cursor, NULL, WINEDDBLT_ALPHATEST,
+ NULL, WINED3D_TEXF_POINT);
+ if (wined3d_clip_blit(&clip_rect, &destRect, &src_rect))
+ wined3d_surface_blt(back_buffer, &destRect, cursor, &src_rect, WINEDDBLT_ALPHATEST,
+ NULL, WINED3D_TEXF_POINT);
+ }
+
+#endif /* STAGING_CSMT */
TRACE("Presenting HDC %p.\n", context->hdc);
render_to_fbo = swapchain->render_to_fbo;
@@ -501,6 +536,7 @@
@@ -501,6 +544,7 @@
*/
if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
@ -74,7 +82,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
wined3d_resource_load_location(&back_buffer->resource, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
swapchain->render_to_fbo = TRUE;
@@ -509,6 +545,16 @@
@@ -509,6 +553,16 @@
else
{
wined3d_resource_load_location(&back_buffer->resource, context, back_buffer->container->resource.draw_binding);
@ -91,7 +99,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
}
if (swapchain->render_to_fbo)
@@ -521,8 +567,13 @@
@@ -521,8 +575,13 @@
swapchain_blit(swapchain, context, &src_rect, &dst_rect);
}
@ -105,7 +113,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
/* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */
gl_info->gl_ops.wgl.p_wglSwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */
@@ -546,6 +597,7 @@
@@ -546,6 +605,7 @@
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
@ -113,7 +121,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
switch (swapchain->desc.swap_effect)
@@ -574,6 +626,31 @@
@@ -574,6 +634,31 @@
{
wined3d_texture_decref(swapchain->device->cs->onscreen_depth_stencil->container);
swapchain->device->cs->onscreen_depth_stencil = NULL;
@ -145,7 +153,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
}
}
}
@@ -606,7 +683,11 @@
@@ -606,7 +691,11 @@
TRACE("Copying surface %p to screen.\n", front);
@ -157,7 +165,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
src_dc = front->hDC;
window = swapchain->win_handle;
@@ -634,8 +715,12 @@
@@ -634,8 +723,12 @@
}
static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in,
@ -170,7 +178,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
{
struct wined3d_surface *front, *back;
@@ -662,9 +747,15 @@
@@ -662,9 +755,15 @@
{
void *tmp;
@ -186,7 +194,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
if (front->resource.heap_memory)
ERR("GDI Surface %p has heap memory allocated.\n", front);
@@ -735,6 +826,7 @@
@@ -735,6 +834,7 @@
swapchain->render_to_fbo = TRUE;
}
@ -194,7 +202,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
const struct wined3d_adapter *adapter = device->adapter;
@@ -798,6 +890,7 @@
@@ -798,6 +898,7 @@
return WINED3D_OK;
}
@ -202,7 +210,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device,
struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
@@ -888,8 +981,13 @@
@@ -888,8 +989,13 @@
front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
if (!(device->wined3d->flags & WINED3D_NO3D))
{
@ -216,7 +224,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
}
/* MSDN says we're only allowed a single fullscreen swapchain per device,
@@ -915,9 +1013,66 @@
@@ -915,9 +1021,66 @@
if (!(device->wined3d->flags & WINED3D_NO3D))
{
@ -1218,7 +1226,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);
}
@@ -7842,7 +7850,11 @@
@@ -7844,7 +7852,11 @@
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
@ -1230,7 +1238,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader
== WINED3D_LOCATION_DRAWABLE
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
@@ -7872,6 +7884,7 @@
@@ -7882,6 +7894,7 @@
/* Leave the opengl state valid for blitting */
arbfp_blit_unset(context->gl_info);
@ -1238,7 +1246,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader
if (wined3d_settings.cs_multithreaded)
context->gl_info->gl_ops.gl.p_glFinish();
else if (wined3d_settings.strict_draw_ordering
@@ -7883,6 +7896,17 @@
@@ -7893,6 +7906,17 @@
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
@ -1840,7 +1848,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
@@ -1442,8 +1497,12 @@
@@ -1444,8 +1499,12 @@
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN;
BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device,
UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN;
@ -1853,7 +1861,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info,
@@ -2026,7 +2085,11 @@
@@ -2028,7 +2087,11 @@
struct wined3d_state
{
DWORD flags;
@ -1865,7 +1873,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2071,6 +2134,7 @@
@@ -2073,6 +2136,7 @@
DWORD render_states[WINEHIGHEST_RENDER_STATE + 1];
};
@ -1873,7 +1881,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_gl_bo
{
GLuint name;
@@ -2079,6 +2143,7 @@
@@ -2081,6 +2145,7 @@
UINT size;
};
@ -1881,7 +1889,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
#define WINED3D_UNMAPPED_STAGE ~0U
/* Multithreaded flag. Removed from the public header to signal that
@@ -2134,11 +2199,23 @@
@@ -2136,11 +2201,23 @@
struct wined3d_rendertarget_view *back_buffer_view;
struct wined3d_swapchain **swapchains;
UINT swapchain_count;
@ -1905,7 +1913,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* For rendering to a texture using glCopyTexImage */
GLuint depth_blt_texture;
@@ -2149,6 +2226,9 @@
@@ -2151,6 +2228,9 @@
UINT xScreenSpace;
UINT yScreenSpace;
UINT cursorWidth, cursorHeight;
@ -1915,7 +1923,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HCURSOR hardwareCursor;
/* The Wine logo texture */
@@ -2180,6 +2260,7 @@
@@ -2182,6 +2262,7 @@
UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN;
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -1923,7 +1931,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN;
void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
@@ -2191,6 +2272,11 @@
@@ -2193,6 +2274,11 @@
void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void device_delete_opengl_contexts_cs(struct wined3d_device *device,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@ -1935,7 +1943,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2210,9 +2296,11 @@
@@ -2212,9 +2298,11 @@
HRESULT (*resource_sub_resource_map)(struct wined3d_resource *resource, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx);
@ -1947,7 +1955,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_resource
@@ -2237,6 +2325,7 @@
@@ -2239,6 +2327,7 @@
UINT depth;
UINT size;
DWORD priority;
@ -1955,7 +1963,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data;
UINT custom_row_pitch, custom_slice_pitch;
struct wined3d_gl_bo *buffer, *map_buffer;
@@ -2244,6 +2333,10 @@
@@ -2246,6 +2335,10 @@
DWORD locations;
LONG access_fence;
BOOL unmap_dirtify;
@ -1966,7 +1974,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *parent;
const struct wined3d_parent_ops *parent_ops;
@@ -2268,6 +2361,7 @@
@@ -2270,6 +2363,7 @@
void *parent, const struct wined3d_parent_ops *parent_ops,
const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN;
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@ -1974,7 +1982,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_changed(struct wined3d_resource *resource,
@@ -2316,6 +2410,15 @@
@@ -2318,6 +2412,15 @@
{
while(InterlockedCompareExchange(&resource->access_fence, 0, 0));
}
@ -1990,7 +1998,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* Tests show that the start address of resources is 32 byte aligned */
#define RESOURCE_ALIGNMENT 16
@@ -2400,7 +2503,9 @@
@@ -2402,7 +2505,9 @@
void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture,
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
@ -2000,7 +2008,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_texture_bind(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
@@ -2434,9 +2539,16 @@
@@ -2436,9 +2541,16 @@
struct wined3d_resource resource;
struct wined3d_texture *container;
@ -2017,7 +2025,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
@@ -2444,6 +2556,7 @@
@@ -2446,6 +2558,7 @@
return CONTAINING_RECORD(resource, struct wined3d_volume, resource);
}
@ -2025,7 +2033,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN;
void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN;
@@ -2459,6 +2572,27 @@
@@ -2461,6 +2574,27 @@
struct wined3d_surface_dib
{
HBITMAP DIBsection;
@ -2053,7 +2061,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
UINT bitmap_size;
};
@@ -2484,7 +2618,11 @@
@@ -2486,7 +2620,11 @@
struct wined3d_surface_ops
{
HRESULT (*surface_private_setup)(struct wined3d_surface *surface);
@ -2065,7 +2073,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_surface
@@ -2492,12 +2630,26 @@
@@ -2494,12 +2632,26 @@
struct wined3d_resource resource;
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
@ -2092,7 +2100,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
GLuint rb_multisample;
GLuint rb_resolved;
GLenum texture_target;
@@ -2541,11 +2693,22 @@
@@ -2543,11 +2695,22 @@
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
@ -2115,7 +2123,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context,
DWORD location) DECLSPEC_HIDDEN;
@@ -2557,6 +2720,7 @@
@@ -2559,6 +2722,7 @@
const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN;
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN;
@ -2123,7 +2131,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
@@ -2571,6 +2735,17 @@
@@ -2573,6 +2737,17 @@
void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
@ -2141,7 +2149,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
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;
@@ -2592,8 +2767,10 @@
@@ -2594,8 +2769,10 @@
GLuint name;
};
@ -2152,7 +2160,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_vertex_declaration_element
{
const struct wined3d_format *format;
@@ -2622,8 +2799,10 @@
@@ -2624,8 +2801,10 @@
BOOL half_float_conv_needed;
};
@ -2163,7 +2171,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_saved_states
{
DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1];
@@ -2691,6 +2870,7 @@
@@ -2693,6 +2872,7 @@
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -2171,7 +2179,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info,
const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN;
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
@@ -2741,6 +2921,32 @@
@@ -2743,6 +2923,32 @@
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context,
struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN;
@ -2204,7 +2212,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
@@ -2790,6 +2996,7 @@
@@ -2792,6 +2998,7 @@
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
@ -2212,7 +2220,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants,
UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
@@ -2853,6 +3060,7 @@
@@ -2855,6 +3062,7 @@
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
unsigned int depth_pitch) DECLSPEC_HIDDEN;
@ -2220,7 +2228,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
@@ -2867,8 +3075,12 @@
@@ -2869,8 +3077,12 @@
struct wined3d_query_ops
{
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
@ -2233,7 +2241,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_query
@@ -2882,12 +3094,16 @@
@@ -2884,12 +3096,16 @@
enum wined3d_query_type type;
DWORD data_size;
void *extendedData;
@ -2250,7 +2258,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
* fixed function semantics as D3DCOLOR or FLOAT16 */
@@ -2914,7 +3130,9 @@
@@ -2916,7 +3132,9 @@
GLenum buffer_object_usage;
GLenum buffer_type_hint;
DWORD flags;
@ -2260,7 +2268,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *map_ptr;
struct wined3d_map_range *maps;
@@ -2939,11 +3157,15 @@
@@ -2941,11 +3159,15 @@
BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN;
void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context,
const struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -2276,7 +2284,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_rendertarget_view
{
@@ -2982,8 +3204,10 @@
@@ -2984,8 +3206,10 @@
return surface_from_resource(resource);
}
@ -2287,7 +2295,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_shader_resource_view
{
LONG refcount;
@@ -2996,8 +3220,12 @@
@@ -2998,8 +3222,12 @@
struct wined3d_swapchain_ops
{
void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect,
@ -2300,7 +2308,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_swapchain
@@ -3036,8 +3264,10 @@
@@ -3038,8 +3266,10 @@
void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@ -2311,7 +2319,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/*****************************************************************************
* Utility function prototypes
@@ -3240,7 +3470,9 @@
@@ -3242,7 +3472,9 @@
void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN;
@ -8261,9 +8269,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
- if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
+ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
+ {
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
- if (location == WINED3D_LOCATION_TEXTURE_RGB
- && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
+ if (location == WINED3D_LOCATION_TEXTURE_RGB
+#if defined(STAGING_CSMT)
+ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
@ -8286,9 +8295,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
+ }
+
+ if (!surface->resource.locations)
{
- if (location == WINED3D_LOCATION_TEXTURE_RGB
- && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
+ {
+ ERR("Surface %p does not have any up to date location.\n", surface);
+ return;
+#else /* STAGING_CSMT */
@ -8386,7 +8393,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }
@@ -4089,6 +5218,7 @@
@@ -4090,6 +5219,7 @@
const RECT *dst_rect, const struct wined3d_color *color)
{
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
@ -8394,7 +8401,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
struct wined3d_rendertarget_view view, *view_ptr = &view;
struct wined3d_fb_state fb = {&view_ptr, NULL, 1};
struct wined3d_texture *texture = dst_surface->container;
@@ -4109,6 +5239,21 @@
@@ -4110,6 +5240,21 @@
view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level;
device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
@ -8416,7 +8423,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return WINED3D_OK;
}
@@ -4117,6 +5262,7 @@
@@ -4118,6 +5263,7 @@
const RECT *dst_rect, float depth)
{
const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height};
@ -8424,7 +8431,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
struct wined3d_rendertarget_view view;
struct wined3d_fb_state fb = {NULL, &view};
struct wined3d_texture *texture = dst_surface->container;
@@ -4132,6 +5278,20 @@
@@ -4133,6 +5279,20 @@
view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level;
device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0);
@ -8445,7 +8452,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return WINED3D_OK;
}
@@ -4160,8 +5320,13 @@
@@ -4169,8 +5329,13 @@
wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT,
(old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL);
@ -8459,7 +8466,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
const struct blit_shader ffp_blit = {
@@ -4317,6 +5482,7 @@
@@ -4326,6 +5491,7 @@
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter)
{
@ -8467,7 +8474,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
int bpp, srcheight, srcwidth, dstheight, dstwidth, width;
const struct wined3d_format *src_format, *dst_format;
unsigned int src_fmt_flags, dst_fmt_flags;
@@ -4351,6 +5517,28 @@
@@ -4360,6 +5526,28 @@
wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
src_data = dst_data;
src_row_pitch = dst_row_pitch;
@ -8496,7 +8503,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format = dst_surface->resource.format;
dst_format = src_format;
dst_fmt_flags = dst_surface->container->resource.format_flags;
@@ -4362,12 +5550,14 @@
@@ -4371,12 +5559,14 @@
dst_fmt_flags = dst_surface->container->resource.format_flags;
if (src_surface)
{
@ -8511,7 +8518,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (dst_surface->resource.format->id != src_surface->resource.format->id)
{
if (!(src_texture = surface_convert_format(src_surface, dst_format->id)))
@@ -4378,9 +5568,13 @@
@@ -4387,9 +5577,13 @@
}
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0));
}
@ -8525,7 +8532,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format = src_surface->resource.format;
src_fmt_flags = src_surface->container->resource.format_flags;
}
@@ -4390,8 +5584,12 @@
@@ -4399,8 +5593,12 @@
src_fmt_flags = dst_fmt_flags;
}
@ -8538,7 +8545,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
bpp = dst_surface->resource.format->byte_count;
@@ -4402,12 +5600,24 @@
@@ -4411,12 +5609,24 @@
width = (dst_rect->right - dst_rect->left) * bpp;
if (src_surface)
@ -8563,7 +8570,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS)
{
@@ -4442,7 +5652,11 @@
@@ -4451,7 +5661,11 @@
}
hr = surface_cpu_blt_compressed(sbase, dbuf,
@ -8575,7 +8582,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
src_format, flags, fx);
goto release;
}
@@ -4450,7 +5664,11 @@
@@ -4459,7 +5673,11 @@
/* First, all the 'source-less' blits */
if (flags & WINEDDBLT_COLORFILL)
{
@ -8587,7 +8594,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
flags &= ~WINEDDBLT_COLORFILL;
}
@@ -4500,6 +5718,7 @@
@@ -4509,6 +5727,7 @@
for (y = 0; y < dstheight; ++y)
{
memcpy(dbuf, sbuf, width);
@ -8595,7 +8602,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
sbuf += src_row_pitch;
dbuf += dst_row_pitch;
}
@@ -4513,6 +5732,21 @@
@@ -4522,6 +5741,21 @@
{
sbuf -= src_row_pitch;
dbuf -= dst_row_pitch;
@ -8617,7 +8624,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
memcpy(dbuf, sbuf, width);
}
}
@@ -4522,8 +5756,13 @@
@@ -4531,8 +5765,13 @@
for (y = 0; y < dstheight; ++y)
{
memmove(dbuf, sbuf, width);
@ -8631,7 +8638,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -4532,9 +5771,15 @@
@@ -4541,9 +5780,15 @@
/* Stretching in y direction only. */
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8647,7 +8654,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -4544,6 +5789,7 @@
@@ -4553,6 +5798,7 @@
int last_sy = -1;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8655,7 +8662,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
sbuf = sbase + (sy >> 16) * src_row_pitch;
if ((sy >> 16) == (last_sy >> 16))
@@ -4551,6 +5797,15 @@
@@ -4560,6 +5806,15 @@
/* This source row is the same as last source row -
* Copy the already stretched row. */
memcpy(dbuf, dbuf - dst_row_pitch, width);
@ -8671,7 +8678,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
else
{
@@ -4597,6 +5852,7 @@
@@ -4606,6 +5861,7 @@
}
#undef STRETCH_ROW
}
@ -8679,7 +8686,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dbuf += dst_row_pitch;
last_sy = sy;
}
@@ -4605,6 +5861,16 @@
@@ -4614,6 +5870,16 @@
else
{
LONG dstyinc = dst_row_pitch, dstxinc = bpp;
@ -8696,7 +8703,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff;
DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff;
if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE))
@@ -4654,7 +5920,11 @@
@@ -4663,7 +5929,11 @@
LONG tmpxy;
dTopLeft = dbuf;
dTopRight = dbuf + ((dstwidth - 1) * bpp);
@ -8708,7 +8715,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp);
if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY)
@@ -4731,6 +6001,7 @@
@@ -4740,6 +6010,7 @@
flags &= ~(WINEDDBLT_DDFX);
}
@ -8716,7 +8723,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
#define COPY_COLORKEY_FX(type) \
do { \
const type *s; \
@@ -4752,6 +6023,29 @@
@@ -4761,6 +6032,29 @@
d = (type *)(((BYTE *)d) + dstyinc); \
} \
} while(0)
@ -8746,7 +8753,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
switch (bpp)
{
@@ -4770,7 +6064,11 @@
@@ -4779,7 +6073,11 @@
BYTE *d = dbuf, *dx;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
@ -8758,7 +8765,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
dx = d;
for (x = sx = 0; x < dstwidth; ++x, sx+= xinc)
{
@@ -4801,10 +6099,12 @@
@@ -4810,10 +6108,12 @@
}
}
@ -8771,7 +8778,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
error:
if (flags && FIXME_ON(d3d_surface))
{
@@ -4812,6 +6112,7 @@
@@ -4821,6 +6121,7 @@
}
release:
@ -8779,7 +8786,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (dst_data)
{
wined3d_resource_release_map_ptr(&dst_surface->resource, context);
@@ -4830,6 +6131,14 @@
@@ -4839,6 +6140,14 @@
wined3d_texture_decref(src_texture);
if (context)
context_release(context);
@ -8794,7 +8801,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return hr;
}
@@ -4874,6 +6183,7 @@
@@ -4883,6 +6192,7 @@
cpu_blit_blit_surface,
};
@ -8802,7 +8809,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect,
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter)
@@ -4881,6 +6191,16 @@
@@ -4890,6 +6200,16 @@
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
struct wined3d_device *device = dst_surface->resource.device;
DWORD src_ds_flags, dst_ds_flags;
@ -8819,9 +8826,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
BOOL scale, convert;
static const DWORD simple_blit = WINEDDBLT_ASYNC
@@ -4891,6 +6211,106 @@
| WINEDDBLT_DEPTHFILL
| WINEDDBLT_DONOTWAIT;
@@ -4901,6 +6221,106 @@
| WINEDDBLT_DONOTWAIT
| WINEDDBLT_ALPHATEST;
+#if !defined(STAGING_CSMT)
+ TRACE("dst_surface %p, dst_rect_in %s, src_surface %p, src_rect_in %s, flags %#x, fx %p, filter %s.\n",
@ -8926,7 +8933,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
if (!device->d3d_initialized)
{
WARN("D3D not initialized, using fallback.\n");
@@ -4933,8 +6353,13 @@
@@ -4943,8 +6363,13 @@
}
scale = src_surface
@ -8940,7 +8947,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id;
dst_ds_flags = dst_surface->container->resource.format_flags
@@ -4954,6 +6379,7 @@
@@ -4964,6 +6389,7 @@
TRACE("Depth fill.\n");
if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth))
@ -8948,7 +8955,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return;
if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth)))
@@ -4964,6 +6390,24 @@
@@ -4974,6 +6400,24 @@
if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding,
src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect)))
return;
@ -8973,7 +8980,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
else
@@ -4972,8 +6416,13 @@
@@ -4982,8 +6426,13 @@
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
@ -8987,7 +8994,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -4994,8 +6443,13 @@
@@ -5004,8 +6453,13 @@
palette, fx->u5.dwFillColor, &color))
goto fallback;
@ -9001,9 +9008,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
else
{
@@ -5013,8 +6467,13 @@
color_key = &src_surface->container->async.src_blt_color_key;
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY;
@@ -5027,8 +6481,13 @@
{
blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST;
}
+#if defined(STAGING_CSMT)
else if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM)
@ -9015,7 +9022,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
{
/* Upload */
if (scale)
@@ -5023,6 +6482,7 @@
@@ -5037,6 +6496,7 @@
TRACE("Not doing upload because of format conversion.\n");
else
{
@ -9023,7 +9030,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
POINT dst_point = {dst_rect->left, dst_rect->top};
if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect)))
@@ -5035,6 +6495,19 @@
@@ -5049,6 +6509,19 @@
context_release(context);
}
return;
@ -9043,7 +9050,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
}
}
@@ -5058,6 +6531,7 @@
@@ -5072,6 +6545,7 @@
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@ -9051,7 +9058,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
return;
}
@@ -5265,6 +6739,53 @@
@@ -5280,6 +6754,54 @@
wined3d_surface_location_invalidated,
wined3d_surface_load_location,
};
@ -9083,7 +9090,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
+ &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format);
+ if (blitter)
+ {
+ blitter->blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key);
+ blitter->blit_surface(device, blit_op, filter, src_surface,
+ &src_rect, dst_surface, &dst_rect, color_key);
+ return WINED3D_OK;
+ }
+ }
@ -9105,7 +9113,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container,
const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags)
@@ -5326,7 +6847,11 @@
@@ -5341,7 +6863,11 @@
}
surface->container = container;
@ -9117,7 +9125,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
list_init(&surface->renderbuffers);
list_init(&surface->overlays);
@@ -5358,9 +6883,14 @@
@@ -5373,9 +6899,14 @@
if (surface->resource.map_binding == WINED3D_LOCATION_DIB)
{
wined3d_resource_free_sysmem(&surface->resource);
@ -9132,7 +9140,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
}
return hr;
@@ -5387,7 +6917,11 @@
@@ -5402,7 +6933,11 @@
if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags)))
{
WARN("Failed to initialize surface, returning %#x.\n", hr);