Rebase against aa475ce23fa295a8f5d0fa120d7b3dac1a5a41b5.

[wininet-InternetReadFile]
Removed patch to return synchronously from InternetReadFile if there is no
more data to read (accepted upstream).
This commit is contained in:
Sebastian Lackner 2016-05-18 01:45:07 +02:00
parent 334b3cb393
commit 8a2c526e13
18 changed files with 607 additions and 759 deletions

View File

@ -51,13 +51,13 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "f7ac364b0c06bbe7a1ef5b715f2be46b5e6c04d4"
echo "aa475ce23fa295a8f5d0fa120d7b3dac1a5a41b5"
}
# Show version information
version()
{
echo "Wine Staging 1.9.10"
echo "Wine Staging 1.9.11 (unreleased)"
echo "Copyright (C) 2014-2016 the Wine Staging project authors."
echo ""
echo "Patchset to be applied on upstream Wine:"
@ -385,7 +385,6 @@ patch_enable_all ()
enable_wininet_Cleanup="$1"
enable_wininet_HttpOpenRequestW="$1"
enable_wininet_InternetCrackUrlW="$1"
enable_wininet_InternetReadFile="$1"
enable_wininet_Internet_Settings="$1"
enable_wininet_ParseX509EncodedCertificateForListBoxEntry="$1"
enable_winmm_Delay_Import_Depends="$1"
@ -1334,9 +1333,6 @@ patch_enable ()
wininet-InternetCrackUrlW)
enable_wininet_InternetCrackUrlW="$2"
;;
wininet-InternetReadFile)
enable_wininet_InternetReadFile="$2"
;;
wininet-Internet_Settings)
enable_wininet_Internet_Settings="$2"
;;
@ -7372,7 +7368,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
patch_apply wined3d-CSMT_Main/0002-wined3d-Start-to-move-surface-volume_load_location-i.patch
patch_apply wined3d-CSMT_Main/0003-wined3d-Call-texture_load_location-instead-of-surfac.patch
patch_apply wined3d-CSMT_Main/0004-wined3d-Share-surface-and-volume-system-memory-loadi.patch
patch_apply wined3d-CSMT_Main/0005-wined3d-Discard-the-backbuffer-in-discard-presents.patch
patch_apply wined3d-CSMT_Main/0006-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
patch_apply wined3d-CSMT_Main/0007-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
patch_apply wined3d-CSMT_Main/0008-wined3d-Move-the-framebuffer-into-wined3d_state.patch
@ -7507,7 +7502,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
echo '+ { "Stefan Dösinger", "wined3d: Start to move surface/volume_load_location into the texture.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Call texture_load_location instead of surface_load_location.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Share surface and volume system memory loading code.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Discard the backbuffer in discard presents.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_convert_format.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_cpu_blt.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },';
@ -7907,21 +7901,6 @@ if test "$enable_wininet_InternetCrackUrlW" -eq 1; then
) >> "$patchlist"
fi
# Patchset wininet-InternetReadFile
# |
# | This patchset fixes the following Wine bugs:
# | * [#40536] Return synchronously from InternetReadFile if there is no more data to read
# |
# | Modified files:
# | * dlls/wininet/http.c
# |
if test "$enable_wininet_InternetReadFile" -eq 1; then
patch_apply wininet-InternetReadFile/0001-wininet-Return-synchronously-from-InternetReadFile-i.patch
(
echo '+ { "Sebastian Lackner", "wininet: Return synchronously from InternetReadFile if there is no more data to read.", 1 },';
) >> "$patchlist"
fi
# Patchset wininet-Internet_Settings
# |
# | Modified files:

View File

@ -1,4 +1,4 @@
From 5d3739d94ccb7e4a7bfaebf33cdb399a0707f9e7 Mon Sep 17 00:00:00 2001
From e5634d551d285a969917899fd21fe5754a418d1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 29 Oct 2015 15:41:59 +0100
Subject: wined3d: Make surface_load_location return nothing.
@ -11,10 +11,10 @@ FIXME: I guess Henri disagrees.
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e0d7c80..3435d17 100644
index d084ffe..ea3c6f0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3035,7 +3035,7 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi
@@ -3188,7 +3188,7 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi
}
/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
@ -23,7 +23,7 @@ index e0d7c80..3435d17 100644
{
unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
struct wined3d_texture *texture = surface->container;
@@ -3053,7 +3053,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3206,7 +3206,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|| (surface->ds_current_size.cx == surface_w && surface->ds_current_size.cy == surface_h)))
{
TRACE("Location (%#x) is already up to date.\n", location);
@ -32,7 +32,7 @@ index e0d7c80..3435d17 100644
}
if (WARN_ON(d3d))
@@ -3091,7 +3091,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3244,7 +3244,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
wined3d_debug_location(sub_resource->locations), wined3d_debug_location(location));
@ -41,7 +41,7 @@ index e0d7c80..3435d17 100644
}
switch (location)
@@ -3104,7 +3104,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3257,7 +3257,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
case WINED3D_LOCATION_DRAWABLE:
if (FAILED(hr = surface_load_drawable(surface, context)))
@ -50,7 +50,7 @@ index e0d7c80..3435d17 100644
break;
case WINED3D_LOCATION_RB_RESOLVED:
@@ -3116,7 +3116,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
@@ -3269,7 +3269,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
case WINED3D_LOCATION_TEXTURE_SRGB:
if (FAILED(hr = surface_load_texture(surface, context,
location == WINED3D_LOCATION_TEXTURE_SRGB)))
@ -59,7 +59,7 @@ index e0d7c80..3435d17 100644
break;
default:
@@ -3133,7 +3133,7 @@ done:
@@ -3286,7 +3286,7 @@ done:
surface->ds_current_size.cy = surface_h;
}
@ -69,7 +69,7 @@ index e0d7c80..3435d17 100644
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 3a03bb6..fcea428 100644
index 4d63568..f126d23 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1353,7 +1353,8 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int
@ -83,10 +83,10 @@ index 3a03bb6..fcea428 100644
/* Context activation is done by the caller. */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 274f620..d5fa2f0 100644
index df7dfcc..19bc68e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2708,7 +2708,7 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru
@@ -2710,7 +2710,7 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct wined3d_context *context) DECLSPEC_HIDDEN;
@ -94,7 +94,7 @@ index 274f620..d5fa2f0 100644
+void surface_load_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
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,
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface,
--
2.8.0

View File

@ -1,4 +1,4 @@
From e9556c0ee5a1e3ca28cfe317b63affa2ec99141d Mon Sep 17 00:00:00 2001
From 7720d0dce434a561ff6c6c6e3d0ac3787691f851 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 29 Oct 2015 17:33:23 +0100
Subject: wined3d: Start to move surface/volume_load_location into the texture.
@ -18,10 +18,10 @@ moving allocation of all locations (including sysmem) there.
6 files changed, 34 insertions(+), 22 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 114422b..d6a36c9 100644
index e741969..49e1c56 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2379,7 +2379,6 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
@@ -2442,7 +2442,6 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
{
/* Onscreen surfaces are always in a swapchain */
struct wined3d_swapchain *swapchain = context->current_rt.texture->swapchain;
@ -29,7 +29,7 @@ index 114422b..d6a36c9 100644
if (context->render_offscreen || !depth_stencil) return;
if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->format)) return;
@@ -2390,8 +2389,8 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
@@ -2453,8 +2452,8 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
@ -41,7 +41,7 @@ index 114422b..d6a36c9 100644
swapchain_update_draw_bindings(swapchain);
context_set_render_offscreen(context, TRUE);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 312c8c1..8f5122a 100644
index 0964da8..66cd8c1 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -324,14 +324,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
@ -134,10 +134,10 @@ index f65a00d..df840f3 100644
if (swapchain->render_to_fbo)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 465fb05..619105f 100644
index c5c1114..cf98940 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -317,7 +317,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -322,7 +322,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
for (i = 0; i < sub_count; ++i)
{
if (texture->sub_resources[i].locations == texture->resource.map_binding
@ -219,10 +219,10 @@ index 465fb05..619105f 100644
+ return texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
+}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0f2dd36..0f540db 100644
index d51d465..9a5989d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2580,6 +2580,8 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size
@@ -2584,6 +2584,8 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size
const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN;
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
@ -230,7 +230,7 @@ index 0f2dd36..0f540db 100644
+ struct wined3d_context *context, DWORD location);
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
--
2.8.0

View File

@ -1,34 +0,0 @@
From 25903b870407e8368508fd002f15c509fdd9a66b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 13:09:58 +0200
Subject: wined3d: Discard the backbuffer in discard presents.
---
dlls/wined3d/swapchain.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index a02fdf0..9a36e38 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -608,6 +608,17 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
* up to date and hope WGL flipped front and back buffers and read this data into
* the FBO. Don't bother about this for now. */
+ switch (swapchain->desc.swap_effect)
+ {
+ case WINED3D_SWAP_EFFECT_DISCARD:
+ wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1],
+ 0, WINED3D_LOCATION_DISCARDED);
+ break;
+
+ default:
+ break;
+ }
+
if (fb->depth_stencil)
{
struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(fb->depth_stencil);
--
2.8.0

View File

@ -1,4 +1,4 @@
From 67ac088653e272f9d0b28a2fe764229a054ff579 Mon Sep 17 00:00:00 2001
From d077ec3e4fbc53758d89e7d71598498c8057a2f3 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
@ -6,24 +6,24 @@ Subject: wined3d: Move the framebuffer into wined3d_state
---
dlls/wined3d/arb_program_shader.c | 4 +-
dlls/wined3d/context.c | 20 +++++--
dlls/wined3d/cs.c | 21 ++-----
dlls/wined3d/device.c | 113 +++++++++++++++++---------------------
dlls/wined3d/cs.c | 22 ++++---
dlls/wined3d/device.c | 122 +++++++++++++++++---------------------
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/glsl_shader.c | 2 +-
dlls/wined3d/shader.c | 2 +-
dlls/wined3d/state.c | 24 ++++----
dlls/wined3d/stateblock.c | 45 +++++++++++++--
dlls/wined3d/stateblock.c | 48 +++++++++++++--
dlls/wined3d/surface.c | 2 +-
dlls/wined3d/swapchain.c | 2 +-
dlls/wined3d/utils.c | 4 +-
dlls/wined3d/wined3d_private.h | 46 ++++++++++++----
13 files changed, 166 insertions(+), 121 deletions(-)
dlls/wined3d/wined3d_private.h | 46 ++++++++++----
13 files changed, 180 insertions(+), 120 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 266f5f5..75ce927 100644
index d67bb5e..f6097b0 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -703,7 +703,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
@@ -704,7 +704,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
{
const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog;
@ -32,7 +32,7 @@ index 266f5f5..75ce927 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,
@@ -4731,7 +4731,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
@@ -4732,7 +4732,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
}
else
{
@ -129,7 +129,7 @@ index 49e1c56..a67aeca 100644
WORD map;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 2e5a3a6..3150f25 100644
index ea4778c..3150f25 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -286,7 +286,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@ -168,35 +168,42 @@ index 2e5a3a6..3150f25 100644
if (!prev != !op->view)
{
@@ -1003,7 +1003,7 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -999,11 +999,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
{
struct wined3d_adapter *adapter = cs->device->adapter;
+ HRESULT hr;
state_cleanup(&cs->state);
memset(&cs->state, 0, sizeof(cs->state));
- if (FAILED(hr = state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info,
- state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info,
- WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
+ if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize CS state, hr %#x.\n", hr);
+ WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
+ ERR("Failed to initialize CS state, hr %#x.\n", hr);
}
@@ -1086,17 +1086,9 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1084,16 +1086,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
- if (!(cs->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof(*cs->fb.render_targets) * gl_info->limits.buffers)))
- {
- HeapFree(GetProcessHeap(), 0, cs);
- return NULL;
- }
-
- if (FAILED(state_init(&cs->state, &cs->fb, gl_info, &device->adapter->d3d_info,
+ if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
+ WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
{
- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -1117,7 +1109,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
- state_init(&cs->state, &cs->fb, gl_info, &device->adapter->d3d_info,
- WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
-
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@@ -1110,7 +1109,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
void wined3d_cs_destroy(struct wined3d_cs *cs)
{
state_cleanup(&cs->state);
@ -205,7 +212,7 @@ index 2e5a3a6..3150f25 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4be5c0c..66e4b1e 100644
index f2aadf6..d4a8d35 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -974,7 +974,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
@ -317,7 +324,7 @@ index 4be5c0c..66e4b1e 100644
device->d3d_initialized = FALSE;
return WINED3D_OK;
@@ -2032,7 +2010,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
@@ -2055,7 +2033,7 @@ static void resolve_depth_buffer(struct wined3d_state *state)
|| !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH))
return;
@ -326,7 +333,7 @@ index 4be5c0c..66e4b1e 100644
return;
if (src_view->resource->type == WINED3D_RTYPE_BUFFER)
{
@@ -3389,6 +3367,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
@@ -3412,6 +3390,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)
{
@ -335,7 +342,7 @@ index 4be5c0c..66e4b1e 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);
@@ -3400,7 +3380,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3423,7 +3403,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
{
@ -344,7 +351,7 @@ index 4be5c0c..66e4b1e 100644
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3409,8 +3389,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
@@ -3432,8 +3412,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
}
else if (flags & WINED3DCLEAR_TARGET)
{
@ -355,7 +362,7 @@ index 4be5c0c..66e4b1e 100644
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3752,8 +3732,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
@@ -3775,8 +3755,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])
{
@ -366,7 +373,7 @@ index 4be5c0c..66e4b1e 100644
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -4211,20 +4191,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
@@ -4234,20 +4214,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co
return NULL;
}
@ -390,7 +397,7 @@ index 4be5c0c..66e4b1e 100644
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4264,13 +4245,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4287,13 +4268,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
}
@ -406,7 +413,7 @@ index 4be5c0c..66e4b1e 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. */
@@ -4282,18 +4263,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device
@@ -4305,18 +4286,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)
{
@ -428,7 +435,7 @@ index 4be5c0c..66e4b1e 100644
wined3d_rendertarget_view_incref(view);
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
@@ -4656,10 +4638,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4679,10 +4661,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_texture_decref(device->cursor_texture);
device->cursor_texture = NULL;
}
@ -440,7 +447,7 @@ index 4be5c0c..66e4b1e 100644
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4668,6 +4649,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4691,6 +4672,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -452,16 +459,18 @@ index 4be5c0c..66e4b1e 100644
if (device->onscreen_depth_stencil)
{
wined3d_texture_decref(device->onscreen_depth_stencil->container);
@@ -4891,7 +4877,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4914,30 +4900,30 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (device->d3d_initialized)
delete_opengl_contexts(device, swapchain);
- if (FAILED(hr = state_init(&device->state, &device->fb, &device->adapter->gl_info,
- state_init(&device->state, &device->fb, &device->adapter->gl_info,
- &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT);
+ if (FAILED(hr = state_init(&device->state, &device->adapter->gl_info,
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize device state, hr %#x.\n", hr);
+ &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
+ ERR("Failed to initialize device state, hr %#x.\n", hr);
device->update_state = &device->state;
@@ -4900,22 +4886,21 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
device_init_swapchain_state(device, swapchain);
}
else if (device->back_buffer_view)
{
@ -489,7 +498,7 @@ index 4be5c0c..66e4b1e 100644
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -5007,11 +4992,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -5029,11 +5015,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -503,15 +512,21 @@ index 4be5c0c..66e4b1e 100644
ERR("Resource %p is still in use as depth/stencil buffer.\n", resource);
switch (type)
@@ -5147,7 +5132,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
@@ -5169,8 +5155,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device->blitter = adapter->blitter;
- if (FAILED(hr = state_init(&device->state, &device->fb, &adapter->gl_info,
- state_init(&device->state, &device->fb, &adapter->gl_info,
- &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT);
+ if (FAILED(hr = state_init(&device->state, &adapter->gl_info,
&adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
{
ERR("Failed to initialize device state, hr %#x.\n", hr);
+ &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
+ {
+ ERR("Failed to initialize device state, hr %#x.\n", hr);
+ goto err;
+ }
device->update_state = &device->state;
if (!(device->cs = wined3d_cs_create(device)))
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 83fe4c3..67d0fea 100644
--- a/dlls/wined3d/drawprim.c
@ -526,7 +541,7 @@ index 83fe4c3..67d0fea 100644
struct wined3d_event_query *ib_query = NULL;
struct wined3d_stream_info si_emulated;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index f8c4a99..5c7edaa 100644
index c42668d..fdfe17d 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1442,7 +1442,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@ -539,10 +554,10 @@ index f8c4a99..5c7edaa 100644
0.0f,
0.0f,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 8f8b727..0ee045f 100644
index f8c335c..461bbd0 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2887,7 +2887,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
@@ -2888,7 +2888,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. */
@ -552,7 +567,7 @@ index 8f8b727..0ee045f 100644
static unsigned int warned = 0;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 44962fa..99389cf 100644
index fc97a95..67aae67 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
@ -564,7 +579,7 @@ index 44962fa..99389cf 100644
{
TRACE("No Z buffer - disabling depth test\n");
zenable = WINED3D_ZB_FALSE;
@@ -373,14 +373,14 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
@@ -382,14 +382,14 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
GLenum srcBlend, dstBlend;
unsigned int rt_fmt_flags;
@ -582,7 +597,7 @@ index 44962fa..99389cf 100644
/* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific
* blending parameters to work. */
@@ -814,7 +814,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
@@ -823,7 +823,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
GLint depthFail_ccw;
/* No stencil test without a stencil buffer. */
@ -591,7 +606,7 @@ index 44962fa..99389cf 100644
{
gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST);
checkGLcall("glDisable GL_STENCIL_TEST");
@@ -910,7 +910,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
@@ -919,7 +919,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -600,7 +615,7 @@ index 44962fa..99389cf 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK));
@@ -924,7 +924,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w
@@ -933,7 +933,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w
static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -609,7 +624,7 @@ index 44962fa..99389cf 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
gl_info->gl_ops.gl.p_glStencilMask(mask);
@@ -1662,7 +1662,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
@@ -1671,7 +1671,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS]
|| state->render_states[WINED3D_RS_DEPTHBIAS])
{
@ -618,7 +633,7 @@ index 44962fa..99389cf 100644
float scale;
union
@@ -4563,8 +4563,8 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
@@ -4572,8 +4572,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)
{
@ -629,7 +644,7 @@ index 44962fa..99389cf 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
unsigned int width, height;
@@ -4750,7 +4750,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
@@ -4759,7 +4759,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
}
else
{
@ -638,7 +653,7 @@ index 44962fa..99389cf 100644
UINT height;
UINT width;
@@ -4818,7 +4818,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
@@ -4827,7 +4827,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);
@ -648,10 +663,10 @@ index 44962fa..99389cf 100644
else
gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 036d594..0507a06 100644
index 2b45d9c..849e749 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -464,6 +464,7 @@ void state_unbind_resources(struct wined3d_state *state)
@@ -430,6 +430,7 @@ void state_unbind_resources(struct wined3d_state *state)
struct wined3d_texture *texture;
struct wined3d_buffer *buffer;
struct wined3d_shader *shader;
@ -659,7 +674,7 @@ index 036d594..0507a06 100644
unsigned int i, j;
if ((decl = state->vertex_declaration))
@@ -540,6 +541,31 @@ void state_unbind_resources(struct wined3d_state *state)
@@ -506,6 +507,31 @@ void state_unbind_resources(struct wined3d_state *state)
}
}
}
@ -691,19 +706,20 @@ index 036d594..0507a06 100644
}
void state_cleanup(struct wined3d_state *state)
@@ -567,6 +593,7 @@ void state_cleanup(struct wined3d_state *state)
HeapFree(GetProcessHeap(), 0, state->vs_consts_f);
HeapFree(GetProcessHeap(), 0, state->ps_consts_f);
@@ -530,6 +556,8 @@ void state_cleanup(struct wined3d_state *state)
HeapFree(GetProcessHeap(), 0, light);
}
}
+
+ HeapFree(GetProcessHeap(), 0, state->fb.render_targets);
}
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
@@ -1296,14 +1323,12 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
@@ -1254,32 +1282,42 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
}
}
-HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
-void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
- const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info,
- DWORD flags)
+HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info,
@ -716,42 +732,42 @@ index 036d594..0507a06 100644
for (i = 0; i < LIGHTMAP_SIZE; i++)
{
@@ -1321,6 +1346,15 @@ HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
return E_OUTOFMEMORY;
list_init(&state->light_map[i]);
}
+ if (!(state->fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+ sizeof(*state->fb.render_targets) * gl_info->limits.buffers)))
+ {
+ HeapFree(GetProcessHeap(), 0, state->ps_consts_f);
+ HeapFree(GetProcessHeap(), 0, state->vs_consts_f);
+ return E_OUTOFMEMORY;
+ }
+
+ state->fb.rt_size = gl_info->limits.buffers;
+
if (flags & WINED3D_STATE_INIT_DEFAULT)
state_init_default(state, gl_info);
+
+ return WINED3D_OK;
}
@@ -1331,12 +1365,13 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
struct wined3d_device *device, enum wined3d_stateblock_type type)
{
HRESULT hr;
+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
+ HRESULT hr;
stateblock->ref = 1;
stateblock->device = device;
- if (FAILED(hr = state_init(&stateblock->state, NULL, &device->adapter->gl_info, d3d_info, 0)))
- state_init(&stateblock->state, NULL, &device->adapter->gl_info, d3d_info, 0);
+
+ if (FAILED(hr = state_init(&stateblock->state, gl_info, d3d_info, 0)))
return hr;
+ return hr;
if (FAILED(hr = stateblock_allocate_shader_constants(stateblock)))
if (type == WINED3D_SBT_RECORDED)
return WINED3D_OK;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 4746c5a..ca394f7 100644
index c974e1a..5873a4b 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2421,7 +2421,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
@@ -2574,7 +2574,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;
@ -761,10 +777,10 @@ index 4746c5a..ca394f7 100644
struct wined3d_texture *src_texture;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 9a36e38..31768cf 100644
index df1155c..e69dadd 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -477,7 +477,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
@@ -481,7 +481,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, DWORD flags)
{
struct wined3d_surface *back_buffer = swapchain->back_buffers[0]->sub_resources[0].u.surface;
@ -796,10 +812,10 @@ index 70a4b03..3d158ec 100644
|| !state->render_states[WINED3D_RS_CLIPPLANEENABLE])
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index eb58d81..f38e1aa 100644
index aabfde6..acdd37d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1315,6 +1315,36 @@ struct wined3d_timestamp_query
@@ -1318,6 +1318,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;
@ -836,7 +852,7 @@ index eb58d81..f38e1aa 100644
struct wined3d_context
{
const struct wined3d_gl_info *gl_info;
@@ -1329,6 +1359,7 @@ struct wined3d_context
@@ -1332,6 +1362,7 @@ struct wined3d_context
DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */
DWORD numDirtyEntries;
DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */
@ -844,7 +860,7 @@ index eb58d81..f38e1aa 100644
struct wined3d_swapchain *swapchain;
struct
@@ -1436,12 +1467,6 @@ struct wined3d_context
@@ -1439,12 +1470,6 @@ struct wined3d_context
GLuint dummy_arbfp_prog;
};
@ -857,7 +873,7 @@ index eb58d81..f38e1aa 100644
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
struct StateEntry
@@ -2191,7 +2216,7 @@ struct wined3d_stream_state
@@ -2194,7 +2219,7 @@ struct wined3d_stream_state
struct wined3d_state
{
DWORD flags;
@ -866,7 +882,7 @@ index eb58d81..f38e1aa 100644
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2294,7 +2319,6 @@ struct wined3d_device
@@ -2297,7 +2322,6 @@ struct wined3d_device
struct wine_rb_tree samplers;
/* Render Target Support */
@ -874,11 +890,11 @@ index eb58d81..f38e1aa 100644
struct wined3d_surface *onscreen_depth_stencil;
struct wined3d_rendertarget_view *auto_depth_stencil_view;
@@ -2834,9 +2858,8 @@ struct wined3d_stateblock
@@ -2836,9 +2860,8 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
-HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
-void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
- const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info,
- DWORD flags) DECLSPEC_HIDDEN;
+HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info,
@ -886,7 +902,7 @@ index eb58d81..f38e1aa 100644
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
struct wined3d_cs_ops
@@ -2849,7 +2872,6 @@ struct wined3d_cs
@@ -2851,7 +2874,6 @@ struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;

View File

@ -1,16 +1,16 @@
From a44c6b3931bc99c58e0f29bbb33c0cddc0616df1 Mon Sep 17 00:00:00 2001
From ddb85bfb8372c694e661d3eb8c955057916a85a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 15:30:26 +0200
Subject: wined3d: Give the cs its own state
---
dlls/wined3d/cs.c | 108 +++++++++++++++++++++++++++++++++++------
dlls/wined3d/device.c | 3 ++
dlls/wined3d/wined3d_private.h | 4 +-
3 files changed, 99 insertions(+), 16 deletions(-)
dlls/wined3d/cs.c | 92 +++++++++++++++++++++++++++++++++++-------
dlls/wined3d/device.c | 3 ++
dlls/wined3d/wined3d_private.h | 4 +-
3 files changed, 83 insertions(+), 16 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index fe96c38..9ec6258 100644
index fe96c38..55cd5d6 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -63,6 +63,7 @@ enum wined3d_cs_op
@ -21,7 +21,7 @@ index fe96c38..9ec6258 100644
WINED3D_CS_OP_STOP,
};
@@ -273,6 +274,13 @@ struct wined3d_cs_reset_state
@@ -273,6 +274,12 @@ struct wined3d_cs_reset_state
enum wined3d_cs_op opcode;
};
@ -29,13 +29,12 @@ index fe96c38..9ec6258 100644
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_state state;
+ float vs_consts_f[256 * 4], ps_consts_f[256 * 4];
+};
+
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -437,7 +445,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -437,7 +444,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[op->rect_count]);
device = cs->device;
@ -44,7 +43,7 @@ index fe96c38..9ec6258 100644
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
&cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags,
&op->color, op->depth, op->stencil);
@@ -466,7 +474,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -466,7 +473,7 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_draw *op = data;
@ -53,7 +52,7 @@ index fe96c38..9ec6258 100644
op->start_instance, op->instance_count, op->indexed);
return sizeof(*op);
@@ -899,6 +907,72 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -899,6 +906,57 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@ -62,13 +61,7 @@ index fe96c38..9ec6258 100644
+
+static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_adapter *adapter = cs->device->adapter;
+ const struct wined3d_cs_stateblock *op = data;
+ UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4;
+ UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4;
+
+ num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count);
+ num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count);
+
+ /* Don't memcpy the entire struct, we'll remove single items as we add dedicated
+ * ops for setting states */
@ -79,11 +72,11 @@ index fe96c38..9ec6258 100644
+
+ memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b));
+ memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i));
+ memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(*cs->state.vs_consts_f) * num_vs_consts_f);
+ memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(cs->state.vs_consts_f));
+
+ memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b));
+ memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i));
+ memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(*cs->state.ps_consts_f) * num_ps_consts_f);
+ memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(cs->state.ps_consts_f));
+
+ memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights));
+
@ -92,14 +85,7 @@ index fe96c38..9ec6258 100644
+
+void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state)
+{
+ const struct wined3d_device *device = cs->device;
+ const struct wined3d_adapter *adapter = device->adapter;
+ struct wined3d_cs_stateblock *op;
+ UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4;
+ UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4;
+
+ num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count);
+ num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count);
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_STATEBLOCK;
@ -112,13 +98,11 @@ index fe96c38..9ec6258 100644
+
+ memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b));
+ memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i));
+ op->state.vs_consts_f = (struct wined3d_vec4 *)op->vs_consts_f;
+ memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(*op->state.vs_consts_f) * num_vs_consts_f);
+ memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(op->state.vs_consts_f));
+
+ memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b));
+ memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i));
+ op->state.ps_consts_f = (struct wined3d_vec4 *)op->ps_consts_f;
+ memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(*op->state.ps_consts_f) * num_ps_consts_f);
+ memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(op->state.ps_consts_f));
+
+ /* FIXME: This is not ideal. CS is still running synchronously, so this is ok.
+ * It will go away soon anyway. */
@ -126,7 +110,7 @@ index fe96c38..9ec6258 100644
cs->ops->submit(cs);
}
@@ -1249,6 +1323,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1249,6 +1307,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key,
/* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material,
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
@ -134,7 +118,7 @@ index fe96c38..9ec6258 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1338,7 +1413,7 @@ done:
@@ -1338,7 +1397,7 @@ done:
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@ -143,7 +127,7 @@ index fe96c38..9ec6258 100644
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
return NULL;
@@ -1346,8 +1421,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1346,8 +1405,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
{
@ -153,7 +137,7 @@ index fe96c38..9ec6258 100644
}
cs->ops = &wined3d_cs_st_ops;
@@ -1356,16 +1430,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1356,16 +1414,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->data_size = WINED3D_INITIAL_CS_SIZE;
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
{
@ -172,7 +156,7 @@ index fe96c38..9ec6258 100644
}
if (wined3d_settings.cs_multithreaded)
@@ -1378,15 +1449,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1378,15 +1433,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@ -201,10 +185,10 @@ index fe96c38..9ec6258 100644
void wined3d_cs_destroy(struct wined3d_cs *cs)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 42ffdb4..24325fd 100644
index ccc773b..46cf23a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3479,6 +3479,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
@@ -3502,6 +3502,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
@ -212,7 +196,7 @@ index 42ffdb4..24325fd 100644
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3522,6 +3523,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
@@ -3545,6 +3546,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
device_invalidate_state(device, STATE_BASEVERTEXINDEX);
}
@ -220,7 +204,7 @@ index 42ffdb4..24325fd 100644
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3533,6 +3535,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3556,6 +3558,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
device, start_idx, index_count, start_instance, instance_count);
@ -229,10 +213,10 @@ index 42ffdb4..24325fd 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 973c512..6e138b8 100644
index 22f4b63..1a5f8fc 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2872,7 +2872,7 @@ struct wined3d_cs_block
@@ -2874,7 +2874,7 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -241,7 +225,7 @@ index 973c512..6e138b8 100644
};
struct wined3d_cs_ops
@@ -2913,6 +2913,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -2915,6 +2915,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;

View File

@ -1,16 +1,16 @@
From 0bb6efaf5e52ba55d1207e313fc3bd53a8a57a33 Mon Sep 17 00:00:00 2001
From e316999cb425711836f63f85a78f13bcc458643e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 20 Aug 2013 15:12:26 +0200
Subject: wined3d: Send float constant updates through the command stream
---
dlls/wined3d/cs.c | 92 +++++++++++++++++++++++++++++++++---------
dlls/wined3d/device.c | 6 ++-
dlls/wined3d/wined3d_private.h | 2 +
3 files changed, 78 insertions(+), 22 deletions(-)
dlls/wined3d/cs.c | 76 +++++++++++++++++++++++++++++++++++++++---
dlls/wined3d/device.c | 6 ++--
dlls/wined3d/wined3d_private.h | 2 ++
3 files changed, 78 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 9ec6258..ef4341c 100644
index 55cd5d6..ef4341c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -64,6 +64,8 @@ enum wined3d_cs_op
@ -22,77 +22,45 @@ index 9ec6258..ef4341c 100644
WINED3D_CS_OP_STOP,
};
@@ -278,7 +280,13 @@ struct wined3d_cs_stateblock
{
enum wined3d_cs_op opcode;
@@ -280,6 +282,13 @@ struct wined3d_cs_stateblock
struct wined3d_state state;
- float vs_consts_f[256 * 4], ps_consts_f[256 * 4];
+};
+
};
+struct wined3d_cs_set_consts_f
+{
+ enum wined3d_cs_op opcode;
+ UINT start_register, vector4f_count;
+ struct wined3d_vec4 constants;
};
+};
+
/* FIXME: The list synchronization probably isn't particularly fast. */
@@ -912,13 +920,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data)
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
- const struct wined3d_adapter *adapter = cs->device->adapter;
const struct wined3d_cs_stateblock *op = data;
- UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4;
- UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4;
-
- num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count);
- num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count);
/* Don't memcpy the entire struct, we'll remove single items as we add dedicated
* ops for setting states */
@@ -929,11 +931,9 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
@@ -922,11 +931,9 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b));
memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i));
- memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(*cs->state.vs_consts_f) * num_vs_consts_f);
- memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(cs->state.vs_consts_f));
memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b));
memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i));
- memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(*cs->state.ps_consts_f) * num_ps_consts_f);
- memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(cs->state.ps_consts_f));
memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights));
@@ -942,14 +942,7 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct wined3d_state *state)
{
- const struct wined3d_device *device = cs->device;
- const struct wined3d_adapter *adapter = device->adapter;
struct wined3d_cs_stateblock *op;
- UINT num_vs_consts_f = sizeof(op->vs_consts_f) / sizeof(*op->vs_consts_f) / 4;
- UINT num_ps_consts_f = sizeof(op->ps_consts_f) / sizeof(*op->ps_consts_f) / 4;
-
- num_vs_consts_f = min(num_vs_consts_f, adapter->d3d_info.limits.vs_uniform_count);
- num_ps_consts_f = min(num_ps_consts_f, adapter->d3d_info.limits.ps_uniform_count);
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_STATEBLOCK;
@@ -962,13 +955,9 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
@@ -948,11 +955,9 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b));
memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i));
- op->state.vs_consts_f = (struct wined3d_vec4 *)op->vs_consts_f;
- memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(*op->state.vs_consts_f) * num_vs_consts_f);
- memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(op->state.vs_consts_f));
memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b));
memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i));
- op->state.ps_consts_f = (struct wined3d_vec4 *)op->ps_consts_f;
- memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(*op->state.ps_consts_f) * num_ps_consts_f);
- memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(op->state.ps_consts_f));
/* FIXME: This is not ideal. CS is still running synchronously, so this is ok.
* It will go away soon anyway. */
@@ -1048,6 +1037,67 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1032,6 +1037,67 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -160,7 +128,7 @@ index 9ec6258..ef4341c 100644
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_render_state *op = data;
@@ -1324,6 +1374,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1308,6 +1374,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material,
/* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state,
/* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
@ -170,12 +138,12 @@ index 9ec6258..ef4341c 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 24325fd..681ba4e 100644
index 46cf23a..241b450 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2472,7 +2472,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
memset(&device->recording->changed.vertexShaderConstantsF[start_idx], 1,
count * sizeof(*device->recording->changed.vertexShaderConstantsF));
@@ -2495,7 +2495,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
memset(&device->recording->changed.vs_consts_f[start_idx], 1,
count * sizeof(*device->recording->changed.vs_consts_f));
else
- device->shader_backend->shader_update_float_vertex_constants(device, start_idx, count);
+ wined3d_cs_emit_set_consts_f(device->cs, start_idx, constants, count,
@ -183,9 +151,9 @@ index 24325fd..681ba4e 100644
return WINED3D_OK;
}
@@ -2700,7 +2701,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device,
memset(&device->recording->changed.pixelShaderConstantsF[start_idx], 1,
count * sizeof(*device->recording->changed.pixelShaderConstantsF));
@@ -2723,7 +2724,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device,
memset(&device->recording->changed.ps_consts_f[start_idx], 1,
count * sizeof(*device->recording->changed.ps_consts_f));
else
- device->shader_backend->shader_update_float_pixel_constants(device, start_idx, count);
+ wined3d_cs_emit_set_consts_f(device->cs, start_idx, constants, count,
@ -194,10 +162,10 @@ index 24325fd..681ba4e 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6e138b8..29cf744 100644
index 1a5f8fc..125fb6d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2949,6 +2949,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -2951,6 +2951,8 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 063fecf5696baafe17b111d015659fbc5474671c Mon Sep 17 00:00:00 2001
From d37e6ad06898282c5cf0e9665afad8ce5b1d8016 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Apr 2013 14:52:24 +0200
Subject: wined3d: Pass the depth stencil to swapchain->present
@ -26,10 +26,10 @@ index c4cf1ad..423ef22 100644
return sizeof(*op);
}
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 7b0f1ec..f05af99 100644
index 178e634..6ee5501 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -474,10 +474,10 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
@@ -478,10 +478,10 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
}
static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
@ -42,9 +42,9 @@ index 7b0f1ec..f05af99 100644
const struct wined3d_gl_info *gl_info;
struct wined3d_texture *logo_texture;
struct wined3d_context *context;
@@ -621,15 +621,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
break;
}
@@ -617,15 +617,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1],
0, WINED3D_LOCATION_DISCARDED);
- if (fb->depth_stencil)
+ if (depth_stencil)
@ -61,7 +61,7 @@ index 7b0f1ec..f05af99 100644
if (ds == swapchain->device->onscreen_depth_stencil)
{
wined3d_texture_decref(swapchain->device->onscreen_depth_stencil->container);
@@ -704,7 +704,8 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai
@@ -700,7 +700,8 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai
}
static void swapchain_gdi_present(struct wined3d_swapchain *swapchain,
@ -72,7 +72,7 @@ index 7b0f1ec..f05af99 100644
struct wined3d_surface *front, *back;
HBITMAP bitmap;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 51aaefd..4ee571e 100644
index 8c31ffd..54bb128 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3079,7 +3079,8 @@ struct wined3d_shader_resource_view

View File

@ -1,16 +1,16 @@
From bd25fc1277b13ce1474ef65b95945cca69cfee48 Mon Sep 17 00:00:00 2001
From f62f9c0774759bd920543c3603d6b65ba77347a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 14:20:47 +0200
Subject: wined3d: Send int constant updates through the command stream
---
dlls/wined3d/cs.c | 76 ++++++++++++++++++++++++++++++++++++++----
dlls/wined3d/cs.c | 74 ++++++++++++++++++++++++++++++++++++++----
dlls/wined3d/device.c | 6 ++--
dlls/wined3d/wined3d_private.h | 2 ++
3 files changed, 76 insertions(+), 8 deletions(-)
3 files changed, 74 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index f1fc4b9..86a8603 100644
index f1fc4b9..e8d7b9a 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -66,8 +66,10 @@ enum wined3d_cs_op
@ -24,21 +24,22 @@ index f1fc4b9..86a8603 100644
WINED3D_CS_OP_GLFINISH,
WINED3D_CS_OP_SET_BASE_VERTEX_INDEX,
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
@@ -301,6 +303,13 @@ struct wined3d_cs_set_consts_b
@@ -301,6 +303,14 @@ struct wined3d_cs_set_consts_b
BOOL constants[1];
};
+struct wined3d_cs_set_consts_i
+{
+ enum wined3d_cs_op opcode;
+ UINT start_register, vector4i_count;
+ int constants[4];
+ unsigned int start_idx;
+ unsigned int count;
+ struct wined3d_ivec4 constants[1];
+};
+
struct wined3d_cs_finish
{
enum wined3d_cs_op opcode;
@@ -969,9 +978,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
@@ -969,9 +979,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
/* Don't memcpy the entire struct, we'll remove single items as we add dedicated
* ops for setting states */
@ -48,7 +49,7 @@ index f1fc4b9..86a8603 100644
memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights));
@@ -987,9 +993,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
@@ -987,9 +994,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
/* Don't memcpy the entire struct, we'll remove single items as we add dedicated
* ops for setting states */
@ -58,7 +59,7 @@ index f1fc4b9..86a8603 100644
/* FIXME: This is not ideal. CS is still running synchronously, so this is ok.
* It will go away soon anyway. */
@@ -1211,6 +1214,65 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
@@ -1211,6 +1215,62 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
cs->ops->submit(cs);
}
@ -67,12 +68,11 @@ index f1fc4b9..86a8603 100644
+ const struct wined3d_cs_set_consts_i *op = data;
+ struct wined3d_device *device = cs->device;
+
+ memcpy(&cs->state.vs_consts_i[op->start_register * 4], op->constants,
+ sizeof(*cs->state.vs_consts_i) * 4 * op->vector4i_count);
+ memcpy(&cs->state.vs_consts_i[op->start_idx], op->constants, sizeof(op->constants[0]) * op->count);
+
+ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_I);
+
+ return sizeof(*op) + sizeof(op->constants) * (op->vector4i_count - 1);
+ return sizeof(*op) + sizeof(op->constants[0]) * (op->count - 1);
+}
+
+static UINT wined3d_cs_exec_set_ps_consts_i(struct wined3d_cs *cs, const void *data)
@ -80,21 +80,19 @@ index f1fc4b9..86a8603 100644
+ const struct wined3d_cs_set_consts_i *op = data;
+ struct wined3d_device *device = cs->device;
+
+ memcpy(&cs->state.ps_consts_i[op->start_register * 4], op->constants,
+ sizeof(*cs->state.ps_consts_i) * 4 * op->vector4i_count);
+ memcpy(&cs->state.ps_consts_i[op->start_idx], op->constants, sizeof(op->constants[0]) * op->count);
+
+ device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_I);
+
+ return sizeof(*op) + sizeof(op->constants) * (op->vector4i_count - 1);
+ return sizeof(*op) + sizeof(op->constants[0]) * (op->count - 1);
+}
+
+void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register,
+ const int *constants, UINT vector4i_count, enum wined3d_shader_type type)
+void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, unsigned int count,
+ const struct wined3d_ivec4 *constants, enum wined3d_shader_type type)
+{
+ struct wined3d_cs_set_consts_i *op;
+ UINT extra_space = vector4i_count - 1;
+
+ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space);
+ op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants[0]) * (count - 1));
+ switch (type)
+ {
+ case WINED3D_SHADER_TYPE_PIXEL:
@ -114,9 +112,9 @@ index f1fc4b9..86a8603 100644
+ case WINED3D_SHADER_TYPE_COUNT:
+ break;
+ }
+ op->start_register = start_register;
+ op->vector4i_count = vector4i_count;
+ memcpy(op->constants, constants, sizeof(op->constants) * vector4i_count);
+ op->start_idx = start_idx;
+ op->count = count;
+ memcpy(op->constants, constants, sizeof(op->constants[0]) * count);
+
+ cs->ops->submit(cs);
+}
@ -124,7 +122,7 @@ index f1fc4b9..86a8603 100644
static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_texture_state *op = data;
@@ -1538,8 +1600,10 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1538,8 +1598,10 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b,
@ -136,39 +134,39 @@ index f1fc4b9..86a8603 100644
/* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 70cc2af..34d03ef 100644
index f961e3d..b1a3b02 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2411,7 +2411,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device,
@@ -2436,7 +2436,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device,
}
else
{
- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_I);
+ wined3d_cs_emit_set_consts_i(device->cs, start_register, constants,
+ vector4i_count, WINED3D_SHADER_TYPE_VERTEX);
+ wined3d_cs_emit_set_consts_i(device->cs, start_idx, count,
+ constants, WINED3D_SHADER_TYPE_VERTEX);
}
return WINED3D_OK;
@@ -2640,7 +2641,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device,
@@ -2667,7 +2668,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device,
}
else
{
- device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_I);
+ wined3d_cs_emit_set_consts_i(device->cs, start_register, constants,
+ vector4i_count, WINED3D_SHADER_TYPE_PIXEL);
+ wined3d_cs_emit_set_consts_i(device->cs, start_idx, count,
+ constants, WINED3D_SHADER_TYPE_PIXEL);
}
return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 263925f..04d17b1 100644
index 684a4c3..b14db6d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2952,6 +2952,8 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, co
UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register,
+ const int *constants, UINT vector4i_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
+ unsigned int count, const struct wined3d_ivec4 *constants, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
UINT base_vertex_index) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From b4d0f97a8a6e5a86d4e3fd1cf416da6521492dbc Mon Sep 17 00:00:00 2001
From 769cd7807af62078c543e9ac9cc27783322f295c 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.
@ -26,7 +26,7 @@ index a308311..0c64b31 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 03bf85e..6cbf83e 100644
index e526a33..0372843 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -74,6 +74,7 @@ enum wined3d_cs_op
@ -37,7 +37,7 @@ index 03bf85e..6cbf83e 100644
WINED3D_CS_OP_STOP,
};
@@ -335,6 +336,18 @@ struct wined3d_cs_set_light_enable
@@ -336,6 +337,18 @@ struct wined3d_cs_set_light_enable
BOOL enable;
};
@ -56,7 +56,7 @@ index 03bf85e..6cbf83e 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -1490,6 +1503,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
@@ -1488,6 +1501,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
struct wined3d_device *device = cs->device;
struct wined3d_context *context;
@ -66,7 +66,7 @@ index 03bf85e..6cbf83e 100644
context = context_acquire(device, NULL);
context->gl_info->gl_ops.gl.p_glFinish();
context_release(context);
@@ -1701,6 +1717,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1699,6 +1715,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
cs->ops->submit(cs);
}
@ -105,7 +105,7 @@ index 03bf85e..6cbf83e 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1741,6 +1789,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1739,6 +1787,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
/* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light,
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
@ -113,7 +113,7 @@ index 03bf85e..6cbf83e 100644
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
@@ -1819,6 +1868,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
@@ -1817,6 +1866,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param)
TRACE("Started.\n");
@ -122,10 +122,10 @@ index 03bf85e..6cbf83e 100644
{
struct wined3d_cs_block *block;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ba1e795..3423e83 100644
index 44692a9..d6fab5d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3962,7 +3962,7 @@ const struct blit_shader cpu_blit = {
@@ -4116,7 +4116,7 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@ -134,7 +134,7 @@ index ba1e795..3423e83 100644
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
{
@@ -3972,9 +3972,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4126,9 +4126,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;
@ -146,7 +146,7 @@ index ba1e795..3423e83 100644
DWORD src_ds_flags, dst_ds_flags;
BOOL scale, convert;
@@ -3987,91 +3986,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4141,91 +4140,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
| WINED3D_BLT_DO_NOT_WAIT
| WINED3D_BLT_ALPHA_TEST;
@ -243,7 +243,7 @@ index ba1e795..3423e83 100644
}
if (!device->d3d_initialized)
@@ -4096,11 +4021,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4250,11 +4175,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
}
@ -255,7 +255,7 @@ index ba1e795..3423e83 100644
dst_swapchain = dst_texture->swapchain;
/* This isn't strictly needed. FBO blits for example could deal with
@@ -4136,22 +4056,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4290,22 +4210,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))
@ -281,7 +281,7 @@ index ba1e795..3423e83 100644
}
}
else
@@ -4187,7 +4101,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4341,7 +4255,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)))
@ -290,7 +290,7 @@ index ba1e795..3423e83 100644
}
else
{
@@ -4230,7 +4144,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4384,7 +4298,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
context, dst_texture->resource.draw_binding);
context_release(context);
}
@ -299,7 +299,7 @@ index ba1e795..3423e83 100644
}
}
}
@@ -4254,7 +4168,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4408,7 +4322,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;
@ -308,7 +308,7 @@ index ba1e795..3423e83 100644
}
if (fbo_blit_supported(&device->adapter->gl_info, blit_op,
@@ -4275,7 +4189,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4429,7 +4343,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);
@ -317,7 +317,7 @@ index ba1e795..3423e83 100644
}
blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
@@ -4285,7 +4199,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4439,7 +4353,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);
@ -326,7 +326,7 @@ index ba1e795..3423e83 100644
}
}
}
@@ -4293,11 +4207,142 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4447,9 +4361,140 @@ 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)))
@ -469,10 +469,8 @@ index ba1e795..3423e83 100644
+
+ return WINED3D_OK;
}
/* Context activation is done by the caller. Context may be NULL in
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 925a326..a248e24 100644
index 523185b..d1e521c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2746,6 +2746,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P

View File

@ -1,4 +1,4 @@
From 2e09b2b8c2b0821eb9ef55547d9600855d079228 Mon Sep 17 00:00:00 2001
From a48f1245857c50591d0ddc367e191b5857c80b2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
Date: Sun, 3 Apr 2016 19:34:19 +0100
Subject: wined3d: send texture maps through the command stream
@ -116,7 +116,7 @@ index fd4a0ce..75e679c 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index f368777..14ac300 100644
index c3d5037..6ff5815 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1580,6 +1580,63 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
@ -344,10 +344,10 @@ index f368777..14ac300 100644
--sub_resource->map_count;
if (!--resource->map_count && texture->update_map_binding)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3b8ad5e..c3bfd58 100644
index 1a4d740..8253934 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2606,6 +2606,8 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -2607,6 +2607,8 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD location);
@ -355,7 +355,7 @@ index 3b8ad5e..c3bfd58 100644
+ DWORD flags) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
@@ -2614,6 +2616,8 @@ void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_texture_unmap_bo_address(const struct wined3d_bo_address *data,

View File

@ -1,4 +1,4 @@
From 774388227ccae6455516e892dcd30c5376d7f152 Mon Sep 17 00:00:00 2001
From 9371749a7b3da74f0f0899fecc86f02bbf132ca7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 23:33:14 +0200
Subject: wined3d: Replace the linked lists with a ringbuffer
@ -9,7 +9,7 @@ Subject: wined3d: Replace the linked lists with a ringbuffer
2 files changed, 161 insertions(+), 222 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 75e679c..1c29500 100644
index 070b937..bbabc3b 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -22,20 +22,10 @@
@ -35,7 +35,7 @@ index 75e679c..1c29500 100644
WINED3D_CS_OP_FENCE,
WINED3D_CS_OP_PRESENT,
WINED3D_CS_OP_CLEAR,
@@ -379,99 +369,30 @@ struct wined3d_cs_texture_unmap
@@ -380,99 +370,30 @@ struct wined3d_cs_texture_unmap
unsigned int sub_resource_idx;
};
@ -149,7 +149,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data)
@@ -492,14 +413,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled)
@@ -493,14 +414,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_FENCE;
op->signalled = signalled;
@ -166,7 +166,7 @@ index 75e679c..1c29500 100644
/* A busy wait should be fine, we're not supposed to have to wait very
* long. */
@@ -538,7 +459,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -539,7 +460,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
pending = InterlockedIncrement(&cs->pending_presents);
@ -175,7 +175,7 @@ index 75e679c..1c29500 100644
while (pending > 1)
pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0);
@@ -564,8 +485,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -565,8 +486,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
struct wined3d_cs_clear *op;
@ -186,7 +186,7 @@ index 75e679c..1c29500 100644
op->opcode = WINED3D_CS_OP_CLEAR;
op->flags = flags;
op->color = *color;
@@ -574,7 +495,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -575,7 +496,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
op->rect_count = rect_count;
memcpy(op->rects, rects, sizeof(*rects) * rect_count);
@ -195,7 +195,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -615,7 +536,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
@@ -616,7 +537,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
op->instance_count = instance_count;
op->indexed = indexed;
@ -204,7 +204,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data)
@@ -637,7 +558,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -638,7 +559,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
op->predicate = predicate;
op->value = value;
@ -213,7 +213,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
@@ -658,7 +579,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -659,7 +580,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
op->viewport = *viewport;
@ -222,7 +222,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data)
@@ -679,7 +600,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -680,7 +601,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT;
op->rect = *rect;
@ -231,7 +231,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data)
@@ -702,7 +623,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -703,7 +624,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
op->view_idx = view_idx;
op->view = view;
@ -240,7 +240,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data)
@@ -756,7 +677,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -757,7 +678,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW;
op->view = view;
@ -249,7 +249,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data)
@@ -777,7 +698,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -778,7 +699,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION;
op->declaration = declaration;
@ -258,7 +258,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data)
@@ -814,7 +735,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -815,7 +736,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
op->offset = offset;
op->stride = stride;
@ -267,7 +267,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data)
@@ -841,7 +762,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -842,7 +763,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
op->frequency = frequency;
op->flags = flags;
@ -276,7 +276,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data)
@@ -874,7 +795,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -875,7 +796,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
op->buffer = buffer;
op->offset = offset;
@ -285,7 +285,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data)
@@ -906,7 +827,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -907,7 +828,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
op->buffer = buffer;
op->format_id = format_id;
@ -294,7 +294,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data)
@@ -937,7 +858,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -938,7 +859,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
op->cb_idx = cb_idx;
op->buffer = buffer;
@ -303,7 +303,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1029,7 +950,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1030,7 +951,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@ -312,7 +312,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
@@ -1053,7 +974,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1054,7 +975,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
op->view_idx = view_idx;
op->view = view;
@ -321,7 +321,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1077,7 +998,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1078,7 +999,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
op->sampler_idx = sampler_idx;
op->sampler = sampler;
@ -330,7 +330,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1100,7 +1021,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1101,7 +1022,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
op->type = type;
op->shader = shader;
@ -339,7 +339,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data)
@@ -1136,8 +1057,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register,
@@ -1137,8 +1058,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register,
{
struct wined3d_cs_set_consts_f *op;
UINT extra_space = vector4f_count - 1;
@ -350,7 +350,7 @@ index 75e679c..1c29500 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1161,7 +1083,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register,
@@ -1162,7 +1084,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register,
op->vector4f_count = vector4f_count;
memcpy(&op->constants, constants, sizeof(*constants) * vector4f_count);
@ -359,7 +359,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
@@ -1183,8 +1105,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1184,8 +1106,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
op->state = state;
op->value = value;
@ -370,7 +370,7 @@ index 75e679c..1c29500 100644
static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data)
{
@@ -1217,8 +1139,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
@@ -1218,8 +1140,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
{
struct wined3d_cs_set_consts_b *op;
UINT extra_space = bool_count - 1;
@ -381,7 +381,7 @@ index 75e679c..1c29500 100644
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1242,7 +1165,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
@@ -1243,7 +1166,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register,
op->bool_count = bool_count;
memcpy(op->constants, constants, sizeof(op->constants) * bool_count);
@ -390,27 +390,27 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data)
@@ -1276,8 +1199,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register,
@@ -1274,8 +1197,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
const struct wined3d_ivec4 *constants, enum wined3d_shader_type type)
{
struct wined3d_cs_set_consts_i *op;
UINT extra_space = vector4i_count - 1;
+ size_t size = sizeof(*op) + sizeof(op->constants) * extra_space;
+ size_t size = sizeof(*op) + sizeof(op->constants[0]) * (count - 1);
- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants) * extra_space);
- op = cs->ops->require_space(cs, sizeof(*op) + sizeof(op->constants[0]) * (count - 1));
+ op = cs->ops->require_space(cs, size);
switch (type)
{
case WINED3D_SHADER_TYPE_PIXEL:
@@ -1301,7 +1225,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, UINT start_register,
op->vector4i_count = vector4i_count;
memcpy(op->constants, constants, sizeof(op->constants) * vector4i_count);
@@ -1299,7 +1223,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
op->count = count;
memcpy(op->constants, constants, sizeof(op->constants[0]) * count);
- cs->ops->submit(cs);
+ cs->ops->submit(cs, size);
}
static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
@@ -1325,7 +1249,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1323,7 +1247,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
op->state = state;
op->value = value;
@ -419,7 +419,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
@@ -1349,7 +1273,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1347,7 +1271,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
op->state = state;
op->value = value;
@ -428,7 +428,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data)
@@ -1373,7 +1297,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1371,7 +1295,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
op->state = state;
op->matrix = *matrix;
@ -437,7 +437,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data)
@@ -1395,7 +1319,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1393,7 +1317,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
op->plane_idx = plane_idx;
op->plane = *plane;
@ -446,7 +446,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data)
@@ -1480,7 +1404,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1478,7 +1402,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
else
op->set = 0;
@ -455,7 +455,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data)
@@ -1501,7 +1425,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1499,7 +1423,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@ -464,7 +464,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1525,7 +1449,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1523,7 +1447,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_RESET_STATE;
@ -473,7 +473,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
@@ -1551,7 +1475,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -1549,7 +1473,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_GLFINISH;
@ -482,7 +482,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data)
@@ -1573,7 +1497,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
@@ -1571,7 +1495,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX;
op->base_vertex_index = base_vertex_index;
@ -491,7 +491,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data)
@@ -1599,7 +1523,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1597,7 +1521,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
op->gl_primitive_type = primitive_type;
@ -500,7 +500,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1656,7 +1580,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1654,7 +1578,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@ -509,7 +509,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -1745,7 +1669,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1743,7 +1667,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
op->idx = idx;
op->enable = enable;
@ -518,7 +518,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
@@ -1777,7 +1701,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1775,7 +1699,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
if (fx)
op->fx = *fx;
@ -527,7 +527,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
@@ -1810,7 +1734,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -1808,7 +1732,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
op->stencil = stencil;
op->blitter = blitter;
@ -536,7 +536,7 @@ index 75e679c..1c29500 100644
}
static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data)
@@ -1835,12 +1759,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
@@ -1833,12 +1757,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
op->flags = flags;
op->mem = &ret;
@ -552,7 +552,7 @@ index 75e679c..1c29500 100644
return ret;
}
@@ -1863,11 +1789,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
@@ -1861,11 +1787,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@ -567,7 +567,7 @@ index 75e679c..1c29500 100644
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
@@ -1912,42 +1840,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1910,42 +1838,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
};
@ -650,7 +650,7 @@ index 75e679c..1c29500 100644
};
/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an
@@ -1959,9 +1904,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
@@ -1957,9 +1902,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
op = wined3d_cs_mt_require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_STOP;
@ -690,7 +690,7 @@ index 75e679c..1c29500 100644
void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{
@@ -1985,31 +1959,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
@@ -1983,31 +1957,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
static DWORD WINAPI wined3d_cs_run(void *thread_param)
{
struct wined3d_cs *cs = thread_param;
@ -737,7 +737,7 @@ index 75e679c..1c29500 100644
}
done:
@@ -2034,25 +2009,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2032,25 +2007,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@ -763,7 +763,7 @@ index 75e679c..1c29500 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@@ -2064,12 +2024,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2062,12 +2022,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
err:
if (cs)
@ -776,7 +776,7 @@ index 75e679c..1c29500 100644
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -2088,17 +2043,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2086,17 +2041,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
CloseHandle(cs->thread);
if (ret != WAIT_OBJECT_0)
ERR("Wait failed (%#x).\n", ret);
@ -795,7 +795,7 @@ index 75e679c..1c29500 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c3bfd58..697e674 100644
index 999c770..195ffb3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -31,6 +31,7 @@

View File

@ -1,14 +1,14 @@
From aacc15190afbbc0c2802e876066e0d84f83e7d8d Mon Sep 17 00:00:00 2001
From 242374f346ff9108cd2d450f2fe79d7d1d48752b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 16 Mar 2014 14:13:42 +0100
Subject: wined3d: Send getdc and releasedc through the command stream.
Another hacky patch to avoid using GL outside the worker thread.
---
dlls/wined3d/cs.c | 57 ++++++++++++++++++++++++++++
dlls/wined3d/texture.c | 84 ++++++++++++++++++++++++------------------
dlls/wined3d/wined3d_private.h | 8 ++++
3 files changed, 114 insertions(+), 35 deletions(-)
dlls/wined3d/cs.c | 57 +++++++++++++++++++++++++++++
dlls/wined3d/texture.c | 82 ++++++++++++++++++++++++------------------
dlls/wined3d/wined3d_private.h | 8 +++++
3 files changed, 113 insertions(+), 34 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 6de25ab..3208c35 100644
@ -100,7 +100,7 @@ index 6de25ab..3208c35 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 44d38f8..4b0cc31 100644
index 7b27fd5..4b6c1d8 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2677,13 +2677,39 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
@ -155,25 +155,17 @@ index 44d38f8..4b0cc31 100644
- wined3d_cs_emit_glfinish(device->cs);
- device->cs->ops->finish(device->cs);
- }
-
- if (device->d3d_initialized)
- context = context_acquire(device, NULL);
+ wined3d_cs_emit_get_dc(device->cs, texture, sub_resource_idx);
+ if (FAILED(texture->dc_hr))
+ return texture->dc_hr;
+
+ *dc = surface->dc;
+ TRACE("Returning dc %p.\n", *dc);
- if (device->d3d_initialized)
- context = context_acquire(device, NULL);
+ return WINED3D_OK;
+}
- wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding);
- wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
+void wined3d_texture_release_dc_cs(struct wined3d_texture *texture, unsigned int sub_resource_idx)
+{
+ struct wined3d_device *device = texture->resource.device;
+ struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
+ struct wined3d_surface *surface = sub_resource->u.surface;
+ *dc = surface->dc;
+ TRACE("Returning dc %p.\n", *dc);
- if (!surface->dc)
- hr = wined3d_surface_create_dc(surface);
@ -181,26 +173,34 @@ index 44d38f8..4b0cc31 100644
- context_release(context);
- if (FAILED(hr))
- return WINED3DERR_INVALIDCALL;
+ if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D))
+ wined3d_surface_destroy_dc(surface);
+ return WINED3D_OK;
+}
+ --sub_resource->map_count;
+ if (!--texture->resource.map_count && texture->update_map_binding)
+ wined3d_texture_update_map_binding(texture);
if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
- if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
- texture->flags |= WINED3D_TEXTURE_DC_IN_USE;
- ++texture->resource.map_count;
- ++sub_resource->map_count;
-
+void wined3d_texture_release_dc_cs(struct wined3d_texture *texture, unsigned int sub_resource_idx)
+{
+ struct wined3d_device *device = texture->resource.device;
+ struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
+ struct wined3d_surface *surface = sub_resource->u.surface;
- *dc = surface->dc;
- TRACE("Returning dc %p.\n", *dc);
-
+ if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D))
+ wined3d_surface_destroy_dc(surface);
- return hr;
+ --sub_resource->map_count;
+ if (!--texture->resource.map_count && texture->update_map_binding)
+ wined3d_texture_update_map_binding(texture);
+ if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
+ texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE;
}
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
@@ -2760,15 +2781,8 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
@@ -2760,14 +2781,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
return WINED3DERR_INVALIDCALL;
}
@ -212,17 +212,15 @@ index 44d38f8..4b0cc31 100644
- wined3d_texture_update_map_binding(texture);
- if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
- texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE;
-
+ wined3d_cs_emit_release_dc(device->cs, texture, sub_resource_idx);
+
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5a4f71b..2ae0f2c 100644
index 496f521..38ab06c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2537,6 +2537,7 @@ struct wined3d_texture
@@ -2538,6 +2538,7 @@ struct wined3d_texture
DWORD flags;
GLenum target;
DWORD update_map_binding;
@ -230,7 +228,7 @@ index 5a4f71b..2ae0f2c 100644
GLuint rb_multisample;
GLuint rb_resolved;
@@ -2632,6 +2633,7 @@ void wined3d_texture_changed(struct wined3d_texture *texture,
@@ -2633,6 +2634,7 @@ void wined3d_texture_changed(struct wined3d_texture *texture,
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
void wined3d_texture_cleanup(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
@ -238,15 +236,15 @@ index 5a4f71b..2ae0f2c 100644
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_bo_address *data, DWORD locations, BOOL map) DECLSPEC_HIDDEN;
@@ -2651,6 +2653,8 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
@@ -2652,6 +2654,8 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
DWORD flags) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
+void wined3d_texture_release_dc_cs(struct wined3d_texture *texture,
+ unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@@ -3061,6 +3065,10 @@ void wined3d_cs_emit_texture_cleanup(struct wined3d_cs *cs, struct wined3d_textu
void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN;
void wined3d_cs_emit_shader_resource_view_destroy(struct wined3d_cs *cs,

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From b5601ae74c8c528a2c636587a7b8678dfb717b5a Mon Sep 17 00:00:00 2001
From a283ad7a863862caf312843950b88bdfd9faeacc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 16 May 2015 00:24:35 +0200
Subject: wininet: Strip filename if no path is set in cookie.
@ -11,7 +11,7 @@ be a bit less strict in the test.
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index edea9f8..f7c8f76 100644
index c44156c..7281512 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -764,10 +764,18 @@ static void HTTP_ProcessCookies( http_request_t *request )
@ -33,13 +33,12 @@ index edea9f8..f7c8f76 100644
EnterCriticalSection( &request->headers_section );
while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1)
@@ -789,11 +797,12 @@ static void HTTP_ProcessCookies( http_request_t *request )
continue;
@@ -786,10 +794,11 @@ static void HTTP_ProcessCookies( http_request_t *request )
name = substr(setCookieHeader->lpszValue, data - setCookieHeader->lpszValue);
data++;
- set_cookie(request->server->name, request->path, name, data, INTERNET_COOKIE_HTTPONLY);
+ set_cookie(request->server->name, path, name, data, INTERNET_COOKIE_HTTPONLY);
heap_free(name);
- set_cookie(substrz(request->server->name), substrz(request->path), name, substrz(data), INTERNET_COOKIE_HTTPONLY);
+ set_cookie(substrz(request->server->name), substrz(path), name, substrz(data), INTERNET_COOKIE_HTTPONLY);
}
LeaveCriticalSection( &request->headers_section );
@ -48,10 +47,10 @@ index edea9f8..f7c8f76 100644
static void strip_spaces(LPWSTR start)
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index 1a82aba..ff76e9f 100644
index b3826bb..910a0b4 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -2217,7 +2217,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
@@ -2226,7 +2226,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
}
if (strstr(buffer, "/testC"))
{
@ -60,7 +59,7 @@ index 1a82aba..ff76e9f 100644
send(c, okmsg, sizeof okmsg-1, 0);
else
send(c, notokmsg, sizeof notokmsg-1, 0);
@@ -3159,7 +3159,7 @@ static void test_header_override(int port)
@@ -3196,7 +3196,7 @@ static void test_header_override(int port)
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
ok(ret, "HttpSendRequest failed\n");
@ -69,7 +68,7 @@ index 1a82aba..ff76e9f 100644
InternetCloseHandle(req);
req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0);
@@ -3168,7 +3168,7 @@ static void test_header_override(int port)
@@ -3205,7 +3205,7 @@ static void test_header_override(int port)
ret = HttpSendRequestA(req, NULL, 0, NULL, 0);
ok(ret, "HttpSendRequest failed\n");
@ -79,5 +78,5 @@ index 1a82aba..ff76e9f 100644
InternetCloseHandle(req);
InternetSetCookieA("http://test.local", "foo", "bar");
--
2.4.3
2.8.0

View File

@ -1,29 +0,0 @@
From 85a6e4977cf307dff5ebefa93bb08bc10c9cfb16 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 11 May 2016 23:25:18 +0200
Subject: wininet: Return synchronously from InternetReadFile if there is no
more data to read.
Similar to 87fffa1ebfb71fe7a34aa989fa88f85409dbb62f.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
---
dlls/wininet/http.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 646619b..c7d857e 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -3242,7 +3242,7 @@ static DWORD HTTPREQ_ReadFile(object_header_t *hdr, void *buffer, DWORD size, DW
if (TryEnterCriticalSection( &req->read_section ))
{
- if (get_avail_data(req))
+ if (get_avail_data(req) || end_of_read_data(req))
{
res = HTTPREQ_Read(req, buffer, size, read);
LeaveCriticalSection( &req->read_section );
--
2.8.0

View File

@ -1 +0,0 @@
Fixes: [40536] Return synchronously from InternetReadFile if there is no more data to read

View File

@ -1 +1 @@
Wine Staging 1.9.10
Wine Staging 1.9.11 (unreleased)