From 32f681f893177e3ae3116a9b109a9e955b7f723b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 3 Jun 2015 18:13:44 +0200 Subject: [PATCH] Rebase against 8d4f56810775757edc87f6f01754df7f9e98d7e3. --- debian/changelog | 2 + patches/patchinstall.sh | 6 +- ...nt-IText-Selection-Range-Set-Start-E.patch | 10 +- ...ing-clipboard-from-multiple-threads.patch} | 50 +++---- ...e-the-framebuffer-into-wined3d_state.patch | 50 +++---- ...of-state-access-in-shader_generate_g.patch | 13 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 140 +++++++++--------- 7 files changed, 137 insertions(+), 134 deletions(-) rename patches/server-OpenClipboard/{0001-server-OpenClipboard-with-current-owner-shouldn-t-fa.patch => 0001-server-Fix-opening-clipboard-from-multiple-threads.patch} (52%) diff --git a/debian/changelog b/debian/changelog index c47bcb00..dac9b6cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ wine-staging (1.7.45) UNRELEASED; urgency=low * Updated shell32-Icons patchset to fix a test failure in comctl32/imagelist. * Updated shlwapi-AssocGetPerceivedType patchset to fix error checking for RegGetValueW. + * Updated patch to fix opening clipboard from multiple threads (partially + fixed upstream). * Added patches for FileRenameInformation support (fixes Wine Staging Bug #296). * Added additional tests for behaviour of opening readonly files. diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index c134da96..89727c83 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -55,7 +55,7 @@ version() echo "Copyright (C) 2014-2015 the Wine Staging project authors." echo "" echo "Patchset to be applied on upstream Wine:" - echo " commit b75cd7e2f0f6f40655f690695ab0843fce472e88" + echo " commit 8d4f56810775757edc87f6f01754df7f9e98d7e3" echo "" } @@ -4387,9 +4387,9 @@ fi # | * dlls/user32/tests/clipboard.c, server/clipboard.c # | if test "$enable_server_OpenClipboard" -eq 1; then - patch_apply server-OpenClipboard/0001-server-OpenClipboard-with-current-owner-shouldn-t-fa.patch + patch_apply server-OpenClipboard/0001-server-Fix-opening-clipboard-from-multiple-threads.patch ( - echo '+ { "Sebastian Lackner", "server: OpenClipboard() with current owner shouldn'\''t fail.", 1 },'; + echo '+ { "Sebastian Lackner", "server: Fix opening clipboard from multiple threads.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch b/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch index 3379b5f1..9fc86203 100644 --- a/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch +++ b/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch @@ -1,4 +1,4 @@ -From 41acfc2923995baef4ed18edf3803ba159464457 Mon Sep 17 00:00:00 2001 +From 1245a3cdde079cccdbd7a5fbae3132e325caff0e Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Fri, 8 Aug 2014 21:32:57 +0800 Subject: riched20: Implement IText{Selection, Range}::Set{Start, End}. @@ -8,11 +8,11 @@ Subject: riched20: Implement IText{Selection, Range}::Set{Start, End}. 1 file changed, 135 insertions(+) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c -index 318b386..957cbee 100644 +index 101896e..20cb78c 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c -@@ -3072,6 +3072,137 @@ static void test_SetFont(void) - ITextSelection_Release(selection); +@@ -3108,6 +3108,137 @@ static void test_InsertObject(void) + release_interfaces(&hwnd, &reole, &doc, NULL); } +static void test_ITextRange_SetStart(void) @@ -149,7 +149,7 @@ index 318b386..957cbee 100644 START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in -@@ -3084,11 +3215,15 @@ START_TEST(richole) +@@ -3120,11 +3251,15 @@ START_TEST(richole) test_GetText(); test_ITextSelection_GetChar(); test_ITextSelection_GetStart_GetEnd(); diff --git a/patches/server-OpenClipboard/0001-server-OpenClipboard-with-current-owner-shouldn-t-fa.patch b/patches/server-OpenClipboard/0001-server-Fix-opening-clipboard-from-multiple-threads.patch similarity index 52% rename from patches/server-OpenClipboard/0001-server-OpenClipboard-with-current-owner-shouldn-t-fa.patch rename to patches/server-OpenClipboard/0001-server-Fix-opening-clipboard-from-multiple-threads.patch index 5167c455..eb6bcbeb 100644 --- a/patches/server-OpenClipboard/0001-server-OpenClipboard-with-current-owner-shouldn-t-fa.patch +++ b/patches/server-OpenClipboard/0001-server-Fix-opening-clipboard-from-multiple-threads.patch @@ -1,21 +1,20 @@ -From 224f0263e0d56336f6baaafd09baddff64679a9b Mon Sep 17 00:00:00 2001 +From 2683d3a1e5f86624b1227933ad620dde8aefa171 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner -Date: Sun, 3 May 2015 07:34:10 +0200 -Subject: server: OpenClipboard() with current owner shouldn't fail. +Date: Wed, 3 Jun 2015 18:12:07 +0200 +Subject: server: Fix opening clipboard from multiple threads. -Based on a patch by Nikolay Sivov. --- - dlls/user32/tests/clipboard.c | 16 +++++++++++++++- + dlls/user32/tests/clipboard.c | 14 ++++++++++++++ server/clipboard.c | 3 ++- - 2 files changed, 17 insertions(+), 2 deletions(-) + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c -index 40218be..8fd4963 100644 +index a9aef84..6f6cb39 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c -@@ -35,9 +35,18 @@ static BOOL is_win9x = FALSE; - expected_error, GetLastError()); \ - } while (0) +@@ -24,9 +24,18 @@ + #include "wingdi.h" + #include "winuser.h" +static DWORD WINAPI open_clipboard_thread(LPVOID arg) +{ @@ -32,34 +31,33 @@ index 40218be..8fd4963 100644 BOOL ret; SetLastError(0xdeadbeef); -@@ -66,7 +75,12 @@ static void test_ClipboardOwner(void) +@@ -56,6 +65,11 @@ static void test_ClipboardOwner(void) ok( ret, "CloseClipboard error %d\n", GetLastError()); ok(OpenClipboard(hWnd1), "OpenClipboard failed\n"); -- todo_wine ok(OpenClipboard(hWnd1), "OpenClipboard second time in the same hwnd failed\n"); + thread = CreateThread(NULL, 0, open_clipboard_thread, hWnd1, 0, NULL); + ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError()); + dwret = WaitForSingleObject(thread, 1000); + ok(dwret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", dwret); + CloseHandle(thread); -+ ok(OpenClipboard(hWnd1), "OpenClipboard second time in the same hwnd failed\n"); + ok(OpenClipboard(hWnd1), "OpenClipboard second time in the same hwnd failed\n"); SetLastError(0xdeadbeef); - ret = OpenClipboard(hWnd2); diff --git a/server/clipboard.c b/server/clipboard.c -index 0c39319..7f94103 100644 +index 9acee98..ad7ae6f 100644 --- a/server/clipboard.c +++ b/server/clipboard.c -@@ -204,7 +204,8 @@ DECL_HANDLER(set_clipboard_info) - if (clipboard->open_thread) - { - /* clipboard already opened */ -- set_error(STATUS_WAS_LOCKED); -+ if (clipboard->open_win != req->clipboard) -+ set_error(STATUS_WAS_LOCKED); - return; - } - +@@ -138,8 +138,9 @@ void cleanup_clipboard_thread(struct thread *thread) + static int open_clipboard( struct clipboard *clipboard, user_handle_t win ) + { + win = get_user_full_handle( win ); +- if (clipboard->open_thread && (clipboard->open_thread != current || clipboard->open_win != win)) ++ if (clipboard->open_thread) + { ++ if (clipboard->open_win == win) return 1; + set_error(STATUS_WAS_LOCKED); + return 0; + } -- -2.3.5 +2.4.2 diff --git a/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch b/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch index 42cc5711..95467f07 100644 --- a/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch +++ b/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch @@ -1,4 +1,4 @@ -From 4dc10ae70ba7ad248e35fbfa456034fc40af00ba Mon Sep 17 00:00:00 2001 +From e898d6d1944694f979f3f7415a4632a190d6dd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 20 Dec 2012 13:09:17 +0100 Subject: wined3d: Move the framebuffer into wined3d_state @@ -20,7 +20,7 @@ Subject: wined3d: Move the framebuffer into wined3d_state 13 files changed, 172 insertions(+), 127 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index 83136bd..f21d672 100644 +index 7138ad1..1a09c2a 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -684,7 +684,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, @@ -42,7 +42,7 @@ index 83136bd..f21d672 100644 } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 728a7cc..bf77b69 100644 +index 724bac9..07db94c 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1453,6 +1453,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, @@ -58,7 +58,7 @@ index 728a7cc..bf77b69 100644 /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { -@@ -1770,6 +1776,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, +@@ -1771,6 +1777,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, out: device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -66,7 +66,7 @@ index 728a7cc..bf77b69 100644 HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -1804,6 +1811,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont +@@ -1805,6 +1812,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); @@ -74,7 +74,7 @@ index 728a7cc..bf77b69 100644 HeapFree(GetProcessHeap(), 0, context->draw_buffers); HeapFree(GetProcessHeap(), 0, context->blit_targets); device_context_remove(device, context); -@@ -2318,7 +2326,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2319,7 +2327,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win DWORD rt_mask = 0, *cur_mask; UINT i; @@ -83,7 +83,7 @@ index 728a7cc..bf77b69 100644 || rt_count != context->gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, fb->depth_stencil)) -@@ -2361,6 +2369,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2362,6 +2370,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win rt_mask = context_generate_rt_mask_no_fbo(device, rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); } @@ -92,7 +92,7 @@ index 728a7cc..bf77b69 100644 } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2411,7 +2421,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2412,7 +2422,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_device *device) { const struct wined3d_state *state = &device->state; @@ -101,7 +101,7 @@ index 728a7cc..bf77b69 100644 struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; DWORD rt_mask, rt_mask_bits; unsigned int i; -@@ -2441,7 +2451,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const +@@ -2442,7 +2452,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_device *device = context->swapchain->device; @@ -110,7 +110,7 @@ index 728a7cc..bf77b69 100644 DWORD rt_mask = find_draw_buffers_mask(context, device); DWORD *cur_mask; -@@ -2471,6 +2481,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat +@@ -2472,6 +2482,8 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -119,7 +119,7 @@ index 728a7cc..bf77b69 100644 } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -3059,7 +3071,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de +@@ -3060,7 +3072,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de { const struct wined3d_state *state = &device->state; const struct StateEntry *state_table = context->state_table; @@ -577,11 +577,11 @@ index f2c2f42..c6a72fc 100644 surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 93863d0..ac74620 100644 +index 87ff576..76d2c35 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1500,7 +1500,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont - const struct wined3d_state *state = &shader->device->state; +@@ -1501,7 +1501,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont + const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; const struct wined3d_gl_info *gl_info = context->gl_info; - const struct wined3d_fb_state *fb = &shader->device->fb; @@ -590,10 +590,10 @@ index 93863d0..ac74620 100644 const struct wined3d_shader_lconst *lconst; const char *prefix; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index 279ec42..18e3f0c 100644 +index 02b0aff..f27a09c 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -2406,7 +2406,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 +@@ -2411,7 +2411,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE]) { @@ -603,7 +603,7 @@ index 279ec42..18e3f0c 100644 { static unsigned int warned = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 37f4498..27cdc8a 100644 +index e042add..d8883b3 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ @@ -839,10 +839,10 @@ index 5ad82bd..5106cd5 100644 const struct wined3d_d3d_info *d3d_info = context->d3d_info; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 12cbdc4..210a23d 100644 +index a7c44e8..35ca5da 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1128,6 +1128,36 @@ struct wined3d_timestamp_query +@@ -1134,6 +1134,36 @@ struct wined3d_timestamp_query void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; @@ -879,7 +879,7 @@ index 12cbdc4..210a23d 100644 struct wined3d_context { const struct wined3d_gl_info *gl_info; -@@ -1142,6 +1172,7 @@ struct wined3d_context +@@ -1148,6 +1178,7 @@ struct wined3d_context DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ DWORD numDirtyEntries; DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ @@ -887,7 +887,7 @@ index 12cbdc4..210a23d 100644 struct wined3d_swapchain *swapchain; struct wined3d_surface *current_rt; -@@ -1243,12 +1274,6 @@ struct wined3d_context +@@ -1249,12 +1280,6 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -900,7 +900,7 @@ index 12cbdc4..210a23d 100644 typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); struct StateEntry -@@ -1932,7 +1957,7 @@ struct wined3d_stream_state +@@ -1938,7 +1963,7 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -909,7 +909,7 @@ index 12cbdc4..210a23d 100644 struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2038,7 +2063,6 @@ struct wined3d_device +@@ -2044,7 +2069,6 @@ struct wined3d_device struct wine_rb_tree samplers; /* Render Target Support */ @@ -917,7 +917,7 @@ index 12cbdc4..210a23d 100644 struct wined3d_surface *onscreen_depth_stencil; struct wined3d_rendertarget_view *auto_depth_stencil_view; -@@ -2544,9 +2568,8 @@ struct wined3d_stateblock +@@ -2550,9 +2574,8 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -929,7 +929,7 @@ index 12cbdc4..210a23d 100644 void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; struct wined3d_cs_ops -@@ -2559,7 +2582,6 @@ struct wined3d_cs +@@ -2565,7 +2588,6 @@ struct wined3d_cs { const struct wined3d_cs_ops *ops; struct wined3d_device *device; diff --git a/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch b/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch index 42d050fd..132010c9 100644 --- a/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch +++ b/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch @@ -1,4 +1,4 @@ -From f329e2cef96141fd66cd2957eafa665b6b1289da Mon Sep 17 00:00:00 2001 +From a605e2c29345026b85ef529bb72bb83422423d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 20 Dec 2012 14:19:52 +0100 Subject: wined3d: Get rid of state access in shader_generate_glsl_declarations @@ -8,21 +8,22 @@ Subject: wined3d: Get rid of state access in shader_generate_glsl_declarations 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 9c0d052..7fc6289 100644 +index 76d2c35..5b0b174 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -949,10 +949,8 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont +@@ -1497,11 +1497,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv) { const struct wined3d_shader_version *version = ®_maps->shader_version; - const struct wined3d_state *state = &shader->device->state; + const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; const struct wined3d_gl_info *gl_info = context->gl_info; - const struct wined3d_fb_state *fb = &state->fb; unsigned int i, extra_constants_needed = 0; const struct wined3d_shader_lconst *lconst; const char *prefix; -@@ -1190,7 +1188,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont +@@ -1751,7 +1749,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont { UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); @@ -31,7 +32,7 @@ index 9c0d052..7fc6289 100644 shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); } -@@ -1231,21 +1229,14 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont +@@ -1792,21 +1790,14 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont } else { @@ -59,5 +60,5 @@ index 9c0d052..7fc6289 100644 shader_addline(buffer, "vec4 vpos;\n"); } -- -2.2.1 +2.4.2 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 4513e131..ec946219 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -1211,7 +1211,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader shader_arb_ps_local_constants(compiled, context, state, rt_height); } -@@ -7810,7 +7818,11 @@ +@@ -7813,7 +7821,11 @@ /* Now load the surface */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -1223,7 +1223,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader == WINED3D_LOCATION_DRAWABLE && !wined3d_resource_is_offscreen(&src_surface->container->resource)) { -@@ -7840,6 +7852,7 @@ +@@ -7843,6 +7855,7 @@ /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); @@ -1231,7 +1231,7 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader if (wined3d_settings.cs_multithreaded) context->gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -7851,6 +7864,17 @@ +@@ -7854,6 +7867,17 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); @@ -1307,7 +1307,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { -@@ -1778,7 +1780,9 @@ +@@ -1779,7 +1781,9 @@ out: device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -1317,7 +1317,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -1813,7 +1817,9 @@ +@@ -1814,7 +1818,9 @@ device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); @@ -1327,7 +1327,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c HeapFree(GetProcessHeap(), 0, context->draw_buffers); HeapFree(GetProcessHeap(), 0, context->blit_targets); device_context_remove(device, context); -@@ -2221,7 +2227,11 @@ +@@ -2222,7 +2228,11 @@ return TRUE; } @@ -1339,7 +1339,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c static void context_validate_onscreen_formats(struct wined3d_context *context, const struct wined3d_rendertarget_view *depth_stencil) { -@@ -2237,6 +2247,7 @@ +@@ -2238,6 +2248,7 @@ WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -1347,7 +1347,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c wined3d_resource_load_location(&context->current_rt->resource, context, WINED3D_LOCATION_TEXTURE_RGB); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); -@@ -2251,6 +2262,22 @@ +@@ -2252,6 +2263,22 @@ return context_generate_rt_mask_from_surface(rt); else return context_generate_rt_mask(context->offscreenBuffer); @@ -1370,7 +1370,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } /* Context activation is done by the caller. */ -@@ -2282,7 +2309,11 @@ +@@ -2283,7 +2310,11 @@ } else { @@ -1382,7 +1382,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; -@@ -2328,7 +2359,11 @@ +@@ -2329,7 +2360,11 @@ DWORD rt_mask = 0, *cur_mask; UINT i; @@ -1394,7 +1394,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c || rt_count != context->gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, fb->depth_stencil)) -@@ -2368,11 +2403,17 @@ +@@ -2369,11 +2404,17 @@ } else { @@ -1412,7 +1412,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2385,7 +2426,11 @@ +@@ -2386,7 +2427,11 @@ } else { @@ -1424,7 +1424,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); } -@@ -2420,6 +2465,7 @@ +@@ -2421,6 +2466,7 @@ return TRUE; } @@ -1432,7 +1432,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) { struct wined3d_rendertarget_view **rts = state->fb.render_targets; -@@ -2429,6 +2475,18 @@ +@@ -2430,6 +2476,18 @@ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); @@ -1451,7 +1451,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c else if (!context->render_offscreen) return context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); -@@ -2451,8 +2509,14 @@ +@@ -2452,8 +2510,14 @@ /* Context activation is done by the caller. */ void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1466,7 +1466,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2481,8 +2545,10 @@ +@@ -2482,8 +2546,10 @@ context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -1477,7 +1477,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -2720,12 +2786,22 @@ +@@ -2721,12 +2787,22 @@ /* Context activation is done by the caller. */ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1500,7 +1500,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c if (rt_mask != *cur_mask) { context_apply_draw_buffers(context, rt_mask); -@@ -2926,7 +3002,11 @@ +@@ -2927,7 +3003,11 @@ { if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) { @@ -1512,7 +1512,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c context->use_immediate_mode_draw = TRUE; } else -@@ -3066,11 +3146,19 @@ +@@ -3067,11 +3147,19 @@ } /* Context activation is done by the caller. */ @@ -1532,7 +1532,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c unsigned int i, j; WORD map; -@@ -3102,12 +3190,17 @@ +@@ -3103,12 +3191,17 @@ for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -1550,7 +1550,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } if (state->index_buffer) { -@@ -3211,7 +3304,11 @@ +@@ -3212,7 +3305,11 @@ if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -1758,7 +1758,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -1002,9 +1032,14 @@ +@@ -1008,9 +1038,14 @@ WORD use_map; /* MAX_ATTRIBS, 16 */ }; @@ -1773,7 +1773,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN; #define eps 1e-8f -@@ -1092,8 +1127,10 @@ +@@ -1098,8 +1133,10 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -1784,7 +1784,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; union wined3d_gl_query_object -@@ -1129,6 +1166,7 @@ +@@ -1135,6 +1172,7 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -1792,7 +1792,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT64 timestamp; }; -@@ -1164,6 +1202,12 @@ +@@ -1170,6 +1208,12 @@ for (i = 0; i < min(dst->rt_size, src->rt_size); i++) dst->render_targets[i] = src->render_targets[i]; } @@ -1805,7 +1805,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context { -@@ -1179,7 +1223,9 @@ +@@ -1185,7 +1229,9 @@ DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ DWORD numDirtyEntries; DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ @@ -1815,7 +1815,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_swapchain *swapchain; struct wined3d_surface *current_rt; -@@ -1279,8 +1325,17 @@ +@@ -1285,8 +1331,17 @@ GLfloat fog_coord_value; GLfloat color[4], fogstart, fogend, fogcolor[4]; GLuint dummy_arbfp_prog; @@ -1833,7 +1833,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); -@@ -1414,8 +1469,12 @@ +@@ -1420,8 +1475,12 @@ void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; @@ -1846,7 +1846,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, -@@ -1967,7 +2026,11 @@ +@@ -1973,7 +2032,11 @@ struct wined3d_state { DWORD flags; @@ -1858,7 +1858,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2012,6 +2075,7 @@ +@@ -2018,6 +2081,7 @@ DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -1866,7 +1866,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_gl_bo { GLuint name; -@@ -2020,6 +2084,7 @@ +@@ -2026,6 +2090,7 @@ UINT size; }; @@ -1874,7 +1874,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2075,11 +2140,23 @@ +@@ -2081,11 +2146,23 @@ struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -1898,7 +1898,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* For rendering to a texture using glCopyTexImage */ GLuint depth_blt_texture; -@@ -2090,6 +2167,9 @@ +@@ -2096,6 +2173,9 @@ UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -1908,7 +1908,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HCURSOR hardwareCursor; /* The Wine logo texture */ -@@ -2121,6 +2201,7 @@ +@@ -2127,6 +2207,7 @@ UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1916,7 +1916,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -@@ -2132,6 +2213,11 @@ +@@ -2138,6 +2219,11 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -1928,7 +1928,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2148,9 +2234,11 @@ +@@ -2154,9 +2240,11 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -1940,7 +1940,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_resource -@@ -2175,6 +2263,7 @@ +@@ -2181,6 +2269,7 @@ UINT depth; UINT size; DWORD priority; @@ -1948,7 +1948,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; struct wined3d_gl_bo *buffer, *map_buffer; -@@ -2182,6 +2271,11 @@ +@@ -2188,6 +2277,11 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -1960,7 +1960,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2206,6 +2300,7 @@ +@@ -2212,6 +2306,7 @@ void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1968,7 +1968,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, -@@ -2252,6 +2347,15 @@ +@@ -2258,6 +2353,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -1984,7 +1984,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2336,7 +2440,9 @@ +@@ -2342,7 +2446,9 @@ void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -1994,7 +1994,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2370,9 +2476,16 @@ +@@ -2376,9 +2482,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2011,7 +2011,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2380,6 +2493,7 @@ +@@ -2386,6 +2499,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2019,7 +2019,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -@@ -2392,6 +2506,23 @@ +@@ -2398,6 +2512,23 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2043,7 +2043,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2417,7 +2548,11 @@ +@@ -2423,7 +2554,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2055,7 +2055,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2425,12 +2560,25 @@ +@@ -2431,12 +2566,25 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2081,7 +2081,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2474,10 +2622,19 @@ +@@ -2480,10 +2628,19 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -2101,7 +2101,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -@@ -2489,6 +2646,7 @@ +@@ -2495,6 +2652,7 @@ const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -2109,7 +2109,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2507,6 +2665,21 @@ +@@ -2513,6 +2671,21 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void surface_flip(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; @@ -2131,7 +2131,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ -@@ -2554,8 +2727,10 @@ +@@ -2560,8 +2733,10 @@ BOOL half_float_conv_needed; }; @@ -2142,7 +2142,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2623,6 +2798,7 @@ +@@ -2629,6 +2804,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2150,7 +2150,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2673,6 +2849,32 @@ +@@ -2679,6 +2855,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2183,7 +2183,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2722,6 +2924,7 @@ +@@ -2728,6 +2930,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2191,7 +2191,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2781,6 +2984,7 @@ +@@ -2787,6 +2990,7 @@ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2199,7 +2199,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2795,8 +2999,12 @@ +@@ -2801,8 +3005,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2212,7 +2212,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2810,12 +3018,16 @@ +@@ -2816,12 +3024,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2229,7 +2229,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2842,7 +3054,9 @@ +@@ -2848,7 +3060,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2239,7 +2239,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2867,11 +3081,15 @@ +@@ -2873,11 +3087,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2255,7 +2255,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2910,8 +3128,10 @@ +@@ -2916,8 +3134,10 @@ return surface_from_resource(resource); } @@ -2266,7 +2266,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2924,8 +3144,12 @@ +@@ -2930,8 +3150,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2279,7 +2279,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -2965,8 +3189,10 @@ +@@ -2971,8 +3195,10 @@ HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2290,7 +2290,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3178,7 +3404,9 @@ +@@ -3176,7 +3402,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -4508,15 +4508,17 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1497,8 +1497,15 @@ +@@ -1497,9 +1497,17 @@ const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv) { const struct wined3d_shader_version *version = ®_maps->shader_version; +#if defined(STAGING_CSMT) + const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; const struct wined3d_gl_info *gl_info = context->gl_info; +#else /* STAGING_CSMT */ + const struct wined3d_state *state = &shader->device->state; ++ const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args; + const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args; + const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_fb_state *fb = &shader->device->fb; @@ -4524,7 +4526,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c unsigned int i, extra_constants_needed = 0; const struct wined3d_shader_lconst *lconst; const char *prefix; -@@ -1739,7 +1746,11 @@ +@@ -1749,7 +1757,11 @@ { UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); @@ -4536,7 +4538,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); } -@@ -1780,6 +1791,7 @@ +@@ -1790,6 +1802,7 @@ } else { @@ -4544,7 +4546,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c /* This happens because we do not have proper tracking of the * constant registers that are actually used, only the max * limit of the shader version. -@@ -1788,6 +1800,23 @@ +@@ -1798,6 +1811,23 @@ * it and just create the uniform. */ FIXME("Cannot find a free uniform for vpos correction params\n"); @@ -9072,7 +9074,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -1869,7 +1869,11 @@ +@@ -1873,7 +1873,11 @@ } } @@ -9084,7 +9086,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); -@@ -2126,10 +2130,16 @@ +@@ -2132,10 +2136,16 @@ if (!refcount) { @@ -9101,7 +9103,7 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c } return refcount; -@@ -2404,7 +2414,11 @@ +@@ -2412,7 +2422,11 @@ memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE]) {