From 16e6b1c3e345228277250ec7538aa941e2944625 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 19 May 2016 01:23:36 +0200 Subject: [PATCH] Rebase against 58e95f72218fa018739c484f172bc236e685d5bb. [dbghelp-EnumerateLoadedModulesExW] Removed patch to implement dbghelp.EnumerateLoadedModulesExW (fixed upstream). --- ...-Implement-EnumerateLoadedModulesExW.patch | 47 --- .../definition | 1 - ...ters-before-sound-is-multiplied-to-s.patch | 28 +- patches/patchinstall.sh | 21 +- ...ture_load_location-instead-of-surfac.patch | 42 +-- ...l-constant-updates-through-the-comma.patch | 68 ++-- ...-constant-updates-through-the-comman.patch | 26 +- ...e-the-linked-lists-with-a-ringbuffer.patch | 116 +++---- .../wined3d-CSMT_Main/9999-IfDefined.patch | 326 +++++++++--------- ...wininet-no-support-on-this-platform-.patch | 10 +- ...st-auth-credential-reusage-with-host.patch | 12 +- ...NTERNET_INVALID_PORT_NUMBER-in-HttpO.patch | 18 +- 12 files changed, 323 insertions(+), 392 deletions(-) delete mode 100644 patches/dbghelp-EnumerateLoadedModulesExW/0001-dbghelp-Implement-EnumerateLoadedModulesExW.patch delete mode 100644 patches/dbghelp-EnumerateLoadedModulesExW/definition diff --git a/patches/dbghelp-EnumerateLoadedModulesExW/0001-dbghelp-Implement-EnumerateLoadedModulesExW.patch b/patches/dbghelp-EnumerateLoadedModulesExW/0001-dbghelp-Implement-EnumerateLoadedModulesExW.patch deleted file mode 100644 index 07d6897c..00000000 --- a/patches/dbghelp-EnumerateLoadedModulesExW/0001-dbghelp-Implement-EnumerateLoadedModulesExW.patch +++ /dev/null @@ -1,47 +0,0 @@ -From fe5d45b540dccdb589978118b7c2828414e21331 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Mon, 16 May 2016 18:00:49 +0200 -Subject: dbghelp: Implement EnumerateLoadedModulesExW. - ---- - dlls/dbghelp/dbghelp.spec | 2 +- - dlls/dbghelp/module.c | 10 ++++++++++ - 2 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec -index 6004f95..624e023 100644 ---- a/dlls/dbghelp/dbghelp.spec -+++ b/dlls/dbghelp/dbghelp.spec -@@ -5,7 +5,7 @@ - @ stdcall EnumerateLoadedModules(long ptr ptr) - @ stdcall EnumerateLoadedModules64(long ptr ptr) - @ stub EnumerateLoadedModulesEx --@ stub EnumerateLoadedModulesExW -+@ stub EnumerateLoadedModulesExW(long ptr ptr) - @ stdcall EnumerateLoadedModulesW64(long ptr ptr) - @ stdcall ExtensionApiVersion() - @ stdcall FindDebugInfoFile(str str ptr) -diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c -index 69a043c..f22ee65 100644 ---- a/dlls/dbghelp/module.c -+++ b/dlls/dbghelp/module.c -@@ -921,6 +921,16 @@ BOOL WINAPI EnumerateLoadedModulesW64(HANDLE hProcess, - } - - /****************************************************************** -+ * EnumerateLoadedModulesExW (DBGHELP.@) -+ * -+ */ -+BOOL WINAPI EnumerateLoadedModulesExW(HANDLE process, PENUMLOADED_MODULES_CALLBACKW64 callback, -+ PVOID context) -+{ -+ return EnumerateLoadedModulesW64(process, callback, context); -+} -+ -+/****************************************************************** - * SymGetModuleInfo (DBGHELP.@) - * - */ --- -2.8.0 - diff --git a/patches/dbghelp-EnumerateLoadedModulesExW/definition b/patches/dbghelp-EnumerateLoadedModulesExW/definition deleted file mode 100644 index 6b0d8f94..00000000 --- a/patches/dbghelp-EnumerateLoadedModulesExW/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [40614] Implement dbghelp.EnumerateLoadedModulesExW diff --git a/patches/dsound-EAX/0001-dsound-Apply-filters-before-sound-is-multiplied-to-s.patch b/patches/dsound-EAX/0001-dsound-Apply-filters-before-sound-is-multiplied-to-s.patch index dcf2caca..124de4b4 100644 --- a/patches/dsound-EAX/0001-dsound-Apply-filters-before-sound-is-multiplied-to-s.patch +++ b/patches/dsound-EAX/0001-dsound-Apply-filters-before-sound-is-multiplied-to-s.patch @@ -1,4 +1,4 @@ -From 31e4f44b8a215624ffc771f055ca1012f4c77841 Mon Sep 17 00:00:00 2001 +From ed0264f5193ecf9d7724be5de6c9bda17919105f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 28 Mar 2015 08:18:10 +0100 Subject: dsound: Apply filters before sound is multiplied to speakers. @@ -11,34 +11,34 @@ Based on a patch by Mark Harmstone. 3 files changed, 77 insertions(+), 32 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c -index cc3feb2..560c1f8 100644 +index 64bfbd3..d73610e 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c -@@ -237,6 +237,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) +@@ -233,6 +233,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) if(device->volume) IAudioStreamVolume_Release(device->volume); + HeapFree(GetProcessHeap(), 0, device->dsp_buffer); HeapFree(GetProcessHeap(), 0, device->tmp_buffer); + HeapFree(GetProcessHeap(), 0, device->cp_buffer); HeapFree(GetProcessHeap(), 0, device->buffer); - RtlDeleteResource(&device->buffer_list_lock); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h -index 6cfc33e..c6beaea 100644 +index 34bab65..f580915 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -88,8 +88,8 @@ struct DirectSoundDevice int speaker_num[DS_MAX_CHANNELS]; int num_speakers; int lfe_channel; -- float *tmp_buffer; -- DWORD tmp_buffer_len; -+ float *tmp_buffer, *dsp_buffer; -+ DWORD tmp_buffer_len, dsp_buffer_len; +- float *tmp_buffer, *cp_buffer; +- DWORD tmp_buffer_len, cp_buffer_len; ++ float *tmp_buffer, *cp_buffer, *dsp_buffer; ++ DWORD tmp_buffer_len, cp_buffer_len, dsp_buffer_len; DSVOLUMEPAN volpan; diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c -index c358385..9a6224e 100644 +index a2fd768..db4235d 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -266,23 +266,22 @@ static inline float get_current_sample(const IDirectSoundBufferImpl *dsb, @@ -93,7 +93,7 @@ index c358385..9a6224e 100644 LONG64 freqAcc_start = *freqAccNum; LONG64 freqAcc_end = freqAcc_start + count * dsb->freqAdjustNum; -@@ -372,7 +371,7 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6 +@@ -383,7 +382,7 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6 float* cache = &intermediate[channel * required_input + ipos]; for (j = 0; j < fir_used; j++) sum += fir_copy[j] * cache[j]; @@ -102,7 +102,7 @@ index c358385..9a6224e 100644 } } -@@ -384,16 +383,17 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6 +@@ -392,16 +391,17 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6 return max_ipos; } @@ -124,7 +124,7 @@ index c358385..9a6224e 100644 ipos = dsb->sec_mixpos + adv * dsb->pwfx->nBlockAlign; if (ipos >= dsb->buflen) { -@@ -423,6 +423,21 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) +@@ -431,6 +431,21 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) return buflen + ptr1 - ptr2; } } @@ -146,7 +146,7 @@ index c358385..9a6224e 100644 /** * Mix at most the given amount of data into the allocated temporary buffer * of the given secondary buffer, starting from the dsb's first currently -@@ -438,32 +453,61 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) +@@ -446,32 +461,61 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) */ static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames) { diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 321c409b..3d8b1943 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "aa475ce23fa295a8f5d0fa120d7b3dac1a5a41b5" + echo "58e95f72218fa018739c484f172bc236e685d5bb" } # Show version information @@ -125,7 +125,6 @@ patch_enable_all () enable_d3dx9_36_Texture_Align="$1" enable_d3dx9_36_UpdateSkinnedMesh="$1" enable_dbghelp_Debug_Symbols="$1" - enable_dbghelp_EnumerateLoadedModulesExW="$1" enable_ddraw_D3DFINDDEVICERESULT="$1" enable_ddraw_Device_Caps="$1" enable_ddraw_EnumSurfaces="$1" @@ -553,9 +552,6 @@ patch_enable () dbghelp-Debug_Symbols) enable_dbghelp_Debug_Symbols="$2" ;; - dbghelp-EnumerateLoadedModulesExW) - enable_dbghelp_EnumerateLoadedModulesExW="$2" - ;; ddraw-D3DFINDDEVICERESULT) enable_ddraw_D3DFINDDEVICERESULT="$2" ;; @@ -3264,21 +3260,6 @@ if test "$enable_dbghelp_Debug_Symbols" -eq 1; then ) >> "$patchlist" fi -# Patchset dbghelp-EnumerateLoadedModulesExW -# | -# | This patchset fixes the following Wine bugs: -# | * [#40614] Implement dbghelp.EnumerateLoadedModulesExW -# | -# | Modified files: -# | * dlls/dbghelp/dbghelp.spec, dlls/dbghelp/module.c -# | -if test "$enable_dbghelp_EnumerateLoadedModulesExW" -eq 1; then - patch_apply dbghelp-EnumerateLoadedModulesExW/0001-dbghelp-Implement-EnumerateLoadedModulesExW.patch - ( - echo '+ { "Michael Müller", "dbghelp: Implement EnumerateLoadedModulesExW.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ddraw-D3DFINDDEVICERESULT # | # | Modified files: diff --git a/patches/wined3d-CSMT_Main/0003-wined3d-Call-texture_load_location-instead-of-surfac.patch b/patches/wined3d-CSMT_Main/0003-wined3d-Call-texture_load_location-instead-of-surfac.patch index 8017a1a8..05b830b1 100644 --- a/patches/wined3d-CSMT_Main/0003-wined3d-Call-texture_load_location-instead-of-surfac.patch +++ b/patches/wined3d-CSMT_Main/0003-wined3d-Call-texture_load_location-instead-of-surfac.patch @@ -1,4 +1,4 @@ -From 130d9dfce6a2aa843885d204471605967c76b164 Mon Sep 17 00:00:00 2001 +From 39cecce0d60c0b630442f1b5dc61d73a205599a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 17 Nov 2015 23:13:29 -0800 Subject: wined3d: Call texture_load_location instead of surface_load_location. @@ -12,7 +12,7 @@ Subject: wined3d: Call texture_load_location instead of surface_load_location. 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index f12cbf4..4be5c0c 100644 +index 5b3b0c9..147bb9a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -203,12 +203,15 @@ void device_switch_onscreen_ds(struct wined3d_device *device, @@ -43,7 +43,7 @@ index f12cbf4..4be5c0c 100644 } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index 78628c5..83fe4c3 100644 +index 0f914df..9103d42 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -481,7 +481,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s @@ -56,7 +56,7 @@ index 78628c5..83fe4c3 100644 wined3d_texture_prepare_location(ds->container, dsv->sub_resource_idx, context, location); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3435d17..68bf333 100644 +index 61135b9..fe9f4fa 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -450,9 +450,11 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, @@ -96,7 +96,7 @@ index 3435d17..68bf333 100644 wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &data, -@@ -2298,7 +2302,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -2451,7 +2455,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use @@ -105,7 +105,7 @@ index 3435d17..68bf333 100644 * unless we're overwriting it completely. */ wined3d_texture_load(src_texture, context, FALSE); -@@ -2796,7 +2800,8 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -2949,7 +2953,8 @@ static void surface_load_sysmem(struct wined3d_surface *surface, } if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) @@ -115,7 +115,7 @@ index 3435d17..68bf333 100644 /* Download the surface to system memory. */ if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) -@@ -2834,7 +2839,8 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -2987,7 +2992,8 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, } surface_get_rect(surface, NULL, &r); @@ -125,27 +125,27 @@ index 3435d17..68bf333 100644 surface_blt_to_drawable(texture->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -2912,7 +2918,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3064,7 +3070,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + == WINED3D_LOCATION_TEXTURE_RGB) { - /* Performance warning... */ - FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); + FIXME_(d3d_perf)("Downloading RGB surface %p to reload it as sRGB.\n", surface); - surface_load_location(surface, context, texture->resource.map_binding); + wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface), + context, texture->resource.map_binding); } } else -@@ -2922,7 +2929,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3073,7 +3080,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, + == WINED3D_LOCATION_TEXTURE_SRGB) { - /* Performance warning... */ - FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); + FIXME_(d3d_perf)("Downloading sRGB surface %p to reload it as RGB.\n", surface); - surface_load_location(surface, context, texture->resource.map_binding); + wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface), + context, texture->resource.map_binding); } } -@@ -2930,7 +2938,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3081,7 +3089,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ @@ -154,7 +154,7 @@ index 3435d17..68bf333 100644 } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -2948,7 +2956,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3099,7 +3107,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, { TRACE("Removing the pbo attached to surface %p.\n", surface); @@ -163,7 +163,7 @@ index 3435d17..68bf333 100644 wined3d_texture_set_map_binding(texture, WINED3D_LOCATION_SYSMEM); } -@@ -3077,7 +3085,8 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte +@@ -3228,7 +3236,8 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte { ERR("Surface %p does not have any up to date location.\n", surface); wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED); @@ -173,7 +173,7 @@ index 3435d17..68bf333 100644 } if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) -@@ -4231,7 +4240,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4383,7 +4392,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst if (!wined3d_resource_is_offscreen(&dst_texture->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -184,10 +184,10 @@ index 3435d17..68bf333 100644 } return WINED3D_OK; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index b9c6055..a02fdf0 100644 +index 853d447..08b8fc2 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -453,7 +453,7 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct +@@ -457,7 +457,7 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct sub_resource = &texture->sub_resources[0]; if (!(sub_resource->locations & supported_locations)) @@ -196,7 +196,7 @@ index b9c6055..a02fdf0 100644 texture_prev->texture_rgb = texture->texture_rgb; texture_prev->rb_multisample = texture->rb_multisample; -@@ -630,12 +630,12 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, +@@ -637,12 +637,12 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, static void swapchain_gl_frontbuffer_updated(struct wined3d_swapchain *swapchain) { @@ -213,7 +213,7 @@ index b9c6055..a02fdf0 100644 SetRectEmpty(&swapchain->front_buffer_update); } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 30a4581..9780cc5 100644 +index 2024bbf..e22e306 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2575,7 +2575,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i diff --git a/patches/wined3d-CSMT_Main/0024-wined3d-Send-bool-constant-updates-through-the-comma.patch b/patches/wined3d-CSMT_Main/0024-wined3d-Send-bool-constant-updates-through-the-comma.patch index 3543679a..6bd346d9 100644 --- a/patches/wined3d-CSMT_Main/0024-wined3d-Send-bool-constant-updates-through-the-comma.patch +++ b/patches/wined3d-CSMT_Main/0024-wined3d-Send-bool-constant-updates-through-the-comma.patch @@ -1,16 +1,16 @@ -From 98405ace64c67ae668c5cfd2ea7fdb2e05e0a5cb Mon Sep 17 00:00:00 2001 +From 1be883772a9bdd7a69891a8accacd2c03cf0c062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 9 Apr 2013 21:50:30 +0200 Subject: wined3d: Send bool constant updates through the command stream --- - dlls/wined3d/cs.c | 74 +++++++++++++++++++++++++++++++++++++++--- + dlls/wined3d/cs.c | 72 +++++++++++++++++++++++++++++++++++++++--- dlls/wined3d/device.c | 8 +++-- dlls/wined3d/wined3d_private.h | 3 ++ - 3 files changed, 78 insertions(+), 7 deletions(-) + 3 files changed, 76 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a409d48..f1fc4b9 100644 +index a409d48..675e81e 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -65,7 +65,9 @@ enum wined3d_cs_op @@ -23,21 +23,22 @@ index a409d48..f1fc4b9 100644 WINED3D_CS_OP_GLFINISH, WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, WINED3D_CS_OP_SET_PRIMITIVE_TYPE, -@@ -292,6 +294,13 @@ struct wined3d_cs_set_consts_f +@@ -292,6 +294,14 @@ struct wined3d_cs_set_consts_f struct wined3d_vec4 constants; }; +struct wined3d_cs_set_consts_b +{ + enum wined3d_cs_op opcode; -+ UINT start_register, bool_count; ++ unsigned int start_idx; ++ unsigned int count; + BOOL constants[1]; +}; + struct wined3d_cs_finish { enum wined3d_cs_op opcode; -@@ -960,10 +969,8 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi +@@ -960,10 +970,8 @@ 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 a409d48..f1fc4b9 100644 memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i)); memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); -@@ -980,10 +987,8 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win +@@ -980,10 +988,8 @@ 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 */ @@ -59,7 +60,7 @@ index a409d48..f1fc4b9 100644 memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i)); /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. -@@ -1145,6 +1150,65 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render +@@ -1145,6 +1151,62 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render op->value = value; cs->ops->submit(cs); @@ -70,12 +71,11 @@ index a409d48..f1fc4b9 100644 + const struct wined3d_cs_set_consts_b *op = data; + struct wined3d_device *device = cs->device; + -+ memcpy(&cs->state.vs_consts_b[op->start_register], op->constants, -+ sizeof(*cs->state.vs_consts_b) * op->bool_count); ++ memcpy(&cs->state.vs_consts_b[op->start_idx], op->constants, sizeof(op->constants[0]) * op->count); + + device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_B); + -+ return sizeof(*op) + sizeof(op->constants) * (op->bool_count - 1); ++ return sizeof(*op) + sizeof(op->constants[0]) * (op->count - 1); +} + +static UINT wined3d_cs_exec_set_ps_consts_b(struct wined3d_cs *cs, const void *data) @@ -83,21 +83,19 @@ index a409d48..f1fc4b9 100644 + const struct wined3d_cs_set_consts_b *op = data; + struct wined3d_device *device = cs->device; + -+ memcpy(&cs->state.ps_consts_b[op->start_register], op->constants, -+ sizeof(*cs->state.ps_consts_b) * op->bool_count); ++ memcpy(&cs->state.ps_consts_b[op->start_idx], op->constants, sizeof(op->constants[0]) * op->count); + + device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_B); + -+ return sizeof(*op) + sizeof(op->constants) * (op->bool_count - 1); ++ return sizeof(*op) + sizeof(op->constants[0]) * (op->count - 1); +} + -+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) ++void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, ++ unsigned int count, const BOOL *constants, enum wined3d_shader_type type) +{ + struct wined3d_cs_set_consts_b *op; -+ UINT extra_space = bool_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: @@ -117,15 +115,15 @@ index a409d48..f1fc4b9 100644 + case WINED3D_SHADER_TYPE_COUNT: + break; + } -+ op->start_register = start_register; -+ op->bool_count = bool_count; -+ memcpy(op->constants, constants, sizeof(op->constants) * bool_count); ++ op->start_idx = start_idx; ++ op->count = count; ++ memcpy(op->constants, constants, sizeof(op->constants[0]) * count); + + cs->ops->submit(cs); } static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) -@@ -1473,7 +1537,9 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1473,7 +1535,9 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, @@ -136,10 +134,10 @@ index a409d48..f1fc4b9 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 588efa5..70cc2af 100644 +index 1dde384..3c9c737 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -2330,7 +2330,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 +@@ -2353,7 +2353,7 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -148,31 +146,31 @@ index 588efa5..70cc2af 100644 { UINT i; -@@ -2363,7 +2363,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, +@@ -2390,7 +2390,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, } else { - device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_B); -+ wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, -+ bool_count, WINED3D_SHADER_TYPE_VERTEX); ++ wined3d_cs_emit_set_consts_b(device->cs, start_idx, count, ++ constants, WINED3D_SHADER_TYPE_VERTEX); } return WINED3D_OK; -@@ -2591,7 +2592,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, +@@ -2624,7 +2625,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, } else { - device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_B); -+ wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, -+ bool_count, WINED3D_SHADER_TYPE_PIXEL); ++ wined3d_cs_emit_set_consts_b(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 a7757ac..263925f 100644 +index d490198..69a7dac 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2366,6 +2366,7 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -2369,6 +2369,7 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; @@ -184,8 +182,8 @@ index a7757ac..263925f 100644 void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const struct wined3d_vec4 *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -+ const BOOL *constants, UINT bool_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, ++ unsigned int count, const BOOL *constants, enum wined3d_shader_type type) 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; diff --git a/patches/wined3d-CSMT_Main/0025-wined3d-Send-int-constant-updates-through-the-comman.patch b/patches/wined3d-CSMT_Main/0025-wined3d-Send-int-constant-updates-through-the-comman.patch index cabb1aa4..014a7215 100644 --- a/patches/wined3d-CSMT_Main/0025-wined3d-Send-int-constant-updates-through-the-comman.patch +++ b/patches/wined3d-CSMT_Main/0025-wined3d-Send-int-constant-updates-through-the-comman.patch @@ -1,4 +1,4 @@ -From f62f9c0774759bd920543c3603d6b65ba77347a4 Mon Sep 17 00:00:00 2001 +From 609309679395d581e84f6e12a796f1e0e83947bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 10 Apr 2013 14:20:47 +0200 Subject: wined3d: Send int constant updates through the command stream @@ -10,7 +10,7 @@ Subject: wined3d: Send int constant updates through the command stream 3 files changed, 74 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f1fc4b9..e8d7b9a 100644 +index 675e81e..b4b6bb9 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -66,8 +66,10 @@ enum wined3d_cs_op @@ -24,7 +24,7 @@ index f1fc4b9..e8d7b9a 100644 WINED3D_CS_OP_GLFINISH, WINED3D_CS_OP_SET_BASE_VERTEX_INDEX, WINED3D_CS_OP_SET_PRIMITIVE_TYPE, -@@ -301,6 +303,14 @@ struct wined3d_cs_set_consts_b +@@ -302,6 +304,14 @@ struct wined3d_cs_set_consts_b BOOL constants[1]; }; @@ -39,7 +39,7 @@ index f1fc4b9..e8d7b9a 100644 struct wined3d_cs_finish { enum wined3d_cs_op opcode; -@@ -969,9 +979,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi +@@ -970,9 +980,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 */ @@ -49,7 +49,7 @@ index f1fc4b9..e8d7b9a 100644 memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights)); -@@ -987,9 +994,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win +@@ -988,9 +995,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 */ @@ -59,7 +59,7 @@ index f1fc4b9..e8d7b9a 100644 /* FIXME: This is not ideal. CS is still running synchronously, so this is ok. * It will go away soon anyway. */ -@@ -1211,6 +1215,62 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, +@@ -1209,6 +1213,62 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, cs->ops->submit(cs); } @@ -122,7 +122,7 @@ index f1fc4b9..e8d7b9a 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 +1598,10 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1536,8 +1596,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, @@ -134,10 +134,10 @@ index f1fc4b9..e8d7b9a 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 f961e3d..b1a3b02 100644 +index 3c9c737..0b07ad5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -2436,7 +2436,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, +@@ -2440,7 +2440,8 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, } else { @@ -147,7 +147,7 @@ index f961e3d..b1a3b02 100644 } return WINED3D_OK; -@@ -2667,7 +2668,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, +@@ -2675,7 +2676,8 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, } else { @@ -158,13 +158,13 @@ index f961e3d..b1a3b02 100644 return WINED3D_OK; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 684a4c3..b14db6d 100644 +index 69a7dac..81d4226 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_b(struct wined3d_cs *cs, unsigned int start_idx, + unsigned int count, const BOOL *constants, 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; diff --git a/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch b/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch index 26c399e1..f6396f7a 100644 --- a/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch +++ b/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch @@ -1,4 +1,4 @@ -From 9371749a7b3da74f0f0899fecc86f02bbf132ca7 Mon Sep 17 00:00:00 2001 +From 4537d2dac1f5396dd8455ff63ae2aa8747c247f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= 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 070b937..bbabc3b 100644 +index 7e504ab..42cee7c 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -22,20 +22,10 @@ @@ -35,7 +35,7 @@ index 070b937..bbabc3b 100644 WINED3D_CS_OP_FENCE, WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, -@@ -380,99 +370,30 @@ struct wined3d_cs_texture_unmap +@@ -381,99 +371,30 @@ struct wined3d_cs_texture_unmap unsigned int sub_resource_idx; }; @@ -149,7 +149,7 @@ index 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data) -@@ -493,14 +414,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) +@@ -494,14 +415,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 070b937..bbabc3b 100644 /* A busy wait should be fine, we're not supposed to have to wait very * long. */ -@@ -539,7 +460,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -540,7 +461,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw pending = InterlockedIncrement(&cs->pending_presents); @@ -175,7 +175,7 @@ index 070b937..bbabc3b 100644 while (pending > 1) pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); -@@ -565,8 +486,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -566,8 +487,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 070b937..bbabc3b 100644 op->opcode = WINED3D_CS_OP_CLEAR; op->flags = flags; op->color = *color; -@@ -575,7 +496,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -576,7 +497,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) -@@ -616,7 +537,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun +@@ -617,7 +538,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) -@@ -638,7 +559,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query +@@ -639,7 +560,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) -@@ -659,7 +580,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi +@@ -660,7 +581,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) -@@ -680,7 +601,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -681,7 +602,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) -@@ -703,7 +624,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -704,7 +625,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) -@@ -757,7 +678,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 +@@ -758,7 +679,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) -@@ -778,7 +699,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 +@@ -779,7 +700,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) -@@ -815,7 +736,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -816,7 +737,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) -@@ -842,7 +763,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i +@@ -843,7 +764,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) -@@ -875,7 +796,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -876,7 +797,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) -@@ -907,7 +828,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -908,7 +829,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) -@@ -938,7 +859,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -939,7 +860,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) -@@ -1030,7 +951,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -1031,7 +952,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) -@@ -1054,7 +975,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1055,7 +976,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) -@@ -1078,7 +999,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1079,7 +1000,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) -@@ -1101,7 +1022,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1102,7 +1023,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data) -@@ -1137,8 +1058,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, +@@ -1138,8 +1059,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 070b937..bbabc3b 100644 switch (type) { case WINED3D_SHADER_TYPE_PIXEL: -@@ -1162,7 +1084,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, +@@ -1163,7 +1085,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) -@@ -1184,8 +1106,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render +@@ -1185,8 +1107,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render op->state = state; op->value = value; @@ -370,27 +370,27 @@ index 070b937..bbabc3b 100644 static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data) { -@@ -1218,8 +1140,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, +@@ -1216,8 +1138,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, + unsigned int count, const BOOL *constants, enum wined3d_shader_type type) { struct wined3d_cs_set_consts_b *op; - UINT extra_space = bool_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: -@@ -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); +@@ -1241,7 +1164,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, + op->count = count; + memcpy(op->constants, constants, sizeof(op->constants[0]) * count); - cs->ops->submit(cs); + cs->ops->submit(cs, size); } static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data) -@@ -1274,8 +1197,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1272,8 +1195,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, const struct wined3d_ivec4 *constants, enum wined3d_shader_type type) { struct wined3d_cs_set_consts_i *op; @@ -401,7 +401,7 @@ index 070b937..bbabc3b 100644 switch (type) { case WINED3D_SHADER_TYPE_PIXEL: -@@ -1299,7 +1223,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1297,7 +1221,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, op->count = count; memcpy(op->constants, constants, sizeof(op->constants[0]) * count); @@ -410,7 +410,7 @@ index 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) -@@ -1323,7 +1247,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1321,7 +1245,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) -@@ -1347,7 +1271,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1345,7 +1269,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) -@@ -1371,7 +1295,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1369,7 +1293,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) -@@ -1393,7 +1317,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const +@@ -1391,7 +1315,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) -@@ -1478,7 +1402,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1476,7 +1400,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -455,7 +455,7 @@ index 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) -@@ -1499,7 +1423,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1497,7 +1421,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) -@@ -1523,7 +1447,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1521,7 +1445,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) -@@ -1549,7 +1473,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) +@@ -1547,7 +1471,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data) -@@ -1571,7 +1495,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, +@@ -1569,7 +1493,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) -@@ -1597,7 +1521,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ +@@ -1595,7 +1519,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -@@ -1654,7 +1578,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1652,7 +1576,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -@@ -1743,7 +1667,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1741,7 +1665,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) -@@ -1775,7 +1699,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -1773,7 +1697,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) -@@ -1808,7 +1732,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge +@@ -1806,7 +1730,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 070b937..bbabc3b 100644 } static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data) -@@ -1833,12 +1757,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture +@@ -1831,12 +1755,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 070b937..bbabc3b 100644 return ret; } -@@ -1861,11 +1787,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -1859,11 +1785,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 070b937..bbabc3b 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, -@@ -1910,42 +1838,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1908,42 +1836,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 070b937..bbabc3b 100644 }; /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -@@ -1957,9 +1902,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) +@@ -1955,9 +1900,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 070b937..bbabc3b 100644 void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) { -@@ -1983,31 +1957,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, +@@ -1981,31 +1955,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 070b937..bbabc3b 100644 } done: -@@ -2032,25 +2007,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2030,25 +2005,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 070b937..bbabc3b 100644 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) { ERR("Failed to create wined3d command stream thread.\n"); -@@ -2062,12 +2022,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2060,12 +2020,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) err: if (cs) @@ -776,7 +776,7 @@ index 070b937..bbabc3b 100644 HeapFree(GetProcessHeap(), 0, cs); return NULL; } -@@ -2086,17 +2041,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -2084,17 +2039,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 070b937..bbabc3b 100644 HeapFree(GetProcessHeap(), 0, cs); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 999c770..195ffb3 100644 +index ae49f7a..cd8b3d1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -31,6 +31,7 @@ diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 494fc790..d72fd373 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -741,7 +741,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_set_consts_f { enum wined3d_cs_op opcode; -@@ -650,6 +660,23 @@ +@@ -651,6 +661,23 @@ struct wined3d_cs_present *op; LONG pending; unsigned int i; @@ -765,7 +765,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_PRESENT; -@@ -659,6 +686,7 @@ +@@ -660,6 +687,7 @@ op->dst_rect = *dst_rect; op->flags = flags; @@ -773,7 +773,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c wined3d_resource_inc_fence(&swapchain->front_buffer->resource); for (i = 0; i < swapchain->desc.backbuffer_count; i++) wined3d_resource_inc_fence(&swapchain->back_buffers[i]->resource); -@@ -716,6 +744,30 @@ +@@ -717,6 +745,30 @@ unsigned int i; op = cs->ops->require_space(cs, size); @@ -804,7 +804,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_CLEAR; op->flags = flags; op->color = *color; -@@ -724,6 +776,7 @@ +@@ -725,6 +777,7 @@ op->rect_count = rect_count; memcpy(op->rects, rects, sizeof(*rects) * rect_count); @@ -812,7 +812,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (flags & WINED3DCLEAR_TARGET) { for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) -@@ -814,6 +867,23 @@ +@@ -815,6 +868,23 @@ struct wined3d_cs_draw *op; unsigned int i; const struct wined3d_state *state = &cs->device->state; @@ -836,7 +836,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_DRAW; -@@ -823,6 +893,7 @@ +@@ -824,6 +894,7 @@ op->instance_count = instance_count; op->indexed = indexed; @@ -844,7 +844,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (indexed) { wined3d_resource_inc_fence(&state->index_buffer->resource); -@@ -860,6 +931,17 @@ +@@ -861,6 +932,17 @@ cs->state.predicate_value = op->value; return sizeof(*op); @@ -862,7 +862,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) -@@ -871,6 +953,7 @@ +@@ -872,6 +954,7 @@ op->predicate = predicate; op->value = value; @@ -870,7 +870,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -882,6 +965,17 @@ +@@ -883,6 +966,17 @@ device_invalidate_state(cs->device, STATE_VIEWPORT); return sizeof(*op); @@ -888,7 +888,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) -@@ -892,6 +986,7 @@ +@@ -893,6 +987,7 @@ op->opcode = WINED3D_CS_OP_SET_VIEWPORT; op->viewport = *viewport; @@ -896,7 +896,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -903,6 +998,17 @@ +@@ -904,6 +999,17 @@ device_invalidate_state(cs->device, STATE_SCISSORRECT); return sizeof(*op); @@ -914,7 +914,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) -@@ -913,6 +1019,7 @@ +@@ -914,6 +1020,7 @@ op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; op->rect = *rect; @@ -922,7 +922,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -924,6 +1031,17 @@ +@@ -925,6 +1032,17 @@ device_invalidate_state(cs->device, STATE_FRAMEBUFFER); return sizeof(*op); @@ -940,7 +940,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -936,6 +1054,7 @@ +@@ -937,6 +1055,7 @@ op->view_idx = view_idx; op->view = view; @@ -948,7 +948,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -946,6 +1065,18 @@ +@@ -947,6 +1066,18 @@ struct wined3d_rendertarget_view *prev; if ((prev = cs->state.fb.depth_stencil)) @@ -967,7 +967,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev); -@@ -953,6 +1084,7 @@ +@@ -954,6 +1085,7 @@ || prev_surface->container->flags & WINED3D_TEXTURE_DISCARD)) { surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height); @@ -975,7 +975,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (prev_surface == cs->onscreen_depth_stencil) { wined3d_texture_decref(cs->onscreen_depth_stencil->container); -@@ -962,6 +1094,17 @@ +@@ -963,6 +1095,17 @@ } cs->state.fb.depth_stencil = op->view; @@ -993,7 +993,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (!prev != !op->view) { -@@ -978,8 +1121,10 @@ +@@ -979,8 +1122,10 @@ } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -1004,7 +1004,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -@@ -990,6 +1135,7 @@ +@@ -991,6 +1136,7 @@ op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; op->view = view; @@ -1012,7 +1012,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1001,6 +1147,17 @@ +@@ -1002,6 +1148,17 @@ device_invalidate_state(cs->device, STATE_VDECL); return sizeof(*op); @@ -1030,7 +1030,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) -@@ -1011,10 +1168,17 @@ +@@ -1012,10 +1169,17 @@ op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; op->declaration = declaration; @@ -1048,7 +1048,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source *op = data; struct wined3d_stream_state *stream; -@@ -1032,8 +1196,10 @@ +@@ -1033,8 +1197,10 @@ InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -1059,7 +1059,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -1048,10 +1214,17 @@ +@@ -1049,10 +1215,17 @@ op->offset = offset; op->stride = stride; @@ -1077,7 +1077,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source_freq *op = data; struct wined3d_stream_state *stream; -@@ -1061,8 +1234,10 @@ +@@ -1062,8 +1235,10 @@ stream->flags = op->flags; device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -1088,7 +1088,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) -@@ -1075,10 +1250,17 @@ +@@ -1076,10 +1251,17 @@ op->frequency = frequency; op->flags = flags; @@ -1106,7 +1106,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_output *op = data; struct wined3d_stream_output *stream; -@@ -1093,8 +1275,10 @@ +@@ -1094,8 +1276,10 @@ InterlockedIncrement(&op->buffer->resource.bind_count); if (prev) InterlockedDecrement(&prev->resource.bind_count); @@ -1117,7 +1117,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -1108,10 +1292,17 @@ +@@ -1109,10 +1293,17 @@ op->buffer = buffer; op->offset = offset; @@ -1135,7 +1135,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_index_buffer *op = data; struct wined3d_buffer *prev; -@@ -1126,8 +1317,10 @@ +@@ -1127,8 +1318,10 @@ InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_INDEXBUFFER); @@ -1146,7 +1146,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -1140,10 +1333,17 @@ +@@ -1141,10 +1334,17 @@ op->buffer = buffer; op->format_id = format_id; @@ -1164,7 +1164,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_constant_buffer *op = data; struct wined3d_buffer *prev; -@@ -1157,7 +1357,9 @@ +@@ -1158,7 +1358,9 @@ InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); @@ -1174,7 +1174,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1171,10 +1373,17 @@ +@@ -1172,10 +1374,17 @@ op->cb_idx = cb_idx; op->buffer = buffer; @@ -1192,7 +1192,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; -@@ -1251,8 +1460,10 @@ +@@ -1252,8 +1461,10 @@ if (new_use_color_key) device_invalidate_state(cs->device, STATE_COLOR_KEY); @@ -1203,7 +1203,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) -@@ -1263,6 +1474,7 @@ +@@ -1264,6 +1475,7 @@ op->opcode = WINED3D_CS_OP_SET_TEXTURE; op->stage = stage; op->texture = texture; @@ -1211,7 +1211,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1274,6 +1486,18 @@ +@@ -1275,6 +1487,18 @@ device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); return sizeof(*op); @@ -1230,7 +1230,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1287,6 +1511,7 @@ +@@ -1288,6 +1512,7 @@ op->view_idx = view_idx; op->view = view; @@ -1238,7 +1238,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1298,6 +1523,17 @@ +@@ -1299,6 +1524,17 @@ device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); return sizeof(*op); @@ -1256,7 +1256,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1311,6 +1547,7 @@ +@@ -1312,6 +1548,7 @@ op->sampler_idx = sampler_idx; op->sampler = sampler; @@ -1264,7 +1264,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1323,6 +1560,18 @@ +@@ -1324,6 +1561,18 @@ device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); return sizeof(*op); @@ -1283,7 +1283,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) -@@ -1334,6 +1583,7 @@ +@@ -1335,6 +1584,7 @@ op->type = type; op->shader = shader; @@ -1291,7 +1291,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1407,6 +1657,17 @@ +@@ -1408,6 +1658,17 @@ device_invalidate_state(cs->device, STATE_RENDER(op->state)); return sizeof(*op); @@ -1309,7 +1309,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) -@@ -1418,6 +1679,7 @@ +@@ -1419,6 +1680,7 @@ op->state = state; op->value = value; @@ -1317,7 +1317,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1546,6 +1808,17 @@ +@@ -1544,6 +1806,17 @@ device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, op->state)); return sizeof(*op); @@ -1335,7 +1335,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, -@@ -1559,6 +1832,7 @@ +@@ -1557,6 +1830,7 @@ op->state = state; op->value = value; @@ -1343,7 +1343,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1570,6 +1844,17 @@ +@@ -1568,6 +1842,17 @@ device_invalidate_state(cs->device, STATE_SAMPLER(op->sampler_idx)); return sizeof(*op); @@ -1361,7 +1361,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -@@ -1583,6 +1868,7 @@ +@@ -1581,6 +1866,7 @@ op->state = state; op->value = value; @@ -1369,7 +1369,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1595,6 +1881,18 @@ +@@ -1593,6 +1879,18 @@ device_invalidate_state(cs->device, STATE_TRANSFORM(op->state)); return sizeof(*op); @@ -1388,7 +1388,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -1607,6 +1905,7 @@ +@@ -1605,6 +1903,7 @@ op->state = state; op->matrix = *matrix; @@ -1396,7 +1396,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1618,6 +1917,17 @@ +@@ -1616,6 +1915,17 @@ device_invalidate_state(cs->device, STATE_CLIPPLANE(op->plane_idx)); return sizeof(*op); @@ -1414,7 +1414,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) -@@ -1629,10 +1939,17 @@ +@@ -1627,10 +1937,17 @@ op->plane_idx = plane_idx; op->plane = *plane; @@ -1432,7 +1432,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_color_key *op = data; struct wined3d_texture *texture = op->texture; -@@ -1693,8 +2010,10 @@ +@@ -1691,8 +2008,10 @@ break; } } @@ -1443,7 +1443,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -1714,6 +2033,7 @@ +@@ -1712,6 +2031,7 @@ else op->set = 0; @@ -1451,7 +1451,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1725,6 +2045,17 @@ +@@ -1723,6 +2043,17 @@ device_invalidate_state(cs->device, STATE_MATERIAL); return sizeof(*op); @@ -1469,7 +1469,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) -@@ -1735,6 +2066,7 @@ +@@ -1733,6 +2064,7 @@ op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; @@ -1477,7 +1477,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -1750,6 +2082,19 @@ +@@ -1748,6 +2080,19 @@ ERR("Failed to initialize CS state, hr %#x.\n", hr); return sizeof(struct wined3d_cs_reset_state); @@ -1497,7 +1497,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1759,6 +2104,7 @@ +@@ -1757,6 +2102,7 @@ op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_RESET_STATE; @@ -1505,7 +1505,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs, sizeof(*op)); } -@@ -3208,5 +3554,106 @@ +@@ -3206,5 +3552,106 @@ ERR("Closing event failed.\n"); } @@ -2091,20 +2091,20 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { UINT i; -@@ -2343,8 +2591,12 @@ +@@ -2347,8 +2595,12 @@ } else { +#if defined(STAGING_CSMT) - wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, - bool_count, WINED3D_SHADER_TYPE_VERTEX); + wined3d_cs_emit_set_consts_b(device->cs, start_idx, count, + constants, WINED3D_SHADER_TYPE_VERTEX); +#else /* STAGING_CSMT */ + device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_B); +#endif /* STAGING_CSMT */ } return WINED3D_OK; -@@ -2393,8 +2645,12 @@ +@@ -2397,8 +2649,12 @@ } else { @@ -2117,7 +2117,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2439,8 +2695,12 @@ +@@ -2443,8 +2699,12 @@ memset(&device->recording->changed.vs_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.vs_consts_f)); else @@ -2130,20 +2130,20 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2575,8 +2835,12 @@ +@@ -2583,8 +2843,12 @@ } else { +#if defined(STAGING_CSMT) - wined3d_cs_emit_set_consts_b(device->cs, start_register, constants, - bool_count, WINED3D_SHADER_TYPE_PIXEL); + wined3d_cs_emit_set_consts_b(device->cs, start_idx, count, + constants, WINED3D_SHADER_TYPE_PIXEL); +#else /* STAGING_CSMT */ + device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_B); +#endif /* STAGING_CSMT */ } return WINED3D_OK; -@@ -2625,8 +2889,12 @@ +@@ -2633,8 +2897,12 @@ } else { @@ -2156,7 +2156,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2672,8 +2940,12 @@ +@@ -2680,8 +2948,12 @@ memset(&device->recording->changed.ps_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.ps_consts_f)); else @@ -2169,7 +2169,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2833,6 +3105,7 @@ +@@ -2841,6 +3113,7 @@ return hr; } @@ -2177,7 +2177,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_settings.cs_multithreaded) { FIXME("Waiting for cs.\n"); -@@ -2840,6 +3113,7 @@ +@@ -2848,6 +3121,7 @@ device->cs->ops->finish(device->cs); } @@ -2185,7 +2185,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat); -@@ -3325,6 +3599,10 @@ +@@ -3333,6 +3607,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -2196,7 +2196,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3333,6 +3611,15 @@ +@@ -3341,6 +3619,15 @@ return WINED3DERR_INVALIDCALL; } @@ -2212,7 +2212,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3340,8 +3627,10 @@ +@@ -3348,8 +3635,10 @@ 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) { @@ -2223,7 +2223,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, debug_color(color), depth, stencil); -@@ -3353,7 +3642,11 @@ +@@ -3361,7 +3650,11 @@ if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -2235,7 +2235,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3362,8 +3655,13 @@ +@@ -3370,8 +3663,13 @@ } else if (flags & WINED3DCLEAR_TARGET) { @@ -2249,7 +2249,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3409,6 +3707,9 @@ +@@ -3417,6 +3715,9 @@ enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -2259,7 +2259,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type)); gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); -@@ -3416,8 +3717,13 @@ +@@ -3424,8 +3725,13 @@ device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -2273,7 +2273,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, -@@ -3440,6 +3746,14 @@ +@@ -3448,6 +3754,14 @@ return WINED3DERR_INVALIDCALL; } @@ -2288,7 +2288,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); return WINED3D_OK; -@@ -3456,6 +3770,10 @@ +@@ -3464,6 +3778,10 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { @@ -2299,7 +2299,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); if (!device->state.index_buffer) -@@ -3474,6 +3792,15 @@ +@@ -3482,6 +3800,15 @@ return WINED3DERR_INVALIDCALL; } @@ -2315,7 +2315,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); return WINED3D_OK; -@@ -3488,6 +3815,7 @@ +@@ -3496,6 +3823,7 @@ wined3d_cs_emit_draw(device->cs, start_idx, index_count, start_instance, instance_count, TRUE); } @@ -2323,7 +2323,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller. */ static void wined3d_device_update_texture_3d(struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_level, -@@ -3498,6 +3826,36 @@ +@@ -3506,6 +3834,36 @@ TRACE("context %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n", context, src_texture, src_level, dst_texture, level_count); @@ -2360,7 +2360,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3505,6 +3863,7 @@ +@@ -3513,6 +3871,7 @@ for (i = 0; i < level_count; ++i) { @@ -2368,7 +2368,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_texture_get_memory(src_texture, src_level + i, &data, src_texture->resource.map_binding, FALSE); -@@ -3582,6 +3941,34 @@ +@@ -3590,6 +3949,34 @@ unsigned int src_size, dst_size, src_skip_levels = 0; unsigned int layer_count; enum wined3d_resource_type type; @@ -2403,7 +2403,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3618,6 +4005,7 @@ +@@ -3626,6 +4013,7 @@ return WINED3DERR_INVALIDCALL; } @@ -2411,7 +2411,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* FIXME: This isn't necessary for 2D textures, but currently surface_upload_from_surface * rejects mismatching formats, and we can't report the error back after dispatching the * call. */ -@@ -3660,6 +4048,65 @@ +@@ -3668,6 +4056,65 @@ wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); return WINED3D_OK; @@ -2477,7 +2477,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) -@@ -3707,8 +4154,13 @@ +@@ -3715,8 +4162,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -2491,7 +2491,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3897,7 +4349,9 @@ +@@ -3905,7 +4357,9 @@ struct wined3d_texture *dst_texture, *src_texture; RECT dst_rect, src_rect; HRESULT hr; @@ -2501,7 +2501,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", -@@ -3985,6 +4439,7 @@ +@@ -3993,6 +4447,7 @@ if (src_box) { @@ -2509,7 +2509,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if ((src_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !wined3d_texture_check_block_align(src_texture, src_sub_resource_idx % src_texture->level_count, src_box)) -@@ -3993,6 +4448,7 @@ +@@ -4001,6 +4456,7 @@ return WINED3DERR_INVALIDCALL; } @@ -2517,7 +2517,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom); } else -@@ -4006,6 +4462,7 @@ +@@ -4014,6 +4470,7 @@ SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left), dst_y + (src_rect.bottom - src_rect.top)); @@ -2525,7 +2525,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) { dst_box.left = dst_rect.left; -@@ -4023,6 +4480,7 @@ +@@ -4031,6 +4488,7 @@ } } @@ -2533,7 +2533,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) WARN("Failed to blit, hr %#x.\n", hr); -@@ -4035,7 +4493,18 @@ +@@ -4043,7 +4501,18 @@ unsigned int depth_pitch) { struct wined3d_texture_sub_resource *sub_resource; @@ -2552,7 +2552,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); -@@ -4069,6 +4538,7 @@ +@@ -4077,6 +4546,7 @@ WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); return; } @@ -2560,7 +2560,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (box) { -@@ -4078,6 +4548,18 @@ +@@ -4086,6 +4556,18 @@ width = wined3d_texture_get_level_width(texture, level); height = wined3d_texture_get_level_height(texture, level); @@ -2579,7 +2579,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (box->left >= box->right || box->right > width || box->top >= box->bottom || box->bottom > height || box->front >= box->back) -@@ -4085,9 +4567,46 @@ +@@ -4093,9 +4575,46 @@ WARN("Invalid box %s specified.\n", debug_box(box)); return; } @@ -2626,7 +2626,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4096,8 +4615,13 @@ +@@ -4104,8 +4623,13 @@ { const struct blit_shader *blitter; struct wined3d_resource *resource; @@ -2640,7 +2640,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n", device, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil); -@@ -4136,8 +4660,15 @@ +@@ -4144,8 +4668,15 @@ return WINED3DERR_INVALIDCALL; } @@ -2656,7 +2656,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -4151,6 +4682,7 @@ +@@ -4159,6 +4690,7 @@ return NULL; } @@ -2664,7 +2664,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -4166,6 +4698,22 @@ +@@ -4174,6 +4706,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -2687,7 +2687,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -4205,6 +4753,7 @@ +@@ -4213,6 +4761,7 @@ } @@ -2695,7 +2695,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c prev = fb->render_targets[view_idx]; if (view == prev) return WINED3D_OK; -@@ -4212,6 +4761,15 @@ +@@ -4220,6 +4769,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -2711,7 +2711,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -4223,6 +4781,7 @@ +@@ -4231,6 +4789,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -2719,7 +2719,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -4236,6 +4795,20 @@ +@@ -4244,6 +4803,20 @@ } if ((fb->depth_stencil = view)) @@ -2740,7 +2740,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4457,8 +5030,10 @@ +@@ -4465,8 +5038,10 @@ TRACE("device %p.\n", device); @@ -2751,7 +2751,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4466,6 +5041,7 @@ +@@ -4474,6 +5049,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -2759,7 +2759,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4484,6 +5060,36 @@ +@@ -4492,6 +5068,36 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; @@ -2796,7 +2796,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4505,6 +5111,7 @@ +@@ -4513,6 +5119,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -2804,7 +2804,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4523,6 +5130,14 @@ +@@ -4531,6 +5138,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -2819,7 +2819,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4539,6 +5154,7 @@ +@@ -4547,6 +5162,7 @@ return hr; } @@ -2827,7 +2827,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4549,6 +5165,33 @@ +@@ -4557,6 +5173,33 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -2861,7 +2861,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4568,12 +5211,14 @@ +@@ -4576,12 +5219,14 @@ TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", device, swapchain_desc, mode, callback, reset_state); @@ -2876,7 +2876,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { ERR("Failed to get the first implicit swapchain.\n"); -@@ -4593,9 +5238,16 @@ +@@ -4601,9 +5246,16 @@ wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -2893,7 +2893,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4604,6 +5256,7 @@ +@@ -4612,6 +5264,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -2901,7 +2901,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4613,6 +5266,12 @@ +@@ -4621,6 +5274,12 @@ { wined3d_texture_decref(device->cs->onscreen_depth_stencil->container); device->cs->onscreen_depth_stencil = NULL; @@ -2914,7 +2914,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4832,6 +5491,7 @@ +@@ -4840,6 +5499,7 @@ if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -2922,7 +2922,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c 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); -@@ -4856,6 +5516,32 @@ +@@ -4864,6 +5524,32 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -2955,7 +2955,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4863,7 +5549,11 @@ +@@ -4871,7 +5557,11 @@ { if (reset_state) hr = create_primary_opengl_context(device, swapchain); @@ -2967,7 +2967,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } /* All done. There is no need to reload resources or shaders, this will happen automatically on the -@@ -4943,6 +5633,7 @@ +@@ -4951,6 +5641,7 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -2975,7 +2975,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { if ((rtv = device->state.fb.render_targets[i]) && rtv->resource == resource) -@@ -4950,6 +5641,17 @@ +@@ -4958,6 +5649,17 @@ } if ((rtv = device->state.fb.depth_stencil) && rtv->resource == resource) @@ -2993,7 +2993,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); switch (type) -@@ -5085,12 +5787,17 @@ +@@ -5093,12 +5795,17 @@ device->blitter = adapter->blitter; @@ -3011,7 +3011,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state = &device->state; if (!(device->cs = wined3d_cs_create(device))) -@@ -5184,6 +5891,7 @@ +@@ -5192,6 +5899,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -3019,7 +3019,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -5237,3 +5945,4 @@ +@@ -5245,3 +5953,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -3865,7 +3865,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -2310,7 +2310,11 @@ +@@ -2311,7 +2311,11 @@ string_buffer_free(&buffer); } @@ -3877,7 +3877,7 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c { HeapFree(GetProcessHeap(), 0, shader->output_signature.elements); HeapFree(GetProcessHeap(), 0, shader->input_signature.elements); -@@ -2579,10 +2583,16 @@ +@@ -2580,10 +2584,16 @@ if (!refcount) { @@ -3894,7 +3894,7 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c } return refcount; -@@ -2889,7 +2899,11 @@ +@@ -2890,7 +2900,11 @@ UINT i; memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ @@ -4669,10 +4669,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_blt_to_drawable(texture->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3048,8 +3295,12 @@ +@@ -3047,8 +3294,12 @@ + == WINED3D_LOCATION_TEXTURE_RGB) { - /* Performance warning... */ - FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); + FIXME_(d3d_perf)("Downloading RGB surface %p to reload it as sRGB.\n", surface); +#if defined(STAGING_CSMT) wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface), context, texture->resource.map_binding); @@ -4682,10 +4682,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -3059,8 +3310,12 @@ +@@ -3057,8 +3308,12 @@ + == WINED3D_LOCATION_TEXTURE_SRGB) { - /* Performance warning... */ - FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); + FIXME_(d3d_perf)("Downloading sRGB surface %p to reload it as RGB.\n", surface); +#if defined(STAGING_CSMT) wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface), context, texture->resource.map_binding); @@ -4695,7 +4695,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } -@@ -3068,7 +3323,11 @@ +@@ -3066,7 +3321,11 @@ { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ @@ -4707,7 +4707,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } wined3d_texture_prepare_texture(texture, context, srgb); -@@ -3082,6 +3341,7 @@ +@@ -3080,6 +3339,7 @@ /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -4715,7 +4715,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((format.convert || conversion) && texture->sub_resources[sub_resource_idx].buffer) { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3091,6 +3351,17 @@ +@@ -3089,6 +3349,17 @@ } wined3d_texture_get_memory(texture, sub_resource_idx, &data, sub_resource->locations, FALSE); @@ -4733,7 +4733,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3173,6 +3444,7 @@ +@@ -3171,6 +3442,7 @@ } /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ @@ -4741,7 +4741,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) { unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); -@@ -3183,6 +3455,52 @@ +@@ -3181,6 +3453,52 @@ TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -4794,7 +4794,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { -@@ -3195,7 +3513,11 @@ +@@ -3193,7 +3511,11 @@ FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", wined3d_debug_location(sub_resource->locations), wined3d_debug_location(location)); @@ -4806,7 +4806,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3208,7 +3530,11 @@ +@@ -3206,7 +3528,11 @@ case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -4818,7 +4818,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3220,7 +3546,11 @@ +@@ -3218,7 +3544,11 @@ case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -4830,7 +4830,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3229,7 +3559,19 @@ +@@ -3227,7 +3557,19 @@ } done: @@ -4850,7 +4850,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -3561,6 +3903,7 @@ +@@ -3559,6 +3901,7 @@ const BYTE *sbuf; BYTE *dbuf; int x, y; @@ -4858,7 +4858,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_device *device = dst_texture->resource.device; struct wined3d_context *context = NULL; struct wined3d_bo_address src_bo_addr, dst_bo_addr; -@@ -3588,6 +3931,18 @@ +@@ -3586,6 +3929,18 @@ wined3d_texture_get_pitch(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_map.row_pitch, &dst_map.slice_pitch); @@ -4877,7 +4877,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_map = dst_map; src_format = dst_texture->resource.format; dst_format = src_format; -@@ -3612,6 +3967,7 @@ +@@ -3610,6 +3965,7 @@ src_texture = converted_texture; src_sub_resource_idx = 0; } @@ -4885,7 +4885,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load_location(src_texture, src_sub_resource_idx, context, src_texture->resource.map_binding); wined3d_texture_get_pitch(src_texture, src_sub_resource_idx % src_texture->level_count, -@@ -3622,6 +3978,9 @@ +@@ -3620,6 +3976,9 @@ src_texture->sub_resources[src_sub_resource_idx].size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); @@ -4895,7 +4895,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_texture->resource.format; src_fmt_flags = src_texture->resource.format_flags; } -@@ -3631,6 +3990,7 @@ +@@ -3629,6 +3988,7 @@ src_fmt_flags = dst_fmt_flags; } @@ -4903,7 +4903,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_bo_addr, dst_texture->resource.map_binding, FALSE); dst_map.data = wined3d_texture_map_bo_address(&dst_bo_addr, -@@ -3638,6 +3998,9 @@ +@@ -3636,6 +3996,9 @@ context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); wined3d_texture_get_pitch(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_map.row_pitch, &dst_map.slice_pitch); @@ -4913,7 +4913,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_format->byte_count; -@@ -3651,9 +4014,18 @@ +@@ -3649,9 +4012,18 @@ sbase = (BYTE *)src_map.data + ((src_box->top / src_format->block_height) * src_map.row_pitch) + ((src_box->left / src_format->block_width) * src_format->block_byte_count); @@ -4932,7 +4932,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4046,6 +4418,7 @@ +@@ -4044,6 +4416,7 @@ } } @@ -4940,7 +4940,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.map_binding); -@@ -4072,6 +4445,18 @@ +@@ -4070,6 +4443,18 @@ wined3d_texture_decref(converted_texture); if (context) context_release(context); @@ -4959,7 +4959,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4116,7 +4501,11 @@ +@@ -4114,7 +4499,11 @@ cpu_blit_blit_surface, }; @@ -4971,7 +4971,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { -@@ -4126,8 +4515,14 @@ +@@ -4124,8 +4513,14 @@ struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; struct wined3d_swapchain *src_swapchain, *dst_swapchain; @@ -4986,7 +4986,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD src_ds_flags, dst_ds_flags; BOOL scale, convert; -@@ -4140,6 +4535,7 @@ +@@ -4138,6 +4533,7 @@ | WINED3D_BLT_DO_NOT_WAIT | WINED3D_BLT_ALPHA_TEST; @@ -4994,7 +4994,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_surface) { src_texture = src_surface->container; -@@ -4151,6 +4547,86 @@ +@@ -4149,6 +4545,86 @@ src_texture = NULL; src_sub_resource_idx = 0; src_swapchain = NULL; @@ -5081,7 +5081,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (!device->d3d_initialized) -@@ -4175,6 +4651,13 @@ +@@ -4173,6 +4649,13 @@ goto fallback; } @@ -5095,7 +5095,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dst_swapchain = dst_texture->swapchain; /* This isn't strictly needed. FBO blits for example could deal with -@@ -4210,6 +4693,7 @@ +@@ -4208,6 +4691,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->fill_color, &depth)) @@ -5103,7 +5103,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -4220,6 +4704,24 @@ +@@ -4218,6 +4702,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_texture->resource.draw_binding, src_rect, dst_surface, dst_texture->resource.draw_binding, dst_rect))) return; @@ -5128,7 +5128,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -4255,7 +4757,11 @@ +@@ -4253,7 +4755,11 @@ goto fallback; if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) @@ -5140,7 +5140,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4294,11 +4800,18 @@ +@@ -4292,11 +4798,18 @@ if (!wined3d_resource_is_offscreen(&dst_texture->resource)) { struct wined3d_context *context = context_acquire(device, dst_surface); @@ -5159,7 +5159,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4322,7 +4835,11 @@ +@@ -4320,7 +4833,11 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -5171,7 +5171,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -@@ -4343,7 +4860,11 @@ +@@ -4341,7 +4858,11 @@ wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding); @@ -5183,7 +5183,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -@@ -4353,7 +4874,11 @@ +@@ -4351,7 +4872,11 @@ { blitter->blit_surface(device, blit_op, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); @@ -5195,7 +5195,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4361,6 +4886,7 @@ +@@ -4359,6 +4884,7 @@ fallback: /* Special cases for render targets. */ if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) @@ -5203,7 +5203,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; cpu: -@@ -4505,4 +5031,11 @@ +@@ -4503,4 +5029,11 @@ flags, fx, filter); return WINED3D_OK; @@ -7130,7 +7130,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +#if defined(STAGING_CSMT) void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const struct wined3d_vec4 *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, + void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, @@ -3082,6 +3204,7 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; diff --git a/patches/winhttp-System_Proxy_Autoconfig/0002-wininet-Silence-wininet-no-support-on-this-platform-.patch b/patches/winhttp-System_Proxy_Autoconfig/0002-wininet-Silence-wininet-no-support-on-this-platform-.patch index f460fd56..932c49c3 100644 --- a/patches/winhttp-System_Proxy_Autoconfig/0002-wininet-Silence-wininet-no-support-on-this-platform-.patch +++ b/patches/winhttp-System_Proxy_Autoconfig/0002-wininet-Silence-wininet-no-support-on-this-platform-.patch @@ -1,4 +1,4 @@ -From e5466e251a5dc694ef214d5c96bf59ebb767f6a4 Mon Sep 17 00:00:00 2001 +From 39a3448740eddb5083e3508e51c3ec6922275c5b Mon Sep 17 00:00:00 2001 From: Jarkko Korpi Date: Sat, 1 Aug 2015 06:45:35 +0300 Subject: wininet: Silence wininet no support on this platform message. @@ -8,19 +8,19 @@ Subject: wininet: Silence wininet no support on this platform message. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c -index ee04f40..c512a5c 100644 +index bd380dc..0680c7d 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c -@@ -2416,7 +2416,8 @@ static BOOL get_proxy_autoconfig_url( char *buf, DWORD buflen ) +@@ -2311,7 +2311,8 @@ static WCHAR *get_proxy_autoconfig_url(void) CFRelease( settings ); return ret; #else - FIXME( "no support on this platform\n" ); + static int once; + if (!once++) FIXME( "no support on this platform\n" ); - return FALSE; + return NULL; #endif } -- -2.5.0 +2.8.0 diff --git a/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch b/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch index 0046872f..d52558f1 100644 --- a/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch +++ b/patches/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch @@ -1,4 +1,4 @@ -From b2525450e258182b0cb426d392f1677cc7971ae4 Mon Sep 17 00:00:00 2001 +From 05c7ce3559767347aa338c002002557ab30d9d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 15 May 2015 21:18:37 +0200 Subject: wininet/tests: Test auth credential reusage with host override. @@ -8,12 +8,12 @@ Subject: wininet/tests: Test auth credential reusage with host override. 1 file changed, 92 insertions(+) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 661dcc3..546e473 100644 +index 90774b8..8fd69a4 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c -@@ -2413,6 +2413,20 @@ static DWORD CALLBACK server_thread(LPVOID param) - SetEvent(server_req_rec_event); - WaitForSingleObject(conn_wait_event, INFINITE); +@@ -2433,6 +2433,20 @@ static DWORD CALLBACK server_thread(LPVOID param) + send(c, okmsg, sizeof(okmsg)-1, 0); + send(c, buffer, strlen(buffer), 0); } + if (strstr(buffer, "HEAD /test_auth_host1")) + { @@ -32,7 +32,7 @@ index 661dcc3..546e473 100644 shutdown(c, 2); closesocket(c); c = -1; -@@ -3118,6 +3132,84 @@ static void test_header_override(int port) +@@ -3139,6 +3153,84 @@ static void test_header_override(int port) InternetCloseHandle(req); InternetCloseHandle(con); InternetCloseHandle(ses); diff --git a/patches/wininet-HttpOpenRequestW/0001-wininet-Handle-INTERNET_INVALID_PORT_NUMBER-in-HttpO.patch b/patches/wininet-HttpOpenRequestW/0001-wininet-Handle-INTERNET_INVALID_PORT_NUMBER-in-HttpO.patch index 41e8706f..4db97988 100644 --- a/patches/wininet-HttpOpenRequestW/0001-wininet-Handle-INTERNET_INVALID_PORT_NUMBER-in-HttpO.patch +++ b/patches/wininet-HttpOpenRequestW/0001-wininet-Handle-INTERNET_INVALID_PORT_NUMBER-in-HttpO.patch @@ -1,4 +1,4 @@ -From 842a91f83a472f364f6617f90a657603385fbc59 Mon Sep 17 00:00:00 2001 +From 8ee0669fae69b5a23fe2d1d4b36055ca64f93f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 25 Apr 2016 21:46:29 +0200 Subject: wininet: Handle INTERNET_INVALID_PORT_NUMBER in HttpOpenRequest. @@ -14,10 +14,10 @@ Signed-off-by: Sebastian Lackner 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index ef0b36e..9d75b59 100644 +index 21f6ff2..39f72c6 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c -@@ -3331,7 +3331,7 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, +@@ -3356,7 +3356,7 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, { appinfo_t *hIC = session->appInfo; http_request_t *request; @@ -26,11 +26,11 @@ index ef0b36e..9d75b59 100644 TRACE("-->\n"); -@@ -3360,7 +3360,14 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, +@@ -3385,7 +3385,14 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, request->session = session; list_add_head( &session->hdr.children, &request->hdr.entry ); -- request->server = get_server(session->hostName, session->hostPort, (dwFlags & INTERNET_FLAG_SECURE) != 0, TRUE); +- request->server = get_server(substrz(session->hostName), session->hostPort, (dwFlags & INTERNET_FLAG_SECURE) != 0, TRUE); + port = session->hostPort; + if (port == INTERNET_INVALID_PORT_NUMBER) + { @@ -38,15 +38,15 @@ index ef0b36e..9d75b59 100644 + INTERNET_DEFAULT_HTTPS_PORT : INTERNET_DEFAULT_HTTP_PORT; + } + -+ request->server = get_server(session->hostName, port, (dwFlags & INTERNET_FLAG_SECURE) != 0, TRUE); ++ request->server = get_server(substrz(session->hostName), port, (dwFlags & INTERNET_FLAG_SECURE) != 0, TRUE); if(!request->server) { WININET_Release(&request->hdr); return ERROR_OUTOFMEMORY; diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c -index 66ba526..6aa0f4c 100644 +index 29dd965..a76046d 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c -@@ -5771,13 +5771,13 @@ static void test_default_service_port(void) +@@ -6079,13 +6079,13 @@ static void test_default_service_port(void) ok(request != NULL, "HttpOpenRequest failed\n"); ret = HttpSendRequestA(request, NULL, 0, NULL, 0); @@ -62,7 +62,7 @@ index 66ba526..6aa0f4c 100644 InternetCloseHandle(request); InternetCloseHandle(connect); -@@ -5796,7 +5796,7 @@ static void test_default_service_port(void) +@@ -6104,7 +6104,7 @@ static void test_default_service_port(void) memset(buffer, 0, sizeof(buffer)); ret = HttpQueryInfoA(request, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); ok(ret, "HttpQueryInfo failed with error %u\n", GetLastError());