diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e24836a5..08ec60ca 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "79361d3bc056ed7659fb63880ed91019837a4906" + echo "bf4493404cee43a345fe853b5c11b053cdd22322" } # Show version information @@ -5605,188 +5605,182 @@ fi # | if test "$enable_wined3d_CSMT_Main" -eq 1; then patch_apply wined3d-CSMT_Main/0001-wined3d-Merge-get_pitch-functions.patch - patch_apply wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch - patch_apply wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch - patch_apply wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch - patch_apply wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch - patch_apply wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch - patch_apply wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch - patch_apply wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch - patch_apply wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch - patch_apply wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch - patch_apply wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch - patch_apply wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch - patch_apply wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch - patch_apply wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch - patch_apply wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch - patch_apply wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch - patch_apply wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch - patch_apply wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch - patch_apply wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch - patch_apply wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch - patch_apply wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch - patch_apply wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch - patch_apply wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch - patch_apply wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch - patch_apply wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch - patch_apply wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch - patch_apply wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch - patch_apply wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch - patch_apply wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch - patch_apply wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch - patch_apply wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch - patch_apply wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch - patch_apply wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch - patch_apply wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch - patch_apply wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch - patch_apply wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch - patch_apply wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch - patch_apply wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch - patch_apply wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch - patch_apply wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch - patch_apply wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch - patch_apply wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch - patch_apply wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch - patch_apply wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch - patch_apply wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch - patch_apply wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch - patch_apply wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch - patch_apply wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch - patch_apply wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch - patch_apply wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch - patch_apply wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch - patch_apply wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch - patch_apply wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch - patch_apply wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch - patch_apply wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch - patch_apply wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch - patch_apply wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch - patch_apply wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch - patch_apply wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch - patch_apply wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch - patch_apply wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch - patch_apply wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch - patch_apply wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch - patch_apply wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch - patch_apply wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch - patch_apply wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch - patch_apply wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch - patch_apply wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch - patch_apply wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch - patch_apply wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch - patch_apply wined3d-CSMT_Main/0075-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch - patch_apply wined3d-CSMT_Main/0076-wined3d-Send-render-target-view-clears-through-the-c.patch - patch_apply wined3d-CSMT_Main/0077-wined3d-Wait-for-the-CS-in-GetDC.patch - patch_apply wined3d-CSMT_Main/0078-wined3d-send-resource-maps-through-the-command-strea.patch - patch_apply wined3d-CSMT_Main/0079-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch - patch_apply wined3d-CSMT_Main/0080-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch - patch_apply wined3d-CSMT_Main/0081-wined3d-Don-t-preload-buffers-on-unmap.patch - patch_apply wined3d-CSMT_Main/0082-wined3d-Don-t-call-glFinish-before-swapping.patch - patch_apply wined3d-CSMT_Main/0083-wined3d-wined3d_-_query_issue-never-fails.patch - patch_apply wined3d-CSMT_Main/0084-wined3d-Add-query-support-to-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0085-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch - patch_apply wined3d-CSMT_Main/0086-wined3d-Poll-queries-automatically-in-the-CS.patch - patch_apply wined3d-CSMT_Main/0087-wined3d-Introduce-a-separate-queue-for-priority-comm.patch - patch_apply wined3d-CSMT_Main/0088-wined3d-Destroy-queries-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0089-wined3d-Separate-main-and-worker-thread-query-state.patch - patch_apply wined3d-CSMT_Main/0090-wined3d-Don-t-poll-queries-that-failed-to-start.patch - patch_apply wined3d-CSMT_Main/0091-wined3d-Remove-restated-queries-from-the-poll-list.patch - patch_apply wined3d-CSMT_Main/0092-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch - patch_apply wined3d-CSMT_Main/0093-wined3d-Put-this-into-the-query-poll-patch.patch - patch_apply wined3d-CSMT_Main/0094-wined3d-Send-update_surface-commands-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0095-wined3d-Send-texture-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0096-wined3d-Send-surface-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0097-wined3d-Send-update_texture-calls-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0098-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch - patch_apply wined3d-CSMT_Main/0099-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch - patch_apply wined3d-CSMT_Main/0100-wined3d-Handle-evit_managed_resources-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0101-wined3d-Introduce-resource-fencing.patch - patch_apply wined3d-CSMT_Main/0102-wined3d-Fence-update_texture-and-update_surface-call.patch - patch_apply wined3d-CSMT_Main/0103-wined3d-Dirtify-resources-on-unmap.patch - patch_apply wined3d-CSMT_Main/0104-wined3d-Fence-texture-reads-in-draws.patch - patch_apply wined3d-CSMT_Main/0105-wined3d-Fence-render-targets-and-depth-stencils.patch - patch_apply wined3d-CSMT_Main/0106-wined3d-Fence-blit-operations.patch - patch_apply wined3d-CSMT_Main/0107-wined3d-Fence-color_fill-operations.patch - patch_apply wined3d-CSMT_Main/0108-wined3d-Fence-clear-calls.patch - patch_apply wined3d-CSMT_Main/0109-wined3d-Fence-present-calls.patch - patch_apply wined3d-CSMT_Main/0110-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch - patch_apply wined3d-CSMT_Main/0111-wined3d-Dirtify-changed-textures-through-the-command.patch - patch_apply wined3d-CSMT_Main/0112-wined3d-Wrap-GL-BOs-in-a-structure.patch - patch_apply wined3d-CSMT_Main/0113-wined3d-Separate-resource-map-and-draw-buffers.patch - patch_apply wined3d-CSMT_Main/0114-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch - patch_apply wined3d-CSMT_Main/0115-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch - patch_apply wined3d-CSMT_Main/0116-wined3d-Unset-some-objects-in-state_init_default.patch - patch_apply wined3d-CSMT_Main/0117-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch - patch_apply wined3d-CSMT_Main/0118-wined3d-Use-double-buffered-buffers-for-multithreade.patch - patch_apply wined3d-CSMT_Main/0119-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0120-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch - patch_apply wined3d-CSMT_Main/0121-wined3d-Accelerate-DISCARD-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0122-wined3d-Accelerate-READONLY-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0123-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0124-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch - patch_apply wined3d-CSMT_Main/0125-wined3d-Send-buffer-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0126-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch - patch_apply wined3d-CSMT_Main/0127-wined3d-Separate-GL-buffer-discard-control-from-igno.patch - patch_apply wined3d-CSMT_Main/0128-wined3d-Create-buffers-before-mapping-them.patch - patch_apply wined3d-CSMT_Main/0129-wined3d-Destroy-views-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0130-wined3d-Remove-another-glFinish.patch - patch_apply wined3d-CSMT_Main/0131-wined3d-Destroy-vertex-declarations-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0132-wined3d-Destroy-shaders-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0133-wined3d-Create-VBOs-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0134-wined3d-Clean-up-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0135-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0136-wined3d-Clean-up-volume-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0137-wined3d-Clean-up-surfaces-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0138-wined3d-Clean-up-texture-resources-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0139-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch - patch_apply wined3d-CSMT_Main/0140-wined3d-Unload-resources-through-the-CS-in-device_re.patch - patch_apply wined3d-CSMT_Main/0141-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch - patch_apply wined3d-CSMT_Main/0142-wined3d-Remove-software-cursor-support.patch - patch_apply wined3d-CSMT_Main/0143-wined3d-Create-dummy-textures-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0144-wined3d-Create-the-initial-context-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0145-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch - patch_apply wined3d-CSMT_Main/0146-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch - patch_apply wined3d-CSMT_Main/0147-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch - patch_apply wined3d-CSMT_Main/0148-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch - patch_apply wined3d-CSMT_Main/0149-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch - patch_apply wined3d-CSMT_Main/0150-wined3d-Use-an-event-to-block-the-worker-thread-when.patch - patch_apply wined3d-CSMT_Main/0151-wined3d-Fence-preload-operations.patch - patch_apply wined3d-CSMT_Main/0152-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0153-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0154-wined3d-Completely-reset-the-state-on-reset.patch - patch_apply wined3d-CSMT_Main/0155-wined3d-Send-getdc-and-releasedc-through-the-command.patch - patch_apply wined3d-CSMT_Main/0156-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch - patch_apply wined3d-CSMT_Main/0157-wined3d-Wait-only-for-the-buffer-to-be-idle.patch - patch_apply wined3d-CSMT_Main/0158-wined3d-Add-a-comment-about-worker-thread-lag.patch - patch_apply wined3d-CSMT_Main/0159-wined3d-Remove-the-texture-destroy-glFinish.patch - patch_apply wined3d-CSMT_Main/0160-wined3d-Move-FBO-destruction-into-the-worker-thread.patch - patch_apply wined3d-CSMT_Main/0161-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch - patch_apply wined3d-CSMT_Main/0162-Winex11-complain-about-glfinish.patch - patch_apply wined3d-CSMT_Main/0163-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch - patch_apply wined3d-CSMT_Main/0164-wined3d-Remove-the-device_reset-CS-sync-fixme.patch - patch_apply wined3d-CSMT_Main/0165-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch - patch_apply wined3d-CSMT_Main/0166-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch - patch_apply wined3d-CSMT_Main/0167-wined3d-Don-t-sync-on-redundant-discard-calls.patch - patch_apply wined3d-CSMT_Main/0168-wined3d-Don-t-discard-new-buffers.patch - patch_apply wined3d-CSMT_Main/0169-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch - patch_apply wined3d-CSMT_Main/0170-wined3d-Render-target-lock-hack.patch - patch_apply wined3d-CSMT_Main/0171-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch - patch_apply wined3d-CSMT_Main/0172-wined3d-Only-discard-buffers-that-are-in-use.patch - patch_apply wined3d-CSMT_Main/0173-wined3d-Destroy-samplers-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0174-wined3d-Hack-to-reject-unsupported-color-fills.patch - patch_apply wined3d-CSMT_Main/0175-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch - patch_apply wined3d-CSMT_Main/0176-wined3d-Send-update_sub_resource-calls-through-the-c.patch + patch_apply wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-surface_multisample_resolv.patch + patch_apply wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_texture.patch + patch_apply wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_load_location.patch + patch_apply wined3d-CSMT_Main/0005-wined3d-Make-surface_load_location-return-nothing.patch + patch_apply wined3d-CSMT_Main/0006-wined3d-Store-volume-locations-in-the-resource.patch + patch_apply wined3d-CSMT_Main/0007-wined3d-Move-validate_location-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0008-wined3d-Move-surface-locations-into-the-resource.patch + patch_apply wined3d-CSMT_Main/0009-wined3d-Remove-surface_validate_location.patch + patch_apply wined3d-CSMT_Main/0010-wined3d-Move-invalidate_location-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0011-wined3d-Invalidate-containers-via-callback.patch + patch_apply wined3d-CSMT_Main/0012-wined3d-Remove-surface_invalidate_location.patch + patch_apply wined3d-CSMT_Main/0013-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch + patch_apply wined3d-CSMT_Main/0014-wined3d-Move-load_location-into-the-resource.patch + patch_apply wined3d-CSMT_Main/0015-wined3d-Replace-surface_load_location-with-resource_.patch + patch_apply wined3d-CSMT_Main/0016-wined3d-Introduce-helper-functions-for-mapping-volum.patch + patch_apply wined3d-CSMT_Main/0017-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch + patch_apply wined3d-CSMT_Main/0018-wined3d-Remove-surface-pbo.patch + patch_apply wined3d-CSMT_Main/0019-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch + patch_apply wined3d-CSMT_Main/0020-wined3d-Move-buffer-creation-into-the-resource.patch + patch_apply wined3d-CSMT_Main/0021-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch + patch_apply wined3d-CSMT_Main/0022-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch + patch_apply wined3d-CSMT_Main/0023-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch + patch_apply wined3d-CSMT_Main/0024-wined3d-Discard-implicit-surfaces-on-unload.patch + patch_apply wined3d-CSMT_Main/0025-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch + patch_apply wined3d-CSMT_Main/0026-wined3d-Discard-the-backbuffer-in-discard-presents.patch + patch_apply wined3d-CSMT_Main/0027-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch + patch_apply wined3d-CSMT_Main/0028-wined3d-Introduce-a-function-to-retrieve-resource-me.patch + patch_apply wined3d-CSMT_Main/0029-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch + patch_apply wined3d-CSMT_Main/0030-wined3d-Move-check_block_align-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0031-wined3d-Replace-surface-alloc-functions-with-resourc.patch + patch_apply wined3d-CSMT_Main/0032-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch + patch_apply wined3d-CSMT_Main/0033-wined3d-Use-resource-facilities-to-destroy-PBOs.patch + patch_apply wined3d-CSMT_Main/0034-wined3d-Move-simple-location-copying-to-the-resource.patch + patch_apply wined3d-CSMT_Main/0035-wined3d-Move-most-of-volume_map-to-resource.c.patch + patch_apply wined3d-CSMT_Main/0036-wined3d-Use-resource_map-for-surface_map.patch + patch_apply wined3d-CSMT_Main/0037-wined3d-Use-client-storage-with-DIB-sections.patch + patch_apply wined3d-CSMT_Main/0038-wined3d-Don-t-call-the-public-map-function-in-surfac.patch + patch_apply wined3d-CSMT_Main/0039-wined3d-Don-t-call-the-public-map-function-in-surfac.patch + patch_apply wined3d-CSMT_Main/0040-wined3d-Move-the-framebuffer-into-wined3d_state.patch + patch_apply wined3d-CSMT_Main/0041-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch + patch_apply wined3d-CSMT_Main/0042-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch + patch_apply wined3d-CSMT_Main/0043-wined3d-Hackily-introduce-a-multithreaded-command-st.patch + patch_apply wined3d-CSMT_Main/0044-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch + patch_apply wined3d-CSMT_Main/0045-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch + patch_apply wined3d-CSMT_Main/0046-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch + patch_apply wined3d-CSMT_Main/0047-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch + patch_apply wined3d-CSMT_Main/0048-wined3d-Pass-the-state-to-draw_primitive.patch + patch_apply wined3d-CSMT_Main/0049-wined3d-Wait-for-the-cs-before-destroying-objects.patch + patch_apply wined3d-CSMT_Main/0050-wined3d-Give-the-cs-its-own-state.patch + patch_apply wined3d-CSMT_Main/0051-wined3d-Send-float-constant-updates-through-the-comm.patch + patch_apply wined3d-CSMT_Main/0052-wined3d-Request-a-glFinish-before-modifying-resource.patch + patch_apply wined3d-CSMT_Main/0053-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch + patch_apply wined3d-CSMT_Main/0054-wined3d-Don-t-call-glFinish-after-clears.patch + patch_apply wined3d-CSMT_Main/0055-wined3d-Don-t-call-glFinish-after-draws.patch + patch_apply wined3d-CSMT_Main/0056-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch + patch_apply wined3d-CSMT_Main/0057-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch + patch_apply wined3d-CSMT_Main/0058-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch + patch_apply wined3d-CSMT_Main/0059-wined3d-Don-t-store-viewport-pointers-in-the-command.patch + patch_apply wined3d-CSMT_Main/0060-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch + patch_apply wined3d-CSMT_Main/0061-wined3d-Send-base-vertex-index-updates-through-the-c.patch + patch_apply wined3d-CSMT_Main/0062-wined3d-Send-primitive-type-updates-through-the-comm.patch + patch_apply wined3d-CSMT_Main/0063-wined3d-Send-bool-constant-updates-through-the-comma.patch + patch_apply wined3d-CSMT_Main/0064-wined3d-Send-int-constant-updates-through-the-comman.patch + patch_apply wined3d-CSMT_Main/0065-wined3d-Send-light-updates-through-the-command-strea.patch + patch_apply wined3d-CSMT_Main/0066-wined3d-Prevent-the-command-stream-from-running-ahea.patch + patch_apply wined3d-CSMT_Main/0067-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch + patch_apply wined3d-CSMT_Main/0068-wined3d-Run-the-cs-asynchronously.patch + patch_apply wined3d-CSMT_Main/0069-wined3d-Send-blits-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0070-wined3d-Put-update_surface-checks-back-in-place.patch + patch_apply wined3d-CSMT_Main/0071-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch + patch_apply wined3d-CSMT_Main/0072-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch + patch_apply wined3d-CSMT_Main/0073-wined3d-Send-render-target-view-clears-through-the-c.patch + patch_apply wined3d-CSMT_Main/0074-wined3d-Wait-for-the-CS-in-GetDC.patch + patch_apply wined3d-CSMT_Main/0075-wined3d-send-resource-maps-through-the-command-strea.patch + patch_apply wined3d-CSMT_Main/0076-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch + patch_apply wined3d-CSMT_Main/0077-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch + patch_apply wined3d-CSMT_Main/0078-wined3d-Don-t-preload-buffers-on-unmap.patch + patch_apply wined3d-CSMT_Main/0079-wined3d-Don-t-call-glFinish-before-swapping.patch + patch_apply wined3d-CSMT_Main/0080-wined3d-wined3d_-_query_issue-never-fails.patch + patch_apply wined3d-CSMT_Main/0081-wined3d-Add-query-support-to-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0082-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch + patch_apply wined3d-CSMT_Main/0083-wined3d-Poll-queries-automatically-in-the-CS.patch + patch_apply wined3d-CSMT_Main/0084-wined3d-Introduce-a-separate-queue-for-priority-comm.patch + patch_apply wined3d-CSMT_Main/0085-wined3d-Destroy-queries-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0086-wined3d-Separate-main-and-worker-thread-query-state.patch + patch_apply wined3d-CSMT_Main/0087-wined3d-Don-t-poll-queries-that-failed-to-start.patch + patch_apply wined3d-CSMT_Main/0088-wined3d-Remove-restated-queries-from-the-poll-list.patch + patch_apply wined3d-CSMT_Main/0089-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch + patch_apply wined3d-CSMT_Main/0090-wined3d-Put-this-into-the-query-poll-patch.patch + patch_apply wined3d-CSMT_Main/0091-wined3d-Send-update_surface-commands-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0092-wined3d-Send-texture-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0093-wined3d-Send-surface-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0094-wined3d-Send-update_texture-calls-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0095-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch + patch_apply wined3d-CSMT_Main/0096-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch + patch_apply wined3d-CSMT_Main/0097-wined3d-Handle-evit_managed_resources-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0098-wined3d-Introduce-resource-fencing.patch + patch_apply wined3d-CSMT_Main/0099-wined3d-Fence-update_texture-and-update_surface-call.patch + patch_apply wined3d-CSMT_Main/0100-wined3d-Dirtify-resources-on-unmap.patch + patch_apply wined3d-CSMT_Main/0101-wined3d-Fence-texture-reads-in-draws.patch + patch_apply wined3d-CSMT_Main/0102-wined3d-Fence-render-targets-and-depth-stencils.patch + patch_apply wined3d-CSMT_Main/0103-wined3d-Fence-blit-operations.patch + patch_apply wined3d-CSMT_Main/0104-wined3d-Fence-color_fill-operations.patch + patch_apply wined3d-CSMT_Main/0105-wined3d-Fence-clear-calls.patch + patch_apply wined3d-CSMT_Main/0106-wined3d-Fence-present-calls.patch + patch_apply wined3d-CSMT_Main/0107-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch + patch_apply wined3d-CSMT_Main/0108-wined3d-Dirtify-changed-textures-through-the-command.patch + patch_apply wined3d-CSMT_Main/0109-wined3d-Wrap-GL-BOs-in-a-structure.patch + patch_apply wined3d-CSMT_Main/0110-wined3d-Separate-resource-map-and-draw-buffers.patch + patch_apply wined3d-CSMT_Main/0111-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch + patch_apply wined3d-CSMT_Main/0112-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch + patch_apply wined3d-CSMT_Main/0113-wined3d-Unset-some-objects-in-state_init_default.patch + patch_apply wined3d-CSMT_Main/0114-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch + patch_apply wined3d-CSMT_Main/0115-wined3d-Use-double-buffered-buffers-for-multithreade.patch + patch_apply wined3d-CSMT_Main/0116-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0117-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch + patch_apply wined3d-CSMT_Main/0118-wined3d-Accelerate-DISCARD-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0119-wined3d-Accelerate-READONLY-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0120-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0121-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch + patch_apply wined3d-CSMT_Main/0122-wined3d-Send-buffer-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0123-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch + patch_apply wined3d-CSMT_Main/0124-wined3d-Separate-GL-buffer-discard-control-from-igno.patch + patch_apply wined3d-CSMT_Main/0125-wined3d-Create-buffers-before-mapping-them.patch + patch_apply wined3d-CSMT_Main/0126-wined3d-Destroy-views-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0127-wined3d-Remove-another-glFinish.patch + patch_apply wined3d-CSMT_Main/0128-wined3d-Destroy-vertex-declarations-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0129-wined3d-Destroy-shaders-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0130-wined3d-Create-VBOs-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0131-wined3d-Clean-up-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0132-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0133-wined3d-Clean-up-volume-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0134-wined3d-Clean-up-surfaces-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0135-wined3d-Clean-up-texture-resources-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0136-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch + patch_apply wined3d-CSMT_Main/0137-wined3d-Unload-resources-through-the-CS-in-device_re.patch + patch_apply wined3d-CSMT_Main/0138-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch + patch_apply wined3d-CSMT_Main/0139-wined3d-Remove-software-cursor-support.patch + patch_apply wined3d-CSMT_Main/0140-wined3d-Create-dummy-textures-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0141-wined3d-Create-the-initial-context-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0142-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch + patch_apply wined3d-CSMT_Main/0143-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch + patch_apply wined3d-CSMT_Main/0144-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch + patch_apply wined3d-CSMT_Main/0145-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch + patch_apply wined3d-CSMT_Main/0146-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch + patch_apply wined3d-CSMT_Main/0147-wined3d-Use-an-event-to-block-the-worker-thread-when.patch + patch_apply wined3d-CSMT_Main/0148-wined3d-Fence-preload-operations.patch + patch_apply wined3d-CSMT_Main/0149-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0150-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0151-wined3d-Completely-reset-the-state-on-reset.patch + patch_apply wined3d-CSMT_Main/0152-wined3d-Send-getdc-and-releasedc-through-the-command.patch + patch_apply wined3d-CSMT_Main/0153-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch + patch_apply wined3d-CSMT_Main/0154-wined3d-Wait-only-for-the-buffer-to-be-idle.patch + patch_apply wined3d-CSMT_Main/0155-wined3d-Add-a-comment-about-worker-thread-lag.patch + patch_apply wined3d-CSMT_Main/0156-wined3d-Remove-the-texture-destroy-glFinish.patch + patch_apply wined3d-CSMT_Main/0157-wined3d-Move-FBO-destruction-into-the-worker-thread.patch + patch_apply wined3d-CSMT_Main/0158-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch + patch_apply wined3d-CSMT_Main/0159-Winex11-complain-about-glfinish.patch + patch_apply wined3d-CSMT_Main/0160-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch + patch_apply wined3d-CSMT_Main/0161-wined3d-Remove-the-device_reset-CS-sync-fixme.patch + patch_apply wined3d-CSMT_Main/0162-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch + patch_apply wined3d-CSMT_Main/0163-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch + patch_apply wined3d-CSMT_Main/0164-wined3d-Don-t-sync-on-redundant-discard-calls.patch + patch_apply wined3d-CSMT_Main/0165-wined3d-Don-t-discard-new-buffers.patch + patch_apply wined3d-CSMT_Main/0166-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch + patch_apply wined3d-CSMT_Main/0167-wined3d-Render-target-lock-hack.patch + patch_apply wined3d-CSMT_Main/0168-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch + patch_apply wined3d-CSMT_Main/0169-wined3d-Only-discard-buffers-that-are-in-use.patch + patch_apply wined3d-CSMT_Main/0170-wined3d-Destroy-samplers-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0171-wined3d-Hack-to-reject-unsupported-color-fills.patch + patch_apply wined3d-CSMT_Main/0172-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch + patch_apply wined3d-CSMT_Main/0173-wined3d-Send-update_sub_resource-calls-through-the-c.patch patch_apply wined3d-CSMT_Main/9998-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch patch_apply wined3d-CSMT_Main/9999-IfDefined.patch ( echo '+ { "Stefan Dösinger", "wined3d: Merge get_pitch functions.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Pass a context to read_from_framebuffer.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_drawable and surface_blt_to_drawable.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_blt_fbo.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_multisample_resolve.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_texture.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_location.", 1 },'; diff --git a/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch b/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch deleted file mode 100644 index fc249921..00000000 --- a/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch +++ /dev/null @@ -1,81 +0,0 @@ -From fb2ae897035c342f2d78590928eaa62f8bb2b47e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:16:40 +0100 -Subject: wined3d: Pass a context to read_from_framebuffer. - -In the average case the function will not be able to reuse it, because -it requires a specific context to access the WGL framebuffer. It will -restore the original context afterwards to hide the context change from -load_location / preload callers. This is related to bug 34574. ---- - dlls/wined3d/surface.c | 29 +++++++++++++++++++++++++---- - 1 file changed, 25 insertions(+), 4 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 534a152..534d4bd 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -2935,11 +2935,13 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) - return WINED3D_OK; - } - --static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_location) -+static void read_from_framebuffer(struct wined3d_surface *surface, -+ struct wined3d_context *old_ctx, DWORD dst_location) - { - struct wined3d_device *device = surface->resource.device; - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; -+ struct wined3d_surface *restore_rt; - BYTE *mem; - BYTE *row, *top, *bottom; - int i; -@@ -2948,7 +2950,21 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc - - surface_get_memory(surface, &data, dst_location); - -- context = context_acquire(device, surface); -+ /* Context_release does not restore the original context in case of -+ * nested context_acquire calls. Only read_from_framebuffer and -+ * surface_blt_to_drawable use nested context_acquire calls. Manually -+ * restore the original context at the end of the function if needed. */ -+ if (old_ctx->current_rt == surface) -+ { -+ restore_rt = NULL; -+ context = old_ctx; -+ } -+ else -+ { -+ restore_rt = old_ctx->current_rt; -+ context = context_acquire(device, surface); -+ } -+ - context_apply_blit_state(context, device); - gl_info = context->gl_info; - -@@ -3036,7 +3052,12 @@ error: - checkGLcall("glBindBuffer"); - } - -- context_release(context); -+ if (restore_rt) -+ { -+ context_release(context); -+ context = context_acquire(device, restore_rt); -+ context_release(context); -+ } - } - - /* Read the framebuffer contents into a texture. Note that this function -@@ -4191,7 +4212,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - - if (surface->locations & WINED3D_LOCATION_DRAWABLE) - { -- read_from_framebuffer(surface, dst_location); -+ read_from_framebuffer(surface, context, dst_location); - return; - } - --- -2.2.1 - diff --git a/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch b/patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-surface_multisample_resolv.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch rename to patches/wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-surface_multisample_resolv.patch diff --git a/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch b/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch deleted file mode 100644 index 6660e02c..00000000 --- a/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 0f7f57e440a198c31920c7077a6c7b0661945039 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:34:26 +0100 -Subject: wined3d: Pass a context to surface_load_drawable and - surface_blt_to_drawable. - ---- - dlls/wined3d/surface.c | 41 +++++++++++++++++++++++++++++++++++------ - 1 file changed, 35 insertions(+), 6 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 9351ab2..1b3def9 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -3536,19 +3536,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW - rect->bottom = drawable_height - rect->bottom; - } - -+/* Context activation is done by the caller. */ - static void surface_blt_to_drawable(const struct wined3d_device *device, -+ struct wined3d_context *old_ctx, - enum wined3d_texture_filter_type filter, BOOL alpha_test, - struct wined3d_surface *src_surface, const RECT *src_rect_in, - struct wined3d_surface *dst_surface, const RECT *dst_rect_in) - { - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; -+ struct wined3d_surface *restore_rt; - RECT src_rect, dst_rect; - - src_rect = *src_rect_in; - dst_rect = *dst_rect_in; - -- context = context_acquire(device, dst_surface); -+ /* Context_release does not restore the original context in case of -+ * nested context_acquire calls. Only read_from_framebuffer and -+ * surface_blt_to_drawable use nested context_acquire calls. Manually -+ * restore the original context at the end of the function if needed. */ -+ if (old_ctx->current_rt == dst_surface) -+ { -+ restore_rt = NULL; -+ context = old_ctx; -+ } -+ else -+ { -+ restore_rt = old_ctx->current_rt; -+ context = context_acquire(device, dst_surface); -+ } - gl_info = context->gl_info; - - /* Make sure the surface is up-to-date. This should probably use -@@ -3601,7 +3617,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - -- context_release(context); -+ if (restore_rt) -+ { -+ context_release(context); -+ context = context_acquire(device, restore_rt); -+ context_release(context); -+ } - } - - HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -4101,8 +4122,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface, - surface, wined3d_debug_location(surface->locations)); - } - -+/* Context activation is done by the caller. */ - static HRESULT surface_load_drawable(struct wined3d_surface *surface, -- const struct wined3d_gl_info *gl_info) -+ struct wined3d_context *context) - { - RECT r; - -@@ -4115,7 +4137,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, - - surface_get_rect(surface, NULL, &r); - surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); -- surface_blt_to_drawable(surface->resource.device, -+ surface_blt_to_drawable(surface->resource.device, context, - WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); - - return WINED3D_OK; -@@ -4373,7 +4395,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) - break; - - case WINED3D_LOCATION_DRAWABLE: -- if (FAILED(hr = surface_load_drawable(surface, gl_info))) -+ context = context_acquire(device, NULL); -+ hr = surface_load_drawable(surface, context); -+ context_release(context); -+ if (FAILED(hr)) - return hr; - break; - -@@ -4547,6 +4572,8 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, - struct wined3d_surface *dst_surface, const RECT *dst_rect, - const struct wined3d_color_key *color_key) - { -+ struct wined3d_context *context; -+ - /* Blit from offscreen surface to render target */ - struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; - DWORD old_color_key_flags = src_surface->container->async.color_key_flags; -@@ -4555,8 +4582,10 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, - - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); - -- surface_blt_to_drawable(device, filter, -+ context = context_acquire(device, dst_surface); -+ surface_blt_to_drawable(device, context, filter, - !!color_key, src_surface, src_rect, dst_surface, dst_rect); -+ context_release(context); - - /* Restore the color key parameters */ - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, --- -2.5.1 - diff --git a/patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch b/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_texture.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch rename to patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_texture.patch diff --git a/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch b/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch deleted file mode 100644 index 22128141..00000000 --- a/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 0d11e8c92575dae298bcf9b830ef155689823c04 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sun, 17 Nov 2013 19:49:38 +0100 -Subject: wined3d: Pass a context to surface_blt_fbo. - ---- - dlls/wined3d/surface.c | 53 +++++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 42 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index f4b9071..8ca5bda 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -860,13 +860,15 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device, - } - - /* Blit between surface locations. Onscreen on different swapchains is not supported. -- * Depth / stencil is not supported. */ --static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_texture_filter_type filter, -+ * Depth / stencil is not supported. Context activation is done by the caller. */ -+static void surface_blt_fbo(const struct wined3d_device *device, -+ struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter, - struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in, - struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in) - { - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; -+ struct wined3d_surface *required_rt, *restore_rt; - RECT src_rect, dst_rect; - GLenum gl_filter; - GLenum buffer; -@@ -909,9 +911,20 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te - if (!surface_is_full_rect(dst_surface, &dst_rect)) - surface_load_location(dst_surface, dst_location); - -- if (src_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, src_surface); -- else if (dst_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, dst_surface); -- else context = context_acquire(device, NULL); -+ if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; -+ else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; -+ else required_rt = NULL; -+ -+ if (required_rt && required_rt != old_ctx->current_rt) -+ { -+ restore_rt = old_ctx->current_rt; -+ context = context_acquire(device, required_rt); -+ } -+ else -+ { -+ restore_rt = NULL; -+ context = old_ctx; -+ } - - if (!context->valid) - { -@@ -974,7 +987,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) - gl_info->gl_ops.gl.p_glFlush(); - -- context_release(context); -+ if (restore_rt) -+ { -+ context_release(context); -+ context = context_acquire(device, restore_rt); -+ context_release(context); -+ } - } - - static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, -@@ -4294,13 +4312,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) - { -+ context = context_acquire(device, NULL); -+ - if (srgb) -- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, -+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, - &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); - else -- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, -+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, - &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); - -+ context_release(context); -+ - return WINED3D_OK; - } - -@@ -4315,8 +4337,10 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - -- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, src_location, -+ context = context_acquire(device, NULL); -+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, - &rect, surface, dst_location, &rect); -+ context_release(context); - - return WINED3D_OK; - } -@@ -4447,14 +4471,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, - - static void surface_multisample_resolve(struct wined3d_surface *surface) - { -+ struct wined3d_context *context; - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - - if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) - ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", - surface); - -- surface_blt_fbo(surface->resource.device, WINED3D_TEXF_POINT, -+ context = context_acquire(surface->resource.device, NULL); -+ surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, - surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); -+ context_release(context); - } - - HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) -@@ -5629,11 +5656,15 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC - &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, - &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) - { -+ struct wined3d_context *context; - TRACE("Using FBO blit.\n"); - -- surface_blt_fbo(device, filter, -+ context = context_acquire(device, NULL); -+ surface_blt_fbo(device, context, filter, - src_surface, src_surface->container->resource.draw_binding, &src_rect, - dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); -+ context_release(context); -+ - surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); - --- -2.2.1 - diff --git a/patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch b/patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_load_location.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch rename to patches/wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_load_location.patch diff --git a/patches/wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch b/patches/wined3d-CSMT_Main/0005-wined3d-Make-surface_load_location-return-nothing.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch rename to patches/wined3d-CSMT_Main/0005-wined3d-Make-surface_load_location-return-nothing.patch diff --git a/patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch b/patches/wined3d-CSMT_Main/0006-wined3d-Store-volume-locations-in-the-resource.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch rename to patches/wined3d-CSMT_Main/0006-wined3d-Store-volume-locations-in-the-resource.patch diff --git a/patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch b/patches/wined3d-CSMT_Main/0007-wined3d-Move-validate_location-to-resource.c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch rename to patches/wined3d-CSMT_Main/0007-wined3d-Move-validate_location-to-resource.c.patch diff --git a/patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch b/patches/wined3d-CSMT_Main/0008-wined3d-Move-surface-locations-into-the-resource.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch rename to patches/wined3d-CSMT_Main/0008-wined3d-Move-surface-locations-into-the-resource.patch diff --git a/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch b/patches/wined3d-CSMT_Main/0009-wined3d-Remove-surface_validate_location.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch rename to patches/wined3d-CSMT_Main/0009-wined3d-Remove-surface_validate_location.patch diff --git a/patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch b/patches/wined3d-CSMT_Main/0010-wined3d-Move-invalidate_location-to-resource.c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch rename to patches/wined3d-CSMT_Main/0010-wined3d-Move-invalidate_location-to-resource.c.patch diff --git a/patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch b/patches/wined3d-CSMT_Main/0011-wined3d-Invalidate-containers-via-callback.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch rename to patches/wined3d-CSMT_Main/0011-wined3d-Invalidate-containers-via-callback.patch diff --git a/patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch b/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_invalidate_location.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch rename to patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_invalidate_location.patch diff --git a/patches/wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch b/patches/wined3d-CSMT_Main/0013-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch rename to patches/wined3d-CSMT_Main/0013-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch diff --git a/patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch b/patches/wined3d-CSMT_Main/0014-wined3d-Move-load_location-into-the-resource.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch rename to patches/wined3d-CSMT_Main/0014-wined3d-Move-load_location-into-the-resource.patch diff --git a/patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch b/patches/wined3d-CSMT_Main/0015-wined3d-Replace-surface_load_location-with-resource_.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch rename to patches/wined3d-CSMT_Main/0015-wined3d-Replace-surface_load_location-with-resource_.patch diff --git a/patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch b/patches/wined3d-CSMT_Main/0016-wined3d-Introduce-helper-functions-for-mapping-volum.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch rename to patches/wined3d-CSMT_Main/0016-wined3d-Introduce-helper-functions-for-mapping-volum.patch diff --git a/patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch b/patches/wined3d-CSMT_Main/0017-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch rename to patches/wined3d-CSMT_Main/0017-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch diff --git a/patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch b/patches/wined3d-CSMT_Main/0018-wined3d-Remove-surface-pbo.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch rename to patches/wined3d-CSMT_Main/0018-wined3d-Remove-surface-pbo.patch diff --git a/patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch b/patches/wined3d-CSMT_Main/0019-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch rename to patches/wined3d-CSMT_Main/0019-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch diff --git a/patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch b/patches/wined3d-CSMT_Main/0020-wined3d-Move-buffer-creation-into-the-resource.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch rename to patches/wined3d-CSMT_Main/0020-wined3d-Move-buffer-creation-into-the-resource.patch diff --git a/patches/wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch b/patches/wined3d-CSMT_Main/0021-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch rename to patches/wined3d-CSMT_Main/0021-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch diff --git a/patches/wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch b/patches/wined3d-CSMT_Main/0022-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch rename to patches/wined3d-CSMT_Main/0022-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch diff --git a/patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch b/patches/wined3d-CSMT_Main/0023-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch rename to patches/wined3d-CSMT_Main/0023-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch diff --git a/patches/wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch b/patches/wined3d-CSMT_Main/0024-wined3d-Discard-implicit-surfaces-on-unload.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch rename to patches/wined3d-CSMT_Main/0024-wined3d-Discard-implicit-surfaces-on-unload.patch diff --git a/patches/wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch b/patches/wined3d-CSMT_Main/0025-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch rename to patches/wined3d-CSMT_Main/0025-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch diff --git a/patches/wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch b/patches/wined3d-CSMT_Main/0026-wined3d-Discard-the-backbuffer-in-discard-presents.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch rename to patches/wined3d-CSMT_Main/0026-wined3d-Discard-the-backbuffer-in-discard-presents.patch diff --git a/patches/wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch b/patches/wined3d-CSMT_Main/0027-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch rename to patches/wined3d-CSMT_Main/0027-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch diff --git a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch b/patches/wined3d-CSMT_Main/0028-wined3d-Introduce-a-function-to-retrieve-resource-me.patch similarity index 89% rename from patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch rename to patches/wined3d-CSMT_Main/0028-wined3d-Introduce-a-function-to-retrieve-resource-me.patch index 33e9afb9..d31a2d36 100644 --- a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch +++ b/patches/wined3d-CSMT_Main/0028-wined3d-Introduce-a-function-to-retrieve-resource-me.patch @@ -1,4 +1,4 @@ -From 42dbd273c1097c5dcd5fb13e94ee7950551db75d Mon Sep 17 00:00:00 2001 +From 4fbfd7b2bbc5f5dd3b99653d223214901597cbad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 16 Sep 2013 22:44:33 +0200 Subject: wined3d: Introduce a function to retrieve resource memory. @@ -51,7 +51,7 @@ index b756bf1..40267e7 100644 void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4fe3d72..1f51116 100644 +index 2abc494..857c620 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -479,39 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -94,7 +94,7 @@ index 4fe3d72..1f51116 100644 static void surface_prepare_buffer(struct wined3d_surface *surface) { struct wined3d_context *context; -@@ -1274,7 +1241,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -1265,7 +1232,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct return; } @@ -103,7 +103,7 @@ index 4fe3d72..1f51116 100644 if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1643,7 +1610,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1641,7 +1608,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); @@ -112,16 +112,16 @@ index 4fe3d72..1f51116 100644 wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -2713,7 +2680,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, +@@ -2831,7 +2798,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, struct wined3d_bo_address data; DWORD slice_pitch, pitch; - surface_get_memory(surface, &data, dst_location); + wined3d_resource_get_memory(&surface->resource, dst_location, &data); - /* Context_release does not restore the original context in case of - * nested context_acquire calls. Only read_from_framebuffer and -@@ -3868,8 +3835,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD + if (surface != old_ctx->current_rt) + { +@@ -3881,8 +3848,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD struct wined3d_bo_address dst, src; UINT size = surface->resource.size; @@ -132,7 +132,7 @@ index 4fe3d72..1f51116 100644 if (dst.buffer_object) { -@@ -4081,7 +4048,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4094,7 +4061,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -142,10 +142,10 @@ index 4fe3d72..1f51116 100644 { /* This code is entered for texture formats which need a fixup. */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f3ab20f..ab938f0 100644 +index 49d9674..dec7787 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2200,6 +2200,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE +@@ -2211,6 +2211,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; @@ -155,5 +155,5 @@ index f3ab20f..ab938f0 100644 UINT *slice_pitch) DECLSPEC_HIDDEN; GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; -- -2.5.1 +2.6.1 diff --git a/patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch b/patches/wined3d-CSMT_Main/0029-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch rename to patches/wined3d-CSMT_Main/0029-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch diff --git a/patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch b/patches/wined3d-CSMT_Main/0030-wined3d-Move-check_block_align-to-resource.c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch rename to patches/wined3d-CSMT_Main/0030-wined3d-Move-check_block_align-to-resource.c.patch diff --git a/patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch b/patches/wined3d-CSMT_Main/0031-wined3d-Replace-surface-alloc-functions-with-resourc.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch rename to patches/wined3d-CSMT_Main/0031-wined3d-Replace-surface-alloc-functions-with-resourc.patch diff --git a/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch b/patches/wined3d-CSMT_Main/0032-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch rename to patches/wined3d-CSMT_Main/0032-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch diff --git a/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch b/patches/wined3d-CSMT_Main/0033-wined3d-Use-resource-facilities-to-destroy-PBOs.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch rename to patches/wined3d-CSMT_Main/0033-wined3d-Use-resource-facilities-to-destroy-PBOs.patch diff --git a/patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch b/patches/wined3d-CSMT_Main/0034-wined3d-Move-simple-location-copying-to-the-resource.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch rename to patches/wined3d-CSMT_Main/0034-wined3d-Move-simple-location-copying-to-the-resource.patch diff --git a/patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch b/patches/wined3d-CSMT_Main/0035-wined3d-Move-most-of-volume_map-to-resource.c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch rename to patches/wined3d-CSMT_Main/0035-wined3d-Move-most-of-volume_map-to-resource.c.patch diff --git a/patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch b/patches/wined3d-CSMT_Main/0036-wined3d-Use-resource_map-for-surface_map.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch rename to patches/wined3d-CSMT_Main/0036-wined3d-Use-resource_map-for-surface_map.patch diff --git a/patches/wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch b/patches/wined3d-CSMT_Main/0037-wined3d-Use-client-storage-with-DIB-sections.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch rename to patches/wined3d-CSMT_Main/0037-wined3d-Use-client-storage-with-DIB-sections.patch diff --git a/patches/wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch b/patches/wined3d-CSMT_Main/0038-wined3d-Don-t-call-the-public-map-function-in-surfac.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch rename to patches/wined3d-CSMT_Main/0038-wined3d-Don-t-call-the-public-map-function-in-surfac.patch diff --git a/patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch b/patches/wined3d-CSMT_Main/0039-wined3d-Don-t-call-the-public-map-function-in-surfac.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch rename to patches/wined3d-CSMT_Main/0039-wined3d-Don-t-call-the-public-map-function-in-surfac.patch diff --git a/patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch b/patches/wined3d-CSMT_Main/0040-wined3d-Move-the-framebuffer-into-wined3d_state.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch rename to patches/wined3d-CSMT_Main/0040-wined3d-Move-the-framebuffer-into-wined3d_state.patch diff --git a/patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch b/patches/wined3d-CSMT_Main/0041-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch rename to patches/wined3d-CSMT_Main/0041-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch diff --git a/patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch b/patches/wined3d-CSMT_Main/0042-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch rename to patches/wined3d-CSMT_Main/0042-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch diff --git a/patches/wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch b/patches/wined3d-CSMT_Main/0043-wined3d-Hackily-introduce-a-multithreaded-command-st.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch rename to patches/wined3d-CSMT_Main/0043-wined3d-Hackily-introduce-a-multithreaded-command-st.patch diff --git a/patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch b/patches/wined3d-CSMT_Main/0044-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch rename to patches/wined3d-CSMT_Main/0044-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch diff --git a/patches/wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch b/patches/wined3d-CSMT_Main/0045-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch rename to patches/wined3d-CSMT_Main/0045-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch diff --git a/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch b/patches/wined3d-CSMT_Main/0046-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch rename to patches/wined3d-CSMT_Main/0046-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch diff --git a/patches/wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch b/patches/wined3d-CSMT_Main/0047-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch rename to patches/wined3d-CSMT_Main/0047-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch diff --git a/patches/wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch b/patches/wined3d-CSMT_Main/0048-wined3d-Pass-the-state-to-draw_primitive.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch rename to patches/wined3d-CSMT_Main/0048-wined3d-Pass-the-state-to-draw_primitive.patch diff --git a/patches/wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch b/patches/wined3d-CSMT_Main/0049-wined3d-Wait-for-the-cs-before-destroying-objects.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch rename to patches/wined3d-CSMT_Main/0049-wined3d-Wait-for-the-cs-before-destroying-objects.patch diff --git a/patches/wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch b/patches/wined3d-CSMT_Main/0050-wined3d-Give-the-cs-its-own-state.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch rename to patches/wined3d-CSMT_Main/0050-wined3d-Give-the-cs-its-own-state.patch diff --git a/patches/wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch b/patches/wined3d-CSMT_Main/0051-wined3d-Send-float-constant-updates-through-the-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch rename to patches/wined3d-CSMT_Main/0051-wined3d-Send-float-constant-updates-through-the-comm.patch diff --git a/patches/wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch b/patches/wined3d-CSMT_Main/0052-wined3d-Request-a-glFinish-before-modifying-resource.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch rename to patches/wined3d-CSMT_Main/0052-wined3d-Request-a-glFinish-before-modifying-resource.patch diff --git a/patches/wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch b/patches/wined3d-CSMT_Main/0053-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch rename to patches/wined3d-CSMT_Main/0053-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch diff --git a/patches/wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch b/patches/wined3d-CSMT_Main/0054-wined3d-Don-t-call-glFinish-after-clears.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch rename to patches/wined3d-CSMT_Main/0054-wined3d-Don-t-call-glFinish-after-clears.patch diff --git a/patches/wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch b/patches/wined3d-CSMT_Main/0055-wined3d-Don-t-call-glFinish-after-draws.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch rename to patches/wined3d-CSMT_Main/0055-wined3d-Don-t-call-glFinish-after-draws.patch diff --git a/patches/wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch b/patches/wined3d-CSMT_Main/0056-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch rename to patches/wined3d-CSMT_Main/0056-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch diff --git a/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch b/patches/wined3d-CSMT_Main/0057-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch rename to patches/wined3d-CSMT_Main/0057-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch diff --git a/patches/wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch b/patches/wined3d-CSMT_Main/0058-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch rename to patches/wined3d-CSMT_Main/0058-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch diff --git a/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch b/patches/wined3d-CSMT_Main/0059-wined3d-Don-t-store-viewport-pointers-in-the-command.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch rename to patches/wined3d-CSMT_Main/0059-wined3d-Don-t-store-viewport-pointers-in-the-command.patch diff --git a/patches/wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch b/patches/wined3d-CSMT_Main/0060-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch rename to patches/wined3d-CSMT_Main/0060-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch diff --git a/patches/wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch b/patches/wined3d-CSMT_Main/0061-wined3d-Send-base-vertex-index-updates-through-the-c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch rename to patches/wined3d-CSMT_Main/0061-wined3d-Send-base-vertex-index-updates-through-the-c.patch diff --git a/patches/wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch b/patches/wined3d-CSMT_Main/0062-wined3d-Send-primitive-type-updates-through-the-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch rename to patches/wined3d-CSMT_Main/0062-wined3d-Send-primitive-type-updates-through-the-comm.patch diff --git a/patches/wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch b/patches/wined3d-CSMT_Main/0063-wined3d-Send-bool-constant-updates-through-the-comma.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch rename to patches/wined3d-CSMT_Main/0063-wined3d-Send-bool-constant-updates-through-the-comma.patch diff --git a/patches/wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch b/patches/wined3d-CSMT_Main/0064-wined3d-Send-int-constant-updates-through-the-comman.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch rename to patches/wined3d-CSMT_Main/0064-wined3d-Send-int-constant-updates-through-the-comman.patch diff --git a/patches/wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch b/patches/wined3d-CSMT_Main/0065-wined3d-Send-light-updates-through-the-command-strea.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch rename to patches/wined3d-CSMT_Main/0065-wined3d-Send-light-updates-through-the-command-strea.patch diff --git a/patches/wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch b/patches/wined3d-CSMT_Main/0066-wined3d-Prevent-the-command-stream-from-running-ahea.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch rename to patches/wined3d-CSMT_Main/0066-wined3d-Prevent-the-command-stream-from-running-ahea.patch diff --git a/patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch b/patches/wined3d-CSMT_Main/0067-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch rename to patches/wined3d-CSMT_Main/0067-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch diff --git a/patches/wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch b/patches/wined3d-CSMT_Main/0068-wined3d-Run-the-cs-asynchronously.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch rename to patches/wined3d-CSMT_Main/0068-wined3d-Run-the-cs-asynchronously.patch diff --git a/patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0069-wined3d-Send-blits-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0069-wined3d-Send-blits-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch b/patches/wined3d-CSMT_Main/0070-wined3d-Put-update_surface-checks-back-in-place.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch rename to patches/wined3d-CSMT_Main/0070-wined3d-Put-update_surface-checks-back-in-place.patch diff --git a/patches/wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch b/patches/wined3d-CSMT_Main/0071-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch rename to patches/wined3d-CSMT_Main/0071-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch diff --git a/patches/wined3d-CSMT_Main/0075-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch b/patches/wined3d-CSMT_Main/0072-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0075-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch rename to patches/wined3d-CSMT_Main/0072-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch diff --git a/patches/wined3d-CSMT_Main/0076-wined3d-Send-render-target-view-clears-through-the-c.patch b/patches/wined3d-CSMT_Main/0073-wined3d-Send-render-target-view-clears-through-the-c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0076-wined3d-Send-render-target-view-clears-through-the-c.patch rename to patches/wined3d-CSMT_Main/0073-wined3d-Send-render-target-view-clears-through-the-c.patch diff --git a/patches/wined3d-CSMT_Main/0077-wined3d-Wait-for-the-CS-in-GetDC.patch b/patches/wined3d-CSMT_Main/0074-wined3d-Wait-for-the-CS-in-GetDC.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0077-wined3d-Wait-for-the-CS-in-GetDC.patch rename to patches/wined3d-CSMT_Main/0074-wined3d-Wait-for-the-CS-in-GetDC.patch diff --git a/patches/wined3d-CSMT_Main/0078-wined3d-send-resource-maps-through-the-command-strea.patch b/patches/wined3d-CSMT_Main/0075-wined3d-send-resource-maps-through-the-command-strea.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0078-wined3d-send-resource-maps-through-the-command-strea.patch rename to patches/wined3d-CSMT_Main/0075-wined3d-send-resource-maps-through-the-command-strea.patch diff --git a/patches/wined3d-CSMT_Main/0079-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch b/patches/wined3d-CSMT_Main/0076-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0079-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch rename to patches/wined3d-CSMT_Main/0076-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch diff --git a/patches/wined3d-CSMT_Main/0080-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch b/patches/wined3d-CSMT_Main/0077-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0080-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch rename to patches/wined3d-CSMT_Main/0077-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch diff --git a/patches/wined3d-CSMT_Main/0081-wined3d-Don-t-preload-buffers-on-unmap.patch b/patches/wined3d-CSMT_Main/0078-wined3d-Don-t-preload-buffers-on-unmap.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0081-wined3d-Don-t-preload-buffers-on-unmap.patch rename to patches/wined3d-CSMT_Main/0078-wined3d-Don-t-preload-buffers-on-unmap.patch diff --git a/patches/wined3d-CSMT_Main/0082-wined3d-Don-t-call-glFinish-before-swapping.patch b/patches/wined3d-CSMT_Main/0079-wined3d-Don-t-call-glFinish-before-swapping.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0082-wined3d-Don-t-call-glFinish-before-swapping.patch rename to patches/wined3d-CSMT_Main/0079-wined3d-Don-t-call-glFinish-before-swapping.patch diff --git a/patches/wined3d-CSMT_Main/0083-wined3d-wined3d_-_query_issue-never-fails.patch b/patches/wined3d-CSMT_Main/0080-wined3d-wined3d_-_query_issue-never-fails.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0083-wined3d-wined3d_-_query_issue-never-fails.patch rename to patches/wined3d-CSMT_Main/0080-wined3d-wined3d_-_query_issue-never-fails.patch diff --git a/patches/wined3d-CSMT_Main/0084-wined3d-Add-query-support-to-the-command-stream.patch b/patches/wined3d-CSMT_Main/0081-wined3d-Add-query-support-to-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0084-wined3d-Add-query-support-to-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0081-wined3d-Add-query-support-to-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0085-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch b/patches/wined3d-CSMT_Main/0082-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0085-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch rename to patches/wined3d-CSMT_Main/0082-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch diff --git a/patches/wined3d-CSMT_Main/0086-wined3d-Poll-queries-automatically-in-the-CS.patch b/patches/wined3d-CSMT_Main/0083-wined3d-Poll-queries-automatically-in-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0086-wined3d-Poll-queries-automatically-in-the-CS.patch rename to patches/wined3d-CSMT_Main/0083-wined3d-Poll-queries-automatically-in-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0087-wined3d-Introduce-a-separate-queue-for-priority-comm.patch b/patches/wined3d-CSMT_Main/0084-wined3d-Introduce-a-separate-queue-for-priority-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0087-wined3d-Introduce-a-separate-queue-for-priority-comm.patch rename to patches/wined3d-CSMT_Main/0084-wined3d-Introduce-a-separate-queue-for-priority-comm.patch diff --git a/patches/wined3d-CSMT_Main/0088-wined3d-Destroy-queries-through-the-CS.patch b/patches/wined3d-CSMT_Main/0085-wined3d-Destroy-queries-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0088-wined3d-Destroy-queries-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0085-wined3d-Destroy-queries-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0089-wined3d-Separate-main-and-worker-thread-query-state.patch b/patches/wined3d-CSMT_Main/0086-wined3d-Separate-main-and-worker-thread-query-state.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0089-wined3d-Separate-main-and-worker-thread-query-state.patch rename to patches/wined3d-CSMT_Main/0086-wined3d-Separate-main-and-worker-thread-query-state.patch diff --git a/patches/wined3d-CSMT_Main/0090-wined3d-Don-t-poll-queries-that-failed-to-start.patch b/patches/wined3d-CSMT_Main/0087-wined3d-Don-t-poll-queries-that-failed-to-start.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0090-wined3d-Don-t-poll-queries-that-failed-to-start.patch rename to patches/wined3d-CSMT_Main/0087-wined3d-Don-t-poll-queries-that-failed-to-start.patch diff --git a/patches/wined3d-CSMT_Main/0091-wined3d-Remove-restated-queries-from-the-poll-list.patch b/patches/wined3d-CSMT_Main/0088-wined3d-Remove-restated-queries-from-the-poll-list.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0091-wined3d-Remove-restated-queries-from-the-poll-list.patch rename to patches/wined3d-CSMT_Main/0088-wined3d-Remove-restated-queries-from-the-poll-list.patch diff --git a/patches/wined3d-CSMT_Main/0092-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch b/patches/wined3d-CSMT_Main/0089-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0092-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch rename to patches/wined3d-CSMT_Main/0089-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch diff --git a/patches/wined3d-CSMT_Main/0093-wined3d-Put-this-into-the-query-poll-patch.patch b/patches/wined3d-CSMT_Main/0090-wined3d-Put-this-into-the-query-poll-patch.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0093-wined3d-Put-this-into-the-query-poll-patch.patch rename to patches/wined3d-CSMT_Main/0090-wined3d-Put-this-into-the-query-poll-patch.patch diff --git a/patches/wined3d-CSMT_Main/0094-wined3d-Send-update_surface-commands-through-the-CS.patch b/patches/wined3d-CSMT_Main/0091-wined3d-Send-update_surface-commands-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0094-wined3d-Send-update_surface-commands-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0091-wined3d-Send-update_surface-commands-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0095-wined3d-Send-texture-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0092-wined3d-Send-texture-preloads-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0095-wined3d-Send-texture-preloads-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0092-wined3d-Send-texture-preloads-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0096-wined3d-Send-surface-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0093-wined3d-Send-surface-preloads-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0096-wined3d-Send-surface-preloads-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0093-wined3d-Send-surface-preloads-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0097-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0094-wined3d-Send-update_texture-calls-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0097-wined3d-Send-update_texture-calls-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0094-wined3d-Send-update_texture-calls-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0098-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch b/patches/wined3d-CSMT_Main/0095-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0098-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch rename to patches/wined3d-CSMT_Main/0095-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0099-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch b/patches/wined3d-CSMT_Main/0096-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0099-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch rename to patches/wined3d-CSMT_Main/0096-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch diff --git a/patches/wined3d-CSMT_Main/0100-wined3d-Handle-evit_managed_resources-through-the-CS.patch b/patches/wined3d-CSMT_Main/0097-wined3d-Handle-evit_managed_resources-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0100-wined3d-Handle-evit_managed_resources-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0097-wined3d-Handle-evit_managed_resources-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0101-wined3d-Introduce-resource-fencing.patch b/patches/wined3d-CSMT_Main/0098-wined3d-Introduce-resource-fencing.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0101-wined3d-Introduce-resource-fencing.patch rename to patches/wined3d-CSMT_Main/0098-wined3d-Introduce-resource-fencing.patch diff --git a/patches/wined3d-CSMT_Main/0102-wined3d-Fence-update_texture-and-update_surface-call.patch b/patches/wined3d-CSMT_Main/0099-wined3d-Fence-update_texture-and-update_surface-call.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0102-wined3d-Fence-update_texture-and-update_surface-call.patch rename to patches/wined3d-CSMT_Main/0099-wined3d-Fence-update_texture-and-update_surface-call.patch diff --git a/patches/wined3d-CSMT_Main/0103-wined3d-Dirtify-resources-on-unmap.patch b/patches/wined3d-CSMT_Main/0100-wined3d-Dirtify-resources-on-unmap.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0103-wined3d-Dirtify-resources-on-unmap.patch rename to patches/wined3d-CSMT_Main/0100-wined3d-Dirtify-resources-on-unmap.patch diff --git a/patches/wined3d-CSMT_Main/0104-wined3d-Fence-texture-reads-in-draws.patch b/patches/wined3d-CSMT_Main/0101-wined3d-Fence-texture-reads-in-draws.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0104-wined3d-Fence-texture-reads-in-draws.patch rename to patches/wined3d-CSMT_Main/0101-wined3d-Fence-texture-reads-in-draws.patch diff --git a/patches/wined3d-CSMT_Main/0105-wined3d-Fence-render-targets-and-depth-stencils.patch b/patches/wined3d-CSMT_Main/0102-wined3d-Fence-render-targets-and-depth-stencils.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0105-wined3d-Fence-render-targets-and-depth-stencils.patch rename to patches/wined3d-CSMT_Main/0102-wined3d-Fence-render-targets-and-depth-stencils.patch diff --git a/patches/wined3d-CSMT_Main/0106-wined3d-Fence-blit-operations.patch b/patches/wined3d-CSMT_Main/0103-wined3d-Fence-blit-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0106-wined3d-Fence-blit-operations.patch rename to patches/wined3d-CSMT_Main/0103-wined3d-Fence-blit-operations.patch diff --git a/patches/wined3d-CSMT_Main/0107-wined3d-Fence-color_fill-operations.patch b/patches/wined3d-CSMT_Main/0104-wined3d-Fence-color_fill-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0107-wined3d-Fence-color_fill-operations.patch rename to patches/wined3d-CSMT_Main/0104-wined3d-Fence-color_fill-operations.patch diff --git a/patches/wined3d-CSMT_Main/0108-wined3d-Fence-clear-calls.patch b/patches/wined3d-CSMT_Main/0105-wined3d-Fence-clear-calls.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0108-wined3d-Fence-clear-calls.patch rename to patches/wined3d-CSMT_Main/0105-wined3d-Fence-clear-calls.patch diff --git a/patches/wined3d-CSMT_Main/0109-wined3d-Fence-present-calls.patch b/patches/wined3d-CSMT_Main/0106-wined3d-Fence-present-calls.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0109-wined3d-Fence-present-calls.patch rename to patches/wined3d-CSMT_Main/0106-wined3d-Fence-present-calls.patch diff --git a/patches/wined3d-CSMT_Main/0110-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch b/patches/wined3d-CSMT_Main/0107-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0110-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch rename to patches/wined3d-CSMT_Main/0107-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch diff --git a/patches/wined3d-CSMT_Main/0111-wined3d-Dirtify-changed-textures-through-the-command.patch b/patches/wined3d-CSMT_Main/0108-wined3d-Dirtify-changed-textures-through-the-command.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0111-wined3d-Dirtify-changed-textures-through-the-command.patch rename to patches/wined3d-CSMT_Main/0108-wined3d-Dirtify-changed-textures-through-the-command.patch diff --git a/patches/wined3d-CSMT_Main/0112-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0109-wined3d-Wrap-GL-BOs-in-a-structure.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0112-wined3d-Wrap-GL-BOs-in-a-structure.patch rename to patches/wined3d-CSMT_Main/0109-wined3d-Wrap-GL-BOs-in-a-structure.patch diff --git a/patches/wined3d-CSMT_Main/0113-wined3d-Separate-resource-map-and-draw-buffers.patch b/patches/wined3d-CSMT_Main/0110-wined3d-Separate-resource-map-and-draw-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0113-wined3d-Separate-resource-map-and-draw-buffers.patch rename to patches/wined3d-CSMT_Main/0110-wined3d-Separate-resource-map-and-draw-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0114-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch b/patches/wined3d-CSMT_Main/0111-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0114-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch rename to patches/wined3d-CSMT_Main/0111-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0115-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch b/patches/wined3d-CSMT_Main/0112-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0115-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch rename to patches/wined3d-CSMT_Main/0112-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch diff --git a/patches/wined3d-CSMT_Main/0116-wined3d-Unset-some-objects-in-state_init_default.patch b/patches/wined3d-CSMT_Main/0113-wined3d-Unset-some-objects-in-state_init_default.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0116-wined3d-Unset-some-objects-in-state_init_default.patch rename to patches/wined3d-CSMT_Main/0113-wined3d-Unset-some-objects-in-state_init_default.patch diff --git a/patches/wined3d-CSMT_Main/0117-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch b/patches/wined3d-CSMT_Main/0114-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0117-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch rename to patches/wined3d-CSMT_Main/0114-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch diff --git a/patches/wined3d-CSMT_Main/0118-wined3d-Use-double-buffered-buffers-for-multithreade.patch b/patches/wined3d-CSMT_Main/0115-wined3d-Use-double-buffered-buffers-for-multithreade.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0118-wined3d-Use-double-buffered-buffers-for-multithreade.patch rename to patches/wined3d-CSMT_Main/0115-wined3d-Use-double-buffered-buffers-for-multithreade.patch diff --git a/patches/wined3d-CSMT_Main/0119-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch b/patches/wined3d-CSMT_Main/0116-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0119-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0116-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0120-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch b/patches/wined3d-CSMT_Main/0117-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0120-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch rename to patches/wined3d-CSMT_Main/0117-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch diff --git a/patches/wined3d-CSMT_Main/0121-wined3d-Accelerate-DISCARD-buffer-maps.patch b/patches/wined3d-CSMT_Main/0118-wined3d-Accelerate-DISCARD-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0121-wined3d-Accelerate-DISCARD-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0118-wined3d-Accelerate-DISCARD-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0122-wined3d-Accelerate-READONLY-buffer-maps.patch b/patches/wined3d-CSMT_Main/0119-wined3d-Accelerate-READONLY-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0122-wined3d-Accelerate-READONLY-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0119-wined3d-Accelerate-READONLY-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0123-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch b/patches/wined3d-CSMT_Main/0120-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0123-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0120-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0124-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch b/patches/wined3d-CSMT_Main/0121-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0124-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch rename to patches/wined3d-CSMT_Main/0121-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0125-wined3d-Send-buffer-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0122-wined3d-Send-buffer-preloads-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0125-wined3d-Send-buffer-preloads-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0122-wined3d-Send-buffer-preloads-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0126-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch b/patches/wined3d-CSMT_Main/0123-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0126-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch rename to patches/wined3d-CSMT_Main/0123-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch diff --git a/patches/wined3d-CSMT_Main/0127-wined3d-Separate-GL-buffer-discard-control-from-igno.patch b/patches/wined3d-CSMT_Main/0124-wined3d-Separate-GL-buffer-discard-control-from-igno.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0127-wined3d-Separate-GL-buffer-discard-control-from-igno.patch rename to patches/wined3d-CSMT_Main/0124-wined3d-Separate-GL-buffer-discard-control-from-igno.patch diff --git a/patches/wined3d-CSMT_Main/0128-wined3d-Create-buffers-before-mapping-them.patch b/patches/wined3d-CSMT_Main/0125-wined3d-Create-buffers-before-mapping-them.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0128-wined3d-Create-buffers-before-mapping-them.patch rename to patches/wined3d-CSMT_Main/0125-wined3d-Create-buffers-before-mapping-them.patch diff --git a/patches/wined3d-CSMT_Main/0129-wined3d-Destroy-views-through-the-CS.patch b/patches/wined3d-CSMT_Main/0126-wined3d-Destroy-views-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0129-wined3d-Destroy-views-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0126-wined3d-Destroy-views-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0130-wined3d-Remove-another-glFinish.patch b/patches/wined3d-CSMT_Main/0127-wined3d-Remove-another-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0130-wined3d-Remove-another-glFinish.patch rename to patches/wined3d-CSMT_Main/0127-wined3d-Remove-another-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0131-wined3d-Destroy-vertex-declarations-through-the-CS.patch b/patches/wined3d-CSMT_Main/0128-wined3d-Destroy-vertex-declarations-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0131-wined3d-Destroy-vertex-declarations-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0128-wined3d-Destroy-vertex-declarations-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0132-wined3d-Destroy-shaders-through-the-CS.patch b/patches/wined3d-CSMT_Main/0129-wined3d-Destroy-shaders-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0132-wined3d-Destroy-shaders-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0129-wined3d-Destroy-shaders-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0133-wined3d-Create-VBOs-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0130-wined3d-Create-VBOs-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0133-wined3d-Create-VBOs-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0130-wined3d-Create-VBOs-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0134-wined3d-Clean-up-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0131-wined3d-Clean-up-resource-data-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0134-wined3d-Clean-up-resource-data-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0131-wined3d-Clean-up-resource-data-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0135-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0132-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0135-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0132-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0136-wined3d-Clean-up-volume-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0133-wined3d-Clean-up-volume-resource-data-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0136-wined3d-Clean-up-volume-resource-data-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0133-wined3d-Clean-up-volume-resource-data-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-surfaces-through-the-cs.patch b/patches/wined3d-CSMT_Main/0134-wined3d-Clean-up-surfaces-through-the-cs.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-surfaces-through-the-cs.patch rename to patches/wined3d-CSMT_Main/0134-wined3d-Clean-up-surfaces-through-the-cs.patch diff --git a/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-texture-resources-through-the-cs.patch b/patches/wined3d-CSMT_Main/0135-wined3d-Clean-up-texture-resources-through-the-cs.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-texture-resources-through-the-cs.patch rename to patches/wined3d-CSMT_Main/0135-wined3d-Clean-up-texture-resources-through-the-cs.patch diff --git a/patches/wined3d-CSMT_Main/0139-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch b/patches/wined3d-CSMT_Main/0136-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0139-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch rename to patches/wined3d-CSMT_Main/0136-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch diff --git a/patches/wined3d-CSMT_Main/0140-wined3d-Unload-resources-through-the-CS-in-device_re.patch b/patches/wined3d-CSMT_Main/0137-wined3d-Unload-resources-through-the-CS-in-device_re.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0140-wined3d-Unload-resources-through-the-CS-in-device_re.patch rename to patches/wined3d-CSMT_Main/0137-wined3d-Unload-resources-through-the-CS-in-device_re.patch diff --git a/patches/wined3d-CSMT_Main/0141-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch b/patches/wined3d-CSMT_Main/0138-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0141-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch rename to patches/wined3d-CSMT_Main/0138-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch diff --git a/patches/wined3d-CSMT_Main/0142-wined3d-Remove-software-cursor-support.patch b/patches/wined3d-CSMT_Main/0139-wined3d-Remove-software-cursor-support.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0142-wined3d-Remove-software-cursor-support.patch rename to patches/wined3d-CSMT_Main/0139-wined3d-Remove-software-cursor-support.patch diff --git a/patches/wined3d-CSMT_Main/0143-wined3d-Create-dummy-textures-through-the-CS.patch b/patches/wined3d-CSMT_Main/0140-wined3d-Create-dummy-textures-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0143-wined3d-Create-dummy-textures-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0140-wined3d-Create-dummy-textures-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0144-wined3d-Create-the-initial-context-through-the-CS.patch b/patches/wined3d-CSMT_Main/0141-wined3d-Create-the-initial-context-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0144-wined3d-Create-the-initial-context-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0141-wined3d-Create-the-initial-context-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0145-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch b/patches/wined3d-CSMT_Main/0142-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0145-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch rename to patches/wined3d-CSMT_Main/0142-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch diff --git a/patches/wined3d-CSMT_Main/0146-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch b/patches/wined3d-CSMT_Main/0143-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0146-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch rename to patches/wined3d-CSMT_Main/0143-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch diff --git a/patches/wined3d-CSMT_Main/0147-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch b/patches/wined3d-CSMT_Main/0144-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0147-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch rename to patches/wined3d-CSMT_Main/0144-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch diff --git a/patches/wined3d-CSMT_Main/0148-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch b/patches/wined3d-CSMT_Main/0145-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0148-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch rename to patches/wined3d-CSMT_Main/0145-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch diff --git a/patches/wined3d-CSMT_Main/0149-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch b/patches/wined3d-CSMT_Main/0146-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0149-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch rename to patches/wined3d-CSMT_Main/0146-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch diff --git a/patches/wined3d-CSMT_Main/0150-wined3d-Use-an-event-to-block-the-worker-thread-when.patch b/patches/wined3d-CSMT_Main/0147-wined3d-Use-an-event-to-block-the-worker-thread-when.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0150-wined3d-Use-an-event-to-block-the-worker-thread-when.patch rename to patches/wined3d-CSMT_Main/0147-wined3d-Use-an-event-to-block-the-worker-thread-when.patch diff --git a/patches/wined3d-CSMT_Main/0151-wined3d-Fence-preload-operations.patch b/patches/wined3d-CSMT_Main/0148-wined3d-Fence-preload-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0151-wined3d-Fence-preload-operations.patch rename to patches/wined3d-CSMT_Main/0148-wined3d-Fence-preload-operations.patch diff --git a/patches/wined3d-CSMT_Main/0152-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch b/patches/wined3d-CSMT_Main/0149-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0152-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch rename to patches/wined3d-CSMT_Main/0149-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch diff --git a/patches/wined3d-CSMT_Main/0153-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch b/patches/wined3d-CSMT_Main/0150-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0153-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch rename to patches/wined3d-CSMT_Main/0150-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch diff --git a/patches/wined3d-CSMT_Main/0154-wined3d-Completely-reset-the-state-on-reset.patch b/patches/wined3d-CSMT_Main/0151-wined3d-Completely-reset-the-state-on-reset.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0154-wined3d-Completely-reset-the-state-on-reset.patch rename to patches/wined3d-CSMT_Main/0151-wined3d-Completely-reset-the-state-on-reset.patch diff --git a/patches/wined3d-CSMT_Main/0155-wined3d-Send-getdc-and-releasedc-through-the-command.patch b/patches/wined3d-CSMT_Main/0152-wined3d-Send-getdc-and-releasedc-through-the-command.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0155-wined3d-Send-getdc-and-releasedc-through-the-command.patch rename to patches/wined3d-CSMT_Main/0152-wined3d-Send-getdc-and-releasedc-through-the-command.patch diff --git a/patches/wined3d-CSMT_Main/0156-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch b/patches/wined3d-CSMT_Main/0153-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0156-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch rename to patches/wined3d-CSMT_Main/0153-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch diff --git a/patches/wined3d-CSMT_Main/0157-wined3d-Wait-only-for-the-buffer-to-be-idle.patch b/patches/wined3d-CSMT_Main/0154-wined3d-Wait-only-for-the-buffer-to-be-idle.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0157-wined3d-Wait-only-for-the-buffer-to-be-idle.patch rename to patches/wined3d-CSMT_Main/0154-wined3d-Wait-only-for-the-buffer-to-be-idle.patch diff --git a/patches/wined3d-CSMT_Main/0158-wined3d-Add-a-comment-about-worker-thread-lag.patch b/patches/wined3d-CSMT_Main/0155-wined3d-Add-a-comment-about-worker-thread-lag.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0158-wined3d-Add-a-comment-about-worker-thread-lag.patch rename to patches/wined3d-CSMT_Main/0155-wined3d-Add-a-comment-about-worker-thread-lag.patch diff --git a/patches/wined3d-CSMT_Main/0159-wined3d-Remove-the-texture-destroy-glFinish.patch b/patches/wined3d-CSMT_Main/0156-wined3d-Remove-the-texture-destroy-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0159-wined3d-Remove-the-texture-destroy-glFinish.patch rename to patches/wined3d-CSMT_Main/0156-wined3d-Remove-the-texture-destroy-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0160-wined3d-Move-FBO-destruction-into-the-worker-thread.patch b/patches/wined3d-CSMT_Main/0157-wined3d-Move-FBO-destruction-into-the-worker-thread.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0160-wined3d-Move-FBO-destruction-into-the-worker-thread.patch rename to patches/wined3d-CSMT_Main/0157-wined3d-Move-FBO-destruction-into-the-worker-thread.patch diff --git a/patches/wined3d-CSMT_Main/0161-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch b/patches/wined3d-CSMT_Main/0158-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0161-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch rename to patches/wined3d-CSMT_Main/0158-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch diff --git a/patches/wined3d-CSMT_Main/0162-Winex11-complain-about-glfinish.patch b/patches/wined3d-CSMT_Main/0159-Winex11-complain-about-glfinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0162-Winex11-complain-about-glfinish.patch rename to patches/wined3d-CSMT_Main/0159-Winex11-complain-about-glfinish.patch diff --git a/patches/wined3d-CSMT_Main/0163-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch b/patches/wined3d-CSMT_Main/0160-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0163-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch rename to patches/wined3d-CSMT_Main/0160-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch diff --git a/patches/wined3d-CSMT_Main/0164-wined3d-Remove-the-device_reset-CS-sync-fixme.patch b/patches/wined3d-CSMT_Main/0161-wined3d-Remove-the-device_reset-CS-sync-fixme.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0164-wined3d-Remove-the-device_reset-CS-sync-fixme.patch rename to patches/wined3d-CSMT_Main/0161-wined3d-Remove-the-device_reset-CS-sync-fixme.patch diff --git a/patches/wined3d-CSMT_Main/0165-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch b/patches/wined3d-CSMT_Main/0162-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0165-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch rename to patches/wined3d-CSMT_Main/0162-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch diff --git a/patches/wined3d-CSMT_Main/0166-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch b/patches/wined3d-CSMT_Main/0163-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0166-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch rename to patches/wined3d-CSMT_Main/0163-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch diff --git a/patches/wined3d-CSMT_Main/0167-wined3d-Don-t-sync-on-redundant-discard-calls.patch b/patches/wined3d-CSMT_Main/0164-wined3d-Don-t-sync-on-redundant-discard-calls.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0167-wined3d-Don-t-sync-on-redundant-discard-calls.patch rename to patches/wined3d-CSMT_Main/0164-wined3d-Don-t-sync-on-redundant-discard-calls.patch diff --git a/patches/wined3d-CSMT_Main/0168-wined3d-Don-t-discard-new-buffers.patch b/patches/wined3d-CSMT_Main/0165-wined3d-Don-t-discard-new-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0168-wined3d-Don-t-discard-new-buffers.patch rename to patches/wined3d-CSMT_Main/0165-wined3d-Don-t-discard-new-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0169-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch b/patches/wined3d-CSMT_Main/0166-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0169-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch rename to patches/wined3d-CSMT_Main/0166-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch diff --git a/patches/wined3d-CSMT_Main/0170-wined3d-Render-target-lock-hack.patch b/patches/wined3d-CSMT_Main/0167-wined3d-Render-target-lock-hack.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0170-wined3d-Render-target-lock-hack.patch rename to patches/wined3d-CSMT_Main/0167-wined3d-Render-target-lock-hack.patch diff --git a/patches/wined3d-CSMT_Main/0171-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch b/patches/wined3d-CSMT_Main/0168-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0171-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch rename to patches/wined3d-CSMT_Main/0168-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch diff --git a/patches/wined3d-CSMT_Main/0172-wined3d-Only-discard-buffers-that-are-in-use.patch b/patches/wined3d-CSMT_Main/0169-wined3d-Only-discard-buffers-that-are-in-use.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0172-wined3d-Only-discard-buffers-that-are-in-use.patch rename to patches/wined3d-CSMT_Main/0169-wined3d-Only-discard-buffers-that-are-in-use.patch diff --git a/patches/wined3d-CSMT_Main/0173-wined3d-Destroy-samplers-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0170-wined3d-Destroy-samplers-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0173-wined3d-Destroy-samplers-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0170-wined3d-Destroy-samplers-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0174-wined3d-Hack-to-reject-unsupported-color-fills.patch b/patches/wined3d-CSMT_Main/0171-wined3d-Hack-to-reject-unsupported-color-fills.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0174-wined3d-Hack-to-reject-unsupported-color-fills.patch rename to patches/wined3d-CSMT_Main/0171-wined3d-Hack-to-reject-unsupported-color-fills.patch diff --git a/patches/wined3d-CSMT_Main/0175-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch b/patches/wined3d-CSMT_Main/0172-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0175-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch rename to patches/wined3d-CSMT_Main/0172-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch diff --git a/patches/wined3d-CSMT_Main/0176-wined3d-Send-update_sub_resource-calls-through-the-c.patch b/patches/wined3d-CSMT_Main/0173-wined3d-Send-update_sub_resource-calls-through-the-c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0176-wined3d-Send-update_sub_resource-calls-through-the-c.patch rename to patches/wined3d-CSMT_Main/0173-wined3d-Send-update_sub_resource-calls-through-the-c.patch diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 2fd8986b..00b2e44a 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -1293,7 +1293,7 @@ diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -1451,6 +1451,7 @@ +@@ -1465,6 +1465,7 @@ goto out; } @@ -1301,7 +1301,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c ret->current_fb.render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret->current_fb.render_targets) * gl_info->limits.buffers); ret->current_fb.rt_size = gl_info->limits.buffers; -@@ -1459,6 +1460,7 @@ +@@ -1473,6 +1474,7 @@ if (device->context_count) ret->offscreenBuffer = device->contexts[0]->offscreenBuffer; @@ -1309,7 +1309,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) { -@@ -1767,7 +1769,9 @@ +@@ -1781,7 +1783,9 @@ out: device->shader_backend->shader_free_context_data(ret); device->adapter->fragment_pipe->free_context_data(ret); @@ -1319,7 +1319,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); -@@ -1802,7 +1806,9 @@ +@@ -1816,7 +1820,9 @@ device->shader_backend->shader_free_context_data(context); device->adapter->fragment_pipe->free_context_data(context); @@ -1329,7 +1329,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); -@@ -2210,7 +2216,11 @@ +@@ -2224,7 +2230,11 @@ return TRUE; } @@ -1341,7 +1341,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c static void context_validate_onscreen_formats(struct wined3d_context *context, const struct wined3d_rendertarget_view *depth_stencil) { -@@ -2226,6 +2236,7 @@ +@@ -2240,6 +2250,7 @@ WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ @@ -1349,7 +1349,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c wined3d_resource_load_location(&context->current_rt->resource, context, WINED3D_LOCATION_TEXTURE_RGB); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); -@@ -2240,6 +2251,22 @@ +@@ -2254,6 +2265,22 @@ return context_generate_rt_mask_from_surface(rt); else return context_generate_rt_mask(context->offscreenBuffer); @@ -1372,7 +1372,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } /* Context activation is done by the caller. */ -@@ -2271,7 +2298,11 @@ +@@ -2285,7 +2312,11 @@ } else { @@ -1384,7 +1384,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; -@@ -2318,7 +2349,11 @@ +@@ -2332,7 +2363,11 @@ DWORD rt_mask = 0, *cur_mask; UINT i; @@ -1396,7 +1396,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c || rt_count != context->gl_info->limits.buffers) { if (!context_validate_rt_config(rt_count, rts, dsv)) -@@ -2360,11 +2395,17 @@ +@@ -2374,11 +2409,17 @@ } else { @@ -1414,7 +1414,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))) -@@ -2377,7 +2418,11 @@ +@@ -2391,7 +2432,11 @@ } else { @@ -1426,7 +1426,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); } -@@ -2412,6 +2457,7 @@ +@@ -2426,6 +2471,7 @@ return TRUE; } @@ -1434,7 +1434,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state) { struct wined3d_rendertarget_view **rts = state->fb.render_targets; -@@ -2421,6 +2467,18 @@ +@@ -2435,6 +2481,18 @@ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); @@ -1453,7 +1453,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c else if (!context->render_offscreen) return context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); -@@ -2443,8 +2501,14 @@ +@@ -2457,8 +2515,14 @@ /* Context activation is done by the caller. */ void context_state_fb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1468,7 +1468,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c DWORD *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) -@@ -2475,8 +2539,10 @@ +@@ -2489,8 +2553,10 @@ context_apply_draw_buffers(context, rt_mask); *cur_mask = rt_mask; } @@ -1479,7 +1479,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } static void context_map_stage(struct wined3d_context *context, DWORD stage, DWORD unit) -@@ -2714,12 +2780,22 @@ +@@ -2728,12 +2794,22 @@ /* Context activation is done by the caller. */ void context_state_drawbuf(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -1502,7 +1502,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c if (rt_mask != *cur_mask) { context_apply_draw_buffers(context, rt_mask); -@@ -2921,7 +2997,11 @@ +@@ -2935,7 +3011,11 @@ { if (state->vertex_declaration->half_float_conv_needed && !stream_info->all_vbo) { @@ -1514,7 +1514,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c context->use_immediate_mode_draw = TRUE; } else -@@ -3096,11 +3176,19 @@ +@@ -3110,11 +3190,19 @@ } /* Context activation is done by the caller. */ @@ -1534,7 +1534,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c unsigned int i; WORD map; -@@ -3133,12 +3221,17 @@ +@@ -3147,12 +3235,17 @@ for (i = 0, map = context->stream_info.use_map; map; map >>= 1, ++i) { if (map & 1) @@ -1552,7 +1552,7 @@ diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c } if (state->index_buffer) { -@@ -3233,7 +3326,11 @@ +@@ -3247,7 +3340,11 @@ if (texture->texture_srgb.name) wined3d_texture_load(texture, context, TRUE); wined3d_texture_load(texture, context, FALSE); @@ -1860,7 +1860,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN; void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, -@@ -2013,7 +2072,11 @@ +@@ -2014,7 +2073,11 @@ struct wined3d_state { DWORD flags; @@ -1872,7 +1872,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]; -@@ -2058,6 +2121,7 @@ +@@ -2059,6 +2122,7 @@ DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -1880,7 +1880,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_gl_bo { GLuint name; -@@ -2066,6 +2130,7 @@ +@@ -2067,6 +2131,7 @@ UINT size; }; @@ -1888,7 +1888,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 -@@ -2121,11 +2186,23 @@ +@@ -2122,11 +2187,23 @@ struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -1912,7 +1912,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; -@@ -2136,6 +2213,9 @@ +@@ -2137,6 +2214,9 @@ UINT xScreenSpace; UINT yScreenSpace; UINT cursorWidth, cursorHeight; @@ -1922,7 +1922,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HCURSOR hardwareCursor; /* The Wine logo texture */ -@@ -2167,6 +2247,7 @@ +@@ -2168,6 +2248,7 @@ UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1930,7 +1930,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, -@@ -2178,6 +2259,11 @@ +@@ -2179,6 +2260,11 @@ void device_create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -1942,7 +1942,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) { -@@ -2194,9 +2280,11 @@ +@@ -2195,9 +2281,11 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); @@ -1954,7 +1954,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_resource -@@ -2221,6 +2309,7 @@ +@@ -2222,6 +2310,7 @@ UINT depth; UINT size; DWORD priority; @@ -1962,7 +1962,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *heap_memory, *map_heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; struct wined3d_gl_bo *buffer, *map_buffer; -@@ -2228,6 +2317,10 @@ +@@ -2229,6 +2318,10 @@ DWORD locations; LONG access_fence; BOOL unmap_dirtify; @@ -1973,7 +1973,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *parent; const struct wined3d_parent_ops *parent_ops; -@@ -2252,6 +2345,7 @@ +@@ -2253,6 +2346,7 @@ void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN; void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -1981,7 +1981,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_changed(struct wined3d_resource *resource, -@@ -2300,6 +2394,15 @@ +@@ -2301,6 +2395,15 @@ { while(InterlockedCompareExchange(&resource->access_fence, 0, 0)); } @@ -1997,7 +1997,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16 -@@ -2387,7 +2490,9 @@ +@@ -2388,7 +2491,9 @@ void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; @@ -2007,7 +2007,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, -@@ -2421,9 +2526,16 @@ +@@ -2422,9 +2527,16 @@ struct wined3d_resource resource; struct wined3d_texture *container; @@ -2024,7 +2024,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource) -@@ -2431,6 +2543,7 @@ +@@ -2432,6 +2544,7 @@ return CONTAINING_RECORD(resource, struct wined3d_volume, resource); } @@ -2032,7 +2032,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; -@@ -2446,6 +2559,27 @@ +@@ -2447,6 +2560,27 @@ struct wined3d_surface_dib { HBITMAP DIBsection; @@ -2060,7 +2060,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT bitmap_size; }; -@@ -2471,7 +2605,11 @@ +@@ -2472,7 +2606,11 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); @@ -2072,7 +2072,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_surface -@@ -2479,12 +2617,26 @@ +@@ -2480,12 +2618,26 @@ struct wined3d_resource resource; const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; @@ -2099,7 +2099,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; GLenum texture_target; -@@ -2528,10 +2680,19 @@ +@@ -2529,10 +2681,19 @@ GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN; void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; @@ -2119,7 +2119,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; -@@ -2543,6 +2704,7 @@ +@@ -2544,6 +2705,7 @@ const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN; HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; @@ -2127,7 +2127,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -@@ -2557,6 +2719,17 @@ +@@ -2558,6 +2720,17 @@ void wined3d_surface_cleanup_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_getdc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_surface_releasedc_cs(struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -2145,7 +2145,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; -@@ -2579,8 +2752,10 @@ +@@ -2580,8 +2753,10 @@ GLuint name; }; @@ -2156,7 +2156,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; -@@ -2609,8 +2784,10 @@ +@@ -2610,8 +2785,10 @@ BOOL half_float_conv_needed; }; @@ -2167,7 +2167,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2678,6 +2855,7 @@ +@@ -2679,6 +2856,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2175,7 +2175,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2728,6 +2906,32 @@ +@@ -2729,6 +2907,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2208,7 +2208,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2777,6 +2981,7 @@ +@@ -2778,6 +2982,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2216,7 +2216,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2840,6 +3045,7 @@ +@@ -2841,6 +3046,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int depth_pitch) DECLSPEC_HIDDEN; @@ -2224,7 +2224,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2854,8 +3060,12 @@ +@@ -2855,8 +3061,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2237,7 +2237,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2869,12 +3079,16 @@ +@@ -2870,12 +3080,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2254,7 +2254,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 */ -@@ -2901,7 +3115,9 @@ +@@ -2902,7 +3116,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2264,7 +2264,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2926,11 +3142,15 @@ +@@ -2927,11 +3143,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2280,7 +2280,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2969,8 +3189,10 @@ +@@ -2970,8 +3190,10 @@ return surface_from_resource(resource); } @@ -2291,7 +2291,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2983,8 +3205,12 @@ +@@ -2984,8 +3206,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2304,7 +2304,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -3023,8 +3249,10 @@ +@@ -3024,8 +3250,10 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2315,7 +2315,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3228,7 +3456,9 @@ +@@ -3229,7 +3457,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -6880,32 +6880,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info = context->gl_info; context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location); -@@ -712,6 +964,7 @@ - context_release(context); - } - -+#if defined(STAGING_CSMT) - /* Blit between surface locations. Onscreen on different swapchains is not supported. - * Depth / stencil is not supported. Context activation is done by the caller. */ - static void surface_blt_fbo(const struct wined3d_device *device, -@@ -722,6 +975,16 @@ - const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; - struct wined3d_surface *required_rt, *restore_rt; -+#else /* STAGING_CSMT */ -+/* Blit between surface locations. Onscreen on different swapchains is not supported. -+ * Depth / stencil is not supported. */ -+static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_texture_filter_type filter, -+ struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in, -+ struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in) -+{ -+ const struct wined3d_gl_info *gl_info; -+ struct wined3d_context *context; -+#endif /* STAGING_CSMT */ - RECT src_rect, dst_rect; - GLenum gl_filter; - GLenum buffer; -@@ -760,6 +1023,7 @@ +@@ -760,9 +1012,15 @@ * surface isn't required if the entire surface is overwritten. (And is * in fact harmful if we're being called by surface_load_location() with * the purpose of loading the destination surface.) */ @@ -6913,40 +6888,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&src_surface->resource, old_ctx, src_location); if (!surface_is_full_rect(dst_surface, &dst_rect)) wined3d_resource_load_location(&dst_surface->resource, old_ctx, dst_location); -@@ -778,6 +1042,15 @@ - restore_rt = NULL; - context = old_ctx; - } +#else /* STAGING_CSMT */ + surface_load_location(src_surface, src_location); + if (!surface_is_full_rect(dst_surface, &dst_rect)) + surface_load_location(dst_surface, dst_location); -+ -+ if (src_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, src_surface); -+ else if (dst_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, dst_surface); -+ else context = context_acquire(device, NULL); +#endif /* STAGING_CSMT */ - if (!context->valid) - { -@@ -840,12 +1113,16 @@ - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) - gl_info->gl_ops.gl.p_glFlush(); - -+#if defined(STAGING_CSMT) - if (restore_rt) - { - context_release(context); - context = context_acquire(device, restore_rt); - context_release(context); - } -+#else /* STAGING_CSMT */ -+ context_release(context); -+#endif /* STAGING_CSMT */ - } - - static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, -@@ -968,6 +1245,18 @@ + if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; + else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; +@@ -959,6 +1217,18 @@ return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); } @@ -6965,7 +6915,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static ULONG surface_resource_incref(struct wined3d_resource *resource) { return wined3d_surface_incref(surface_from_resource(resource)); -@@ -988,6 +1277,7 @@ +@@ -979,6 +1249,7 @@ TRACE("surface %p.\n", surface); @@ -6973,7 +6923,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(device, NULL); gl_info = context->gl_info; -@@ -999,6 +1289,23 @@ +@@ -990,6 +1261,23 @@ * opengl resources, so we cannot leave early. */ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DISCARDED); wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DISCARDED); @@ -6997,7 +6947,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* We also get here when the ddraw swapchain is destroyed, for example * for a mode switch. In this case this surface won't necessarily be -@@ -1008,10 +1315,24 @@ +@@ -999,10 +1287,24 @@ } else { @@ -7022,7 +6972,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Destroy fbo render buffers. This is needed for implicit render targets, for * all application-created targets the application has to release the surface -@@ -1042,6 +1363,7 @@ +@@ -1033,6 +1335,7 @@ resource_unload(resource); } @@ -7030,7 +6980,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); -@@ -1057,6 +1379,19 @@ +@@ -1048,6 +1351,19 @@ { surface_private_setup, surface_frontbuffer_updated, @@ -7050,7 +7000,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /***************************************************************************** -@@ -1100,6 +1435,7 @@ +@@ -1091,6 +1407,7 @@ return WINED3D_OK; } @@ -7058,7 +7008,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static void gdi_surface_frontbuffer_updated(struct wined3d_surface *surface) { x11_copy_to_screen(surface->container->swapchain, &surface->lockedRect); -@@ -1109,6 +1445,23 @@ +@@ -1100,6 +1417,23 @@ { gdi_surface_private_setup, gdi_surface_frontbuffer_updated, @@ -7082,7 +7032,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c }; /* This call just downloads data, the caller is responsible for binding the -@@ -1127,7 +1480,11 @@ +@@ -1118,7 +1452,11 @@ return; } @@ -7094,7 +7044,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->container->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { -@@ -1155,6 +1512,7 @@ +@@ -1146,6 +1484,7 @@ void *mem; GLenum gl_format = format->glFormat; GLenum gl_type = format->glType; @@ -7102,7 +7052,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c UINT src_pitch = 0; UINT dst_row_pitch, dst_slice_pitch; -@@ -1163,6 +1521,16 @@ +@@ -1154,6 +1493,16 @@ unsigned char alignment = surface->resource.device->surface_alignment; src_pitch = format->byte_count * surface->pow2Width; wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch); @@ -7119,7 +7069,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height); } -@@ -1249,12 +1617,21 @@ +@@ -1240,12 +1589,21 @@ * won't be released, and doesn't have to be re-read. */ src_data = mem; dst_data = data.addr; @@ -7141,7 +7091,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HeapFree(GetProcessHeap(), 0, mem); -@@ -1378,10 +1755,33 @@ +@@ -1369,10 +1727,33 @@ static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box) { @@ -7175,7 +7125,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1}; -@@ -1400,7 +1800,11 @@ +@@ -1391,7 +1772,11 @@ UINT update_w, update_h; UINT dst_w, dst_h; RECT r, dst_rect; @@ -7187,7 +7137,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT p; TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n", -@@ -1471,11 +1875,17 @@ +@@ -1462,11 +1847,17 @@ return WINED3DERR_INVALIDCALL; } @@ -7205,7 +7155,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(dst_surface->resource.device, NULL); gl_info = context->gl_info; -@@ -1486,6 +1896,7 @@ +@@ -1477,6 +1868,7 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else @@ -7213,7 +7163,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&dst_surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); -@@ -1499,6 +1910,21 @@ +@@ -1490,6 +1882,21 @@ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7235,7 +7185,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -1602,8 +2028,12 @@ +@@ -1593,8 +2000,12 @@ return GL_BACK; } @@ -7248,7 +7198,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; -@@ -1612,6 +2042,7 @@ +@@ -1603,6 +2014,7 @@ if (surface->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); @@ -7256,7 +7206,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (surface->resource.locations & location) { TRACE("surface is already in texture\n"); -@@ -1620,6 +2051,16 @@ +@@ -1611,6 +2023,16 @@ TRACE("Reloading because surface is dirty.\n"); wined3d_resource_load_location(&surface->resource, context, location); @@ -7273,7 +7223,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_evict_sysmem(surface); } -@@ -1702,6 +2143,7 @@ +@@ -1693,6 +2115,7 @@ void CDECL wined3d_surface_preload(struct wined3d_surface *surface) { @@ -7281,7 +7231,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct wined3d_device *device = surface->resource.device; TRACE("surface %p.\n", surface); -@@ -1712,6 +2154,17 @@ +@@ -1703,6 +2126,17 @@ } wined3d_cs_emit_surface_preload(device->cs, surface); @@ -7299,7 +7249,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) -@@ -1746,10 +2199,28 @@ +@@ -1737,10 +2171,28 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { @@ -7328,7 +7278,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) -@@ -1874,6 +2345,7 @@ +@@ -1865,6 +2317,7 @@ { DeleteDC(surface->hDC); DeleteObject(surface->dib.DIBsection); @@ -7336,7 +7286,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.bitmap_data = NULL; surface->flags &= ~SFLAG_DIBSECTION; create_dib = TRUE; -@@ -1882,6 +2354,15 @@ +@@ -1873,6 +2326,15 @@ surface->resource.locations = 0; wined3d_resource_free_sysmem(&surface->resource); surface->resource.map_heap_memory = NULL; @@ -7352,7 +7302,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c width = texture_resource->width; height = texture_resource->height; -@@ -1907,6 +2388,7 @@ +@@ -1898,6 +2360,7 @@ else surface->flags &= ~SFLAG_NONPOW2; @@ -7360,7 +7310,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.user_memory = mem)) { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; -@@ -1927,6 +2409,27 @@ +@@ -1918,6 +2381,27 @@ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); @@ -7388,7 +7338,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* The format might be changed to a format that needs conversion. -@@ -1949,11 +2452,19 @@ +@@ -1940,11 +2424,19 @@ if (!valid_location) { @@ -7408,7 +7358,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2312,6 +2823,7 @@ +@@ -2303,6 +2795,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7416,7 +7366,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2320,6 +2832,13 @@ +@@ -2311,6 +2804,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7430,7 +7380,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2343,6 +2862,7 @@ +@@ -2334,6 +2834,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7438,7 +7388,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2383,6 +2903,32 @@ +@@ -2374,6 +2875,32 @@ if (context) context_release(context); return NULL; @@ -7471,7 +7421,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, -@@ -2450,6 +2996,7 @@ +@@ -2441,6 +2968,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7479,18 +7429,13 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2460,13 +3007,42 @@ +@@ -2451,6 +2979,20 @@ memset(&surface->lockedRect, 0, sizeof(surface->lockedRect)); return hr; --} +#else /* STAGING_CSMT */ + TRACE("surface %p.\n", surface); - --HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, -- struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) --{ -- const struct wined3d_format *format = surface->resource.format; ++ + if (!surface->resource.map_count) + { + WARN("Trying to unmap unmapped surface.\n"); @@ -7502,19 +7447,21 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + + return WINED3D_OK; +#endif /* STAGING_CSMT */ -+} -+ -+HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, -+ struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) -+{ -+ const struct wined3d_format *format = surface->resource.format; + } + + HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2458,9 +3000,24 @@ + { + const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; +#if !defined(STAGING_CSMT) + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context; + const struct wined3d_gl_info *gl_info; + BYTE *base_memory; -+ + +- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box +- && !surface_check_block_align(surface, box)) + TRACE("surface %p, map_desc %p, box %p, flags %#x.\n", + surface, map_desc, box, flags); + @@ -7524,10 +7471,13 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + return WINED3DERR_INVALIDCALL; + } +#endif /* STAGING_CSMT */ - - if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box - && !surface_check_block_align(surface, box)) -@@ -2478,6 +3054,13 @@ ++ ++ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box ++ && !surface_check_block_align(surface, box)) + { + WARN("Map rect %p is misaligned for %ux%u blocks.\n", + box, format->block_width, format->block_height); +@@ -2469,6 +3026,13 @@ return WINED3DERR_INVALIDCALL; } @@ -7541,7 +7491,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface -@@ -2493,6 +3076,7 @@ +@@ -2484,6 +3048,7 @@ } } @@ -7549,9 +7499,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (box) { surface->lockedRect.left = box->left; -@@ -2553,6 +3137,104 @@ - WARN("Cannot use GetDC on a %s surface.\n", debug_d3dformat(surface->resource.format->id)); - return WINED3DERR_INVALIDCALL; +@@ -2585,6 +3150,140 @@ + if (context) + context_release(context); } +#else /* STAGING_CSMT */ + surface_prepare_map_memory(surface); @@ -7650,23 +7600,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + HRESULT hr; + + TRACE("surface %p, dc %p.\n", surface, dc); -+#endif /* STAGING_CSMT */ - - /* Give more detailed info for ddraw. */ - if (surface->flags & SFLAG_DCINUSE) -@@ -2562,6 +3244,7 @@ - if (surface->resource.map_count) - return WINED3DERR_INVALIDCALL; - -+#if defined(STAGING_CSMT) - surface->flags |= SFLAG_DCINUSE; - surface->resource.map_count++; - wined3d_cs_emit_getdc(device->cs, surface); -@@ -2594,6 +3277,35 @@ - if (context) - context_release(context); - } -+#else /* STAGING_CSMT */ ++ ++ /* Give more detailed info for ddraw. */ ++ if (surface->flags & SFLAG_DCINUSE) ++ return WINEDDERR_DCALREADYCREATED; ++ ++ /* Can't GetDC if the surface is locked. */ ++ if (surface->resource.map_count) ++ return WINED3DERR_INVALIDCALL; ++ + /* Create a DIB section if there isn't a dc yet. */ + if (!surface->hDC) + { @@ -7698,18 +7640,12 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2613,6 +3325,7 @@ +@@ -2604,7 +3303,24 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; +#if defined(STAGING_CSMT) wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); - - return WINED3D_OK; -@@ -2649,6 +3362,40 @@ - context = context_acquire(device, surface); - } - +#else /* STAGING_CSMT */ + if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY + || (surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM @@ -7725,29 +7661,26 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + surface_load_location(surface, surface->resource.map_binding); + surface_invalidate_location(surface, WINED3D_LOCATION_DIB); + } -+ -+ return WINED3D_OK; -+} -+ -+static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_location) -+{ -+ struct wined3d_device *device = surface->resource.device; -+ const struct wined3d_gl_info *gl_info; -+ struct wined3d_context *context; -+ BYTE *mem; -+ BYTE *row, *top, *bottom; -+ int i; -+ BOOL srcIsUpsideDown; -+ struct wined3d_bo_address data; ++#endif /* STAGING_CSMT */ + + return WINED3D_OK; + } +@@ -2621,9 +3337,14 @@ + int i; + BOOL srcIsUpsideDown; + struct wined3d_bo_address data; ++#if defined(STAGING_CSMT) + DWORD slice_pitch, pitch; + + wined3d_resource_get_memory(&surface->resource, dst_location, &data); ++#else /* STAGING_CSMT */ + + surface_get_memory(surface, &data, dst_location); -+ -+ context = context_acquire(device, surface); +#endif /* STAGING_CSMT */ - context_apply_blit_state(context, device); - gl_info = context->gl_info; -@@ -2681,8 +3428,13 @@ + if (surface != old_ctx->current_rt) + { +@@ -2663,8 +3384,13 @@ } /* Setup pixel store pack state -- to glReadPixels into the correct place */ @@ -7761,7 +7694,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2699,6 +3451,10 @@ +@@ -2681,6 +3407,10 @@ { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -7772,24 +7705,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -2733,12 +3489,16 @@ - checkGLcall("glBindBuffer"); - } - -+#if defined(STAGING_CSMT) - if (restore_rt) - { - context_release(context); - context = context_acquire(device, restore_rt); - context_release(context); - } -+#else /* STAGING_CSMT */ -+ context_release(context); -+#endif /* STAGING_CSMT */ - } - - /* Read the framebuffer contents into a texture. Note that this function -@@ -2919,8 +3679,13 @@ +@@ -2897,8 +3627,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -7803,7 +7719,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -2988,7 +3753,11 @@ +@@ -2966,7 +3701,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7815,7 +7731,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3185,6 +3954,7 @@ +@@ -3163,6 +3902,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7823,7 +7739,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3196,6 +3966,17 @@ +@@ -3174,6 +3914,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7841,34 +7757,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3226,6 +4007,7 @@ - rect->bottom = drawable_height - rect->bottom; - } +@@ -3228,9 +3979,15 @@ + + gl_info = context->gl_info; +#if defined(STAGING_CSMT) - /* Context activation is done by the caller. */ - static void surface_blt_to_drawable(const struct wined3d_device *device, - struct wined3d_context *old_ctx, -@@ -3260,6 +4042,26 @@ /* Make sure the surface is up-to-date. This should probably use * wined3d_resource_load_location() and worry about the destination * surface too, unless we're overwriting it completely. */ +#else /* STAGING_CSMT */ -+static void surface_blt_to_drawable(const struct wined3d_device *device, -+ enum wined3d_texture_filter_type filter, BOOL alpha_test, -+ struct wined3d_surface *src_surface, const RECT *src_rect_in, -+ struct wined3d_surface *dst_surface, const RECT *dst_rect_in) -+{ -+ const struct wined3d_gl_info *gl_info; -+ struct wined3d_context *context; -+ RECT src_rect, dst_rect; -+ -+ src_rect = *src_rect_in; -+ dst_rect = *dst_rect_in; -+ -+ context = context_acquire(device, dst_surface); -+ gl_info = context->gl_info; -+ + /* Make sure the surface is up-to-date. This should probably use + * surface_load_location() and worry about the destination surface too, + * unless we're overwriting it completely. */ @@ -7876,7 +7773,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3302,6 +4104,7 @@ +@@ -3273,9 +4030,13 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7884,22 +7781,13 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3315,6 +4118,14 @@ - context = context_acquire(device, restore_rt); - context_release(context); - } +#else /* STAGING_CSMT */ + if (wined3d_settings.strict_draw_ordering -+ || (dst_surface->container->swapchain -+ && dst_surface->container->swapchain->front_buffer == dst_surface->container)) -+ gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ -+ -+ context_release(context); +#endif /* STAGING_CSMT */ - } - - HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3338,8 +4149,13 @@ + || (dst_surface->container->swapchain + && dst_surface->container->swapchain->front_buffer == dst_surface->container)) + gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ +@@ -3305,8 +4066,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7913,7 +7801,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, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3530,6 +4346,7 @@ +@@ -3497,6 +4263,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7921,7 +7809,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3538,6 +4355,15 @@ +@@ -3505,6 +4272,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7937,7 +7825,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3552,7 +4378,11 @@ +@@ -3519,7 +4295,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -7949,7 +7837,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3578,7 +4408,11 @@ +@@ -3545,7 +4325,11 @@ return; } @@ -7961,7 +7849,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3598,6 +4432,7 @@ +@@ -3565,6 +4349,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -7969,7 +7857,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3609,6 +4444,19 @@ +@@ -3576,6 +4361,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -7989,7 +7877,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3673,9 +4521,13 @@ +@@ -3640,9 +4438,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -8003,7 +7891,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) -@@ -3691,9 +4543,13 @@ +@@ -3658,9 +4460,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -8017,7 +7905,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 -@@ -3701,6 +4557,7 @@ +@@ -3668,6 +4474,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -8025,10 +7913,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3746,6 +4603,130 @@ - TRACE("Surface was discarded, nothing to do.\n"); - return WINED3D_OK; - } +@@ -3700,6 +4507,124 @@ + + FIXME("Can't load surface %p with location flags %s into sysmem.\n", + surface, wined3d_debug_location(surface->resource.locations)); +#else /* STAGING_CSMT */ + surface->locations |= location; + surface->ds_current_size.cx = surface->resource.width; @@ -8140,44 +8028,56 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + + if (surface->locations & WINED3D_LOCATION_DRAWABLE) + { -+ read_from_framebuffer(surface, dst_location); ++ read_from_framebuffer(surface, context, dst_location); + return; + } + + FIXME("Can't load surface %p with location flags %s into sysmem.\n", + surface, wined3d_debug_location(surface->locations)); -+} -+ -+static HRESULT surface_load_drawable(struct wined3d_surface *surface, -+ const struct wined3d_gl_info *gl_info) -+{ -+ RECT r; +#endif /* STAGING_CSMT */ + } + /* Context activation is done by the caller. */ +@@ -3708,12 +4633,14 @@ + { + RECT r; + ++#if defined(STAGING_CSMT) + if (surface->resource.locations & WINED3D_LOCATION_DISCARDED) + { + TRACE("Surface was discarded, nothing to do.\n"); + return WINED3D_OK; + } + ++#endif /* STAGING_CSMT */ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3755,6 +4736,7 @@ + { +@@ -3722,7 +4649,11 @@ } surface_get_rect(surface, NULL, &r); +#if defined(STAGING_CSMT) wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); - surface_blt_to_drawable(surface->resource.device, context, - WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3823,7 +4805,67 @@ - RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - - surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, -- &rect, surface, dst_location, &rect); +#else /* STAGING_CSMT */ + surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); -+ surface_blt_to_drawable(surface->resource.device, -+ WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -+ -+ return WINED3D_OK; -+} -+ -+static HRESULT surface_load_texture(struct wined3d_surface *surface, ++#endif /* STAGING_CSMT */ + surface_blt_to_drawable(surface->resource.device, context, + WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); + +@@ -3730,6 +4661,7 @@ + } + + static HRESULT surface_load_texture(struct wined3d_surface *surface, ++#if defined(STAGING_CSMT) + struct wined3d_context *context, BOOL srgb) + { + const struct wined3d_gl_info *gl_info = context->gl_info; +@@ -3768,6 +4700,38 @@ + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) + { ++#else /* STAGING_CSMT */ + const struct wined3d_gl_info *gl_info, BOOL srgb) +{ + RECT src_rect = {0, 0, surface->resource.width, surface->resource.height}; @@ -8206,12 +8106,26 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format, + NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) + { -+ if (srgb) -+ surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, -+ &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); -+ else -+ surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, -+ &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); ++ context = context_acquire(device, NULL); ++ ++#endif /* STAGING_CSMT */ + if (srgb) + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, + &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); +@@ -3775,6 +4739,7 @@ + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, + &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); + ++#if defined(STAGING_CSMT) + return WINED3D_OK; + } + +@@ -3791,6 +4756,28 @@ + + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, + &rect, surface, dst_location, &rect); ++#else /* STAGING_CSMT */ ++ context_release(context); + + return WINED3D_OK; + } @@ -8227,13 +8141,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + -+ surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, src_location, -+#endif /* STAGING_CSMT */ ++ context = context_acquire(device, NULL); ++ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, + &rect, surface, dst_location, &rect); ++ context_release(context); ++#endif /* STAGING_CSMT */ return WINED3D_OK; } -@@ -3832,6 +4874,7 @@ +@@ -3799,6 +4786,7 @@ if (srgb) { @@ -8241,10 +8157,13 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -3866,6 +4909,45 @@ +@@ -3833,15 +4821,58 @@ width = surface->resource.width; wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); +- +- format = *texture->resource.format; +- if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) +#else /* STAGING_CSMT */ + if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) + == WINED3D_LOCATION_TEXTURE_RGB) @@ -8284,10 +8203,11 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + width = surface->resource.width; + src_pitch = wined3d_surface_get_pitch(surface); +#endif /* STAGING_CSMT */ ++ ++ format = *texture->resource.format; ++ if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) + format = *wined3d_get_format(gl_info, conversion->dst_format); - format = *texture->resource.format; - if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -3874,7 +4956,11 @@ /* 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. */ @@ -8299,7 +8219,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3883,6 +4969,7 @@ +@@ -3850,6 +4881,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8307,7 +8227,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -3890,6 +4977,14 @@ +@@ -3857,6 +4889,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8322,7 +8242,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. */ -@@ -3904,9 +4999,15 @@ +@@ -3871,9 +4911,15 @@ context_release(context); return E_OUTOFMEMORY; } @@ -8338,7 +8258,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c data.addr = mem; } else if (conversion) -@@ -3926,6 +5027,7 @@ +@@ -3893,6 +4939,7 @@ } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -8346,7 +8266,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, width, height, palette, &texture->async.gl_color_key); src_row_pitch = dst_pitch; -@@ -3989,6 +5091,88 @@ +@@ -3956,6 +5003,91 @@ ERR("Surface %p does not have any up to date location.\n", surface); surface->flags |= SFLAG_LOST; return; @@ -8369,14 +8289,17 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + +static void surface_multisample_resolve(struct wined3d_surface *surface) +{ ++ struct wined3d_context *context; + RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + + if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE)) + ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", + surface); + -+ surface_blt_fbo(surface->resource.device, WINED3D_TEXF_POINT, ++ context = context_acquire(surface->resource.device, NULL); ++ surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, + surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); ++ context_release(context); +} + +HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) @@ -8435,7 +8358,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3997,6 +5181,7 @@ +@@ -3964,6 +5096,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8443,7 +8366,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_load_sysmem(surface, context, location); break; -@@ -4014,6 +5199,28 @@ +@@ -3981,6 +5114,31 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8456,7 +8379,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + break; + + case WINED3D_LOCATION_DRAWABLE: -+ if (FAILED(hr = surface_load_drawable(surface, gl_info))) ++ context = context_acquire(device, NULL); ++ hr = surface_load_drawable(surface, context); ++ context_release(context); ++ if (FAILED(hr)) + return hr; + break; + @@ -8472,7 +8398,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -4021,12 +5228,21 @@ +@@ -3988,12 +5146,21 @@ break; } @@ -8494,7 +8420,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; } -@@ -4134,6 +5350,7 @@ +@@ -4101,6 +5268,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8502,7 +8428,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4154,6 +5371,21 @@ +@@ -4121,6 +5289,21 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); @@ -8524,7 +8450,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4162,6 +5394,7 @@ +@@ -4129,6 +5312,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8532,7 +8458,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4177,6 +5410,20 @@ +@@ -4144,6 +5328,20 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); @@ -8553,44 +8479,21 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4186,8 +5433,10 @@ - struct wined3d_surface *dst_surface, const RECT *dst_rect, - const struct wined3d_color_key *color_key) - { -+#if defined(STAGING_CSMT) - struct wined3d_context *context; - -+#endif /* STAGING_CSMT */ - /* Blit from offscreen surface to render target */ - struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; - DWORD old_color_key_flags = src_surface->container->async.color_key_flags; -@@ -4196,6 +5445,7 @@ - - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); +@@ -4172,8 +5370,13 @@ + wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, + (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); +#if defined(STAGING_CSMT) - context = context_acquire(device, dst_surface); - surface_blt_to_drawable(device, context, filter, - !!color_key, src_surface, src_rect, dst_surface, dst_rect); -@@ -4207,6 +5457,17 @@ - wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); +#else /* STAGING_CSMT */ -+ surface_blt_to_drawable(device, filter, -+ !!color_key, src_surface, src_rect, dst_surface, dst_rect); -+ -+ /* Restore the color key parameters */ -+ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, -+ (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); -+ + surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); + surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); +#endif /* STAGING_CSMT */ } const struct blit_shader ffp_blit = { -@@ -4362,6 +5623,7 @@ +@@ -4329,6 +5532,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { @@ -8598,7 +8501,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; -@@ -4396,6 +5658,28 @@ +@@ -4363,6 +5567,28 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8627,7 +8530,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4407,12 +5691,14 @@ +@@ -4374,12 +5600,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -8642,7 +8545,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4423,9 +5709,13 @@ +@@ -4390,9 +5618,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8656,7 +8559,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; src_fmt_flags = src_surface->container->resource.format_flags; } -@@ -4435,8 +5725,12 @@ +@@ -4402,8 +5634,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -8669,7 +8572,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4447,12 +5741,24 @@ +@@ -4414,12 +5650,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8694,7 +8597,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4487,7 +5793,11 @@ +@@ -4454,7 +5702,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8706,7 +8609,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4495,7 +5805,11 @@ +@@ -4462,7 +5714,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8718,7 +8621,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4544,6 +5858,7 @@ +@@ -4511,6 +5767,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8726,7 +8629,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4557,6 +5872,21 @@ +@@ -4524,6 +5781,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8748,7 +8651,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4566,8 +5896,13 @@ +@@ -4533,8 +5805,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8762,7 +8665,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4576,9 +5911,15 @@ +@@ -4543,9 +5820,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8778,7 +8681,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4588,6 +5929,7 @@ +@@ -4555,6 +5838,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8786,7 +8689,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4595,6 +5937,15 @@ +@@ -4562,6 +5846,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8802,7 +8705,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4641,6 +5992,7 @@ +@@ -4608,6 +5901,7 @@ } #undef STRETCH_ROW } @@ -8810,7 +8713,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4649,6 +6001,16 @@ +@@ -4616,6 +5910,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8827,7 +8730,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4698,7 +6060,11 @@ +@@ -4665,7 +5969,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8839,7 +8742,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4775,6 +6141,7 @@ +@@ -4742,6 +6050,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8847,7 +8750,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4796,6 +6163,29 @@ +@@ -4763,6 +6072,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8877,7 +8780,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4814,7 +6204,11 @@ +@@ -4781,7 +6113,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8889,7 +8792,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4845,10 +6239,12 @@ +@@ -4812,10 +6148,12 @@ } } @@ -8902,7 +8805,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4856,6 +6252,7 @@ +@@ -4823,6 +6161,7 @@ } release: @@ -8910,7 +8813,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4874,6 +6271,14 @@ +@@ -4841,6 +6180,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8925,7 +8828,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4918,6 +6323,7 @@ +@@ -4885,6 +6232,7 @@ cpu_blit_blit_surface, }; @@ -8933,7 +8836,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -4925,6 +6331,16 @@ +@@ -4892,6 +6240,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -8950,7 +8853,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4935,6 +6351,106 @@ +@@ -4902,6 +6260,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -9057,7 +8960,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -4977,8 +6493,13 @@ +@@ -4944,8 +6402,13 @@ } scale = src_surface @@ -9071,7 +8974,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->container->resource.format_flags -@@ -4998,6 +6519,7 @@ +@@ -4965,6 +6428,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -9079,7 +8982,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5008,6 +6530,24 @@ +@@ -4975,6 +6439,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return; @@ -9104,7 +9007,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -5016,8 +6556,13 @@ +@@ -4983,8 +6465,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -9118,7 +9021,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5038,8 +6583,13 @@ +@@ -5005,8 +6492,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -9132,7 +9035,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -5057,8 +6607,13 @@ +@@ -5024,8 +6516,13 @@ color_key = &src_surface->container->async.src_blt_color_key; blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; } @@ -9146,7 +9049,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -5067,6 +6622,7 @@ +@@ -5034,6 +6531,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -9154,7 +9057,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5079,6 +6635,15 @@ +@@ -5046,6 +6544,15 @@ context_release(context); } return; @@ -9170,7 +9073,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5102,6 +6667,7 @@ +@@ -5069,6 +6576,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -9178,7 +9081,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5307,6 +6873,49 @@ +@@ -5274,6 +6782,53 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -9190,11 +9093,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, + &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) + { ++ struct wined3d_context *context; + TRACE("Using FBO blit.\n"); + -+ surface_blt_fbo(device, filter, ++ context = context_acquire(device, NULL); ++ surface_blt_fbo(device, context, filter, + src_surface, src_surface->container->resource.draw_binding, &src_rect, + dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); ++ context_release(context); ++ + surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); + surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); + @@ -9228,7 +9135,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5368,7 +6977,11 @@ +@@ -5335,7 +6890,11 @@ } surface->container = container; @@ -9240,7 +9147,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5400,9 +7013,14 @@ +@@ -5367,9 +6926,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -9255,7 +9162,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5429,7 +7047,11 @@ +@@ -5396,7 +6960,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr);