From 669232e38f2284df4d5e778bfd84104291ea8e51 Mon Sep 17 00:00:00 2001 From: Brandon Amaro Date: Sun, 18 Feb 2018 19:05:26 -0800 Subject: [PATCH] Update 9999-IfDefined.patch Allows the patch to be applied --- .../wined3d-CSMT_Main/9999-IfDefined.patch | 65 ++++--------------- 1 file changed, 11 insertions(+), 54 deletions(-) diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 1675ed91..739b8d93 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -6,34 +6,6 @@ Based on patches by: Sebastian Lackner Stefan Dösinger -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1219,6 +1219,9 @@ HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, - const struct wined3d_box *box, const void *data) - { - UINT offset, size; -+#if defined(STAGING_CSMT) -+ DWORD flags = 0; -+#endif /* STAGING_CSMT */ - HRESULT hr; - BYTE *ptr; - -@@ -1233,7 +1236,14 @@ HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, - size = buffer->resource.size; - } - -+#if !defined(STAGING_CSMT) - if (FAILED(hr = wined3d_buffer_map(buffer, offset, size, &ptr, 0))) -+#else /* STAGING_CSMT */ -+ if (offset == 0 && size == buffer->resource.size) -+ flags = WINED3D_MAP_DISCARD; -+ -+ if (FAILED(hr = wined3d_buffer_map(buffer, offset, size, &ptr, flags))) -+#endif /* STAGING_CSMT */ - return hr; - - memcpy(ptr, data, size); diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -299,14 +271,14 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2410,7 +2410,11 @@ static BOOL surface_load_texture(struct wined3d_surface *surface, +@@ -2461,7 +2461,11 @@ static BOOL surface_load_texture(struct /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ +#if !defined(STAGING_CSMT) - if ((format.convert || conversion) && texture->sub_resources[sub_resource_idx].buffer_object) + if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer_object) +#else /* STAGING_CSMT */ -+ if ((format.convert || conversion) && texture->sub_resources[sub_resource_idx].buffer) ++ if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer) +#endif /* STAGING_CSMT */ { TRACE("Removing the pbo attached to surface %p.\n", surface); @@ -314,9 +286,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -483,7 +483,11 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, +@@ -476,7 +476,11 @@ static void swapchain_gl_present(struct + if (swapchain->render_to_fbo) swapchain_blit(swapchain, context, src_rect, dst_rect); - } +#if !defined(STAGING_CSMT) if (swapchain->num_contexts > 1) @@ -601,27 +573,12 @@ diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c wined3d_cs_init_object(resource->device->cs, wined3d_unordered_access_view_cs_init, view); return WINED3D_OK; -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 -@@ -72,7 +72,11 @@ static CRITICAL_SECTION wined3d_wndproc_cs = {&wined3d_wndproc_cs_debug, -1, 0, - * where appropriate. */ - struct wined3d_settings wined3d_settings = - { -+#if !defined(STAGING_CSMT) - FALSE, /* No multithreaded CS by default. */ -+#else /* STAGING_CSMT */ -+ TRUE, /* Multithreaded CS by default. */ -+#endif /* STAGING_CSMT */ - MAKEDWORD_VERSION(1, 0), /* Default to legacy OpenGL */ - TRUE, /* Use of GLSL enabled by default */ - ORM_FBO, /* Use FBOs to do offscreen rendering */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2860,6 +2860,16 @@ static inline BOOL wined3d_dualblend_enabled(const struct wined3d_state *state, - return FALSE; - } +@@ -2898,6 +2898,16 @@ struct wined3d_dummy_textures + GLuint tex_2d_ms_array; + }; +#if defined(STAGING_CSMT) +struct wined3d_gl_bo @@ -636,7 +593,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 -@@ -2971,6 +2981,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -2998,6 +3008,12 @@ LRESULT device_process_message(struct wi void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; @@ -649,7 +606,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) { -@@ -3158,7 +3174,11 @@ struct wined3d_texture +@@ -3188,7 +3204,11 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -661,7 +618,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h } sub_resources[1]; }; -@@ -3474,6 +3494,9 @@ struct wined3d_cs_queue +@@ -3504,6 +3524,9 @@ struct wined3d_cs_queue struct wined3d_cs_ops {