From 51d7077f518b806d824122c5fa02451546961cfc Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 31 Aug 2015 04:58:17 +0200 Subject: [PATCH] patchupdate.py: Add 'Apply-Before' definition field and fix a bug in dependency resolution. --- debian/tools/patchupdate.py | 17 +- patches/d3d11-Fix_Compile/definition | 1 + patches/patchinstall.sh | 24 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 348 +++++++++--------- 4 files changed, 199 insertions(+), 191 deletions(-) create mode 100644 patches/d3d11-Fix_Compile/definition diff --git a/debian/tools/patchupdate.py b/debian/tools/patchupdate.py index 43a248e0..863106a9 100755 --- a/debian/tools/patchupdate.py +++ b/debian/tools/patchupdate.py @@ -300,6 +300,11 @@ def read_patchset(revision = None): if i != j and any([fnmatch.fnmatch(f, val) for f in other_patch.modified_files]): patch.auto_depends.add(j) + elif key == "apply-before": + for j, other_patch in all_patches.iteritems(): + if i != j and any([fnmatch.fnmatch(f, val) for f in other_patch.modified_files]): + other_patch.auto_depends.add(i) + elif key == "category": val = "category-%s" % val if name_to_id.has_key(val): @@ -432,7 +437,7 @@ def select_patches(all_patches, indices, filename): selected_patches[i] = extract_patch(all_patches[i], filename) return selected_patches -def resolve_dependencies(all_patches, index = None, depends = None): +def resolve_dependencies(all_patches, index = None, depends = None, auto_deps = True): """Returns a sorted list with all dependencies for a given patch.""" def _resolve(depends): @@ -450,7 +455,7 @@ def resolve_dependencies(all_patches, index = None, depends = None): # Recusively resolve dependencies all_patches[i].verify_resolved = -1 _resolve(all_patches[i].depends) - _resolve(all_patches[i].auto_depends) + if auto_deps: _resolve(all_patches[i].auto_depends) all_patches[i].verify_resolved = 1 resolved.append(i) @@ -459,8 +464,10 @@ def resolve_dependencies(all_patches, index = None, depends = None): resolved = [] if depends is None: - depends = all_patches[index].depends - _resolve(depends) + _resolve(all_patches[index].depends) + if auto_deps: _resolve(all_patches[index].auto_depends) + else: + _resolve(depends) return resolved def generate_ifdefined(all_patches): @@ -684,7 +691,7 @@ def generate_script(all_patches): # List dependencies (if any) if len(patch.depends): - depends = resolve_dependencies(all_patches, i) + depends = resolve_dependencies(all_patches, i, auto_deps=False) lines.append("# | This patchset has the following (direct or indirect) dependencies:\n") lines.append("# | *\t%s\n" % "\n# | \t".join(textwrap.wrap( ", ".join([all_patches[j].name for j in depends]), 120))) diff --git a/patches/d3d11-Fix_Compile/definition b/patches/d3d11-Fix_Compile/definition new file mode 100644 index 00000000..80b17a46 --- /dev/null +++ b/patches/d3d11-Fix_Compile/definition @@ -0,0 +1 @@ +Apply-Before: * diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4212cad9..bdc7713c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -1981,6 +1981,18 @@ if test "$enable_patchlist" -eq 1; then fi +# Patchset d3d11-Fix_Compile +# | +# | Modified files: +# | * dlls/d3d11/utils.c +# | +if test "$enable_d3d11_Fix_Compile" -eq 1; then + patch_apply d3d11-Fix_Compile/0001-d3d11-Fix-compile-failure-with-recent-version-of-gcc.patch + ( + echo '+ { "Sebastian Lackner", "d3d11: Fix compile failure with recent version of gcc.", 1 },'; + ) >> "$patchlist" +fi + # Patchset Compiler_Warnings # | # | Modified files: @@ -2287,18 +2299,6 @@ if test "$enable_crypt32_CMS_Certificates" -eq 1; then ) >> "$patchlist" fi -# Patchset d3d11-Fix_Compile -# | -# | Modified files: -# | * dlls/d3d11/utils.c -# | -if test "$enable_d3d11_Fix_Compile" -eq 1; then - patch_apply d3d11-Fix_Compile/0001-d3d11-Fix-compile-failure-with-recent-version-of-gcc.patch - ( - echo '+ { "Sebastian Lackner", "d3d11: Fix compile failure with recent version of gcc.", 1 },'; - ) >> "$patchlist" -fi - # Patchset d3d9-DesktopWindow # | # | Modified files: diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index dd71bd64..e68a7df7 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -4,7 +4,7 @@ Subject: Autogenerated #ifdef patch for wined3d-CSMT_Main. diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -309,7 +309,11 @@ +@@ -314,7 +314,11 @@ if (backbuffer->resource.multisample_type) { location = WINED3D_LOCATION_RB_RESOLVED; @@ -16,7 +16,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); -@@ -417,11 +421,19 @@ +@@ -422,11 +426,19 @@ } static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in, @@ -36,7 +36,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c const struct wined3d_gl_info *gl_info; struct wined3d_context *context; struct wined3d_surface *front; -@@ -449,6 +461,29 @@ +@@ -454,6 +466,29 @@ NULL, WINED3D_TEXF_POINT); } @@ -66,7 +66,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c TRACE("Presenting HDC %p.\n", context->hdc); render_to_fbo = swapchain->render_to_fbo; -@@ -490,6 +525,7 @@ +@@ -495,6 +530,7 @@ */ if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { @@ -74,7 +74,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c wined3d_resource_load_location(&back_buffer->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE); swapchain->render_to_fbo = TRUE; -@@ -498,6 +534,16 @@ +@@ -503,6 +539,16 @@ else { wined3d_resource_load_location(&back_buffer->resource, context, back_buffer->container->resource.draw_binding); @@ -91,7 +91,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } if (swapchain->render_to_fbo) -@@ -510,8 +556,13 @@ +@@ -515,8 +561,13 @@ swapchain_blit(swapchain, context, &src_rect, &dst_rect); } @@ -105,7 +105,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ gl_info->gl_ops.wgl.p_wglSwapBuffers(context->hdc); /* TODO: cycle through the swapchain buffers */ -@@ -534,6 +585,7 @@ +@@ -539,6 +590,7 @@ } front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); @@ -113,7 +113,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE); wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE); switch (swapchain->desc.swap_effect) -@@ -562,6 +614,61 @@ +@@ -567,6 +619,61 @@ { wined3d_surface_decref(swapchain->device->cs->onscreen_depth_stencil); swapchain->device->cs->onscreen_depth_stencil = NULL; @@ -175,7 +175,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } } } -@@ -594,7 +701,11 @@ +@@ -599,7 +706,11 @@ TRACE("Copying surface %p to screen.\n", front); @@ -187,7 +187,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c src_dc = front->hDC; window = swapchain->win_handle; -@@ -622,8 +733,12 @@ +@@ -627,8 +738,12 @@ } static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in, @@ -200,7 +200,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c { struct wined3d_surface *front, *back; -@@ -650,9 +765,15 @@ +@@ -655,9 +770,15 @@ { void *tmp; @@ -216,7 +216,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c if (front->resource.heap_memory) ERR("GDI Surface %p has heap memory allocated.\n", front); -@@ -723,6 +844,7 @@ +@@ -728,6 +849,7 @@ swapchain->render_to_fbo = TRUE; } @@ -224,7 +224,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { const struct wined3d_adapter *adapter = device->adapter; -@@ -786,6 +908,7 @@ +@@ -791,6 +913,7 @@ return WINED3D_OK; } @@ -232,7 +232,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device, struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) { -@@ -876,8 +999,13 @@ +@@ -881,8 +1004,13 @@ wined3d_texture_set_swapchain(swapchain->front_buffer, swapchain); if (!(device->wined3d->flags & WINED3D_NO3D)) { @@ -246,7 +246,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } /* MSDN says we're only allowed a single fullscreen swapchain per device, -@@ -903,9 +1031,66 @@ +@@ -908,9 +1036,66 @@ if (!(device->wined3d->flags & WINED3D_NO3D)) { @@ -328,7 +328,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c { TRACE("No Z buffer - disabling depth test\n"); zenable = WINED3D_ZB_FALSE; -@@ -367,8 +371,13 @@ +@@ -370,8 +374,13 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -342,7 +342,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; GLenum srcBlend, dstBlend; enum wined3d_blend d3d_blend; -@@ -813,7 +822,11 @@ +@@ -816,7 +825,11 @@ GLint depthFail_ccw; /* No stencil test without a stencil buffer. */ @@ -354,7 +354,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c { gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST); checkGLcall("glDisable GL_STENCIL_TEST"); -@@ -909,7 +922,11 @@ +@@ -912,7 +925,11 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -366,7 +366,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK)); -@@ -923,7 +940,11 @@ +@@ -926,7 +943,11 @@ static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -378,7 +378,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; gl_info->gl_ops.gl.p_glStencilMask(mask); -@@ -1125,10 +1146,17 @@ +@@ -1128,10 +1149,17 @@ /* drop through */ case WINED3D_FOG_NONE: @@ -396,7 +396,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c new_source = FOGSOURCE_COORD; gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)"); -@@ -1650,7 +1678,11 @@ +@@ -1653,7 +1681,11 @@ if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] || state->render_states[WINED3D_RS_DEPTHBIAS]) { @@ -408,7 +408,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c float scale; union -@@ -4187,9 +4219,15 @@ +@@ -4190,9 +4222,15 @@ } } } else { @@ -424,7 +424,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c WARN("unsupported blending in openGl\n"); } } -@@ -4543,7 +4581,11 @@ +@@ -4546,7 +4584,11 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -436,7 +436,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; -@@ -4721,7 +4763,11 @@ +@@ -4724,7 +4766,11 @@ } else { @@ -448,7 +448,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c UINT height; UINT width; -@@ -4785,7 +4831,11 @@ +@@ -4788,7 +4834,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1208,7 +1208,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c -@@ -86,8 +86,10 @@ +@@ -87,8 +87,10 @@ ~0U, /* No GS shader model limit by default. */ ~0U, /* No PS shader model limit by default. */ FALSE, /* 3D support enabled by default. */ @@ -1219,7 +1219,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c }; struct wined3d * CDECL wined3d_create(DWORD flags) -@@ -316,6 +318,7 @@ +@@ -328,6 +330,7 @@ TRACE("Disabling 3D support.\n"); wined3d_settings.no_3d = TRUE; } @@ -1227,7 +1227,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c if (!get_config_key(hkey, appkey, "CSMT", buffer, size) && !strcmp(buffer,"disabled")) { -@@ -332,6 +335,9 @@ +@@ -344,6 +347,9 @@ FIXME_(winediag)("Experimental wined3d CSMT feature is currently %s.\n", wined3d_settings.cs_multithreaded ? "enabled" : "disabled"); @@ -1344,7 +1344,7 @@ diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -1509,6 +1509,7 @@ +@@ -1451,6 +1451,7 @@ goto out; } @@ -1352,7 +1352,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c ret->current_fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret->current_fb.render_targets) * gl_info->limits.buffers); ret->current_fb.rt_size = gl_info->limits.buffers; -@@ -1517,6 +1518,7 @@ +@@ -1459,6 +1460,7 @@ if (device->context_count) ret->offscreenBuffer = device->contexts[0]->offscreenBuffer; @@ -1360,7 +1360,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) { -@@ -1830,7 +1832,9 @@ +@@ -1767,7 +1769,9 @@ out: device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -1370,7 +1370,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); -@@ -1865,7 +1869,9 @@ +@@ -1802,7 +1806,9 @@ device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); @@ -1380,7 +1380,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); -@@ -2273,7 +2279,11 @@ +@@ -2210,7 +2216,11 @@ return TRUE; } @@ -1392,7 +1392,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) { -@@ -2289,6 +2299,7 @@ +@@ -2226,6 +2236,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 */ @@ -1400,7 +1400,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); -@@ -2303,6 +2314,22 @@ +@@ -2240,6 +2251,22 @@ return context_generate_rt_mask_from_surface(rt); else return context_generate_rt_mask(context->offscreenBuffer); @@ -1423,7 +1423,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } /* Context activation is done by the caller. */ -@@ -2334,7 +2361,11 @@ +@@ -2271,7 +2298,11 @@ } else { @@ -1435,7 +1435,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; -@@ -2381,7 +2412,11 @@ +@@ -2318,7 +2349,11 @@ DWORD rt_mask = 0, *cur_mask; UINT i; @@ -1447,7 +1447,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, dsv)) -@@ -2423,11 +2458,17 @@ +@@ -2360,11 +2395,17 @@ } else { @@ -1465,7 +1465,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))) -@@ -2440,7 +2481,11 @@ +@@ -2377,7 +2418,11 @@ } else { @@ -1477,7 +1477,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); } -@@ -2475,6 +2520,7 @@ +@@ -2412,6 +2457,7 @@ return TRUE; } @@ -1485,7 +1485,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; -@@ -2484,6 +2530,18 @@ +@@ -2421,6 +2467,18 @@ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); @@ -1504,7 +1504,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])); -@@ -2506,8 +2564,14 @@ +@@ -2443,8 +2501,14 @@ /* Context activation is done by the caller. */ void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1519,7 +1519,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2538,8 +2602,10 @@ +@@ -2475,8 +2539,10 @@ context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -1530,7 +1530,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) -@@ -2777,12 +2843,22 @@ +@@ -2714,12 +2780,22 @@ /* Context activation is done by the caller. */ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1553,7 +1553,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); -@@ -2984,7 +3060,11 @@ +@@ -2921,7 +2997,11 @@ { if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) { @@ -1565,7 +1565,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c context->use_immediate_mode_draw = TRUE; } else -@@ -3159,11 +3239,19 @@ +@@ -3096,11 +3176,19 @@ } /* Context activation is done by the caller. */ @@ -1585,7 +1585,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c unsigned int i; WORD map; -@@ -3196,12 +3284,17 @@ +@@ -3133,12 +3221,17 @@ for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -1603,7 +1603,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } if (state->index_buffer) { -@@ -3296,7 +3389,11 @@ +@@ -3233,7 +3326,11 @@ if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -1800,7 +1800,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h #include #include #include -@@ -278,8 +306,10 @@ +@@ -279,8 +307,10 @@ unsigned int max_sm_gs; unsigned int max_sm_ps; BOOL no_3d; @@ -1811,7 +1811,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -1012,9 +1042,14 @@ +@@ -1013,9 +1043,14 @@ WORD use_map; /* MAX_ATTRIBS, 16 */ }; @@ -1826,7 +1826,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 -@@ -1102,8 +1137,10 @@ +@@ -1103,8 +1138,10 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -1837,7 +1837,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; union wined3d_gl_query_object -@@ -1139,6 +1176,7 @@ +@@ -1140,6 +1177,7 @@ struct list entry; GLuint id; struct wined3d_context *context; @@ -1845,7 +1845,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT64 timestamp; }; -@@ -1174,6 +1212,12 @@ +@@ -1175,6 +1213,12 @@ for (i = 0; i < min(dst->rt_size, src->rt_size); i++) dst->render_targets[i] = src->render_targets[i]; } @@ -1858,7 +1858,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context { -@@ -1189,7 +1233,9 @@ +@@ -1190,7 +1234,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 */ @@ -1868,7 +1868,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_swapchain *swapchain; struct wined3d_surface *current_rt; -@@ -1289,8 +1335,17 @@ +@@ -1287,8 +1333,17 @@ GLfloat fog_coord_value; GLfloat color[4], fogstart, fogend, fogcolor[4]; GLuint dummy_arbfp_prog; @@ -1886,7 +1886,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); -@@ -1430,8 +1485,12 @@ +@@ -1428,8 +1483,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; @@ -1899,7 +1899,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, -@@ -2004,7 +2063,11 @@ +@@ -2003,7 +2062,11 @@ struct wined3d_state { DWORD flags; @@ -1911,7 +1911,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]; -@@ -2049,6 +2112,7 @@ +@@ -2048,6 +2111,7 @@ DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -1919,7 +1919,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_gl_bo { GLuint name; -@@ -2057,6 +2121,7 @@ +@@ -2056,6 +2120,7 @@ UINT size; }; @@ -1927,7 +1927,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 -@@ -2112,11 +2177,23 @@ +@@ -2111,11 +2176,23 @@ struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -1951,7 +1951,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; -@@ -2127,6 +2204,9 @@ +@@ -2126,6 +2203,9 @@ UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -1961,7 +1961,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HCURSOR hardwareCursor; /* The Wine logo texture */ -@@ -2158,6 +2238,7 @@ +@@ -2157,6 +2237,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; @@ -1969,7 +1969,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, -@@ -2169,6 +2250,11 @@ +@@ -2168,6 +2249,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; @@ -1981,7 +1981,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) { -@@ -2185,9 +2271,11 @@ +@@ -2184,9 +2270,11 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -1993,7 +1993,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_resource -@@ -2212,6 +2300,7 @@ +@@ -2211,6 +2299,7 @@ UINT depth; UINT size; DWORD priority; @@ -2001,7 +2001,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; -@@ -2219,6 +2308,10 @@ +@@ -2218,6 +2307,10 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -2012,7 +2012,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2243,6 +2336,7 @@ +@@ -2242,6 +2335,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; @@ -2020,7 +2020,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, -@@ -2291,6 +2385,15 @@ +@@ -2290,6 +2384,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -2036,7 +2036,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 -@@ -2375,7 +2478,9 @@ +@@ -2374,7 +2477,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; @@ -2046,7 +2046,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, -@@ -2409,9 +2514,16 @@ +@@ -2408,9 +2513,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2063,7 +2063,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) -@@ -2419,6 +2531,7 @@ +@@ -2418,6 +2530,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2071,7 +2071,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; -@@ -2431,6 +2544,24 @@ +@@ -2430,6 +2543,24 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2096,7 +2096,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2456,7 +2587,11 @@ +@@ -2455,7 +2586,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2108,7 +2108,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2464,12 +2599,26 @@ +@@ -2463,12 +2598,26 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2135,7 +2135,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2513,10 +2662,19 @@ +@@ -2512,10 +2661,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; @@ -2155,7 +2155,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; -@@ -2528,6 +2686,7 @@ +@@ -2527,6 +2685,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; @@ -2163,7 +2163,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; -@@ -2546,6 +2705,21 @@ +@@ -2545,6 +2704,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; @@ -2185,7 +2185,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. */ -@@ -2593,8 +2767,10 @@ +@@ -2592,8 +2766,10 @@ BOOL half_float_conv_needed; }; @@ -2196,7 +2196,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]; -@@ -2662,6 +2838,7 @@ +@@ -2661,6 +2837,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2204,7 +2204,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; -@@ -2712,6 +2889,32 @@ +@@ -2711,6 +2888,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; @@ -2237,7 +2237,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; -@@ -2761,6 +2964,7 @@ +@@ -2760,6 +2963,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; @@ -2245,7 +2245,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, -@@ -2820,6 +3024,7 @@ +@@ -2819,6 +3023,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; @@ -2253,7 +2253,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 -@@ -2834,8 +3039,12 @@ +@@ -2833,8 +3038,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2266,7 +2266,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2849,12 +3058,16 @@ +@@ -2848,12 +3057,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2283,7 +2283,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 */ -@@ -2881,7 +3094,9 @@ +@@ -2880,7 +3093,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2293,7 +2293,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2906,11 +3121,15 @@ +@@ -2905,11 +3120,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; @@ -2309,7 +2309,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2949,8 +3168,10 @@ +@@ -2948,8 +3167,10 @@ return surface_from_resource(resource); } @@ -2320,7 +2320,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2963,8 +3184,12 @@ +@@ -2962,8 +3183,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2333,7 +2333,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -3003,8 +3228,10 @@ +@@ -3002,8 +3227,10 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2344,7 +2344,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3208,7 +3435,9 @@ +@@ -3207,7 +3434,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; @@ -2391,7 +2391,7 @@ diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c -@@ -1983,7 +1983,9 @@ +@@ -2001,7 +2001,9 @@ escape.code = X11DRV_FLUSH_GL_DRAWABLE; escape.gl_drawable = 0; @@ -2401,7 +2401,7 @@ diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c if ((gl = get_gl_drawable( WindowFromDC( ctx->hdc ), 0 ))) { switch (gl->type) -@@ -2009,7 +2011,9 @@ +@@ -2027,7 +2029,9 @@ escape.code = X11DRV_FLUSH_GL_DRAWABLE; escape.gl_drawable = 0; @@ -3472,7 +3472,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1435,6 +1614,16 @@ +@@ -1458,6 +1637,16 @@ TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n", light->range, light->falloff, light->theta, light->phi); @@ -3489,7 +3489,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Save away the information. */ object->OriginalParms = *light; -@@ -1514,9 +1703,11 @@ +@@ -1537,9 +1726,11 @@ FIXME("Unrecognized light type %#x.\n", light->type); } @@ -3501,7 +3501,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1589,6 +1780,14 @@ +@@ -1612,6 +1803,14 @@ { if (light_info->glIndex != -1) { @@ -3516,7 +3516,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state->lights[light_info->glIndex] = NULL; light_info->glIndex = -1; } -@@ -1630,11 +1829,23 @@ +@@ -1653,11 +1852,23 @@ WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -3540,7 +3540,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1809,9 +2020,11 @@ +@@ -1832,9 +2043,11 @@ TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -3552,7 +3552,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) -@@ -1856,7 +2069,11 @@ +@@ -1879,7 +2092,11 @@ || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); @@ -3564,7 +3564,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -2176,7 +2393,11 @@ +@@ -2199,7 +2416,11 @@ return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -3576,7 +3576,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { UINT i; -@@ -2209,8 +2430,12 @@ +@@ -2232,8 +2453,12 @@ } else { @@ -3589,7 +3589,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2257,8 +2482,12 @@ +@@ -2280,8 +2505,12 @@ } else { @@ -3602,7 +3602,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2309,8 +2538,13 @@ +@@ -2332,8 +2561,13 @@ memset(device->recording->changed.vertexShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count); else @@ -3616,7 +3616,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2445,8 +2679,12 @@ +@@ -2468,8 +2702,12 @@ } else { @@ -3629,7 +3629,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2493,8 +2731,12 @@ +@@ -2516,8 +2754,12 @@ } else { @@ -3642,7 +3642,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2546,8 +2788,12 @@ +@@ -2569,8 +2811,12 @@ memset(device->recording->changed.pixelShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count); else @@ -3655,7 +3655,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2707,6 +2953,7 @@ +@@ -2730,6 +2976,7 @@ return hr; } @@ -3663,7 +3663,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_settings.cs_multithreaded) { FIXME("Waiting for cs.\n"); -@@ -2714,6 +2961,7 @@ +@@ -2737,6 +2984,7 @@ device->cs->ops->finish(device->cs); } @@ -3671,7 +3671,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); -@@ -3215,6 +3463,10 @@ +@@ -3238,6 +3486,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -3682,7 +3682,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3223,6 +3475,15 @@ +@@ -3246,6 +3498,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3698,7 +3698,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3248,8 +3509,10 @@ +@@ -3271,8 +3532,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) { @@ -3709,7 +3709,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); -@@ -3258,12 +3521,19 @@ +@@ -3281,12 +3544,19 @@ WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); return WINED3D_OK; } @@ -3729,7 +3729,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"); -@@ -3272,8 +3542,13 @@ +@@ -3295,8 +3565,13 @@ } else if (flags & WINED3DCLEAR_TARGET) { @@ -3743,7 +3743,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; -@@ -3319,6 +3594,9 @@ +@@ -3342,6 +3617,9 @@ enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -3753,7 +3753,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); -@@ -3326,8 +3604,13 @@ +@@ -3349,8 +3627,13 @@ device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -3767,7 +3767,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, -@@ -3350,6 +3633,14 @@ +@@ -3373,6 +3656,14 @@ return WINED3DERR_INVALIDCALL; } @@ -3782,7 +3782,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; -@@ -3366,6 +3657,10 @@ +@@ -3389,6 +3680,10 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { @@ -3793,7 +3793,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) -@@ -3384,6 +3679,15 @@ +@@ -3407,6 +3702,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3809,7 +3809,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; -@@ -3399,6 +3703,7 @@ +@@ -3422,6 +3726,7 @@ } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -3817,7 +3817,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { -@@ -3434,6 +3739,88 @@ +@@ -3457,6 +3762,88 @@ { enum wined3d_resource_type type = src_texture->resource.type; unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; @@ -3906,7 +3906,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3452,7 +3839,13 @@ +@@ -3475,7 +3862,13 @@ } /* Make sure that the destination texture is loaded. */ @@ -3920,7 +3920,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update every surface level of the texture. */ switch (type) -@@ -3467,7 +3860,16 @@ +@@ -3490,7 +3883,16 @@ src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -3937,7 +3937,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3487,7 +3889,16 @@ +@@ -3510,7 +3912,16 @@ i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); @@ -3954,7 +3954,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -3497,6 +3908,7 @@ +@@ -3520,6 +3931,7 @@ { for (i = 0; i < level_count; ++i) { @@ -3962,7 +3962,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device_update_volume(context, volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)), -@@ -3545,6 +3957,25 @@ +@@ -3568,6 +3980,25 @@ } wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); @@ -3988,7 +3988,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -3607,8 +4038,13 @@ +@@ -3630,8 +4061,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -4002,7 +4002,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3707,6 +4143,7 @@ +@@ -3730,6 +4166,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -4010,7 +4010,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c const struct wined3d_format *src_format = src_surface->resource.format; const struct wined3d_format *dst_format = dst_surface->resource.format; UINT update_w, update_h; -@@ -3714,6 +4151,7 @@ +@@ -3737,6 +4174,7 @@ RECT r, dst_rect; POINT p; @@ -4018,7 +4018,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", device, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_point(dst_point)); -@@ -3725,6 +4163,7 @@ +@@ -3748,6 +4186,7 @@ return WINED3DERR_INVALIDCALL; } @@ -4026,7 +4026,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (src_format->id != dst_format->id) { WARN("Source and destination surfaces should have the same format.\n"); -@@ -3787,6 +4226,9 @@ +@@ -3810,6 +4249,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -4036,7 +4036,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -4000,7 +4442,11 @@ +@@ -4023,7 +4465,11 @@ && src_rect.bottom == sub_resource->height) wined3d_texture_prepare_texture(texture, context, FALSE); else @@ -4048,7 +4048,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_texture_bind_and_dirtify(texture, context, FALSE); wined3d_surface_upload_data(surface, gl_info, resource->format, -@@ -4008,8 +4454,13 @@ +@@ -4031,8 +4477,13 @@ context_release(context); @@ -4062,7 +4062,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4040,8 +4491,14 @@ +@@ -4063,8 +4514,14 @@ rect = &r; } @@ -4077,7 +4077,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, -@@ -4055,6 +4512,7 @@ +@@ -4078,6 +4535,7 @@ return NULL; } @@ -4085,7 +4085,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -4070,6 +4528,22 @@ +@@ -4093,6 +4551,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4108,7 +4108,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); -@@ -4109,6 +4583,7 @@ +@@ -4132,6 +4606,7 @@ } @@ -4116,7 +4116,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; -@@ -4116,6 +4591,15 @@ +@@ -4139,6 +4614,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4132,7 +4132,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. */ -@@ -4127,6 +4611,7 @@ +@@ -4150,6 +4634,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4140,7 +4140,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; -@@ -4151,6 +4636,79 @@ +@@ -4174,6 +4659,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4220,7 +4220,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image) { -@@ -4186,8 +4744,16 @@ +@@ -4209,8 +4767,16 @@ * release it after setting the cursor image. Windows doesn't * addref the set surface, so we can't do this either without * creating circular refcount dependencies. */ @@ -4237,7 +4237,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4287,6 +4853,12 @@ +@@ -4310,6 +4876,12 @@ else SetCursor(NULL); } @@ -4250,7 +4250,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4297,8 +4869,10 @@ +@@ -4320,8 +4892,10 @@ TRACE("device %p.\n", device); @@ -4261,7 +4261,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); -@@ -4306,6 +4880,7 @@ +@@ -4329,6 +4903,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4269,7 +4269,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4326,6 +4901,37 @@ +@@ -4349,6 +4924,37 @@ gl_info = context->gl_info; wine_rb_clear(&device->samplers, device_free_sampler, NULL); @@ -4307,7 +4307,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4346,6 +4952,7 @@ +@@ -4369,6 +4975,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4315,7 +4315,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4365,6 +4972,14 @@ +@@ -4388,6 +4995,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4330,7 +4330,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, -@@ -4381,6 +4996,7 @@ +@@ -4404,6 +5019,7 @@ return hr; } @@ -4338,7 +4338,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)) { -@@ -4391,6 +5007,34 @@ +@@ -4414,6 +5030,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4373,7 +4373,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4407,8 +5051,10 @@ +@@ -4430,8 +5074,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4384,7 +4384,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4424,9 +5070,21 @@ +@@ -4447,9 +5093,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4406,7 +4406,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4435,6 +5093,7 @@ +@@ -4458,6 +5116,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4414,7 +4414,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4444,6 +5103,12 @@ +@@ -4467,6 +5126,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4427,7 +4427,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4456,6 +5121,7 @@ +@@ -4479,6 +5144,7 @@ } } @@ -4435,7 +4435,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4477,6 +5143,7 @@ +@@ -4500,6 +5166,7 @@ } device->cs->ops->finish(device->cs); @@ -4443,7 +4443,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("New params:\n"); TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width); TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height); -@@ -4603,6 +5270,13 @@ +@@ -4626,6 +5293,13 @@ swapchain_desc->multisample_type, swapchain_desc->multisample_quality))) return hr; @@ -4457,7 +4457,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc surface_desc; -@@ -4640,6 +5314,13 @@ +@@ -4663,6 +5337,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4471,7 +4471,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4660,12 +5341,20 @@ +@@ -4683,12 +5364,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4492,7 +4492,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4674,6 +5363,7 @@ +@@ -4697,6 +5386,7 @@ } else if (device->back_buffer_view) { @@ -4500,7 +4500,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4689,6 +5379,24 @@ +@@ -4712,6 +5402,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4525,7 +4525,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4764,6 +5472,10 @@ +@@ -4787,6 +5495,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4536,7 +4536,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4774,6 +5486,7 @@ +@@ -4797,6 +5509,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4544,7 +4544,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4785,6 +5498,19 @@ +@@ -4808,6 +5521,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4564,7 +4564,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4947,7 +5673,11 @@ +@@ -4970,7 +5696,11 @@ device->blitter = adapter->blitter; @@ -4576,7 +4576,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -5046,6 +5776,7 @@ +@@ -5069,6 +5799,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4584,7 +4584,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, -@@ -5099,3 +5830,4 @@ +@@ -5122,3 +5853,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -9879,7 +9879,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -5492,9 +5492,15 @@ +@@ -5536,9 +5536,15 @@ DebugBreak(); } @@ -9898,7 +9898,7 @@ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -200,7 +200,9 @@ +@@ -203,7 +203,9 @@ ERR("Failed to allocate system memory.\n"); return E_OUTOFMEMORY; } @@ -9908,7 +9908,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c } else { -@@ -224,6 +226,7 @@ +@@ -227,6 +229,7 @@ return WINED3D_OK; } @@ -9916,7 +9916,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void wined3d_resource_free_bo(struct wined3d_resource *resource) { struct wined3d_context *context = context_acquire(resource->device, NULL); -@@ -249,6 +252,7 @@ +@@ -252,6 +255,7 @@ resource->map_heap_memory = NULL; } @@ -9924,7 +9924,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void resource_cleanup(struct wined3d_resource *resource) { const struct wined3d *d3d = resource->device->wined3d; -@@ -261,7 +265,11 @@ +@@ -264,7 +268,11 @@ adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -9936,7 +9936,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c device_resource_released(resource->device, resource); } -@@ -271,9 +279,11 @@ +@@ -274,9 +282,11 @@ if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -9948,7 +9948,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c context_resource_unloaded(resource->device, resource, resource->type); } -@@ -336,7 +346,11 @@ +@@ -339,7 +349,11 @@ p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; *p = mem; @@ -9960,7 +9960,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c return TRUE; } -@@ -402,7 +416,11 @@ +@@ -405,7 +419,11 @@ return ret; } @@ -9972,7 +9972,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c { if (d3d_flags & WINED3D_MAP_READONLY) return GL_READ_ONLY_ARB; -@@ -443,6 +461,7 @@ +@@ -446,6 +464,7 @@ else resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB; } @@ -9980,7 +9980,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch, UINT *slice_pitch) -@@ -1021,3 +1040,4 @@ +@@ -1024,3 +1043,4 @@ wined3d_resource_invalidate_location(resource, ~resource->map_binding); }