diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 69a15ad3..eda63a17 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -365,6 +365,7 @@ patch_enable_all () enable_wined3d_1DTextures="$1" enable_wined3d_Accounting="$1" enable_wined3d_CSMT_Helper="$1" + enable_wined3d_CSMT_Main="$1" enable_wined3d_DXTn="$1" enable_wined3d_GTX_560M="$1" enable_wined3d_Limit_Vram="$1" @@ -1274,6 +1275,9 @@ patch_enable () wined3d-CSMT_Helper) enable_wined3d_CSMT_Helper="$2" ;; + wined3d-CSMT_Main) + enable_wined3d_CSMT_Main="$2" + ;; wined3d-DXTn) enable_wined3d_DXTn="$2" ;; @@ -1994,6 +1998,13 @@ if test "$enable_wpcap_Dynamic_Linking" -eq 1; then enable_wpcap_Several_Fixes=1 fi +if test "$enable_wined3d_CSMT_Main" -eq 1; then + if test "$enable_wined3d_CSMT_Helper" -gt 1; then + abort "Patchset wined3d-CSMT_Helper disabled, but wined3d-CSMT_Main depends on that." + fi + enable_wined3d_CSMT_Helper=1 +fi + if test "$enable_wined3d_CSMT_Helper" -eq 1; then if test "$enable_makedep_PARENTSPEC" -gt 1; then abort "Patchset makedep-PARENTSPEC disabled, but wined3d-CSMT_Helper depends on that." @@ -7599,6 +7610,163 @@ if test "$enable_wined3d_check_format_support" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-CSMT_Main +# | +# | This patchset has the following (direct or indirect) dependencies: +# | * makedep-PARENTSPEC, ntdll-Attach_Process_DLLs, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, +# | wined3d-1DTextures, wined3d-Accounting, wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Revert_Pixel_Center_Offset, wined3d- +# | Silence_FIXMEs, wined3d-CSMT_Helper +# | +# | This patchset fixes the following Wine bugs: +# | * [#11674] Support for CSMT (command stream) to increase graphic performance +# | +# | Modified files: +# | * dlls/wined3d/arb_program_shader.c, dlls/wined3d/buffer.c, dlls/wined3d/context.c, dlls/wined3d/cs.c, +# | dlls/wined3d/device.c, dlls/wined3d/drawprim.c, dlls/wined3d/glsl_shader.c, dlls/wined3d/query.c, +# | dlls/wined3d/resource.c, dlls/wined3d/sampler.c, dlls/wined3d/shader.c, dlls/wined3d/state.c, dlls/wined3d/stateblock.c, +# | dlls/wined3d/surface.c, dlls/wined3d/swapchain.c, dlls/wined3d/texture.c, dlls/wined3d/utils.c, dlls/wined3d/view.c, +# | dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h +# | +if test "$enable_wined3d_CSMT_Main" -eq 1; then + patch_apply wined3d-CSMT_Main/9999-IfDefined.patch + ( + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Return location from wined3d_buffer_get_memory().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use unsynchronized buffer updates only if there has been at least one buffer map.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Avoid unsynchronized buffer update when reloading whole buffer.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_rendertarget_view_get_drawable_size() as replacement for surface_get_drawable_size().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Move surface_get_drawable_size() to view.c file.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Mark buffers as used in wined3d_buffer_copy().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use wined3d_vec4 in fixup_transformed_pos().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Invalidate STATE_CONSTANT_BUFFER(*) device state in buffer_destroy_buffer_object() when needed.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Fix style issues in delete_gl_buffer().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Pass context to delete_gl_buffer().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Invalidate device state based on buffer bind flags when buffer is deleted.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Compute \"buffer_type_hint\" from buffer bind flags.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use buffer_bind() in buffer_conversion_upload().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Fix index offset for immediate mode draws.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce buffer_conversion_upload() helper function.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Replace wined3d_buffer_load_sysmem() calls with wined3d_buffer_load_location().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Prefer current locations to WINED3D_LOCATION_SYSMEM in wined3d_buffer_copy().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_get_memory().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Implement wined3d_buffer_prepare_location() for WINED3D_LOCATION_BUFFER.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Move buffer_get_memory() under wined3d_buffer_load_sysmem().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Do not assume that WINED3D_LOCATION_SYSMEM is always valid for double buffered buffers.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_load_location().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_prepapre_location().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Explicitly track locations for buffers.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Clean up buffer_internal_preload().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Let buffer_direct_upload() invalidate STATE_INDEXBUFFER if needed.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Sanitise resource map flags in wined3d_resource_map().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send resource unmaps through the command stream.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send resource maps through the command stream.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send shader constant updates through the command stream.\".", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Make surface_load_location return nothing.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Call texture_load_location instead of surface_load_location.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Share surface and volume system memory loading code.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_convert_format.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_cpu_blt.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Preload buffers if streamsrc is not dirty.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Hackily introduce a multithreaded command stream.", 1 },'; + echo '+ { "Henri Verbeet", "wined3d: Wait for resource updates to finish when using the multithreaded command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs before destroying objects.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Give the cs its own state.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send float constant updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Request a glFinish before modifying resources outside the cs.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Finish the cs before changing the texture lod.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after clears.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after draws.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Pass the depth stencil to swapchain->present.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Keep track of the onscreen depth stencil in the command stream instead of the device.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send base vertex index updates through the cs.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send primitive type updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send bool constant updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send int constant updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send light updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Run the cs asynchronously.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Hack to reject unsupported color fills.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Restore some wined3d_device_copy_sub_resource_region checks.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t force strict draw ordering for multithreaded CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send render target view clears through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send texture maps through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Replace the linked lists with a ringbuffer.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t preload buffers on unmap.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish before swapping.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Add query support to the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Check our CS state to find out if a query is done.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Poll queries automatically in the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Introduce a separate queue for priority commands.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t poll queries that failed to start.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Remove restated queries from the poll list.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Put this into the query poll patch.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t access device state in clears.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Avoid destroying views in color and depth fills.", 1 },'; + echo '+ { "Matteo Bruni", "wined3d: Avoid calling wined3d_surface_blt() from surface_upload_from_surface().", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Get rid of the surface_upload_data glFinish.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t lock the src volume in device_update_volume.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence update_texture calls.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Dirtify resources on unmap.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence render targets and depth stencils.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence blit operations.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence color_fill operations.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Make resource maps and unmaps a priority command.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send update_sub_resource calls through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Dirtify changed textures through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Separate resource map and draw buffers.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD texture maps with PBOs.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD resource maps with heap memory.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Unset some objects in state_init_default.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use double-buffered buffers for multithreaded CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t synchronize NOOVERWRITE buffer maps.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Separate buffer map write and draw read memory pointers.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Accelerate DISCARD buffer maps.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Accelerate READONLY buffer maps.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Access the buffer dirty areas through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Ignore buffer->resource.map_count in the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use glBufferSubData instead of glMapBufferRange.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Separate GL buffer discard control from ignoring MAP_DISCARD.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create buffers before mapping them.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Remove another glFinish.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create VBOs through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "Swapchain waits.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in uninit_3d.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in device_reset.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t glFinish after a depth buffer blit.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use surface_blt_ugly in swapchain_gl_present.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use an event to block the worker thread when it is idle.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Set map_heap_memory = NULL when allocating a PBO.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wait only for the buffer to be idle.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Put GL_APPLE_flush_buffer_range syncing back in place.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t sync on redundant discard calls.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t discard new buffers.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t try to sync VBOs manually on OSX with CSMT.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Only discard buffers that are in use.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send getdc and releasedc through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create dummy textures through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create the initial context through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Recreate ctx and dummy textures through the CS after resets.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Call create_default_sampler from create_dummy_textures.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in reset.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in uninit_3d.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Do the sampler GL init through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create initial DCs through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Assign a read buffer when discarding a new texture.", 1 },'; + echo '+ { "Sebastian Lackner", "wined3d: Do not query available GPU memory on main thread when CSMT is enabled.", 1 },'; + echo '+ { "Nils Kuhnhenn", "wined3d: Fix incorrect return value in wined3d_cs_exec_set_light.", 1 },'; + echo '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },'; + echo '+ { "Sebastian Lackner", "wined3d: Do not signal CS event when we manage to unset waiting_for_event quickly enough.", 1 },'; + echo '+ { "Sebastian Lackner", "wined3d: Enable CSMT by default, print a winediag message informing about this patchset.", 1 },'; + ) >> "$patchlist" +fi + # Patchset winedevice-Fix_Relocation # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch b/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch index 47262964..dd6021c5 100644 --- a/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch +++ b/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch @@ -1,4 +1,4 @@ -From 2bd4f2e4ad2310471f7c3cd85f59f261314cd6c4 Mon Sep 17 00:00:00 2001 +From 9e7a6ec77afd6a2a0304b2a09697792f80c2a595 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 15 Nov 2016 22:07:56 +0100 Subject: Revert "wined3d: Introduce @@ -14,7 +14,7 @@ This reverts commit 5cdb8f2486cf00a61c1aac20daef8c7cac0d8312. 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index d7349fcf..a611531 100644 +index ae8ca97..c526266 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -291,8 +291,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c @@ -37,10 +37,10 @@ index d7349fcf..a611531 100644 else { diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index cd3763c..9e36bcd 100644 +index 3a899b3..6e89fbc 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -4624,7 +4624,7 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine +@@ -4633,7 +4633,7 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine if (vp.height > target->height) vp.height = target->height; @@ -49,7 +49,7 @@ index cd3763c..9e36bcd 100644 } else if (depth_stencil) { -@@ -4668,7 +4668,7 @@ static void viewport_miscpart_cc(struct wined3d_context *context, +@@ -4675,7 +4675,7 @@ static void viewport_miscpart_cc(struct wined3d_context *context, if (vp.height > target->height) vp.height = target->height; @@ -58,7 +58,7 @@ index cd3763c..9e36bcd 100644 } else if (depth_stencil) { -@@ -4853,7 +4853,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st +@@ -4860,7 +4860,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st UINT height; UINT width; @@ -68,10 +68,10 @@ index cd3763c..9e36bcd 100644 } checkGLcall("glScissor"); diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index a67c506..1f819e6 100644 +index 10eecc8..cfd2ce1 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c -@@ -94,21 +94,10 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str +@@ -195,21 +195,10 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str return view->resource; } @@ -97,10 +97,10 @@ index a67c506..1f819e6 100644 /* The drawable size of an onscreen drawable is the surface size. * (Actually: The window size, but the surface is created in window diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 503f7f2..19b650e 100644 +index f14ad98..52bf790 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2908,6 +2908,8 @@ HRESULT surface_color_fill(struct wined3d_surface *s, +@@ -2973,6 +2973,8 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_destroy_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -109,16 +109,16 @@ index 503f7f2..19b650e 100644 void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; HRESULT surface_load_location(struct wined3d_surface *surface, -@@ -3224,9 +3226,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( +@@ -3291,9 +3293,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( return texture->sub_resources[view->sub_resource_idx].u.surface; } -void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, - const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; - - struct wined3d_shader_resource_view + struct wined3d_gl_view { - LONG refcount; + GLenum target; -- 2.9.0 diff --git a/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch b/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch index 703df53f..d419eaec 100644 --- a/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch +++ b/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch @@ -1,4 +1,4 @@ -From 1a411d1906c961dc1d754181823b2ce92301937a Mon Sep 17 00:00:00 2001 +From 3d5e571fff02e6e1ca260c00025864230e9a058f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 15 Nov 2016 22:08:06 +0100 Subject: Revert "wined3d: Move surface_get_drawable_size() to view.c file." @@ -10,7 +10,7 @@ This reverts commit 4beb9e5922301b76c16f6ea885bc1cb604f9eb91. 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index bba855a..1c211ed 100644 +index 3fb3394..630d463 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -36,6 +36,39 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); @@ -54,10 +54,10 @@ index bba855a..1c211ed 100644 { GLenum binding; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index 1f819e6..7f07d57 100644 +index cfd2ce1..95f7453 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c -@@ -94,39 +94,6 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str +@@ -195,39 +195,6 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str return view->resource; } @@ -95,7 +95,7 @@ index 1f819e6..7f07d57 100644 -} - static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, - const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, + const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops) -- 2.9.0 diff --git a/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch b/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch index b15edaba..ebd0ed89 100644 --- a/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch +++ b/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch @@ -1,4 +1,4 @@ -From 244b077b597e99f5a68b9c905114ee6a82781c73 Mon Sep 17 00:00:00 2001 +From 9364fbffd1a4a65bb2b833f3d53cfa24bcf9a3b2 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, 194 insertions(+), 135 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c -index cbdc871..5a0bb65 100644 +index 5de7c02..d3d35c5 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -704,7 +704,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, @@ -42,10 +42,10 @@ index cbdc871..5a0bb65 100644 } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index e7d0121..200a899 100644 +index 0642766..0545e57 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -1705,6 +1705,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, +@@ -1706,6 +1706,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, goto out; } @@ -57,7 +57,7 @@ index e7d0121..200a899 100644 /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { -@@ -2013,6 +2018,7 @@ out: +@@ -2026,6 +2031,7 @@ out: if (hdc) wined3d_release_dc(swapchain->win_handle, hdc); device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -65,7 +65,7 @@ index e7d0121..200a899 100644 HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); -@@ -2060,6 +2066,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont +@@ -2073,6 +2079,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); HeapFree(GetProcessHeap(), 0, context->fbo_key); @@ -73,7 +73,7 @@ index e7d0121..200a899 100644 HeapFree(GetProcessHeap(), 0, context->draw_buffers); HeapFree(GetProcessHeap(), 0, context->blit_targets); device_context_remove(device, context); -@@ -2614,7 +2621,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2627,7 +2634,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win DWORD rt_mask = 0, *cur_mask; UINT i; @@ -82,7 +82,7 @@ index e7d0121..200a899 100644 || rt_count != gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2659,6 +2666,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2672,6 +2679,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL); } @@ -91,7 +91,7 @@ index e7d0121..200a899 100644 } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))) -@@ -2716,7 +2725,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2729,7 +2738,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_state *state) { @@ -100,7 +100,7 @@ index e7d0121..200a899 100644 struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; DWORD rt_mask, rt_mask_bits; unsigned int i; -@@ -2746,7 +2755,7 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const +@@ -2759,7 +2768,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) { DWORD rt_mask = find_draw_buffers_mask(context, state); @@ -109,7 +109,7 @@ index e7d0121..200a899 100644 DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -3035,6 +3044,8 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d +@@ -3048,6 +3057,8 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -118,7 +118,7 @@ index e7d0121..200a899 100644 } static BOOL fixed_get_input(BYTE usage, BYTE usage_idx, unsigned int *regnum) -@@ -3409,7 +3420,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, +@@ -3479,7 +3490,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) { const struct StateEntry *state_table = context->state_table; @@ -128,10 +128,10 @@ index e7d0121..200a899 100644 WORD map; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b4cbcab..0beb6c2 100644 +index 1029c1a..3bca1bd 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -342,19 +342,19 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +@@ -350,19 +350,19 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) state = &device->state; wined3d_get_draw_rect(state, &draw_rect); device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, @@ -155,7 +155,7 @@ index b4cbcab..0beb6c2 100644 } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, -@@ -377,12 +377,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -385,12 +385,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * { for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -171,7 +171,7 @@ index b4cbcab..0beb6c2 100644 cs->ops->submit(cs); } -@@ -420,11 +420,11 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -428,11 +428,11 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) } for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -187,7 +187,7 @@ index b4cbcab..0beb6c2 100644 for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i) { if (!(shader = state->shader[i])) -@@ -481,11 +481,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -489,11 +489,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i } for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -203,7 +203,7 @@ index b4cbcab..0beb6c2 100644 for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i) { if (!(shader = state->shader[i])) -@@ -573,7 +573,7 @@ static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v +@@ -581,7 +581,7 @@ static void wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const v { const struct wined3d_cs_set_rendertarget_view *op = data; @@ -212,7 +212,7 @@ index b4cbcab..0beb6c2 100644 device_invalidate_state(cs->device, STATE_FRAMEBUFFER); } -@@ -596,7 +596,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -604,7 +604,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const struct wined3d_device *device = cs->device; struct wined3d_rendertarget_view *prev; @@ -221,7 +221,7 @@ index b4cbcab..0beb6c2 100644 { struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev); -@@ -612,7 +612,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -620,7 +620,7 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } } @@ -230,7 +230,7 @@ index b4cbcab..0beb6c2 100644 if (!prev != !op->view) { -@@ -1201,11 +1201,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1238,11 +1238,13 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) { struct wined3d_adapter *adapter = cs->device->adapter; @@ -246,7 +246,7 @@ index b4cbcab..0beb6c2 100644 } void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1374,15 +1376,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1412,15 +1414,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) return NULL; @@ -264,7 +264,7 @@ index b4cbcab..0beb6c2 100644 cs->ops = &wined3d_cs_st_ops; cs->device = device; -@@ -1390,7 +1390,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1428,7 +1428,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size))) { state_cleanup(&cs->state); @@ -272,7 +272,7 @@ index b4cbcab..0beb6c2 100644 HeapFree(GetProcessHeap(), 0, cs); return NULL; } -@@ -1401,7 +1400,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1439,7 +1438,6 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) void wined3d_cs_destroy(struct wined3d_cs *cs) { state_cleanup(&cs->state); @@ -281,7 +281,7 @@ index b4cbcab..0beb6c2 100644 HeapFree(GetProcessHeap(), 0, cs); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c08dda6..6356b64 100644 +index 1ce6d76..9757cd5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1004,7 +1004,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi @@ -311,7 +311,7 @@ index c08dda6..6356b64 100644 if (FAILED(hr = device->shader_backend->shader_alloc_private(device, device->adapter->vertex_pipe, device->adapter->fragment_pipe))) { -@@ -1112,7 +1108,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1114,7 +1110,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, return WINED3D_OK; err_out: @@ -319,7 +319,7 @@ index c08dda6..6356b64 100644 HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) -@@ -1190,8 +1185,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1192,8 +1187,25 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (device->cursor_texture) wined3d_texture_decref(device->cursor_texture); @@ -345,7 +345,7 @@ index c08dda6..6356b64 100644 /* Unload resources */ LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { -@@ -1218,37 +1230,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1220,37 +1232,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) context_release(context); @@ -383,7 +383,7 @@ index c08dda6..6356b64 100644 if (device->back_buffer_view) { wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1266,9 +1247,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1268,9 +1249,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->swapchains = NULL; device->swapchain_count = 0; @@ -393,7 +393,7 @@ index c08dda6..6356b64 100644 device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -2085,7 +2063,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) +@@ -2087,7 +2065,7 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; @@ -402,7 +402,7 @@ index c08dda6..6356b64 100644 return; if (src_view->resource->type == WINED3D_RTYPE_BUFFER) { -@@ -3485,6 +3463,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3513,6 +3491,8 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) 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) { @@ -411,7 +411,7 @@ index c08dda6..6356b64 100644 TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, debug_color(color), depth, stencil); -@@ -3496,7 +3476,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3524,7 +3504,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -420,7 +420,7 @@ index c08dda6..6356b64 100644 if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3505,8 +3485,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3533,8 +3513,8 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -431,7 +431,7 @@ index c08dda6..6356b64 100644 { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3822,8 +3802,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -3850,8 +3830,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -442,7 +442,7 @@ index c08dda6..6356b64 100644 if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -4281,20 +4261,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co +@@ -4287,20 +4267,21 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -466,7 +466,7 @@ index c08dda6..6356b64 100644 TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -4331,13 +4312,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4337,13 +4318,13 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -482,7 +482,7 @@ index c08dda6..6356b64 100644 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. */ -@@ -4349,18 +4330,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4355,18 +4336,19 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -504,7 +504,7 @@ index c08dda6..6356b64 100644 wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4721,10 +4703,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4727,10 +4709,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -516,7 +516,7 @@ index c08dda6..6356b64 100644 { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4733,6 +4714,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4739,6 +4720,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -528,7 +528,7 @@ index c08dda6..6356b64 100644 if (device->onscreen_depth_stencil) { wined3d_texture_decref(device->onscreen_depth_stencil->container); -@@ -4901,27 +4887,28 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4911,27 +4897,28 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -564,7 +564,7 @@ index c08dda6..6356b64 100644 wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -5011,11 +4998,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -5021,11 +5008,11 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -578,7 +578,7 @@ index c08dda6..6356b64 100644 ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); switch (type) -@@ -5140,8 +5127,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -5150,8 +5137,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -594,10 +594,10 @@ index c08dda6..6356b64 100644 if (!(device->cs = wined3d_cs_create(device))) diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c -index e5b30db..1188009 100644 +index 06c5bc9..fa92f25 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c -@@ -412,7 +412,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s +@@ -413,7 +413,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed) { @@ -607,10 +607,10 @@ index e5b30db..1188009 100644 struct wined3d_event_query *ib_query = NULL; struct wined3d_stream_info si_emulated; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c -index 3fa02c2..35b2abe55 100644 +index a3c2190..4edeb01 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1514,7 +1514,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context +@@ -1561,7 +1561,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context const struct wined3d_vec4 correction_params = { /* Position is relative to the framebuffer, not the viewport. */ @@ -620,10 +620,10 @@ index 3fa02c2..35b2abe55 100644 0.0f, 0.0f, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index 61509d9..a2fb749 100644 +index 24051cc..5c28bff 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -3066,7 +3066,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 +@@ -3198,7 +3198,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 UINT i; memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ @@ -633,7 +633,7 @@ index 61509d9..a2fb749 100644 static unsigned int warned = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 8ac23bc..60e1ea6 100644 +index 6e89fbc..519c084 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -152,7 +152,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ @@ -661,7 +661,7 @@ index 8ac23bc..60e1ea6 100644 /* Disable blending in all cases even without pixelshaders. * With blending on we could face a big performance penalty. @@ -858,7 +858,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ - GLint depthFail_ccw; + GLint depthFail_back; /* No stencil test without a stencil buffer. */ - if (!state->fb->depth_stencil) @@ -737,10 +737,10 @@ index 8ac23bc..60e1ea6 100644 else gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB); diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c -index 2fbfa2c..bb3c0cc 100644 +index fd01752..2fd4ef4 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c -@@ -430,6 +430,7 @@ void state_unbind_resources(struct wined3d_state *state) +@@ -431,6 +431,7 @@ void state_unbind_resources(struct wined3d_state *state) struct wined3d_texture *texture; struct wined3d_buffer *buffer; struct wined3d_shader *shader; @@ -748,8 +748,8 @@ index 2fbfa2c..bb3c0cc 100644 unsigned int i, j; if ((decl = state->vertex_declaration)) -@@ -506,6 +507,31 @@ void state_unbind_resources(struct wined3d_state *state) - } +@@ -516,6 +517,31 @@ void state_unbind_resources(struct wined3d_state *state) + wined3d_unordered_access_view_decref(uav); } } + @@ -780,7 +780,7 @@ index 2fbfa2c..bb3c0cc 100644 } void state_cleanup(struct wined3d_state *state) -@@ -530,6 +556,8 @@ void state_cleanup(struct wined3d_state *state) +@@ -540,6 +566,8 @@ void state_cleanup(struct wined3d_state *state) HeapFree(GetProcessHeap(), 0, light); } } @@ -789,7 +789,7 @@ index 2fbfa2c..bb3c0cc 100644 } ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock) -@@ -1244,32 +1272,41 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d +@@ -1254,32 +1282,41 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d } } @@ -837,10 +837,10 @@ index 2fbfa2c..bb3c0cc 100644 if (type == WINED3D_SBT_RECORDED) return WINED3D_OK; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 08f6d10..b87bbab 100644 +index d21b293..6db9ca8 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2568,7 +2568,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -2572,7 +2572,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE { struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; @@ -850,7 +850,7 @@ index 08f6d10..b87bbab 100644 struct wined3d_texture *src_texture; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index d5478f4..f649b2f 100644 +index dc7f5de..2773d2f 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -488,7 +488,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, @@ -863,10 +863,10 @@ index d5478f4..f649b2f 100644 struct wined3d_texture *logo_texture; struct wined3d_context *context; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index cb3ae62..267e884 100644 +index 3eed41a..ea4d94d 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -4532,7 +4532,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w +@@ -4583,7 +4583,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w float y_offset = flip ? (center_offset - (2.0f * y) - h) / h : (center_offset - (2.0f * y) - h) / -h; @@ -875,7 +875,7 @@ index cb3ae62..267e884 100644 state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; float z_scale = zenable ? clip_control ? 1.0f : 2.0f : 0.0f; float z_offset = zenable ? clip_control ? 0.0f : -1.0f : 0.0f; -@@ -5331,7 +5331,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d +@@ -5382,7 +5382,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d break; } } @@ -885,10 +885,10 @@ index cb3ae62..267e884 100644 || !state->render_states[WINED3D_RS_CLIPPLANEENABLE]) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f338c55..8bb5957 100644 +index df28689..497b79a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1447,6 +1447,36 @@ struct wined3d_timestamp_query +@@ -1504,6 +1504,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; @@ -925,7 +925,7 @@ index f338c55..8bb5957 100644 struct wined3d_context { const struct wined3d_gl_info *gl_info; -@@ -1461,6 +1491,7 @@ struct wined3d_context +@@ -1518,6 +1548,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 */ @@ -933,7 +933,7 @@ index f338c55..8bb5957 100644 struct wined3d_device *device; struct wined3d_swapchain *swapchain; -@@ -1571,12 +1602,6 @@ struct wined3d_context +@@ -1630,12 +1661,6 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -946,7 +946,7 @@ index f338c55..8bb5957 100644 typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); struct StateEntry -@@ -2380,7 +2405,7 @@ struct wined3d_stream_state +@@ -2442,7 +2467,7 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -955,7 +955,7 @@ index f338c55..8bb5957 100644 struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2485,7 +2510,6 @@ struct wined3d_device +@@ -2548,7 +2573,6 @@ struct wined3d_device struct wine_rb_tree samplers; /* Render Target Support */ @@ -963,7 +963,7 @@ index f338c55..8bb5957 100644 struct wined3d_surface *onscreen_depth_stencil; struct wined3d_rendertarget_view *auto_depth_stencil_view; -@@ -3035,9 +3059,8 @@ struct wined3d_stateblock +@@ -3098,9 +3122,8 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -975,7 +975,7 @@ index f338c55..8bb5957 100644 void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; struct wined3d_cs_ops -@@ -3050,7 +3073,6 @@ struct wined3d_cs +@@ -3113,7 +3136,6 @@ struct wined3d_cs { const struct wined3d_cs_ops *ops; struct wined3d_device *device; diff --git a/patches/wined3d-CSMT_Main/0038-wined3d-Hackily-introduce-a-multithreaded-command-st.patch b/patches/wined3d-CSMT_Main/0038-wined3d-Hackily-introduce-a-multithreaded-command-st.patch index bbf528b0..40ae4abb 100644 --- a/patches/wined3d-CSMT_Main/0038-wined3d-Hackily-introduce-a-multithreaded-command-st.patch +++ b/patches/wined3d-CSMT_Main/0038-wined3d-Hackily-introduce-a-multithreaded-command-st.patch @@ -1,16 +1,16 @@ -From 6e78f864b5f4c377f49483ea35859db2429917c3 Mon Sep 17 00:00:00 2001 +From 43060700de61d94ba910752b26d9a4327b56fc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 1 Oct 2013 14:31:56 +0200 Subject: wined3d: Hackily introduce a multithreaded command stream --- - dlls/wined3d/cs.c | 377 +++++++++++++++++++++++++++++++++++++---- + dlls/wined3d/cs.c | 381 +++++++++++++++++++++++++++++++++++++---- dlls/wined3d/wined3d_main.c | 9 + dlls/wined3d/wined3d_private.h | 18 ++ - 3 files changed, 372 insertions(+), 32 deletions(-) + 3 files changed, 375 insertions(+), 33 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 0beb6c2..b25aab3 100644 +index 3bca1bd..59725a3 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -24,8 +24,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -33,7 +33,7 @@ index 0beb6c2..b25aab3 100644 WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, WINED3D_CS_OP_DRAW, -@@ -57,6 +68,18 @@ enum wined3d_cs_op +@@ -58,6 +69,18 @@ enum wined3d_cs_op WINED3D_CS_OP_QUERY_ISSUE, WINED3D_CS_OP_PRELOAD_RESOURCE, WINED3D_CS_OP_UNLOAD_RESOURCE, @@ -52,7 +52,7 @@ index 0beb6c2..b25aab3 100644 }; struct wined3d_cs_present -@@ -289,7 +312,134 @@ struct wined3d_cs_unload_resource +@@ -297,7 +320,134 @@ struct wined3d_cs_unload_resource struct wined3d_resource *resource; }; @@ -188,7 +188,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_present *op = data; struct wined3d_swapchain *swapchain; -@@ -305,6 +455,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -313,6 +463,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) { wined3d_resource_release(&swapchain->back_buffers[i]->resource); } @@ -197,7 +197,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, -@@ -330,13 +482,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -338,13 +490,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw cs->ops->submit(cs); } @@ -213,7 +213,7 @@ index 0beb6c2..b25aab3 100644 device = cs->device; state = &device->state; -@@ -355,6 +508,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +@@ -363,6 +516,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) } if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) wined3d_resource_release(state->fb.depth_stencil->resource); @@ -222,7 +222,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, -@@ -387,7 +542,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -395,7 +550,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * cs->ops->submit(cs); } @@ -231,7 +231,7 @@ index 0beb6c2..b25aab3 100644 { struct wined3d_state *state = &cs->device->state; struct wined3d_shader_sampler_map_entry *entry; -@@ -446,6 +601,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -454,6 +609,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) wined3d_resource_release(view->resource); } } @@ -240,7 +240,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, -@@ -511,12 +668,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -519,12 +676,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i cs->ops->submit(cs); } @@ -256,7 +256,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) -@@ -531,12 +690,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query +@@ -539,12 +698,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query cs->ops->submit(cs); } @@ -272,7 +272,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) -@@ -550,12 +711,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi +@@ -558,12 +719,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi cs->ops->submit(cs); } @@ -288,7 +288,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) -@@ -569,12 +732,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -577,12 +740,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) cs->ops->submit(cs); } @@ -304,7 +304,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -590,7 +755,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -598,7 +763,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v cs->ops->submit(cs); } @@ -313,7 +313,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_set_depth_stencil_view *op = data; struct wined3d_device *device = cs->device; -@@ -629,6 +794,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -637,6 +802,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -322,7 +322,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -@@ -642,12 +809,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 +@@ -650,12 +817,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 cs->ops->submit(cs); } @@ -338,7 +338,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) -@@ -661,7 +830,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 +@@ -669,7 +838,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 cs->ops->submit(cs); } @@ -347,7 +347,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_set_stream_source *op = data; struct wined3d_stream_state *stream; -@@ -679,6 +848,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void +@@ -687,6 +856,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -356,7 +356,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -696,7 +867,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -704,7 +875,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, cs->ops->submit(cs); } @@ -365,7 +365,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_set_stream_source_freq *op = data; struct wined3d_stream_state *stream; -@@ -706,6 +877,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const +@@ -714,6 +885,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const stream->flags = op->flags; device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -374,7 +374,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) -@@ -721,7 +894,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i +@@ -729,7 +902,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i cs->ops->submit(cs); } @@ -383,7 +383,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_set_stream_output *op = data; struct wined3d_stream_output *stream; -@@ -736,6 +909,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void +@@ -744,6 +917,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void InterlockedIncrement(&op->buffer->resource.bind_count); if (prev) InterlockedDecrement(&prev->resource.bind_count); @@ -392,7 +392,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -752,7 +927,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -760,7 +935,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, cs->ops->submit(cs); } @@ -401,7 +401,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_set_index_buffer *op = data; struct wined3d_buffer *prev; -@@ -768,6 +943,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * +@@ -776,6 +951,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_INDEXBUFFER); @@ -410,7 +410,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -784,7 +961,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -792,7 +969,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff cs->ops->submit(cs); } @@ -419,7 +419,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_set_constant_buffer *op = data; struct wined3d_buffer *prev; -@@ -798,6 +975,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi +@@ -806,6 +983,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); @@ -427,7 +427,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -814,7 +992,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -822,7 +1000,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha cs->ops->submit(cs); } @@ -436,7 +436,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; -@@ -891,6 +1069,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +@@ -899,6 +1077,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (new_use_color_key) device_invalidate_state(cs->device, STATE_COLOR_KEY); @@ -445,7 +445,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) -@@ -905,12 +1085,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -913,12 +1093,14 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined cs->ops->submit(cs); } @@ -460,8 +460,26 @@ index 0beb6c2..b25aab3 100644 + return sizeof(*op); } + void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned int view_idx, +@@ -934,7 +1116,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_unordered_access_view *op = data; + struct wined3d_unordered_access_view *prev; +@@ -948,6 +1130,8 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con + InterlockedDecrement(&prev->resource->bind_count); + + device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING); ++ ++ return sizeof(*op); + } + void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -927,12 +1109,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -964,12 +1148,14 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 cs->ops->submit(cs); } @@ -477,7 +495,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -949,13 +1133,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -986,13 +1172,15 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type cs->ops->submit(cs); } @@ -494,7 +512,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) -@@ -970,12 +1156,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1007,12 +1195,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type cs->ops->submit(cs); } @@ -510,7 +528,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, -@@ -990,12 +1178,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1027,12 +1217,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -526,7 +544,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) -@@ -1010,12 +1200,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render +@@ -1047,12 +1239,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render cs->ops->submit(cs); } @@ -542,7 +560,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, -@@ -1032,12 +1224,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1069,12 +1263,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, cs->ops->submit(cs); } @@ -558,7 +576,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -@@ -1054,13 +1248,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1091,13 +1287,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, cs->ops->submit(cs); } @@ -575,7 +593,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -1076,12 +1272,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1113,12 +1311,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform cs->ops->submit(cs); } @@ -591,7 +609,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) -@@ -1096,7 +1294,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const +@@ -1133,7 +1333,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const cs->ops->submit(cs); } @@ -600,7 +618,7 @@ index 0beb6c2..b25aab3 100644 { const struct wined3d_cs_set_color_key *op = data; struct wined3d_texture *texture = op->texture; -@@ -1157,6 +1355,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat +@@ -1194,6 +1394,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat break; } } @@ -609,7 +627,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -1179,12 +1379,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1216,12 +1418,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture cs->ops->submit(cs); } @@ -625,7 +643,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) -@@ -1198,7 +1400,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1235,7 +1439,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma cs->ops->submit(cs); } @@ -634,7 +652,7 @@ index 0beb6c2..b25aab3 100644 { struct wined3d_adapter *adapter = cs->device->adapter; HRESULT hr; -@@ -1208,6 +1410,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1245,6 +1449,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize CS state, hr %#x.\n", hr); @@ -643,7 +661,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1220,11 +1424,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1257,11 +1463,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) cs->ops->submit(cs); } @@ -658,7 +676,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) -@@ -1239,12 +1445,14 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void +@@ -1276,12 +1484,14 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void cs->ops->submit(cs); } @@ -674,7 +692,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1259,13 +1467,15 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1296,13 +1506,15 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu cs->ops->submit(cs); } @@ -691,7 +709,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1281,13 +1491,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1318,13 +1530,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -708,7 +726,7 @@ index 0beb6c2..b25aab3 100644 } void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1303,8 +1515,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1340,8 +1554,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -719,7 +737,7 @@ index 0beb6c2..b25aab3 100644 /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, /* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw, -@@ -1368,6 +1581,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = +@@ -1406,6 +1621,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = wined3d_cs_st_submit, }; @@ -778,7 +796,7 @@ index 0beb6c2..b25aab3 100644 struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -1394,12 +1659,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1432,12 +1699,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) return NULL; } @@ -867,10 +885,10 @@ index 1dd6a8b..f573dcb 100644 if (appkey) RegCloseKey( appkey ); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index eca8601..481f384 100644 +index 751b66f..5cbb7b5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -310,6 +310,7 @@ struct wined3d_settings +@@ -307,6 +307,7 @@ struct wined3d_settings unsigned int max_sm_ps; unsigned int max_sm_cs; BOOL no_3d; @@ -878,7 +896,7 @@ index eca8601..481f384 100644 }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -3033,6 +3034,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl +@@ -3126,6 +3127,18 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -897,7 +915,7 @@ index eca8601..481f384 100644 struct wined3d_cs_ops { void *(*require_space)(struct wined3d_cs *cs, size_t size); -@@ -3044,9 +3057,14 @@ struct wined3d_cs +@@ -3137,9 +3150,14 @@ struct wined3d_cs const struct wined3d_cs_ops *ops; struct wined3d_device *device; struct wined3d_state state; diff --git a/patches/wined3d-CSMT_Main/0062-wined3d-send-texture-maps-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0062-wined3d-send-texture-maps-through-the-command-stream.patch index 9ced21d9..ec6b7a0d 100644 --- a/patches/wined3d-CSMT_Main/0062-wined3d-send-texture-maps-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0062-wined3d-send-texture-maps-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From 9ddf0916b91ba7b9cc77b79ac3b4030d5b6c9dee Mon Sep 17 00:00:00 2001 +From ba98f5859e765933043d191026c88840864f40b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 3 Apr 2016 19:34:19 +0100 Subject: wined3d: send texture maps through the command stream @@ -11,10 +11,10 @@ Slow version only. Good enough to dodge some Nvidia bugs in the ddraw tests. 3 files changed, 168 insertions(+), 85 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f6b6b49..6dd95af 100644 +index d6a37f9..bf4a07a 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -80,6 +80,8 @@ enum wined3d_cs_op +@@ -82,6 +82,8 @@ enum wined3d_cs_op WINED3D_CS_OP_SET_LIGHT_ENABLE, WINED3D_CS_OP_BLT, WINED3D_CS_OP_CLEAR_RTV, @@ -23,7 +23,7 @@ index f6b6b49..6dd95af 100644 WINED3D_CS_OP_STOP, }; -@@ -396,6 +398,22 @@ struct wined3d_cs_clear_rtv +@@ -411,6 +413,22 @@ struct wined3d_cs_clear_rtv const struct blit_shader *blitter; }; @@ -46,7 +46,7 @@ index f6b6b49..6dd95af 100644 /* FIXME: The list synchronization probably isn't particularly fast. */ static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) { -@@ -2061,6 +2079,59 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge +@@ -2134,6 +2152,59 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge cs->ops->submit(cs); } @@ -106,7 +106,7 @@ index f6b6b49..6dd95af 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -2107,6 +2178,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2182,6 +2253,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, @@ -116,10 +116,10 @@ index f6b6b49..6dd95af 100644 static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index b1ac7bf..1acf5d5 100644 +index 4a27e6f..43cb895 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1749,6 +1749,63 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -2127,6 +2127,63 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_unload_gl_texture(texture); } @@ -183,7 +183,7 @@ index b1ac7bf..1acf5d5 100644 static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -1756,13 +1813,9 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2134,13 +2191,9 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour struct wined3d_texture_sub_resource *sub_resource; struct wined3d_device *device = resource->device; unsigned int fmt_flags = resource->format_flags; @@ -197,7 +197,7 @@ index b1ac7bf..1acf5d5 100644 TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n", resource, sub_resource_idx, map_desc, debug_box(box), flags); -@@ -1807,53 +1860,9 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2185,53 +2238,9 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3DERR_INVALIDCALL; } @@ -252,7 +252,7 @@ index b1ac7bf..1acf5d5 100644 if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) { -@@ -1889,17 +1898,6 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2267,17 +2276,6 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour } } @@ -270,7 +270,7 @@ index b1ac7bf..1acf5d5 100644 ++resource->map_count; ++sub_resource->map_count; -@@ -1909,14 +1907,38 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2287,14 +2285,38 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3D_OK; } @@ -313,7 +313,7 @@ index b1ac7bf..1acf5d5 100644 TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); -@@ -1932,27 +1954,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -2310,27 +2332,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso return WINEDDERR_NOTLOCKED; } @@ -343,10 +343,10 @@ index b1ac7bf..1acf5d5 100644 --sub_resource->map_count; if (!--resource->map_count && texture->update_map_binding) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4862f79..d9c33c6 100644 +index 4415c46..36a85bd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2787,6 +2787,8 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size +@@ -2884,6 +2884,8 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN; BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -355,16 +355,16 @@ index 4862f79..d9c33c6 100644 void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN; -@@ -2794,6 +2796,8 @@ void wined3d_texture_set_swapchain(struct wined3d_texture *texture, +@@ -2891,6 +2893,8 @@ void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void wined3d_texture_unmap_bo_address(const struct wined3d_bo_address *data, const struct wined3d_gl_info *gl_info, GLenum binding) DECLSPEC_HIDDEN; +void wined3d_texture_unmap_internal(struct wined3d_texture *texture, + unsigned int sub_resource_idx) DECLSPEC_HIDDEN; void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, - const struct wined3d_context *context, const struct wined3d_const_bo_address *data, - unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; -@@ -3146,6 +3150,10 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform + const struct wined3d_context *context, const struct wined3d_box *box, + const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; +@@ -3246,6 +3250,10 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i 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; diff --git a/patches/wined3d-CSMT_Main/0064-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch b/patches/wined3d-CSMT_Main/0064-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch index 4354ad11..cc4956e9 100644 --- a/patches/wined3d-CSMT_Main/0064-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch +++ b/patches/wined3d-CSMT_Main/0064-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch @@ -1,15 +1,15 @@ -From a636b8ad1d800fe7f288838c93e09a5c96358e55 Mon Sep 17 00:00:00 2001 +From e98d093b203282ceebd6fb95a948932c3f1a0948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 4 Jul 2013 23:33:14 +0200 Subject: wined3d: Replace the linked lists with a ringbuffer --- - dlls/wined3d/cs.c | 373 ++++++++++++++++++----------------------- + dlls/wined3d/cs.c | 375 ++++++++++++++++++----------------------- dlls/wined3d/wined3d_private.h | 20 +-- - 2 files changed, 166 insertions(+), 227 deletions(-) + 2 files changed, 167 insertions(+), 228 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 880cecc..d8cc7e0 100644 +index bf4a07a..2643713 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -22,20 +22,10 @@ @@ -35,7 +35,7 @@ index 880cecc..d8cc7e0 100644 WINED3D_CS_OP_FENCE, WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, -@@ -421,99 +411,30 @@ struct wined3d_cs_texture_unmap +@@ -429,99 +419,30 @@ struct wined3d_cs_texture_unmap unsigned int sub_resource_idx; }; @@ -149,7 +149,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_fence(struct wined3d_cs *cs, const void *data) -@@ -534,14 +455,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) +@@ -542,14 +463,14 @@ static void wined3d_cs_emit_fence(struct wined3d_cs *cs, BOOL *signalled) op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_FENCE; op->signalled = signalled; @@ -166,7 +166,7 @@ index 880cecc..d8cc7e0 100644 /* A busy wait should be fine, we're not supposed to have to wait very * long. */ -@@ -594,7 +515,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -602,7 +523,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw pending = InterlockedIncrement(&cs->pending_presents); @@ -175,7 +175,7 @@ index 880cecc..d8cc7e0 100644 /* D3D10 documentation suggests that Windows allows the game to run * 3 frames ahead of the GPU. Increasing this above 1 causes uneven -@@ -644,8 +565,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -652,8 +573,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_clear *op; unsigned int i; @@ -186,7 +186,7 @@ index 880cecc..d8cc7e0 100644 op->opcode = WINED3D_CS_OP_CLEAR; op->flags = flags; op->color = *color; -@@ -665,7 +586,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -673,7 +594,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) wined3d_resource_acquire(state->fb.depth_stencil->resource); @@ -195,7 +195,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) -@@ -806,7 +727,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -814,7 +735,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i } } @@ -204,7 +204,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) -@@ -828,7 +749,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query +@@ -836,7 +757,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query op->predicate = predicate; op->value = value; @@ -213,7 +213,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) -@@ -849,7 +770,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi +@@ -857,7 +778,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi op->opcode = WINED3D_CS_OP_SET_VIEWPORT; op->viewport = *viewport; @@ -222,7 +222,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) -@@ -870,7 +791,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -878,7 +799,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; op->rect = *rect; @@ -231,7 +231,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) -@@ -893,7 +814,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -901,7 +822,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v op->view_idx = view_idx; op->view = view; @@ -240,7 +240,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) -@@ -947,7 +868,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 +@@ -955,7 +876,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; op->view = view; @@ -249,7 +249,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) -@@ -968,7 +889,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 +@@ -976,7 +897,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; op->declaration = declaration; @@ -258,7 +258,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) -@@ -1005,7 +926,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -1013,7 +934,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, op->offset = offset; op->stride = stride; @@ -267,7 +267,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) -@@ -1032,7 +953,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i +@@ -1040,7 +961,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i op->frequency = frequency; op->flags = flags; @@ -276,7 +276,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) -@@ -1065,7 +986,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -1073,7 +994,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, op->buffer = buffer; op->offset = offset; @@ -285,7 +285,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) -@@ -1099,7 +1020,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -1107,7 +1028,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff op->format_id = format_id; op->offset = offset; @@ -294,7 +294,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) -@@ -1130,7 +1051,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -1138,7 +1059,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha op->cb_idx = cb_idx; op->buffer = buffer; @@ -303,7 +303,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) -@@ -1222,7 +1143,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -1230,7 +1151,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined op->opcode = WINED3D_CS_OP_SET_TEXTURE; op->stage = stage; op->texture = texture; @@ -312,7 +312,16 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) -@@ -1246,7 +1167,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1253,7 +1174,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i + op->view_idx = view_idx; + op->view = view; + +- cs->ops->submit(cs); ++ cs->ops->submit(cs, sizeof(*op)); + } + + static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data) +@@ -1285,7 +1206,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 op->view_idx = view_idx; op->view = view; @@ -321,7 +330,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) -@@ -1270,7 +1191,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1309,7 +1230,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type op->sampler_idx = sampler_idx; op->sampler = sampler; @@ -330,7 +339,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) -@@ -1293,7 +1214,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1332,7 +1253,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type op->type = type; op->shader = shader; @@ -339,7 +348,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_rasterizer_state(struct wined3d_cs *cs, const void *data) -@@ -1315,7 +1236,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1354,7 +1275,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE; op->state = rasterizer_state; @@ -348,7 +357,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_vs_consts_f(struct wined3d_cs *cs, const void *data) -@@ -1348,8 +1269,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1387,8 +1308,9 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx, const struct wined3d_vec4 *constants, enum wined3d_shader_type type) { struct wined3d_cs_set_consts_f *op; @@ -359,7 +368,7 @@ index 880cecc..d8cc7e0 100644 switch (type) { case WINED3D_SHADER_TYPE_PIXEL: -@@ -1374,7 +1296,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1413,7 +1335,7 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx, op->count = count; memcpy(op->constants, constants, sizeof(op->constants[0]) * count); @@ -368,7 +377,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) -@@ -1396,8 +1318,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render +@@ -1435,8 +1357,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render op->state = state; op->value = value; @@ -379,7 +388,7 @@ index 880cecc..d8cc7e0 100644 static UINT wined3d_cs_exec_set_vs_consts_b(struct wined3d_cs *cs, const void *data) { -@@ -1427,8 +1349,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1466,8 +1388,9 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, unsigned int count, const BOOL *constants, enum wined3d_shader_type type) { struct wined3d_cs_set_consts_b *op; @@ -390,7 +399,7 @@ index 880cecc..d8cc7e0 100644 switch (type) { case WINED3D_SHADER_TYPE_PIXEL: -@@ -1453,7 +1376,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1492,7 +1415,7 @@ void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, unsigned int start_idx, op->count = count; memcpy(op->constants, constants, sizeof(op->constants[0]) * count); @@ -399,7 +408,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *data) -@@ -1484,8 +1407,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1523,8 +1446,9 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, const struct wined3d_ivec4 *constants, enum wined3d_shader_type type) { struct wined3d_cs_set_consts_i *op; @@ -410,7 +419,7 @@ index 880cecc..d8cc7e0 100644 switch (type) { case WINED3D_SHADER_TYPE_PIXEL: -@@ -1510,7 +1434,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, +@@ -1549,7 +1473,7 @@ void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx, op->count = count; memcpy(op->constants, constants, sizeof(op->constants[0]) * count); @@ -419,7 +428,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) -@@ -1534,7 +1458,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1573,7 +1497,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, op->state = state; op->value = value; @@ -428,7 +437,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) -@@ -1558,7 +1482,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1597,7 +1521,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, op->state = state; op->value = value; @@ -437,7 +446,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) -@@ -1582,7 +1506,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1621,7 +1545,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform op->state = state; op->matrix = *matrix; @@ -446,7 +455,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) -@@ -1604,7 +1528,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const +@@ -1643,7 +1567,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const op->plane_idx = plane_idx; op->plane = *plane; @@ -455,7 +464,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) -@@ -1689,7 +1613,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1728,7 +1652,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -464,7 +473,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) -@@ -1710,7 +1634,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1749,7 +1673,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; @@ -473,7 +482,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) -@@ -1734,7 +1658,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1773,7 +1697,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_RESET_STATE; @@ -482,7 +491,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_destroy_object(struct wined3d_cs *cs, const void *data) -@@ -1755,7 +1679,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void +@@ -1794,7 +1718,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void op->callback = callback; op->object = object; @@ -491,7 +500,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) -@@ -1777,7 +1701,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1816,7 +1740,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu op->query = query; op->flags = flags; @@ -500,7 +509,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_preload_resource(struct wined3d_cs *cs, const void *data) -@@ -1801,7 +1725,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1840,7 +1764,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso wined3d_resource_acquire(resource); @@ -509,7 +518,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_unload_resource(struct wined3d_cs *cs, const void *data) -@@ -1825,7 +1749,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1864,7 +1788,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou wined3d_resource_acquire(resource); @@ -518,7 +527,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) -@@ -1851,7 +1775,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) +@@ -1890,7 +1814,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_GLFINISH; @@ -527,7 +536,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data) -@@ -1873,7 +1797,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, +@@ -1912,7 +1836,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX; op->base_vertex_index = base_vertex_index; @@ -536,7 +545,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) -@@ -1899,7 +1823,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ +@@ -1938,7 +1862,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; op->gl_primitive_type = primitive_type; @@ -545,7 +554,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -@@ -1956,7 +1880,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1995,7 +1919,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light op->opcode = WINED3D_CS_OP_SET_LIGHT; op->light = *light; @@ -554,7 +563,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -@@ -2045,7 +1969,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -2084,7 +2008,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab op->idx = idx; op->enable = enable; @@ -563,7 +572,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) -@@ -2077,7 +2001,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -2116,7 +2040,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf if (fx) op->fx = *fx; @@ -572,7 +581,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) -@@ -2110,7 +2034,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge +@@ -2149,7 +2073,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge op->stencil = stencil; op->blitter = blitter; @@ -581,7 +590,7 @@ index 880cecc..d8cc7e0 100644 } static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data) -@@ -2135,12 +2059,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture +@@ -2174,12 +2098,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture op->flags = flags; op->mem = &ret; @@ -597,7 +606,7 @@ index 880cecc..d8cc7e0 100644 return ret; } -@@ -2163,11 +2089,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -2202,11 +2128,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture op->texture = texture; op->sub_resource_idx = sub_resource_idx; @@ -612,7 +621,7 @@ index 880cecc..d8cc7e0 100644 /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, -@@ -2217,42 +2145,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2257,42 +2185,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, }; @@ -695,7 +704,7 @@ index 880cecc..d8cc7e0 100644 }; /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -@@ -2264,9 +2209,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) +@@ -2304,9 +2249,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) op = wined3d_cs_mt_require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_STOP; @@ -735,7 +744,7 @@ index 880cecc..d8cc7e0 100644 void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) { -@@ -2290,31 +2264,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, +@@ -2330,31 +2304,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, static DWORD WINAPI wined3d_cs_run(void *thread_param) { struct wined3d_cs *cs = thread_param; @@ -782,7 +791,7 @@ index 880cecc..d8cc7e0 100644 } done: -@@ -2339,25 +2314,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2379,25 +2354,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) cs->ops = &wined3d_cs_st_ops; cs->device = device; @@ -808,7 +817,7 @@ index 880cecc..d8cc7e0 100644 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) { ERR("Failed to create wined3d command stream thread.\n"); -@@ -2369,12 +2329,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2409,12 +2369,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) err: if (cs) @@ -821,7 +830,7 @@ index 880cecc..d8cc7e0 100644 HeapFree(GetProcessHeap(), 0, cs); return NULL; } -@@ -2393,17 +2348,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -2433,17 +2388,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) CloseHandle(cs->thread); if (ret != WAIT_OBJECT_0) ERR("Wait failed (%#x).\n", ret); @@ -840,7 +849,7 @@ index 880cecc..d8cc7e0 100644 HeapFree(GetProcessHeap(), 0, cs); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f3912a1..24c54b2 100644 +index 36a85bd..12835d0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -31,6 +31,7 @@ @@ -851,7 +860,7 @@ index f3912a1..24c54b2 100644 #include #include #include -@@ -3042,19 +3043,17 @@ struct wined3d_cs_list +@@ -3135,19 +3136,17 @@ struct wined3d_cs_list struct list blocks; }; @@ -876,7 +885,7 @@ index f3912a1..24c54b2 100644 void (*finish)(struct wined3d_cs *cs); }; -@@ -3065,14 +3064,9 @@ struct wined3d_cs +@@ -3158,14 +3157,9 @@ struct wined3d_cs struct wined3d_state state; HANDLE thread; DWORD thread_id; diff --git a/patches/wined3d-CSMT_Main/0067-wined3d-Add-query-support-to-the-command-stream.patch b/patches/wined3d-CSMT_Main/0067-wined3d-Add-query-support-to-the-command-stream.patch index c8fd9558..4d3fa80e 100644 --- a/patches/wined3d-CSMT_Main/0067-wined3d-Add-query-support-to-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0067-wined3d-Add-query-support-to-the-command-stream.patch @@ -1,4 +1,4 @@ -From 2fb1651ce03c957a505acbbf282c04c59e47265b Mon Sep 17 00:00:00 2001 +From b5aa14996c4b4968eb011080fc0f9b6211c486aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 18:26:11 +0200 Subject: wined3d: Add query support to the command stream @@ -10,10 +10,10 @@ Subject: wined3d: Add query support to the command stream 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index c04f293..20be430 100644 +index 2643713..ee57a56 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -72,6 +72,7 @@ enum wined3d_cs_op +@@ -74,6 +74,7 @@ enum wined3d_cs_op WINED3D_CS_OP_CLEAR_RTV, WINED3D_CS_OP_TEXTURE_MAP, WINED3D_CS_OP_TEXTURE_UNMAP, @@ -21,7 +21,7 @@ index c04f293..20be430 100644 WINED3D_CS_OP_STOP, }; -@@ -410,6 +411,13 @@ struct wined3d_cs_skip +@@ -425,6 +426,13 @@ struct wined3d_cs_skip DWORD size; }; @@ -35,7 +35,7 @@ index c04f293..20be430 100644 static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2050,6 +2058,33 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -2131,6 +2139,33 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture cs->ops->submit(cs, sizeof(*op)); } @@ -69,7 +69,7 @@ index c04f293..20be430 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2100,6 +2135,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2183,6 +2218,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, /* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map, /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, @@ -78,7 +78,7 @@ index c04f293..20be430 100644 static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 8b15765..c64e5fb 100644 +index 902e01a..d8cfb64 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -338,8 +338,13 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, @@ -97,7 +97,7 @@ index 8b15765..c64e5fb 100644 if (data) memcpy(data, query->data, min(data_size, query->data_size)); -@@ -479,7 +484,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD +@@ -491,7 +496,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD * restart. */ if (flags & WINED3DISSUE_BEGIN) { @@ -106,7 +106,7 @@ index 8b15765..c64e5fb 100644 { if (oq->context->tid != GetCurrentThreadId()) { -@@ -509,13 +514,14 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD +@@ -521,13 +526,14 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glBeginQuery()"); context_release(context); @@ -122,7 +122,7 @@ index 8b15765..c64e5fb 100644 { if (oq->context->tid != GetCurrentThreadId()) { -@@ -531,6 +537,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD +@@ -543,6 +549,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD context_release(context); } } @@ -131,18 +131,18 @@ index 8b15765..c64e5fb 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d894b3b..8b0f2a6 100644 +index 12835d0..2f6a586 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1437,6 +1437,7 @@ struct wined3d_occlusion_query +@@ -1491,6 +1491,7 @@ struct wined3d_occlusion_query GLuint id; struct wined3d_context *context; - DWORD samples; + UINT64 samples; + BOOL started; }; struct wined3d_timestamp_query -@@ -3089,6 +3090,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; +@@ -3187,6 +3188,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0075-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch b/patches/wined3d-CSMT_Main/0075-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch index 1749a01b..373f803d 100644 --- a/patches/wined3d-CSMT_Main/0075-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch +++ b/patches/wined3d-CSMT_Main/0075-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch @@ -1,32 +1,34 @@ -From 02a0a49d5329dd8c17b22e3014d28d37e4231e88 Mon Sep 17 00:00:00 2001 +From d02f39e6b45855a3f1ea963961f767330f4b0e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 7 Apr 2016 20:04:17 +0100 Subject: wined3d: Avoid destroying views in color and depth fills. --- - dlls/wined3d/surface.c | 50 ++++++++++++++++++++++---------------------------- - 1 file changed, 22 insertions(+), 28 deletions(-) + dlls/wined3d/surface.c | 54 ++++++++++++++++++++------------------------------ + 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 978c826..7e060ae 100644 +index c5e14d6..6c47743 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -717,8 +717,7 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const +@@ -713,8 +713,7 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const { struct wined3d_resource *resource = &surface->container->resource; struct wined3d_device *device = resource->device; -- struct wined3d_rendertarget_view_desc view_desc; - struct wined3d_rendertarget_view *view; +- struct wined3d_view_desc view_desc; + struct wined3d_rendertarget_view view; const struct blit_shader *blitter; HRESULT hr; -@@ -729,19 +728,17 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const +@@ -725,21 +724,17 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const return WINED3DERR_INVALIDCALL; } - view_desc.format_id = resource->format->id; +- view_desc.flags = 0; - view_desc.u.texture.level_idx = surface->texture_level; +- view_desc.u.texture.level_count = 1; - view_desc.u.texture.layer_idx = surface->texture_layer; - view_desc.u.texture.layer_count = 1; - if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, @@ -51,22 +53,24 @@ index 978c826..7e060ae 100644 return hr; } -@@ -2398,8 +2395,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2547,8 +2542,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st { struct wined3d_resource *resource = &s->container->resource; struct wined3d_device *device = resource->device; -- struct wined3d_rendertarget_view_desc view_desc; - struct wined3d_rendertarget_view *view; +- struct wined3d_view_desc view_desc; + struct wined3d_rendertarget_view view; const struct blit_shader *blitter; HRESULT hr; -@@ -2410,19 +2406,17 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2559,21 +2553,17 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st return WINED3DERR_INVALIDCALL; } - view_desc.format_id = resource->format->id; +- view_desc.flags = 0; - view_desc.u.texture.level_idx = s->texture_level; +- view_desc.u.texture.level_count = 1; - view_desc.u.texture.layer_idx = s->texture_layer; - view_desc.u.texture.layer_count = 1; - if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, @@ -92,5 +96,5 @@ index 978c826..7e060ae 100644 return hr; } -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0077-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0077-wined3d-Send-update_texture-calls-through-the-CS.patch index 1692df33..1ce6dfc4 100644 --- a/patches/wined3d-CSMT_Main/0077-wined3d-Send-update_texture-calls-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0077-wined3d-Send-update_texture-calls-through-the-CS.patch @@ -1,4 +1,4 @@ -From a7ae79e550f236f00a348b8cfdad719f69a0323c Mon Sep 17 00:00:00 2001 +From 4e4f075820bce1fb670507e957fe61ea1e0889dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 00:33:48 +0200 Subject: wined3d: Send update_texture calls through the CS @@ -11,10 +11,10 @@ FIXME: This logic duplication is ugly. 3 files changed, 137 insertions(+), 82 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 87763b5..40d7c91 100644 +index d5c8295..ef02d3e 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -73,6 +73,7 @@ enum wined3d_cs_op +@@ -74,6 +74,7 @@ enum wined3d_cs_op WINED3D_CS_OP_CLEAR_RTV, WINED3D_CS_OP_TEXTURE_MAP, WINED3D_CS_OP_TEXTURE_UNMAP, @@ -22,7 +22,7 @@ index 87763b5..40d7c91 100644 WINED3D_CS_OP_STOP, }; -@@ -417,6 +418,12 @@ struct wined3d_cs_skip +@@ -425,6 +426,12 @@ struct wined3d_cs_skip DWORD size; }; @@ -35,7 +35,7 @@ index 87763b5..40d7c91 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2129,6 +2136,31 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -2168,6 +2175,31 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture cs->ops->submit(cs, sizeof(*op)); } @@ -67,7 +67,7 @@ index 87763b5..40d7c91 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2180,6 +2212,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2220,6 +2252,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, /* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map, /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, @@ -76,10 +76,10 @@ index 87763b5..40d7c91 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ad2da77..aa6d796 100644 +index 99bb0c2..6a0b9cd2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3567,34 +3567,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3604,34 +3604,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -118,7 +118,7 @@ index ad2da77..aa6d796 100644 /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3602,32 +3585,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3639,32 +3622,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { @@ -130,7 +130,7 @@ index ad2da77..aa6d796 100644 data.buffer_object = 0; data.addr = src.data; - wined3d_texture_upload_data(dst_texture, i, context, &data, src.row_pitch, src.slice_pitch); + wined3d_texture_upload_data(dst_texture, i, context, NULL, &data, src.row_pitch, src.slice_pitch); wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); - if (FAILED(hr = wined3d_resource_unmap(&src_texture->resource, src_level + i))) @@ -218,7 +218,7 @@ index ad2da77..aa6d796 100644 TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3664,70 +3704,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3701,70 +3741,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -319,10 +319,10 @@ index ad2da77..aa6d796 100644 HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index bd3bebf..7ba4fd3 100644 +index a90cd93..6733d91 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2539,6 +2539,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource +@@ -2631,6 +2631,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource 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; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; @@ -331,7 +331,7 @@ index bd3bebf..7ba4fd3 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -3161,6 +3163,8 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture +@@ -3256,6 +3258,8 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0079-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch b/patches/wined3d-CSMT_Main/0079-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch index 811b51ee..7dc87ad5 100644 --- a/patches/wined3d-CSMT_Main/0079-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch +++ b/patches/wined3d-CSMT_Main/0079-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch @@ -1,4 +1,4 @@ -From 1feae0a25e88a0f7f7c51f1cd2f9484e0927f558 Mon Sep 17 00:00:00 2001 +From a7fc603682b132869b5775fc6892899a455dc2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 29 Aug 2013 22:25:14 +0200 Subject: wined3d: Don't lock the src volume in device_update_volume @@ -17,10 +17,10 @@ since its a sysmem texture. 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index de927cc..896e7a1 100644 +index 6a0b9cd2..480da33 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3563,8 +3563,8 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, +@@ -3609,8 +3609,8 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_level, struct wined3d_texture *dst_texture, unsigned int level_count) { @@ -31,7 +31,7 @@ index de927cc..896e7a1 100644 unsigned int i; TRACE("context %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n", -@@ -3576,17 +3576,13 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, +@@ -3622,17 +3622,13 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, for (i = 0; i < level_count; ++i) { @@ -44,8 +44,8 @@ index de927cc..896e7a1 100644 - data.buffer_object = 0; - data.addr = src.data; -- wined3d_texture_upload_data(dst_texture, i, context, &data, src.row_pitch, src.slice_pitch); -+ wined3d_texture_upload_data(dst_texture, i, context, wined3d_const_bo_address(&data), +- wined3d_texture_upload_data(dst_texture, i, context, NULL, &data, src.row_pitch, src.slice_pitch); ++ wined3d_texture_upload_data(dst_texture, i, context, NULL, wined3d_const_bo_address(&data), + row_pitch, slice_pitch); wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); - diff --git a/patches/wined3d-CSMT_Main/0086-wined3d-Send-update_sub_resource-calls-through-the-c.patch b/patches/wined3d-CSMT_Main/0086-wined3d-Send-update_sub_resource-calls-through-the-c.patch index 83ed41d0..fe3115c6 100644 --- a/patches/wined3d-CSMT_Main/0086-wined3d-Send-update_sub_resource-calls-through-the-c.patch +++ b/patches/wined3d-CSMT_Main/0086-wined3d-Send-update_sub_resource-calls-through-the-c.patch @@ -1,19 +1,19 @@ -From 3831f30d2549855400978627d4912ea6b28e4333 Mon Sep 17 00:00:00 2001 +From 52b35f31cc613857f6131ea7662150ebba7f3a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 4 Sep 2015 15:22:49 +0200 Subject: wined3d: Send update_sub_resource calls through the command stream. --- dlls/wined3d/cs.c | 95 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 53 ++++------------------- + dlls/wined3d/device.c | 22 +--------- dlls/wined3d/wined3d_private.h | 3 ++ - 3 files changed, 105 insertions(+), 46 deletions(-) + 3 files changed, 99 insertions(+), 21 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 5375f04..6857e8c 100644 +index 9a1c076..011020f 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -74,6 +74,7 @@ enum wined3d_cs_op +@@ -75,6 +75,7 @@ enum wined3d_cs_op WINED3D_CS_OP_TEXTURE_MAP, WINED3D_CS_OP_TEXTURE_UNMAP, WINED3D_CS_OP_UPDATE_TEXTURE, @@ -21,7 +21,7 @@ index 5375f04..6857e8c 100644 WINED3D_CS_OP_STOP, }; -@@ -424,6 +425,15 @@ struct wined3d_cs_update_texture +@@ -432,6 +433,15 @@ struct wined3d_cs_update_texture struct wined3d_texture *src, *dst; }; @@ -37,7 +37,7 @@ index 5375f04..6857e8c 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2199,6 +2209,90 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur +@@ -2238,6 +2248,90 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur cs->ops->submit(cs, sizeof(*op)); } @@ -128,7 +128,7 @@ index 5375f04..6857e8c 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2251,6 +2345,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2291,6 +2385,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map, /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, @@ -137,80 +137,36 @@ index 5375f04..6857e8c 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 2597aa2..a8403b6 100644 +index 480da33..172b7ee 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4117,14 +4117,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4154,8 +4154,6 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str unsigned int depth_pitch) { - struct wined3d_texture_sub_resource *sub_resource; -- const struct wined3d_gl_info *gl_info; + unsigned int width, height, depth, level; - struct wined3d_const_bo_address addr; -- unsigned int width, height, level; - struct wined3d_context *context; struct wined3d_texture *texture; -- struct wined3d_surface *surface; -- POINT dst_point; -- RECT src_rect; TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", - device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); -@@ -4158,16 +4151,15 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); +@@ -4205,25 +4203,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str return; } -- surface = sub_resource->u.surface; - -- level = sub_resource_idx % texture->level_count; -- width = wined3d_texture_get_level_width(texture, level); -- height = wined3d_texture_get_level_height(texture, level); -- -- src_rect.left = 0; -- src_rect.top = 0; - if (box) - { -+ unsigned int width, height, level; -+ -+ level = sub_resource_idx % texture->level_count; -+ width = wined3d_texture_get_level_width(texture, level); -+ height = wined3d_texture_get_level_height(texture, level); -+ - if (box->left >= box->right || box->right > width - || box->top >= box->bottom || box->bottom > height - || box->front >= box->back) -@@ -4175,40 +4167,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - WARN("Invalid box %s specified.\n", debug_box(box)); - return; - } -- -- src_rect.right = box->right - box->left; -- src_rect.bottom = box->bottom - box->top; -- dst_point.x = box->left; -- dst_point.y = box->top; -- } -- else -- { -- src_rect.right = width; -- src_rect.bottom = height; -- dst_point.x = 0; -- dst_point.y = 0; - } - addr.buffer_object = 0; - addr.addr = data; - - context = context_acquire(resource->device, NULL); -- gl_info = context->gl_info; - -- /* Only load the surface for partial updates. */ -- if (!dst_point.x && !dst_point.y && src_rect.right == width && src_rect.bottom == height) +- /* Only load the sub-resource for partial updates. */ +- if (!box || (!box->left && !box->top && !box->front +- && box->right == width && box->bottom == height && box->back == depth)) - wined3d_texture_prepare_texture(texture, context, FALSE); - else - wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB); - wined3d_texture_bind_and_dirtify(texture, context, FALSE); - -- wined3d_surface_upload_data(surface, gl_info, resource->format, -- &src_rect, row_pitch, &dst_point, FALSE, &addr); +- wined3d_texture_upload_data(texture, sub_resource_idx, context, box, &addr, row_pitch, depth_pitch); - - context_release(context); - @@ -221,10 +177,10 @@ index 2597aa2..a8403b6 100644 HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index c3f104e..9db3cf1 100644 +index 643f366..e832af2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3164,6 +3164,9 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture +@@ -3259,6 +3259,9 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0088-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0088-wined3d-Wrap-GL-BOs-in-a-structure.patch index acd2fa61..501b7092 100644 --- a/patches/wined3d-CSMT_Main/0088-wined3d-Wrap-GL-BOs-in-a-structure.patch +++ b/patches/wined3d-CSMT_Main/0088-wined3d-Wrap-GL-BOs-in-a-structure.patch @@ -1,4 +1,4 @@ -From 67f6c320ba0d32d73a7cde737a1ecea30f627cca Mon Sep 17 00:00:00 2001 +From 420f9451c9d2267ad8133abdf9821e185a0b6515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:00:35 +0200 Subject: wined3d: Wrap GL BOs in a structure @@ -13,10 +13,10 @@ them for DISCARD maps. 4 files changed, 93 insertions(+), 34 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 56d45e5..824fa89 100644 +index 172b7ee..afc94b9 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -5241,3 +5241,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5242,3 +5242,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -74,7 +74,7 @@ index 56d45e5..824fa89 100644 + wined3d_device_destroy_bo(device, context, bo); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index a0b6d62..e187742 100644 +index 7c37160..344299b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3075,7 +3075,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, @@ -87,7 +87,7 @@ index a0b6d62..e187742 100644 TRACE("Removing the pbo attached to surface %p.\n", surface); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 6ca00ce..06ae160 100644 +index 4fc6c38..6160b6b 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -342,7 +342,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su @@ -99,7 +99,7 @@ index 6ca00ce..06ae160 100644 return; } if (locations & WINED3D_LOCATION_USER_MEMORY) -@@ -439,18 +439,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc +@@ -441,18 +441,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc /* Context activation is done by the caller. */ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture, @@ -124,7 +124,7 @@ index 6ca00ce..06ae160 100644 } static void wined3d_texture_update_map_binding(struct wined3d_texture *texture) -@@ -470,7 +469,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture) +@@ -472,7 +471,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture) && !wined3d_texture_load_location(texture, i, context, map_binding)) ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding)); if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER) @@ -133,7 +133,7 @@ index 6ca00ce..06ae160 100644 } if (context) -@@ -627,28 +626,25 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) +@@ -629,28 +628,25 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) unsigned int sub_count = texture->level_count * texture->layer_count; struct wined3d_device *device = texture->resource.device; struct wined3d_context *context = NULL; @@ -167,7 +167,7 @@ index 6ca00ce..06ae160 100644 } if (context) context_release(context); -@@ -1321,22 +1317,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT +@@ -1330,22 +1326,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT /* Context activation is done by the caller. */ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture, @@ -195,7 +195,7 @@ index 6ca00ce..06ae160 100644 } static void wined3d_texture_force_reload(struct wined3d_texture *texture) -@@ -1462,7 +1455,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned +@@ -1471,7 +1464,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned return TRUE; case WINED3D_LOCATION_BUFFER: @@ -204,7 +204,7 @@ index 6ca00ce..06ae160 100644 return TRUE; case WINED3D_LOCATION_TEXTURE_RGB: -@@ -1742,7 +1735,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1762,7 +1755,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -212,8 +212,8 @@ index 6ca00ce..06ae160 100644 + struct wined3d_const_bo_address data = {sub_resource->buffer->name, NULL}; wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch); - texture1d_upload_data(texture, sub_resource_idx, context, &data, row_pitch, slice_pitch); -@@ -1787,7 +1780,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in + texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch); +@@ -1807,7 +1800,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in case WINED3D_LOCATION_BUFFER: if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -222,7 +222,7 @@ index 6ca00ce..06ae160 100644 if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); -@@ -2068,8 +2061,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -2101,8 +2094,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED); } @@ -233,7 +233,7 @@ index 6ca00ce..06ae160 100644 if (resource->type == WINED3D_RTYPE_TEXTURE_2D) { -@@ -2845,7 +2838,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2897,7 +2890,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -242,7 +242,7 @@ index 6ca00ce..06ae160 100644 wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch); -@@ -2891,7 +2884,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2943,7 +2936,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in case WINED3D_LOCATION_BUFFER: if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -252,10 +252,10 @@ index 6ca00ce..06ae160 100644 if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index e6d6647..3796ebb 100644 +index d19b380..4f8abb8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2433,6 +2433,14 @@ struct wined3d_state +@@ -2520,6 +2520,14 @@ struct wined3d_state struct wined3d_rasterizer_state *rasterizer_state; }; @@ -270,7 +270,7 @@ index e6d6647..3796ebb 100644 #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2543,6 +2551,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D +@@ -2633,6 +2641,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D 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, struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; @@ -282,7 +282,7 @@ index e6d6647..3796ebb 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2731,7 +2744,7 @@ struct wined3d_texture +@@ -2822,7 +2835,7 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -292,5 +292,5 @@ index e6d6647..3796ebb 100644 } sub_resources[1]; }; -- -2.8.1 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0089-wined3d-Separate-resource-map-and-draw-buffers.patch b/patches/wined3d-CSMT_Main/0089-wined3d-Separate-resource-map-and-draw-buffers.patch index 79e0e5ce..b668031b 100644 --- a/patches/wined3d-CSMT_Main/0089-wined3d-Separate-resource-map-and-draw-buffers.patch +++ b/patches/wined3d-CSMT_Main/0089-wined3d-Separate-resource-map-and-draw-buffers.patch @@ -1,4 +1,4 @@ -From 9feb9ed51972175002f84d899915fe57a82d509d Mon Sep 17 00:00:00 2001 +From 2d336621af183127636cfcc5ed502490046b2068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:06:29 +0200 Subject: wined3d: Separate resource map and draw buffers @@ -11,10 +11,10 @@ Subject: wined3d: Separate resource map and draw buffers 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 928fcda..92f9034 100644 +index afc94b9..25a6ee5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3577,7 +3577,7 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, +@@ -3623,7 +3623,7 @@ static void wined3d_device_update_texture_3d(struct wined3d_context *context, for (i = 0; i < level_count; ++i) { wined3d_texture_get_memory(src_texture, src_level + i, &data, @@ -22,12 +22,12 @@ index 928fcda..92f9034 100644 + src_texture->resource.map_binding, FALSE); wined3d_texture_get_pitch(src_texture, src_level + i, &row_pitch, &slice_pitch); - wined3d_texture_upload_data(dst_texture, i, context, wined3d_const_bo_address(&data), + wined3d_texture_upload_data(dst_texture, i, context, NULL, wined3d_const_bo_address(&data), diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 46f79db..4b2cdad 100644 +index 344299b..87d4f93 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -324,7 +324,7 @@ void wined3d_surface_destroy_dc(struct wined3d_surface *surface) +@@ -322,7 +322,7 @@ void wined3d_surface_destroy_dc(struct wined3d_surface *surface) gl_info = context->gl_info; } @@ -36,7 +36,7 @@ index 46f79db..4b2cdad 100644 wined3d_texture_unmap_bo_address(&data, gl_info, GL_PIXEL_UNPACK_BUFFER); if (context) -@@ -360,7 +360,7 @@ HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) +@@ -358,7 +358,7 @@ HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) gl_info = context->gl_info; } @@ -45,7 +45,7 @@ index 46f79db..4b2cdad 100644 desc.pMemory = wined3d_texture_map_bo_address(&data, texture->sub_resources[sub_resource_idx].size, gl_info, GL_PIXEL_UNPACK_BUFFER, 0); -@@ -808,7 +808,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -804,7 +804,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct } } @@ -54,7 +54,7 @@ index 46f79db..4b2cdad 100644 if (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED) { -@@ -1210,7 +1210,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1208,7 +1208,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &data, @@ -63,7 +63,7 @@ index 46f79db..4b2cdad 100644 wined3d_texture_get_pitch(src_texture, src_surface->texture_level, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1758,7 +1758,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1756,7 +1756,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr wined3d_texture_load_location(src_texture, sub_resource_idx, context, src_texture->resource.map_binding); wined3d_texture_get_memory(src_texture, sub_resource_idx, &src_bo_addr, @@ -72,7 +72,7 @@ index 46f79db..4b2cdad 100644 src_data = wined3d_texture_map_bo_address(&src_bo_addr, src_texture->sub_resources[sub_resource_idx].size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, WINED3D_MAP_READONLY); -@@ -1771,7 +1771,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1769,7 +1769,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr wined3d_texture_prepare_location(dst_texture, 0, context, dst_texture->resource.map_binding); wined3d_texture_get_memory(dst_texture, 0, &dst_bo_addr, @@ -81,7 +81,7 @@ index 46f79db..4b2cdad 100644 dst_data = wined3d_texture_map_bo_address(&dst_bo_addr, dst_texture->sub_resources[0].size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); -@@ -1900,7 +1900,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, +@@ -1898,7 +1898,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -90,7 +90,7 @@ index 46f79db..4b2cdad 100644 restore_rt = context_get_rt_surface(old_ctx); if (restore_rt != surface) -@@ -3088,7 +3088,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3083,7 +3083,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_texture_set_map_binding(texture, WINED3D_LOCATION_SYSMEM); } @@ -99,7 +99,7 @@ index 46f79db..4b2cdad 100644 if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3579,7 +3579,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3576,7 +3576,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int same_sub_resource = TRUE; wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_bo_addr, @@ -108,7 +108,7 @@ index 46f79db..4b2cdad 100644 dst_map.data = wined3d_texture_map_bo_address(&dst_bo_addr, dst_texture->sub_resources[dst_sub_resource_idx].size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); -@@ -3615,7 +3615,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3612,7 +3612,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int wined3d_texture_get_pitch(src_texture, src_sub_resource_idx % src_texture->level_count, &src_map.row_pitch, &src_map.slice_pitch); wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &src_bo_addr, @@ -117,7 +117,7 @@ index 46f79db..4b2cdad 100644 src_map.data = wined3d_texture_map_bo_address(&src_bo_addr, src_texture->sub_resources[src_sub_resource_idx].size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); -@@ -3630,7 +3630,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3627,7 +3627,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int } wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_bo_addr, @@ -127,10 +127,10 @@ index 46f79db..4b2cdad 100644 dst_texture->sub_resources[dst_sub_resource_idx].size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index afb1738..729863c 100644 +index 6160b6b..827dfd4 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -163,9 +163,9 @@ static BOOL wined3d_texture_copy_sysmem_location(struct wined3d_texture *texture +@@ -168,9 +168,9 @@ static BOOL wined3d_texture_copy_sysmem_location(struct wined3d_texture *texture wined3d_texture_prepare_location(texture, sub_resource_idx, context, location); @@ -142,7 +142,7 @@ index afb1738..729863c 100644 if (dst.buffer_object) { -@@ -326,7 +326,7 @@ void wined3d_texture_unmap_bo_address(const struct wined3d_bo_address *data, +@@ -331,7 +331,7 @@ void wined3d_texture_unmap_bo_address(const struct wined3d_bo_address *data, } void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, @@ -151,7 +151,7 @@ index afb1738..729863c 100644 { struct wined3d_texture_sub_resource *sub_resource; -@@ -337,7 +337,10 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su +@@ -342,7 +342,10 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su if (locations & WINED3D_LOCATION_BUFFER) { data->addr = NULL; @@ -163,7 +163,7 @@ index afb1738..729863c 100644 return; } if (locations & WINED3D_LOCATION_USER_MEMORY) -@@ -439,8 +442,13 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture +@@ -446,8 +449,13 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture struct wined3d_gl_bo *buffer = texture->sub_resources[sub_resource_idx].buffer; GLuint name = buffer->name; @@ -177,7 +177,7 @@ index afb1738..729863c 100644 wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_BUFFER); TRACE("Deleted buffer object %u for texture %p, sub-resource %u.\n", -@@ -628,6 +636,10 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) +@@ -635,6 +643,10 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) for (i = 0; i < sub_count; ++i) { @@ -188,7 +188,7 @@ index afb1738..729863c 100644 if (!(buffer = texture->sub_resources[i].buffer)) continue; -@@ -640,6 +652,7 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) +@@ -647,6 +659,7 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture) wined3d_device_release_bo(device, buffer, context); texture->sub_resources[i].buffer = NULL; @@ -196,7 +196,7 @@ index afb1738..729863c 100644 } if (context) context_release(context); -@@ -1322,6 +1335,7 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur +@@ -1336,6 +1349,7 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur sub_resource->buffer = wined3d_device_get_bo(texture->resource.device, sub_resource->size, GL_STREAM_DRAW, GL_PIXEL_UNPACK_BUFFER, context); @@ -204,7 +204,7 @@ index afb1738..729863c 100644 TRACE("Created buffer object %u for texture %p, sub-resource %u.\n", sub_resource->buffer->name, texture, sub_resource_idx); -@@ -1779,7 +1793,7 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int +@@ -2158,7 +2172,7 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) sub_resource->unmap_dirtify = TRUE; @@ -213,7 +213,7 @@ index afb1738..729863c 100644 data = wined3d_texture_map_bo_address(&bo_data, sub_resource->size, context->gl_info, GL_PIXEL_UNPACK_BUFFER, flags); -@@ -1913,7 +1927,7 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in +@@ -2292,7 +2306,7 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in if (texture->resource.device->d3d_initialized) context = context_acquire(texture->resource.device, NULL); @@ -223,10 +223,10 @@ index afb1738..729863c 100644 if (context) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index c56e454..cbcb923 100644 +index 4f8abb8..77dd83e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2735,7 +2735,7 @@ struct wined3d_texture +@@ -2835,7 +2835,7 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -235,7 +235,7 @@ index c56e454..cbcb923 100644 BOOL unmap_dirtify; } sub_resources[1]; }; -@@ -2793,7 +2793,7 @@ BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture, +@@ -2893,7 +2893,7 @@ BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture, unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN; GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, diff --git a/patches/wined3d-CSMT_Main/0123-wined3d-Call-create_default_sampler-from-create_dumm.patch b/patches/wined3d-CSMT_Main/0123-wined3d-Call-create_default_sampler-from-create_dumm.patch index 68741b6f..52542e08 100644 --- a/patches/wined3d-CSMT_Main/0123-wined3d-Call-create_default_sampler-from-create_dumm.patch +++ b/patches/wined3d-CSMT_Main/0123-wined3d-Call-create_default_sampler-from-create_dumm.patch @@ -1,4 +1,4 @@ -From 21a06ced85ce0e69abdb0d0ed89cc9f3ee2910b9 Mon Sep 17 00:00:00 2001 +From 03bf69ef24be95096e195766f0d9afca5dcde9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 7 May 2016 21:16:47 +0100 Subject: wined3d: Call create_default_sampler from create_dummy_textures. @@ -9,7 +9,7 @@ I should really rename it, don't feel like it now. 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e0ef122..1da8384 100644 +index 75897b7..9836106 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -663,6 +663,39 @@ out: @@ -30,7 +30,7 @@ index e0ef122..1da8384 100644 + */ + GL_EXTCALL(glGenSamplers(1, &device->default_sampler)); + GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); -+ GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); ++ GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); + checkGLcall("Create default sampler"); + + /* In D3D10+, a NULL sampler maps to the default sampler state. */ @@ -78,7 +78,7 @@ index e0ef122..1da8384 100644 - */ - GL_EXTCALL(glGenSamplers(1, &device->default_sampler)); - GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); -- GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); +- GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); - checkGLcall("Create default sampler"); - - /* In D3D10+, a NULL sampler maps to the default sampler state. */ @@ -108,7 +108,7 @@ index e0ef122..1da8384 100644 DWORD clear_flags = 0; HRESULT hr; -@@ -1063,9 +1063,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1065,9 +1065,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, device_init_swapchain_state(device, swapchain); wined3d_cs_emit_create_dummy_textures(device->cs); @@ -118,7 +118,7 @@ index e0ef122..1da8384 100644 device->contexts[0]->last_was_rhw = 0; -@@ -4607,7 +4604,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d +@@ -4632,7 +4629,6 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -126,7 +126,7 @@ index e0ef122..1da8384 100644 HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4634,9 +4630,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4659,9 +4655,6 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru } wined3d_cs_emit_create_dummy_textures(device->cs); diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index b08066a4..5b429570 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -66,7 +66,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); } -@@ -7987,8 +8011,16 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_ +@@ -8008,8 +8032,16 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_ /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); @@ -1134,7 +1134,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -1705,6 +1705,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, +@@ -1706,6 +1706,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, goto out; } @@ -1148,7 +1148,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) { -@@ -2013,6 +2020,9 @@ out: +@@ -2026,6 +2033,9 @@ out: if (hdc) wined3d_release_dc(swapchain->win_handle, hdc); device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -1158,7 +1158,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); -@@ -2060,6 +2070,9 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont +@@ -2073,6 +2083,9 @@ 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); HeapFree(GetProcessHeap(), 0, context->fbo_key); @@ -1168,7 +1168,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); -@@ -2605,7 +2618,11 @@ static BOOL context_validate_rt_config(UINT rt_count, struct wined3d_rendertarge +@@ -2618,7 +2631,11 @@ static BOOL context_validate_rt_config(UINT rt_count, struct wined3d_rendertarge } /* Context activation is done by the caller. */ @@ -1180,7 +1180,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c UINT rt_count, const struct wined3d_fb_state *fb) { struct wined3d_rendertarget_view **rts = fb->render_targets; -@@ -2614,7 +2631,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2627,7 +2644,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win DWORD rt_mask = 0, *cur_mask; UINT i; @@ -1192,7 +1192,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c || rt_count != gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2659,6 +2680,10 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2672,6 +2693,10 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win rt_mask = context_generate_rt_mask_no_fbo(context, rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL); } @@ -1203,7 +1203,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))) -@@ -2699,7 +2724,12 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2712,7 +2737,12 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST); if (rt_count && gl_info->supported[ARB_FRAMEBUFFER_SRGB]) { @@ -1216,7 +1216,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB); else gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB); -@@ -2716,7 +2746,11 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win +@@ -2729,7 +2759,11 @@ 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_state *state) { @@ -1228,7 +1228,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL]; DWORD rt_mask, rt_mask_bits; unsigned int i; -@@ -2746,7 +2780,11 @@ static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const +@@ -2759,7 +2793,11 @@ 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) { DWORD rt_mask = find_draw_buffers_mask(context, state); @@ -1240,7 +1240,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -3035,6 +3073,10 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d +@@ -3048,6 +3086,10 @@ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -1251,7 +1251,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } static BOOL fixed_get_input(BYTE usage, BYTE usage_idx, unsigned int *regnum) -@@ -3219,7 +3261,11 @@ static void context_update_stream_info(struct wined3d_context *context, const st +@@ -3232,7 +3274,11 @@ static void context_update_stream_info(struct wined3d_context *context, const st else { wined3d_buffer_load(buffer, context, state); @@ -1263,7 +1263,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c element->data.buffer_object = data.buffer_object; element->data.addr += (ULONG_PTR)data.addr; } -@@ -3409,7 +3455,11 @@ BOOL context_apply_draw_state(struct wined3d_context *context, +@@ -3479,7 +3525,11 @@ BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) { const struct StateEntry *state_table = context->state_table; @@ -1275,7 +1275,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c unsigned int i; WORD map; -@@ -3442,8 +3492,17 @@ BOOL context_apply_draw_state(struct wined3d_context *context, +@@ -3512,8 +3562,17 @@ BOOL context_apply_draw_state(struct wined3d_context *context, for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -1293,7 +1293,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } if (state->index_buffer) { -@@ -3563,6 +3622,11 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str +@@ -3639,6 +3698,11 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str TRACE("device %p, target %p.\n", device, target); @@ -1327,7 +1327,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, WINED3D_CS_OP_DRAW, -@@ -57,8 +65,52 @@ enum wined3d_cs_op +@@ -58,8 +66,52 @@ enum wined3d_cs_op WINED3D_CS_OP_QUERY_ISSUE, WINED3D_CS_OP_PRELOAD_RESOURCE, WINED3D_CS_OP_UNLOAD_RESOURCE, @@ -1380,7 +1380,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_present -@@ -291,6 +343,7 @@ struct wined3d_cs_unload_resource +@@ -299,6 +351,7 @@ struct wined3d_cs_unload_resource struct wined3d_resource *resource; }; @@ -1388,7 +1388,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_map { enum wined3d_cs_op opcode; -@@ -303,14 +356,272 @@ struct wined3d_cs_map +@@ -311,14 +364,272 @@ struct wined3d_cs_map }; struct wined3d_cs_unmap @@ -1661,7 +1661,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_present *op = data; struct wined3d_swapchain *swapchain; -@@ -319,13 +630,24 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -327,13 +638,24 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) swapchain = op->swapchain; wined3d_swapchain_set_window(swapchain, op->dst_window_override); @@ -1686,7 +1686,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, -@@ -333,6 +655,9 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -341,6 +663,9 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw { struct wined3d_cs_present *op; unsigned int i; @@ -1696,7 +1696,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_PRESENT; -@@ -348,34 +673,75 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -356,34 +681,75 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw wined3d_resource_acquire(&swapchain->back_buffers[i]->resource); } @@ -1772,7 +1772,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, -@@ -384,8 +750,13 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -392,8 +758,13 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_clear *op; unsigned int i; @@ -1786,7 +1786,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_CLEAR; op->flags = flags; op->color = *color; -@@ -398,11 +769,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -406,11 +777,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * { for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -1804,7 +1804,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c wined3d_resource_acquire(state->fb->depth_stencil->resource); cs->ops->submit(cs); -@@ -411,12 +788,65 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -419,12 +796,65 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) { struct wined3d_state *state = &cs->device->state; @@ -1870,7 +1870,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (!cs->device->adapter->gl_info.supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && state->load_base_vertex_index != op->base_vertex_idx) { -@@ -441,11 +871,19 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -449,11 +879,19 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) } for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -1890,7 +1890,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i) { if (!(shader = state->shader[i])) -@@ -467,6 +905,10 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -475,6 +913,10 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) wined3d_resource_release(view->resource); } } @@ -1901,7 +1901,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, -@@ -489,11 +931,25 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -497,11 +939,25 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i op->indexed = indexed; if (indexed) @@ -1927,7 +1927,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } for (i = 0; i < ARRAY_SIZE(state->textures); ++i) { -@@ -502,11 +958,19 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -510,11 +966,19 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i } for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -1947,7 +1947,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i) { if (!(shader = state->shader[i])) -@@ -529,15 +993,26 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -537,15 +1001,26 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i } } @@ -1974,7 +1974,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) -@@ -549,15 +1024,26 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query +@@ -557,15 +1032,26 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query op->predicate = predicate; op->value = value; @@ -2001,7 +2001,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) -@@ -568,15 +1054,26 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi +@@ -576,15 +1062,26 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi op->opcode = WINED3D_CS_OP_SET_VIEWPORT; op->viewport = *viewport; @@ -2028,7 +2028,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) -@@ -587,15 +1084,29 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -595,15 +1092,29 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; op->rect = *rect; @@ -2058,7 +2058,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -608,16 +1119,27 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -616,16 +1127,27 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v op->view_idx = view_idx; op->view = view; @@ -2086,7 +2086,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev); -@@ -625,15 +1147,26 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -633,15 +1155,26 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const || prev_surface->container->flags & WINED3D_TEXTURE_DISCARD)) { surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height); @@ -2113,7 +2113,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (!prev != !op->view) { -@@ -650,6 +1183,10 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -658,6 +1191,10 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -2124,7 +2124,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -@@ -660,15 +1197,26 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 +@@ -668,15 +1205,26 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; op->view = view; @@ -2151,7 +2151,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) -@@ -679,10 +1227,17 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 +@@ -687,10 +1235,17 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; op->declaration = declaration; @@ -2169,7 +2169,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source *op = data; struct wined3d_stream_state *stream; -@@ -700,6 +1255,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void +@@ -708,6 +1263,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -2180,7 +2180,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -714,10 +1273,17 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -722,10 +1281,17 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, op->offset = offset; op->stride = stride; @@ -2198,7 +2198,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source_freq *op = data; struct wined3d_stream_state *stream; -@@ -727,6 +1293,10 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const +@@ -735,6 +1301,10 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const stream->flags = op->flags; device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -2209,7 +2209,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) -@@ -739,10 +1309,17 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i +@@ -747,10 +1317,17 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i op->frequency = frequency; op->flags = flags; @@ -2227,7 +2227,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_output *op = data; struct wined3d_stream_output *stream; -@@ -757,6 +1334,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void +@@ -765,6 +1342,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void InterlockedIncrement(&op->buffer->resource.bind_count); if (prev) InterlockedDecrement(&prev->resource.bind_count); @@ -2238,7 +2238,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -770,10 +1351,17 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -778,10 +1359,17 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, op->buffer = buffer; op->offset = offset; @@ -2256,7 +2256,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_index_buffer *op = data; struct wined3d_buffer *prev; -@@ -789,6 +1377,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * +@@ -797,6 +1385,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_INDEXBUFFER); @@ -2267,7 +2267,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -802,10 +1394,17 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -810,10 +1402,17 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff op->format_id = format_id; op->offset = offset; @@ -2285,7 +2285,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_constant_buffer *op = data; struct wined3d_buffer *prev; -@@ -819,6 +1418,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi +@@ -827,6 +1426,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); @@ -2295,7 +2295,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -832,10 +1434,17 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -840,10 +1442,17 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha op->cb_idx = cb_idx; op->buffer = buffer; @@ -2313,7 +2313,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; -@@ -912,6 +1521,10 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +@@ -920,6 +1529,10 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (new_use_color_key) device_invalidate_state(cs->device, STATE_COLOR_KEY); @@ -2324,7 +2324,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) -@@ -922,16 +1535,27 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -930,16 +1543,27 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined op->opcode = WINED3D_CS_OP_SET_TEXTURE; op->stage = stage; op->texture = texture; @@ -2351,8 +2351,39 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +#endif /* STAGING_CSMT */ } + void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned int view_idx, +@@ -952,11 +1576,18 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i + op->view_idx = view_idx; + op->view = view; + ++#if !defined(STAGING_CSMT) + cs->ops->submit(cs); + } + + static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data) +-{ ++#else /* STAGING_CSMT */ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ ++static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data) ++#endif /* STAGING_CSMT */ ++{ + const struct wined3d_cs_set_unordered_access_view *op = data; + struct wined3d_unordered_access_view *prev; + +@@ -969,6 +1600,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con + InterlockedDecrement(&prev->resource->bind_count); + + device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING); ++#if defined(STAGING_CSMT) ++ ++ return sizeof(*op); ++#endif /* STAGING_CSMT */ + } + void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -945,15 +1569,26 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -982,15 +1617,26 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 op->view_idx = view_idx; op->view = view; @@ -2361,14 +2392,13 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) --{ +#else /* STAGING_CSMT */ + cs->ops->submit(cs, sizeof(*op)); +} + +static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) +#endif /* STAGING_CSMT */ -+{ + { const struct wined3d_cs_set_sampler *op = data; cs->state.sampler[op->type][op->sampler_idx] = op->sampler; @@ -2380,7 +2410,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -967,16 +1602,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1004,16 +1650,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type op->sampler_idx = sampler_idx; op->sampler = sampler; @@ -2408,7 +2438,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) -@@ -988,15 +1634,26 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1025,15 +1682,26 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type op->type = type; op->shader = shader; @@ -2435,7 +2465,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, -@@ -1008,6 +1665,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1045,15 +1713,86 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE; op->state = rasterizer_state; @@ -2443,10 +2473,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs); } -@@ -1069,19 +1727,275 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, - op = cs->ops->require_space(cs, sizeof(*op)); - op->opcode = WINED3D_CS_OP_SET_SAMPLER_STATE; - op->sampler_idx = sampler_idx; + static void wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) +#else /* STAGING_CSMT */ + cs->ops->submit(cs, sizeof(*op)); +} @@ -2512,22 +2539,20 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +} + +static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_render_state *op = data; -+ -+ cs->state.render_states[op->state] = op->value; -+ device_invalidate_state(cs->device, STATE_RENDER(op->state)); ++#endif /* STAGING_CSMT */ + { + const struct wined3d_cs_set_render_state *op = data; + + cs->state.render_states[op->state] = op->value; + device_invalidate_state(cs->device, STATE_RENDER(op->state)); ++#if defined(STAGING_CSMT) + + return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) -+{ -+ struct wined3d_cs_set_render_state *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_RENDER_STATE; +#endif /* STAGING_CSMT */ + } + + void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) +@@ -1065,6 +1804,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render op->state = state; op->value = value; @@ -2535,7 +2560,10 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs); } - static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) +@@ -1096,6 +1836,159 @@ static void wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void + + cs->state.sampler_states[op->sampler_idx][op->state] = op->value; + device_invalidate_state(cs->device, STATE_SAMPLER(op->sampler_idx)); +#else /* STAGING_CSMT */ + cs->ops->submit(cs, sizeof(*op)); +} @@ -2688,19 +2716,20 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + device_invalidate_state(cs->device, STATE_SAMPLER(op->sampler_idx)); + + return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -+ enum wined3d_sampler_state state, DWORD value) -+{ -+ struct wined3d_cs_set_sampler_state *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_SAMPLER_STATE; -+ op->sampler_idx = sampler_idx; -+ op->state = state; -+ op->value = value; -+ ++#endif /* STAGING_CSMT */ + } + + void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1109,16 +2002,27 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, + op->state = state; + op->value = value; + ++#if !defined(STAGING_CSMT) + cs->ops->submit(cs); + } + + static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) ++#else /* STAGING_CSMT */ + cs->ops->submit(cs, sizeof(*op)); +} + @@ -2719,7 +2748,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -1094,15 +2008,26 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1131,15 +2035,26 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform op->state = state; op->matrix = *matrix; @@ -2746,7 +2775,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) -@@ -1114,10 +2039,17 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const +@@ -1151,10 +2066,17 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const op->plane_idx = plane_idx; op->plane = *plane; @@ -2764,7 +2793,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_color_key *op = data; struct wined3d_texture *texture = op->texture; -@@ -1178,6 +2110,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat +@@ -1215,6 +2137,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat break; } } @@ -2775,7 +2804,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -1197,15 +2133,26 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1234,15 +2160,26 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -2802,7 +2831,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) -@@ -1216,17 +2163,35 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1253,17 +2190,35 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; @@ -2838,7 +2867,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1236,14 +2201,25 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1273,14 +2228,25 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_RESET_STATE; @@ -2864,7 +2893,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) -@@ -1255,15 +2231,57 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void +@@ -1292,15 +2258,57 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void op->callback = callback; op->object = object; @@ -2922,7 +2951,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1275,16 +2293,27 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1312,16 +2320,27 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu op->query = query; op->flags = flags; @@ -2950,7 +2979,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1297,16 +2326,27 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1334,16 +2353,27 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso wined3d_resource_acquire(resource); @@ -2978,7 +3007,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1319,6 +2359,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1356,6 +2386,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou wined3d_resource_acquire(resource); @@ -2986,7 +3015,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs); } -@@ -1523,5 +2564,1174 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -1561,5 +2592,1175 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) state_cleanup(&cs->state); HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); HeapFree(GetProcessHeap(), 0, cs->data); @@ -3774,6 +3803,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, + /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, + /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, ++ /* WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW */ wined3d_cs_exec_set_unordered_access_view, + /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, + /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, + /* WINED3D_CS_OP_SET_RASTERIZER_STATE */ wined3d_cs_exec_set_rasterizer_state, @@ -4278,7 +4308,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + */ + GL_EXTCALL(glGenSamplers(1, &device->default_sampler)); + GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); -+ GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); ++ GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); + checkGLcall("Create default sampler"); + + /* In D3D10+, a NULL sampler maps to the default sampler state. */ @@ -4366,7 +4396,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = device->shader_backend->shader_alloc_private(device, device->adapter->vertex_pipe, device->adapter->fragment_pipe))) { -@@ -1084,17 +1165,23 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1086,17 +1167,23 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, device->swapchains[0] = swapchain; device_init_swapchain_state(device, swapchain); @@ -4390,7 +4420,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Clear the screen */ if (swapchain->back_buffers && swapchain->back_buffers[0]) clear_flags |= WINED3DCLEAR_TARGET; -@@ -1110,7 +1197,9 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1112,7 +1199,9 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, return WINED3D_OK; err_out: @@ -4400,7 +4430,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) -@@ -1167,8 +1256,10 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) +@@ -1169,8 +1258,10 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { struct wined3d_resource *resource, *cursor; @@ -4411,7 +4441,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_surface *surface; UINT i; -@@ -1177,17 +1268,23 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1179,17 +1270,23 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (!device->d3d_initialized) return WINED3DERR_INVALIDCALL; @@ -4435,7 +4465,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c state_unbind_resources(&device->state); /* Unload resources */ -@@ -1221,9 +1318,21 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1223,9 +1320,21 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { surface = device->onscreen_depth_stencil; device->onscreen_depth_stencil = NULL; @@ -4457,7 +4487,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->fb.depth_stencil) { struct wined3d_rendertarget_view *view = device->fb.depth_stencil; -@@ -1233,9 +1342,13 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1235,9 +1344,13 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->fb.depth_stencil = NULL; wined3d_rendertarget_view_decref(view); } @@ -4471,7 +4501,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_rendertarget_view *view = device->auto_depth_stencil_view; device->auto_depth_stencil_view = NULL; -@@ -1247,6 +1360,24 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1249,6 +1362,24 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { wined3d_device_set_rendertarget_view(device, i, NULL, FALSE); } @@ -4496,7 +4526,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->back_buffer_view) { wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1264,9 +1395,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1266,9 +1397,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->swapchains = NULL; device->swapchain_count = 0; @@ -4508,7 +4538,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1311,7 +1444,11 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device +@@ -1313,7 +1446,11 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device /* We can not acquire the context unless there is a swapchain. */ if (device->swapchains && gl_info->supported[NVX_GPU_MEMORY_INFO] && @@ -4520,7 +4550,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { GLint vram_free_kb; UINT64 vram_free; -@@ -1652,6 +1789,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1654,6 +1791,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, light->direction.x, light->direction.y, light->direction.z, light->range, light->falloff, light->theta, light->phi); @@ -4528,7 +4558,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update the live definitions if the light is currently assigned a glIndex. */ if (object->glIndex != -1 && !device->recording) { -@@ -1660,6 +1798,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1662,6 +1800,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex)); } @@ -4536,7 +4566,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Save away the information. */ object->OriginalParms = *light; -@@ -1739,6 +1878,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1741,6 +1880,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, FIXME("Unrecognized light type %#x.\n", light->type); } @@ -4548,7 +4578,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1811,12 +1955,14 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1813,12 +1957,14 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN { if (light_info->glIndex != -1) { @@ -4563,7 +4593,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; } -@@ -1858,6 +2004,7 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1860,6 +2006,7 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -4571,7 +4601,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* i == light_info->glIndex */ if (!device->recording) -@@ -1865,9 +2012,15 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1867,9 +2014,15 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN device_invalidate_state(device, STATE_LIGHT_TYPE); device_invalidate_state(device, STATE_ACTIVELIGHT(i)); } @@ -4587,7 +4617,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2038,6 +2191,11 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I +@@ -2040,6 +2193,11 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -4599,7 +4629,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) -@@ -2083,7 +2241,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) +@@ -2085,7 +2243,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; @@ -4611,7 +4641,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; if (src_view->resource->type == WINED3D_RTYPE_BUFFER) { -@@ -2444,6 +2606,18 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 +@@ -2446,6 +2608,18 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -4630,7 +4660,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const BOOL *constants) { -@@ -2471,7 +2645,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, +@@ -2473,7 +2647,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, } else { @@ -4643,7 +4673,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2520,7 +2699,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, +@@ -2522,7 +2701,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, } else { @@ -4656,7 +4686,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2565,7 +2749,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, +@@ -2567,7 +2751,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, memset(&device->recording->changed.vs_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.vs_consts_f)); else @@ -4669,7 +4699,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2704,7 +2893,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, +@@ -2706,7 +2895,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, } else { @@ -4682,7 +4712,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2753,7 +2947,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, +@@ -2755,7 +2949,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, } else { @@ -4695,7 +4725,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2799,7 +2998,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, +@@ -2801,7 +3000,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, memset(&device->recording->changed.ps_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.ps_consts_f)); else @@ -4708,7 +4738,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2964,6 +3168,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO +@@ -2992,6 +3196,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO } dest_ptr = map_desc.data; @@ -4724,7 +4754,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); -@@ -3229,7 +3442,9 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, +@@ -3257,7 +3470,9 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, { GL_EXTCALL(glDeleteBuffers(1, &buffer->buffer_object)); buffer->buffer_object = 0; @@ -4734,7 +4764,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (e->data.addr) e->data.addr += e->stride * src_start_idx; -@@ -3526,8 +3741,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) +@@ -3554,8 +3769,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -4745,7 +4775,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3536,6 +3753,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3564,6 +3781,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) return WINED3DERR_INVALIDCALL; } @@ -4753,7 +4783,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c context = context_acquire(device, NULL); /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ context->gl_info->gl_ops.gl.p_glFlush(); -@@ -3543,6 +3761,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3571,6 +3789,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) * fails. */ context_release(context); @@ -4761,7 +4791,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3550,6 +3769,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3578,6 +3797,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) 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) { @@ -4772,7 +4802,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, debug_color(color), depth, stencil); -@@ -3561,7 +3784,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3589,7 +3812,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -4784,7 +4814,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"); -@@ -3570,8 +3797,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3598,8 +3825,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -4798,7 +4828,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; -@@ -3617,7 +3849,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +@@ -3645,7 +3877,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -4808,7 +4838,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); -@@ -3625,8 +3859,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +@@ -3653,8 +3887,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -4822,7 +4852,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, -@@ -3686,10 +3925,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3714,10 +3953,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -4839,7 +4869,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_const_bo_address data; struct wined3d_context *context; struct wined3d_map_desc src; -@@ -3714,6 +3959,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3742,6 +3987,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, } context = context_acquire(device, NULL); @@ -4854,7 +4884,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3721,6 +3974,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3749,6 +4002,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { @@ -4862,7 +4892,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_resource_map(&src_texture->resource, src_level + i, &src, NULL, WINED3D_MAP_READONLY))) goto done; -@@ -3737,16 +3991,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3765,16 +4019,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, done: context_release(context); return hr; @@ -4871,7 +4901,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c + src_texture->resource.map_binding, FALSE); + wined3d_texture_get_pitch(src_texture, src_level + i, &row_pitch, &slice_pitch); + -+ wined3d_texture_upload_data(dst_texture, i, context, wined3d_const_bo_address(&data), ++ wined3d_texture_upload_data(dst_texture, i, context, NULL, wined3d_const_bo_address(&data), + row_pitch, slice_pitch); + wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); + } @@ -4957,7 +4987,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3783,6 +4115,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3811,6 +4143,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -4965,7 +4995,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)); -@@ -3805,9 +4138,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3833,9 +4166,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, context_release(context); /* Update every surface level of the texture. */ @@ -4987,7 +5017,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { unsigned int src_levels = src_texture->level_count; unsigned int dst_levels = dst_texture->level_count; -@@ -3840,6 +4185,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3868,6 +4213,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, FIXME("Unsupported texture type %#x.\n", type); return WINED3DERR_INVALIDCALL; } @@ -5026,7 +5056,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) -@@ -3887,8 +4264,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -3915,8 +4292,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -5040,7 +5070,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -4077,6 +4459,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4105,6 +4487,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev struct wined3d_texture *dst_texture, *src_texture; RECT dst_rect, src_rect; HRESULT hr; @@ -5050,7 +5080,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", -@@ -4164,6 +4549,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4192,6 +4577,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev if (src_box) { @@ -5067,7 +5097,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom); } else -@@ -4177,6 +4572,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4205,6 +4600,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left), dst_y + (src_rect.bottom - src_rect.top)); @@ -5093,71 +5123,36 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) WARN("Failed to blit, hr %#x.\n", hr); -@@ -4189,6 +4603,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4217,8 +4631,10 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str unsigned int depth_pitch) { - struct wined3d_texture_sub_resource *sub_resource; + unsigned int width, height, depth, level; +#if !defined(STAGING_CSMT) - const struct wined3d_gl_info *gl_info; struct wined3d_const_bo_address addr; - unsigned int width, height, level; -@@ -4197,6 +4612,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - struct wined3d_surface *surface; - POINT dst_point; - RECT src_rect; -+#else /* STAGING_CSMT */ -+ struct wined3d_texture *texture; + struct wined3d_context *context; +#endif /* STAGING_CSMT */ + struct wined3d_texture *texture; TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", - device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); -@@ -4230,6 +4648,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); +@@ -4268,6 +4684,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str return; } -+#if !defined(STAGING_CSMT) - surface = sub_resource->u.surface; - level = sub_resource_idx % texture->level_count; -@@ -4240,6 +4659,17 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - src_rect.top = 0; - if (box) - { -+#else /* STAGING_CSMT */ -+ -+ if (box) -+ { -+ unsigned int width, height, level; -+ -+ level = sub_resource_idx % texture->level_count; -+ width = wined3d_texture_get_level_width(texture, level); -+ height = wined3d_texture_get_level_height(texture, level); -+ -+#endif /* STAGING_CSMT */ - if (box->left >= box->right || box->right > width - || box->top >= box->bottom || box->bottom > height - || box->front >= box->back) -@@ -4247,6 +4677,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str - WARN("Invalid box %s specified.\n", debug_box(box)); - return; - } +#if !defined(STAGING_CSMT) + addr.buffer_object = 0; + addr.addr = data; - src_rect.right = box->right - box->left; - src_rect.bottom = box->bottom - box->top; -@@ -4281,6 +4712,11 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4287,6 +4704,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); +#else /* STAGING_CSMT */ -+ } -+ + wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); +#endif /* STAGING_CSMT */ } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4289,8 +4725,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4295,8 +4715,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi { const struct blit_shader *blitter; struct wined3d_resource *resource; @@ -5171,7 +5166,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n", device, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil); -@@ -4329,10 +4770,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4335,10 +4760,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return WINED3DERR_INVALIDCALL; } @@ -5187,7 +5182,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, -@@ -4346,20 +4792,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co +@@ -4352,20 +4782,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -5219,7 +5214,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); -@@ -4396,13 +4853,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4402,13 +4843,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -5241,7 +5236,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. */ -@@ -4414,18 +4879,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4420,18 +4869,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -5271,7 +5266,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4659,19 +5135,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) +@@ -4665,19 +5125,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) } } @@ -5298,7 +5293,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) { device->shader_backend->shader_destroy(shader); -@@ -4703,12 +5186,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d +@@ -4709,12 +5176,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -5329,7 +5324,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, -@@ -4725,6 +5226,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4731,6 +5216,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru return hr; } @@ -5337,7 +5332,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Recreate the primary swapchain's context */ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); if (!swapchain->context) -@@ -4737,10 +5239,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4743,10 +5229,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer; if (!(context = context_create(swapchain, target, swapchain->ds_format))) @@ -5353,7 +5348,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HeapFree(GetProcessHeap(), 0, swapchain->context); return E_FAIL; } -@@ -4750,6 +5257,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4756,6 +5247,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru create_dummy_textures(device, context); create_default_samplers(device, context); context_release(context); @@ -5366,7 +5361,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4768,6 +5281,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4774,6 +5271,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", device, swapchain_desc, mode, callback, reset_state); @@ -5381,7 +5376,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { ERR("Failed to get the first implicit swapchain.\n"); -@@ -4786,10 +5307,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4792,10 +5297,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -5398,7 +5393,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4798,10 +5325,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4804,10 +5315,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -5421,7 +5416,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4966,27 +5505,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4976,27 +5499,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -5470,7 +5465,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4994,7 +5554,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -5004,7 +5548,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, { if (reset_state) hr = create_primary_opengl_context(device, swapchain); @@ -5482,7 +5477,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } /* All done. There is no need to reload resources or shaders, this will happen automatically on the -@@ -5076,11 +5640,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -5086,11 +5634,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -5502,7 +5497,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); switch (type) -@@ -5205,8 +5777,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -5215,8 +5771,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -5520,7 +5515,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state = &device->state; if (!(device->cs = wined3d_cs_create(device))) -@@ -5300,3 +5881,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5310,3 +5875,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -5631,7 +5626,7 @@ diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.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 -@@ -1514,7 +1514,11 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context +@@ -1561,7 +1561,11 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context const struct wined3d_vec4 correction_params = { /* Position is relative to the framebuffer, not the viewport. */ @@ -5643,7 +5638,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c context->render_offscreen ? 1.0f : -1.0f, 0.0f, 0.0f, -@@ -1620,6 +1624,13 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev +@@ -1667,6 +1671,13 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev { update_heap_entry(heap, i, priv->next_constant_version); } @@ -5657,7 +5652,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c } static void shader_glsl_update_float_pixel_constants(struct wined3d_device *device, UINT start, UINT count) -@@ -1632,6 +1643,13 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi +@@ -1679,6 +1690,13 @@ static void shader_glsl_update_float_pixel_constants(struct wined3d_device *devi { update_heap_entry(heap, i, priv->next_constant_version); } @@ -5733,7 +5728,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c wined3d_cs_emit_query_issue(query->device->cs, query, flags); if (flags & WINED3DISSUE_BEGIN) -@@ -449,7 +477,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query +@@ -461,7 +489,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query return query->type; } @@ -5745,7 +5740,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { TRACE("query %p, flags %#x.\n", query, flags); -@@ -458,20 +490,33 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla +@@ -470,20 +502,33 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla struct wined3d_event_query *event_query = wined3d_event_query_from_query(query); wined3d_event_query_issue(event_query, query->device); @@ -5779,7 +5774,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c TRACE("query %p, flags %#x.\n", query, flags); -@@ -479,7 +524,11 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD +@@ -491,7 +536,11 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD * restart. */ if (flags & WINED3DISSUE_BEGIN) { @@ -5791,7 +5786,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { if (oq->context->tid != GetCurrentThreadId()) { -@@ -509,13 +558,20 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD +@@ -521,13 +570,20 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glBeginQuery()"); context_release(context); @@ -5812,7 +5807,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { if (oq->context->tid != GetCurrentThreadId()) { -@@ -529,9 +585,19 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD +@@ -541,9 +597,19 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glEndQuery()"); context_release(context); @@ -5832,7 +5827,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) -@@ -572,7 +638,11 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) +@@ -584,7 +650,11 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) return available; } @@ -5844,7 +5839,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); const struct wined3d_gl_info *gl_info; -@@ -595,6 +665,12 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD +@@ -607,6 +677,12 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glQueryCounter()"); context_release(context); } @@ -5857,7 +5852,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) -@@ -604,9 +680,16 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer +@@ -616,9 +692,16 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer return TRUE; } @@ -5874,7 +5869,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) -@@ -616,9 +699,16 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) +@@ -628,9 +711,16 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) return TRUE; } @@ -5891,7 +5886,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) -@@ -628,9 +718,16 @@ static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) +@@ -640,9 +730,16 @@ static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) return TRUE; } @@ -6127,7 +6122,7 @@ diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c -@@ -3066,7 +3066,11 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 +@@ -3198,7 +3198,11 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 UINT i; memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ @@ -6175,7 +6170,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c /* Disable blending in all cases even without pixelshaders. * With blending on we could face a big performance penalty. @@ -858,7 +870,11 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ - GLint depthFail_ccw; + GLint depthFail_back; /* No stencil test without a stencil buffer. */ +#if !defined(STAGING_CSMT) @@ -6321,7 +6316,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c -@@ -430,6 +430,9 @@ void state_unbind_resources(struct wined3d_state *state) +@@ -431,6 +431,9 @@ void state_unbind_resources(struct wined3d_state *state) struct wined3d_texture *texture; struct wined3d_buffer *buffer; struct wined3d_shader *shader; @@ -6331,8 +6326,8 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c unsigned int i, j; if ((decl = state->vertex_declaration)) -@@ -506,6 +509,33 @@ void state_unbind_resources(struct wined3d_state *state) - } +@@ -516,6 +519,33 @@ void state_unbind_resources(struct wined3d_state *state) + wined3d_unordered_access_view_decref(uav); } } +#if defined(STAGING_CSMT) @@ -6365,7 +6360,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c } void state_cleanup(struct wined3d_state *state) -@@ -530,6 +560,10 @@ void state_cleanup(struct wined3d_state *state) +@@ -540,6 +570,10 @@ void state_cleanup(struct wined3d_state *state) HeapFree(GetProcessHeap(), 0, light); } } @@ -6376,7 +6371,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c } ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock) -@@ -981,8 +1015,13 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) +@@ -991,8 +1025,13 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) gl_primitive_type = stateblock->state.gl_primitive_type; prev = device->update_state->gl_primitive_type; device->update_state->gl_primitive_type = gl_primitive_type; @@ -6390,7 +6385,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c } if (stateblock->changed.indices) -@@ -1241,35 +1280,77 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d +@@ -1251,35 +1290,77 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->sampler_states[i][WINED3D_SAMP_ELEMENT_INDEX] = 0; /* TODO: Vertex offset in the presampled displacement map. */ state->sampler_states[i][WINED3D_SAMP_DMAP_OFFSET] = 0; @@ -6560,8 +6555,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_resource *resource = &surface->container->resource; struct wined3d_device *device = resource->device; +#if !defined(STAGING_CSMT) - struct wined3d_rendertarget_view_desc view_desc; struct wined3d_rendertarget_view *view; + struct wined3d_view_desc view_desc; +#else /* STAGING_CSMT */ + struct wined3d_rendertarget_view view; +#endif /* STAGING_CSMT */ @@ -6574,9 +6569,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +#if !defined(STAGING_CSMT) view_desc.format_id = resource->format->id; + view_desc.flags = 0; view_desc.u.texture.level_idx = surface->texture_level; - view_desc.u.texture.layer_idx = surface->texture_layer; -@@ -700,6 +758,19 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const +@@ -702,6 +760,19 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const hr = blitter->depth_fill(device, view, rect, WINED3DCLEAR_ZBUFFER, depth, 0); wined3d_rendertarget_view_decref(view); @@ -6596,7 +6591,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -764,7 +835,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -766,7 +837,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct } } @@ -6608,7 +6603,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED) { -@@ -1144,9 +1219,22 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1146,9 +1221,22 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P return WINED3DERR_INVALIDCALL; } @@ -6631,7 +6626,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(dst_texture->resource.device, NULL); gl_info = context->gl_info; -@@ -1161,7 +1249,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1163,7 +1251,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &data, @@ -6643,7 +6638,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_get_pitch(src_texture, src_surface->texture_level, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1662,11 +1754,22 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1664,11 +1756,22 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr { unsigned int texture_level = sub_resource_idx % src_texture->level_count; const struct wined3d_format *src_format = src_texture->resource.format; @@ -6666,7 +6661,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(conv = find_converter(src_format->id, dst_format->id)) && (!device->d3d_initialized || !is_identity_fixup(src_format->color_fixup) || src_format->convert -@@ -1696,6 +1799,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1698,6 +1801,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr return NULL; } @@ -6674,7 +6669,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memset(&src_map, 0, sizeof(src_map)); if (FAILED(wined3d_resource_map(&src_texture->resource, sub_resource_idx, &src_map, NULL, WINED3D_MAP_READONLY))) -@@ -1720,10 +1824,51 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1722,10 +1826,51 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr conv->convert(src_map.data, dst_map.data, src_map.row_pitch, dst_map.row_pitch, desc.width, desc.height); wined3d_resource_unmap(&dst_texture->resource, 0); @@ -6726,7 +6721,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c RECT src_rect = {0, 0, desc.width, desc.height}; const struct wined3d_gl_info *gl_info; struct wined3d_context *context; -@@ -1736,16 +1881,40 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1738,16 +1883,40 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr wined3d_texture_prepare_texture(dst_texture, context, FALSE); wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_surface_upload_data(dst_texture->sub_resources[0].u.surface, gl_info, src_format, @@ -6767,7 +6762,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, -@@ -1823,7 +1992,11 @@ static void read_from_framebuffer(struct wined3d_surface *surface, +@@ -1825,7 +1994,11 @@ static void read_from_framebuffer(struct wined3d_surface *surface, BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -6779,7 +6774,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c restore_rt = context_get_rt_surface(old_ctx); if (restore_rt != surface) -@@ -2350,7 +2523,13 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -2352,7 +2525,13 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glDeleteTextures(1, &backup)"); } @@ -6793,7 +6788,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ context_release(context); -@@ -2415,9 +2594,15 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -2417,9 +2596,15 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, gl_info = context->gl_info; @@ -6809,7 +6804,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_texture, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -2460,8 +2645,16 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -2462,8 +2647,16 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -6826,28 +6821,28 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ if (restore_rt) -@@ -2472,8 +2665,12 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2474,8 +2667,12 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st { struct wined3d_resource *resource = &s->container->resource; struct wined3d_device *device = resource->device; +#if !defined(STAGING_CSMT) - struct wined3d_rendertarget_view_desc view_desc; struct wined3d_rendertarget_view *view; + struct wined3d_view_desc view_desc; +#else /* STAGING_CSMT */ + struct wined3d_rendertarget_view view; +#endif /* STAGING_CSMT */ const struct blit_shader *blitter; HRESULT hr; -@@ -2484,6 +2681,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2486,6 +2683,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st return WINED3DERR_INVALIDCALL; } +#if !defined(STAGING_CSMT) view_desc.format_id = resource->format->id; + view_desc.flags = 0; view_desc.u.texture.level_idx = s->texture_level; - view_desc.u.texture.layer_idx = s->texture_layer; -@@ -2497,6 +2695,19 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2501,6 +2699,19 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st hr = blitter->color_fill(device, view, rect, color); wined3d_rendertarget_view_decref(view); @@ -6867,7 +6862,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -2507,7 +2718,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -2511,7 +2722,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE { struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; @@ -6879,7 +6874,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_texture *src_texture; -@@ -2808,7 +3023,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win +@@ -2812,7 +3027,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6893,7 +6888,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else if (location == WINED3D_LOCATION_DRAWABLE) -@@ -2825,7 +3046,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win +@@ -2829,7 +3050,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6907,7 +6902,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } else -@@ -2834,6 +3061,7 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win +@@ -2838,6 +3065,7 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win } } @@ -6915,7 +6910,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static DWORD resource_access_from_location(DWORD location) { switch (location) -@@ -2895,6 +3123,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -2899,6 +3127,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD memcpy(dst.addr, src.addr, sub_resource->size); } @@ -6923,7 +6918,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_load_sysmem(struct wined3d_surface *surface, struct wined3d_context *context, DWORD dst_location) -@@ -2907,12 +3136,14 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -2911,12 +3140,14 @@ static void surface_load_sysmem(struct wined3d_surface *surface, wined3d_texture_prepare_location(texture, sub_resource_idx, context, dst_location); sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -6938,7 +6933,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB); -@@ -3061,7 +3292,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3065,7 +3296,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* 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. */ @@ -6950,7 +6945,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3069,7 +3304,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3073,7 +3308,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_texture_set_map_binding(texture, WINED3D_LOCATION_SYSMEM); } @@ -6962,7 +6957,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (format.convert) { /* This code is entered for texture formats which need a fixup. */ -@@ -3152,16 +3391,23 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi +@@ -3156,16 +3395,23 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi } /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ @@ -6986,7 +6981,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_w = wined3d_texture_get_level_width(texture, surface->texture_level); surface_h = wined3d_texture_get_level_height(texture, surface->texture_level); -@@ -3196,6 +3442,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3200,6 +3446,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED); return surface_load_location(surface, context, location); } @@ -6996,7 +6991,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { -@@ -3208,7 +3457,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3212,7 +3461,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", wined3d_debug_location(sub_resource->locations), wined3d_debug_location(location)); @@ -7008,7 +7003,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3221,7 +3474,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3225,7 +3478,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -7020,7 +7015,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3233,7 +3490,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3237,7 +3494,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -7032,7 +7027,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3242,6 +3503,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3246,6 +3507,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co } done: @@ -7040,7 +7035,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_validate_location(texture, sub_resource_idx, location); if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) -@@ -3251,6 +3513,9 @@ done: +@@ -3255,6 +3517,9 @@ done: } return WINED3D_OK; @@ -7050,7 +7045,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; } -@@ -3584,16 +3849,41 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3588,16 +3853,41 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int const BYTE *sbuf; BYTE *dbuf; int x, y; @@ -7092,7 +7087,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_map = dst_map; src_format = dst_texture->resource.format; dst_format = src_format; -@@ -3618,7 +3908,20 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3622,7 +3912,20 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_texture = converted_texture; src_sub_resource_idx = 0; } @@ -7113,7 +7108,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_texture->resource.format; src_fmt_flags = src_texture->resource.format_flags; } -@@ -3628,7 +3931,17 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3632,7 +3935,17 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_fmt_flags = dst_fmt_flags; } @@ -7131,7 +7126,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_format->byte_count; -@@ -3642,12 +3955,18 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3646,12 +3959,18 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int sbase = (BYTE *)src_map.data + ((src_box->top / src_format->block_height) * src_map.row_pitch) + ((src_box->left / src_format->block_width) * src_format->block_byte_count); @@ -7150,7 +7145,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4040,16 +4359,42 @@ do { \ +@@ -4044,16 +4363,42 @@ do { \ } } @@ -7193,7 +7188,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4094,7 +4439,11 @@ const struct blit_shader cpu_blit = { +@@ -4098,7 +4443,11 @@ const struct blit_shader cpu_blit = { cpu_blit_blit_surface, }; @@ -7205,7 +7200,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { -@@ -4104,9 +4453,14 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4108,9 +4457,14 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; struct wined3d_swapchain *src_swapchain, *dst_swapchain; @@ -7220,7 +7215,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD src_ds_flags, dst_ds_flags; BOOL scale, convert; -@@ -4119,6 +4473,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4123,6 +4477,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst | WINED3D_BLT_DO_NOT_WAIT | WINED3D_BLT_ALPHA_TEST; @@ -7228,7 +7223,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), flags, fx, debug_d3dtexturefiltertype(filter)); -@@ -4136,10 +4491,12 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4140,10 +4495,12 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst fx->src_color_key.color_space_high_value); } @@ -7241,7 +7236,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (dst_texture->sub_resources[dst_sub_resource_idx].map_count -@@ -4197,6 +4554,15 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4201,6 +4558,15 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst if (!once++) FIXME("Can't handle WINED3D_BLT_DO_NOT_WAIT flag.\n"); flags &= ~WINED3D_BLT_DO_NOT_WAIT; @@ -7257,7 +7252,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (!device->d3d_initialized) -@@ -4221,11 +4587,13 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4225,11 +4591,13 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst goto fallback; } @@ -7271,7 +7266,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dst_swapchain = dst_texture->swapchain; /* This isn't strictly needed. FBO blits for example could deal with -@@ -4261,13 +4629,21 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4265,13 +4633,21 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->fill_color, &depth)) @@ -7293,7 +7288,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_ds_flags != dst_ds_flags) { WARN("Rejecting depth / stencil blit between incompatible formats.\n"); -@@ -4277,6 +4653,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4281,6 +4657,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_texture->resource.draw_binding, src_rect, dst_surface, dst_texture->resource.draw_binding, dst_rect))) return WINED3D_OK; @@ -7305,7 +7300,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -4312,7 +4693,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4316,7 +4697,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst goto fallback; if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) @@ -7317,7 +7312,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4355,7 +4740,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4359,7 +4744,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst context, dst_texture->resource.draw_binding); context_release(context); } @@ -7329,7 +7324,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4379,7 +4768,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4383,7 +4772,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -7341,7 +7336,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -@@ -4400,7 +4793,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4404,7 +4797,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding); @@ -7353,7 +7348,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -@@ -4410,7 +4807,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4414,7 +4811,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst { blitter->blit_surface(device, blit_op, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); @@ -7365,7 +7360,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4418,9 +4819,156 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4422,9 +4823,156 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst fallback: /* Special cases for render targets. */ if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) @@ -7737,7 +7732,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c } if (swapchain->desc.backbuffer_count > 0) -@@ -1312,6 +1431,9 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha +@@ -1314,6 +1433,9 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha enum wined3d_multisample_type multisample_type, unsigned int multisample_quality) { BOOL update_desc = FALSE; @@ -7747,7 +7742,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c TRACE("swapchain %p, buffer_count %u, width %u, height %u, format %s, " "multisample_type %#x, multisample_quality %#x.\n", -@@ -1323,6 +1445,11 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha +@@ -1325,6 +1447,11 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha if (buffer_count && buffer_count != swapchain->desc.backbuffer_count) FIXME("Cannot change the back buffer count yet.\n"); @@ -8205,7 +8200,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3D_OK; } -@@ -1619,7 +1875,9 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1630,7 +1886,9 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in struct wined3d_context *context, DWORD location) { struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -8215,7 +8210,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c unsigned int row_pitch, slice_pitch; TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n", -@@ -1627,6 +1885,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1638,6 +1896,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in TRACE("Current resource location %s.\n", wined3d_debug_location(sub_resource->locations)); @@ -8223,7 +8218,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if ((sub_resource->locations & location) == location) { TRACE("Location(s) already up to date.\n"); -@@ -1640,9 +1899,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1651,9 +1910,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in return FALSE; } @@ -8235,7 +8230,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (sub_resource->locations & WINED3D_LOCATION_DISCARDED) { TRACE("1d texture previously discarded, nothing to do.\n"); -@@ -1651,6 +1912,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1662,6 +1923,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in goto done; } @@ -8243,7 +8238,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c switch (location) { case WINED3D_LOCATION_TEXTURE_RGB: -@@ -1665,7 +1927,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1676,7 +1938,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -8254,8 +8249,8 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c +#endif /* STAGING_CSMT */ wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch); - texture1d_upload_data(texture, sub_resource_idx, context, &data, row_pitch, slice_pitch); -@@ -1710,7 +1976,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in + texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch); +@@ -1721,7 +1987,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in case WINED3D_LOCATION_BUFFER: if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -8267,7 +8262,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); -@@ -1733,7 +2003,9 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1744,7 +2014,9 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in return FALSE; } @@ -8277,7 +8272,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_texture_validate_location(texture, sub_resource_idx, location); return TRUE; -@@ -1828,7 +2100,12 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int +@@ -1852,7 +2124,12 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) { @@ -8290,7 +8285,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } /* Context activation is done by the caller. */ -@@ -1991,8 +2268,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -2015,8 +2292,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED); } @@ -8304,7 +8299,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (resource->type == WINED3D_RTYPE_TEXTURE_2D) { -@@ -2017,6 +2299,89 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -2041,6 +2323,89 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_unload_gl_texture(texture); } @@ -8394,7 +8389,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -2024,6 +2389,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2048,6 +2413,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour struct wined3d_texture_sub_resource *sub_resource; struct wined3d_device *device = resource->device; unsigned int fmt_flags = resource->format_flags; @@ -8402,7 +8397,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c const struct wined3d_gl_info *gl_info = NULL; struct wined3d_context *context = NULL; struct wined3d_texture *texture; -@@ -2031,6 +2397,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2055,6 +2421,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour unsigned int texture_level; BYTE *base_memory; BOOL ret; @@ -8414,7 +8409,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n", resource, sub_resource_idx, map_desc, debug_box(box), flags); -@@ -2075,14 +2446,22 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2099,14 +2470,22 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3DERR_INVALIDCALL; } @@ -8437,7 +8432,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", wined3d_debug_location(texture->resource.map_binding)); if ((ret = wined3d_texture_prepare_location(texture, sub_resource_idx, -@@ -2113,6 +2492,24 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2137,6 +2516,24 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour if (context) context_release(context); @@ -8462,7 +8457,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) { -@@ -2148,6 +2545,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2172,6 +2569,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour } } @@ -8470,7 +8465,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (texture->swapchain && texture->swapchain->front_buffer == texture) { RECT *r = &texture->swapchain->front_buffer_update; -@@ -2159,6 +2557,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2183,6 +2581,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour TRACE("Mapped front buffer %s.\n", wine_dbgstr_rect(r)); } @@ -8478,7 +8473,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c ++resource->map_count; ++sub_resource->map_count; -@@ -2168,14 +2567,71 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -2192,14 +2591,71 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3D_OK; } @@ -8550,7 +8545,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); -@@ -2191,6 +2647,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -2215,6 +2671,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso return WINEDDERR_NOTLOCKED; } @@ -8558,7 +8553,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (device->d3d_initialized) { context = context_acquire(device, NULL); -@@ -2211,6 +2668,15 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -2235,6 +2692,15 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso else if (resource->format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) { FIXME("Depth / stencil buffer locking is not implemented.\n"); @@ -8574,7 +8569,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } --sub_resource->map_count; -@@ -2574,11 +3040,23 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 +@@ -2598,11 +3064,23 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 TRACE("Created surface level %u, layer %u @ %p.\n", i, j, surface); @@ -8598,7 +8593,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } } } -@@ -2715,7 +3193,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2758,7 +3236,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in struct wined3d_context *context, DWORD location) { struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -8608,7 +8603,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c unsigned int row_pitch, slice_pitch; TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n", -@@ -2723,6 +3203,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2766,6 +3246,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in TRACE("Current resource location %s.\n", wined3d_debug_location(sub_resource->locations)); @@ -8616,7 +8611,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if ((sub_resource->locations & location) == location) { TRACE("Location(s) already up to date.\n"); -@@ -2736,9 +3217,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2779,9 +3260,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in return FALSE; } @@ -8628,7 +8623,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (sub_resource->locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); -@@ -2747,6 +3230,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2790,6 +3273,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in goto done; } @@ -8636,7 +8631,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c switch (location) { case WINED3D_LOCATION_TEXTURE_RGB: -@@ -2762,7 +3246,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2805,7 +3289,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -8648,7 +8643,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch); -@@ -2808,7 +3296,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2851,7 +3339,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in case WINED3D_LOCATION_BUFFER: if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -8660,7 +8655,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); -@@ -2831,7 +3323,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2874,7 +3366,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in return FALSE; } @@ -8670,7 +8665,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_texture_validate_location(texture, sub_resource_idx, location); return TRUE; -@@ -2995,6 +3489,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct +@@ -3038,6 +3532,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct if (wined3d_texture_use_pbo(texture, gl_info)) { wined3d_resource_free_sysmem(&texture->resource); @@ -8680,7 +8675,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->resource.map_binding = WINED3D_LOCATION_BUFFER; } -@@ -3355,13 +3852,47 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct +@@ -3387,13 +3884,47 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct return WINED3D_OK; } @@ -8728,7 +8723,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); -@@ -3386,6 +3917,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -3418,6 +3949,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) return WINED3DERR_INVALIDCALL; @@ -8736,7 +8731,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (device->d3d_initialized) context = context_acquire(device, NULL); -@@ -3408,6 +3940,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -3440,6 +3972,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i TRACE("Returning dc %p.\n", *dc); return hr; @@ -8769,7 +8764,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) -@@ -3438,6 +3996,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -3470,6 +4028,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign return WINED3DERR_INVALIDCALL; } @@ -8777,7 +8772,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D)) wined3d_surface_destroy_dc(surface); -@@ -3446,6 +4005,9 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -3478,6 +4037,9 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign wined3d_texture_update_map_binding(texture); if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE; @@ -8790,7 +8785,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -4594,7 +4594,11 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w +@@ -4595,7 +4595,11 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w float y_offset = flip ? (center_offset - (2.0f * y) - h) / h : (center_offset - (2.0f * y) - h) / -h; @@ -8802,7 +8797,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; float z_scale = zenable ? clip_control ? 1.0f : 2.0f : 0.0f; float z_offset = zenable ? clip_control ? 0.0f : -1.0f : 0.0f; -@@ -5393,7 +5397,11 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d +@@ -5394,7 +5398,11 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d break; } } @@ -8817,7 +8812,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c -@@ -94,6 +94,7 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str +@@ -195,6 +195,7 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str return view->resource; } @@ -8825,13 +8820,13 @@ diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, const struct wined3d_context *context, unsigned int *width, unsigned int *height) { -@@ -138,6 +139,7 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg +@@ -239,6 +240,7 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg } } +#endif /* STAGING_CSMT */ static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, - const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, + const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops) diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c --- a/dlls/wined3d/wined3d_main.c @@ -8880,7 +8875,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h #include #include #include -@@ -306,6 +309,9 @@ struct wined3d_settings +@@ -307,6 +310,9 @@ struct wined3d_settings unsigned int max_sm_ps; unsigned int max_sm_cs; BOOL no_3d; @@ -8890,7 +8885,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -1377,7 +1383,11 @@ enum wined3d_query_state +@@ -1434,7 +1440,11 @@ enum wined3d_query_state struct wined3d_query_ops { BOOL (*query_poll)(struct wined3d_query *query); @@ -8902,7 +8897,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -1391,6 +1401,10 @@ struct wined3d_query +@@ -1448,6 +1458,10 @@ struct wined3d_query const void *data; DWORD data_size; const struct wined3d_query_ops *query_ops; @@ -8913,17 +8908,17 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; union wined3d_gl_query_object -@@ -1432,6 +1446,9 @@ struct wined3d_occlusion_query +@@ -1489,6 +1503,9 @@ struct wined3d_occlusion_query GLuint id; struct wined3d_context *context; - DWORD samples; + UINT64 samples; +#if defined(STAGING_CSMT) + BOOL started; +#endif /* STAGING_CSMT */ }; struct wined3d_timestamp_query -@@ -1447,6 +1464,38 @@ struct wined3d_timestamp_query +@@ -1504,6 +1521,38 @@ 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; @@ -8962,7 +8957,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context { const struct wined3d_gl_info *gl_info; -@@ -1461,6 +1510,9 @@ struct wined3d_context +@@ -1518,6 +1567,9 @@ 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 */ @@ -8972,7 +8967,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_device *device; struct wined3d_swapchain *swapchain; -@@ -1571,12 +1623,14 @@ struct wined3d_context +@@ -1630,12 +1682,14 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -8987,7 +8982,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); struct StateEntry -@@ -1715,7 +1769,11 @@ void context_alloc_event_query(struct wined3d_context *context, +@@ -1774,7 +1828,11 @@ void context_alloc_event_query(struct wined3d_context *context, void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; @@ -8999,7 +8994,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2381,7 +2439,11 @@ struct wined3d_stream_state +@@ -2443,7 +2501,11 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -9011,7 +9006,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]; -@@ -2428,6 +2490,16 @@ struct wined3d_state +@@ -2491,6 +2553,16 @@ struct wined3d_state struct wined3d_rasterizer_state *rasterizer_state; }; @@ -9028,7 +9023,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 -@@ -2480,16 +2552,21 @@ struct wined3d_device +@@ -2543,16 +2615,21 @@ struct wined3d_device struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -9050,7 +9045,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; -@@ -2541,9 +2618,23 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -2604,9 +2681,23 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL 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; @@ -9074,7 +9069,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) { -@@ -2588,7 +2679,11 @@ struct wined3d_resource +@@ -2651,7 +2742,11 @@ struct wined3d_resource UINT depth; UINT size; DWORD priority; @@ -9086,7 +9081,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct list resource_list_entry; LONG access_count; -@@ -2635,6 +2730,9 @@ void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HI +@@ -2698,6 +2793,9 @@ void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HI GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -9096,7 +9091,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN; /* Tests show that the start address of resources is 32 byte aligned */ -@@ -2696,6 +2794,9 @@ struct wined3d_texture +@@ -2759,6 +2857,9 @@ struct wined3d_texture DWORD flags; GLenum target; DWORD update_map_binding; @@ -9106,7 +9101,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; -@@ -2732,7 +2833,12 @@ struct wined3d_texture +@@ -2795,7 +2896,12 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -9119,7 +9114,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h } sub_resources[1]; }; -@@ -2783,11 +2889,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture, +@@ -2846,11 +2952,23 @@ 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, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; @@ -9143,7 +9138,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; void wined3d_texture_invalidate_location(struct wined3d_texture *texture, -@@ -2800,13 +2918,26 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size +@@ -2863,13 +2981,26 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN; BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -9168,9 +9163,9 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h + unsigned int sub_resource_idx) DECLSPEC_HIDDEN; +#endif /* STAGING_CSMT */ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, - const struct wined3d_context *context, const struct wined3d_const_bo_address *data, - unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; -@@ -2911,9 +3042,17 @@ HRESULT surface_color_fill(struct wined3d_surface *s, + const struct wined3d_context *context, const struct wined3d_box *box, + const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; +@@ -2974,9 +3105,17 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_destroy_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -9188,7 +9183,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, -@@ -2924,6 +3063,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -2987,6 +3126,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; @@ -9200,7 +9195,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; -@@ -2938,6 +3082,12 @@ struct wined3d_sampler +@@ -3001,6 +3145,12 @@ struct wined3d_sampler GLuint name; }; @@ -9213,7 +9208,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; -@@ -3033,6 +3183,7 @@ struct wined3d_stateblock +@@ -3096,6 +3246,7 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -9221,7 +9216,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; -@@ -3046,54 +3197,150 @@ enum wined3d_push_constants +@@ -3109,54 +3260,150 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_I, WINED3D_PUSH_CONSTANTS_VS_B, WINED3D_PUSH_CONSTANTS_PS_B, @@ -9372,7 +9367,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, -@@ -3123,6 +3370,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -3188,6 +3435,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, unsigned i 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; @@ -9380,7 +9375,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN; -@@ -3134,6 +3382,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d +@@ -3199,6 +3447,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d { cs->ops->push_constants(cs, p, start_idx, count, constants); } @@ -9405,7 +9400,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 */ -@@ -3159,13 +3425,20 @@ struct wined3d_buffer +@@ -3224,13 +3490,20 @@ struct wined3d_buffer GLuint buffer_object; GLenum buffer_object_usage; GLenum buffer_type_hint; @@ -9426,7 +9421,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_event_query *query; /* conversion stuff */ -@@ -3181,6 +3454,7 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc +@@ -3246,6 +3519,7 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc return CONTAINING_RECORD(resource, struct wined3d_buffer, resource); } @@ -9434,7 +9429,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN; -@@ -3189,12 +3463,25 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * +@@ -3254,12 +3528,25 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * const struct wined3d_state *state) DECLSPEC_HIDDEN; BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -9460,7 +9455,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -3227,9 +3514,11 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( +@@ -3292,9 +3579,11 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( return texture->sub_resources[view->sub_resource_idx].u.surface; } @@ -9469,10 +9464,10 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; +#endif /* STAGING_CSMT */ - struct wined3d_shader_resource_view + struct wined3d_gl_view { - LONG refcount; -@@ -3259,7 +3548,12 @@ struct wined3d_unordered_access_view + GLenum target; +@@ -3336,7 +3625,12 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -9485,7 +9480,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3296,6 +3590,10 @@ struct wined3d_swapchain +@@ -3373,6 +3667,10 @@ struct wined3d_swapchain void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN; struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/definition b/patches/wined3d-CSMT_Main/definition index dcae18bb..b3acc9dd 100644 --- a/patches/wined3d-CSMT_Main/definition +++ b/patches/wined3d-CSMT_Main/definition @@ -5,7 +5,6 @@ Fixes: [11674] Support for CSMT (command stream) to increase graphic performance Apply-After: dlls/wined3d/* Depends: wined3d-CSMT_Helper IfDefined: STAGING_CSMT -Disabled: true # Known issues: # https://bugs.wine-staging.com/buglist.cgi?component=Bugs&keywords=csmt%2C%20&keywords_type=allwords&list_id=3690&query_format=advanced&resolution=---