From 883297db764514f7397302b915b330ead47b94ff Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 4 Feb 2016 09:47:45 +0100 Subject: [PATCH] Rebase against 44f2589e7c239243b587e2d7ff92f4cdde61c3b6. --- patches/patchinstall.sh | 2 +- ...urce-buffer-mapping-facilities-in-su.patch | 32 ++++++++--------- ...d3d-Use-resource_map-for-surface_map.patch | 6 ++-- .../wined3d-CSMT_Main/9999-IfDefined.patch | 34 +++++++++---------- ...ined3d_resource_-un-map-to-wined3d_r.patch | 21 ++++++++---- 5 files changed, 52 insertions(+), 43 deletions(-) diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index ea6f0eb3..5203ef80 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "36187987ed92f1e6662cfd739e0f67d7ff58a9f3" + echo "44f2589e7c239243b587e2d7ff92f4cdde61c3b6" } # Show version information diff --git a/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch b/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch index aab2e74d..8fe7f7ac 100644 --- a/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch +++ b/patches/wined3d-CSMT_Main/0017-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch @@ -1,4 +1,4 @@ -From 0c74d61fdaa16fbb70f443f6863d864024b8e615 Mon Sep 17 00:00:00 2001 +From 15d68401bf24f7ba0face4f18b90a708fd33545a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 21 Jan 2014 13:30:59 +0100 Subject: wined3d: Use resource buffer mapping facilities in surfaces. @@ -9,10 +9,10 @@ Subject: wined3d: Use resource buffer mapping facilities in surfaces. 2 files changed, 23 insertions(+), 63 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 5f0a98e..dda77f0 100644 +index 869c42f..642e907 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -544,6 +544,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -570,6 +570,12 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, case WINED3D_LOCATION_SYSMEM: return resource->heap_memory; @@ -25,7 +25,7 @@ index 5f0a98e..dda77f0 100644 default: ERR("Unexpected map binding %s.\n", wined3d_debug_location(resource->map_binding)); return NULL; -@@ -566,6 +572,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -592,6 +598,8 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, return; case WINED3D_LOCATION_SYSMEM: @@ -35,10 +35,10 @@ index 5f0a98e..dda77f0 100644 default: diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 62f74bd..583fa59 100644 +index b94d7a2..3e27544 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -716,36 +716,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) +@@ -692,36 +692,10 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) static void surface_unmap(struct wined3d_surface *surface) { @@ -75,16 +75,16 @@ index 62f74bd..583fa59 100644 if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)) { TRACE("Not dirtified, nothing to do.\n"); -@@ -2623,6 +2597,8 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso +@@ -2569,6 +2543,8 @@ do { \ - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context = NULL; TRACE("surface %p.\n", surface); if (!surface->resource.map_count) -@@ -2632,6 +2608,12 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) +@@ -2578,6 +2554,12 @@ HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) } --surface->resource.map_count; @@ -97,7 +97,7 @@ index 62f74bd..583fa59 100644 surface->surface_ops->surface_unmap(surface); return WINED3D_OK; -@@ -2643,8 +2625,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2589,8 +2571,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; struct wined3d_device *device = surface->resource.device; @@ -107,7 +107,7 @@ index 62f74bd..583fa59 100644 BYTE *base_memory; TRACE("surface %p, map_desc %p, box %p, flags %#x.\n", -@@ -2686,6 +2667,9 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2632,6 +2613,9 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } } @@ -117,7 +117,7 @@ index 62f74bd..583fa59 100644 surface_prepare_map_memory(surface); if (flags & WINED3D_MAP_DISCARD) { -@@ -2695,51 +2679,19 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2641,51 +2625,19 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } else { @@ -149,12 +149,12 @@ index 62f74bd..583fa59 100644 - case WINED3D_LOCATION_DIB: - base_memory = surface->resource.bitmap_data; - break; -- ++ base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); + - case WINED3D_LOCATION_BUFFER: - context = context_acquire(device, NULL); - gl_info = context->gl_info; -+ base_memory = wined3d_resource_get_map_ptr(&surface->resource, context, flags); - +- - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->resource.buffer_object)); - base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE)); - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); @@ -173,5 +173,5 @@ index 62f74bd..583fa59 100644 if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; -- -2.6.0 +2.7.0 diff --git a/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch b/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch index ade744c5..9355b1cb 100644 --- a/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch +++ b/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource_map-for-surface_map.patch @@ -1,4 +1,4 @@ -From 1dcec444b4b710b583a251e585bb46b00c7ee420 Mon Sep 17 00:00:00 2001 +From 3b13285f9a78d467d8e3a52ae5d497c268d6ac3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 18:00:23 +0200 Subject: wined3d: Use resource_map for surface_map. @@ -23,12 +23,12 @@ index 9b5445d..ba0e1c9 100644 if (device->d3d_initialized) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 296f448..6201928 100644 +index 5b22643..627e1c7 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2365,28 +2365,18 @@ do { \ - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context = NULL; diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 427fb9e1..86d295ae 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -5852,7 +5852,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height, @@ -2409,6 +2909,7 @@ - HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) + HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) { +#if defined(STAGING_CSMT) HRESULT hr; @@ -9496,7 +9496,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; -@@ -2644,6 +2807,7 @@ +@@ -2645,6 +2808,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; @@ -9504,7 +9504,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; -@@ -2658,6 +2822,17 @@ +@@ -2659,6 +2823,17 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -9522,7 +9522,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2678,8 +2853,10 @@ +@@ -2679,8 +2854,10 @@ GLuint name; }; @@ -9533,7 +9533,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration_element { const struct wined3d_format *format; -@@ -2708,8 +2885,10 @@ +@@ -2709,8 +2886,10 @@ BOOL half_float_conv_needed; }; @@ -9544,7 +9544,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]; -@@ -2777,6 +2956,7 @@ +@@ -2778,6 +2957,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -9552,7 +9552,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; -@@ -2827,6 +3007,32 @@ +@@ -2828,6 +3008,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; @@ -9585,7 +9585,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; -@@ -2876,6 +3082,7 @@ +@@ -2877,6 +3083,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; @@ -9593,7 +9593,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, -@@ -2938,6 +3145,7 @@ +@@ -2939,6 +3146,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int depth_pitch) DECLSPEC_HIDDEN; @@ -9601,7 +9601,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 -@@ -2952,8 +3160,12 @@ +@@ -2953,8 +3161,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -9614,7 +9614,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2967,12 +3179,16 @@ +@@ -2968,12 +3180,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -9631,7 +9631,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 */ -@@ -2999,7 +3215,9 @@ +@@ -3000,7 +3216,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -9641,7 +9641,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -3024,11 +3242,15 @@ +@@ -3025,11 +3243,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; @@ -9657,7 +9657,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; -@@ -3066,8 +3288,10 @@ +@@ -3067,8 +3289,10 @@ return surface_from_resource(resource); } @@ -9668,7 +9668,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -3080,8 +3304,12 @@ +@@ -3081,8 +3305,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -9681,7 +9681,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -3120,8 +3348,10 @@ +@@ -3121,8 +3349,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; @@ -9692,7 +9692,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3324,7 +3554,9 @@ +@@ -3325,7 +3555,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; diff --git a/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch b/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch index 9b1403eb..962a53dd 100644 --- a/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch +++ b/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch @@ -1,4 +1,4 @@ -From 0e0a130efc01757ea0c25a422d952f54e998fc91 Mon Sep 17 00:00:00 2001 +From 450ad7808200772e20a81e538628a86b304a5fd8 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 4 Nov 2015 19:31:30 +0100 Subject: wined3d: Rename wined3d_resource_(un)map to @@ -12,11 +12,11 @@ To avoid name conflicts in the CSMT patchset. dlls/d3d8/volume.c | 4 ++-- dlls/d3d9/surface.c | 4 ++-- dlls/d3d9/volume.c | 4 ++-- - dlls/ddraw/surface.c | 12 ++++++------ + dlls/ddraw/surface.c | 14 +++++++------- dlls/wined3d/resource.c | 4 ++-- dlls/wined3d/wined3d.spec | 4 ++-- include/wine/wined3d.h | 6 +++--- - 10 files changed, 27 insertions(+), 27 deletions(-) + 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index fb308d0..9658c21 100644 @@ -169,7 +169,7 @@ index 52502bf..a81b6c7 100644 return hr; diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index edb9485..0cefd8e 100644 +index 71b424d..8fa19e2 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -984,7 +984,7 @@ static HRESULT surface_lock(struct ddraw_surface *surface, @@ -181,6 +181,15 @@ index edb9485..0cefd8e 100644 surface->sub_resource_idx, &map_desc, rect ? &box : NULL, flags); if (FAILED(hr)) { +@@ -1159,7 +1159,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Unlock(IDirectDrawSurface + TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect)); + + wined3d_mutex_lock(); +- hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); ++ hr = wined3d_resource_sub_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); + if (SUCCEEDED(hr) && surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + hr = ddraw_surface_update_frontbuffer(surface, &surface->ddraw->primary_lock, FALSE); + wined3d_mutex_unlock(); @@ -5134,7 +5134,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu DDCKEY_SRCBLT, &src_desc->ddckCKSrcBlt); } @@ -238,7 +247,7 @@ index 73250ec..c1079ba 100644 TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index 6ff3151..1382a5a 100644 +index 6f930ef..33ce73d 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -182,10 +182,10 @@ @@ -255,7 +264,7 @@ index 6ff3151..1382a5a 100644 @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr) @ cdecl wined3d_rendertarget_view_create_from_surface(ptr ptr ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 04b022c..d5747cb 100644 +index f29f4ff..e56ee35 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2421,11 +2421,11 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,