From dcc28e042c55a839fe453b77291bd19bd229aed5 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 15 Nov 2016 22:25:07 +0100 Subject: [PATCH] wined3d-CSMT_Helper: Reenable patchset. --- patches/patchinstall.sh | 168 ++++ ...eturn-location-from-wined3d_buffer_g.patch | 79 ++ ...se-unsynchronized-buffer-updates-onl.patch | 80 ++ ...void-unsynchronized-buffer-update-wh.patch | 30 + ...ntroduce-wined3d_rendertarget_view_g.patch | 124 +++ ...ove-surface_get_drawable_size-to-vie.patch | 102 +++ ...ark-buffers-as-used-in-wined3d_buffe.patch | 27 + ...se-wined3d_vec4-in-fixup_transformed.patch | 54 ++ ...nvalidate-STATE_CONSTANT_BUFFER-devi.patch | 34 + ...Fix-style-issues-in-delete_gl_buffer.patch | 92 ++ ...d3d-Pass-context-to-delete_gl_buffer.patch | 57 ++ ...nvalidate-device-state-based-on-buff.patch | 99 +++ ...ompute-buffer_type_hint-from-buffer-.patch | 112 +++ ...e-buffer_bind-in-buffer_conversion_.patch} | 0 ...x-index-offset-for-immediate-mode-d.patch} | 0 ...troduce-buffer_conversion_upload-he.patch} | 0 ...place-wined3d_buffer_load_sysmem-ca.patch} | 0 ...efer-current-locations-to-WINED3D_L.patch} | 0 ...Introduce-wined3d_buffer_get_memory.patch} | 0 ...plement-wined3d_buffer_prepare_loca.patch} | 0 ...ve-buffer_get_memory-under-wined3d_.patch} | 0 ...-not-assume-that-WINED3D_LOCATION_S.patch} | 0 ...troduce-wined3d_buffer_load_locatio.patch} | 0 ...troduce-wined3d_buffer_prepapre_loc.patch} | 0 ...plicitly-track-locations-for-buffer.patch} | 0 ...3d-Clean-up-buffer_internal_preload.patch} | 0 ...t-buffer_direct_upload-invalidate-S.patch} | 0 ...nitise-resource-map-flags-in-wined3.patch} | 0 ...nd-resource-unmaps-through-the-comm.patch} | 0 ...nd-resource-maps-through-the-comman.patch} | 0 ...nd-shader-constant-updates-through-.patch} | 0 ...urface_load_location-return-nothing.patch} | 0 ...ure_load_location-instead-of-surfac.patch} | 0 ...face-and-volume-system-memory-loadi.patch} | 0 ...l-the-public-map-function-in-surfac.patch} | 0 ...l-the-public-map-function-in-surfac.patch} | 0 ...-the-framebuffer-into-wined3d_state.patch} | 0 ...d-buffers-if-streamsrc-is-not-dirty.patch} | 0 ...ntroduce-a-multithreaded-command-st.patch} | 0 ...resource-updates-to-finish-when-usi.patch} | 0 ...or-the-cs-before-destroying-objects.patch} | 0 ...1-wined3d-Give-the-cs-its-own-state.patch} | 0 ...t-constant-updates-through-the-comm.patch} | 0 ...-glFinish-before-modifying-resource.patch} | 0 ...e-cs-before-changing-the-texture-lo.patch} | 0 ...3d-Don-t-call-glFinish-after-clears.patch} | 0 ...d3d-Don-t-call-glFinish-after-draws.patch} | 0 ...-depth-stencil-to-swapchain-present.patch} | 0 ...k-of-the-onscreen-depth-stencil-in-.patch} | 0 ...-vertex-index-updates-through-the-c.patch} | 0 ...itive-type-updates-through-the-comm.patch} | 0 ...-constant-updates-through-the-comma.patch} | 0 ...constant-updates-through-the-comman.patch} | 0 ...t-updates-through-the-command-strea.patch} | 0 ...he-command-stream-from-running-ahea.patch} | 0 ...the-cs-to-finish-before-destroying-.patch} | 0 ...6-wined3d-Run-the-cs-asynchronously.patch} | 0 ...nd-blits-through-the-command-stream.patch} | 0 ...k-to-reject-unsupported-color-fills.patch} | 0 ...ome-wined3d_device_copy_sub_resourc.patch} | 0 ...ce-strict-draw-ordering-for-multith.patch} | 0 ...er-target-view-clears-through-the-c.patch} | 0 ...ure-maps-through-the-command-stream.patch} | 0 ...d-of-the-end_scene-flush-and-finish.patch} | 0 ...-the-linked-lists-with-a-ringbuffer.patch} | 0 ...ed3d-Don-t-preload-buffers-on-unmap.patch} | 0 ...Don-t-call-glFinish-before-swapping.patch} | 0 ...query-support-to-the-command-stream.patch} | 0 ...-CS-state-to-find-out-if-a-query-is.patch} | 0 ...oll-queries-automatically-in-the-CS.patch} | 0 ...-a-separate-queue-for-priority-comm.patch} | 0 ...t-poll-queries-that-failed-to-start.patch} | 0 ...restated-queries-from-the-poll-list.patch} | 0 ...-Put-this-into-the-query-poll-patch.patch} | 0 ...Don-t-access-device-state-in-clears.patch} | 0 ...troying-views-in-color-and-depth-fi.patch} | 0 ...ling-wined3d_surface_blt-from-surfa.patch} | 0 ...update_texture-calls-through-the-CS.patch} | 0 ...of-the-surface_upload_data-glFinish.patch} | 0 ...k-the-src-volume-in-device_update_v.patch} | 0 ...-wined3d-Fence-update_texture-calls.patch} | 0 ...-wined3d-Dirtify-resources-on-unmap.patch} | 0 ...e-render-targets-and-depth-stencils.patch} | 0 ... 0083-wined3d-Fence-blit-operations.patch} | 0 ...wined3d-Fence-color_fill-operations.patch} | 0 ...urce-maps-and-unmaps-a-priority-com.patch} | 0 ...te_sub_resource-calls-through-the-c.patch} | 0 ...hanged-textures-through-the-command.patch} | 0 ...-wined3d-Wrap-GL-BOs-in-a-structure.patch} | 0 ...arate-resource-map-and-draw-buffers.patch} | 0 ...ment-DISCARD-texture-maps-with-PBOs.patch} | 0 ...-DISCARD-resource-maps-with-heap-me.patch} | 0 ...-some-objects-in-state_init_default.patch} | 0 ...e-buffered-buffers-for-multithreade.patch} | 0 ...synchronize-NOOVERWRITE-buffer-maps.patch} | 0 ...buffer-map-write-and-draw-read-memo.patch} | 0 ...ed3d-Accelerate-DISCARD-buffer-maps.patch} | 0 ...d3d-Accelerate-READONLY-buffer-maps.patch} | 0 ...e-buffer-dirty-areas-through-the-CS.patch} | 0 ...buffer-resource.map_count-in-the-CS.patch} | 0 ...ferSubData-instead-of-glMapBufferRa.patch} | 0 ...GL-buffer-discard-control-from-igno.patch} | 0 ...-Create-buffers-before-mapping-them.patch} | 0 ...103-wined3d-Remove-another-glFinish.patch} | 0 ...ate-VBOs-through-the-command-stream.patch} | 0 ...waits.patch => 0105-Swapchain-waits.patch} | 0 ...sources-through-the-CS-in-uninit_3d.patch} | 0 ...sources-through-the-CS-in-device_re.patch} | 0 ...-glFinish-after-a-depth-buffer-blit.patch} | 0 ...ce_blt_ugly-in-swapchain_gl_present.patch} | 0 ...ent-to-block-the-worker-thread-when.patch} | 0 ...eap_memory-NULL-when-allocating-a-P.patch} | 0 ...Wait-only-for-the-buffer-to-be-idle.patch} | 0 ...PLE_flush_buffer_range-syncing-back.patch} | 0 ...n-t-sync-on-redundant-discard-calls.patch} | 0 ...5-wined3d-Don-t-discard-new-buffers.patch} | 0 ...-to-sync-VBOs-manually-on-OSX-with-.patch} | 0 ...nly-discard-buffers-that-are-in-use.patch} | 0 ...c-and-releasedc-through-the-command.patch} | 0 ...NED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch} | 0 ...reate-dummy-textures-through-the-CS.patch} | 0 ...-the-initial-context-through-the-CS.patch} | 0 ...ctx-and-dummy-textures-through-the-.patch} | 0 ...te_default_sampler-from-create_dumm.patch} | 0 ...GL-contexts-through-the-CS-in-reset.patch} | 0 ...-contexts-through-the-CS-in-uninit_.patch} | 0 ...e-swap-interval-through-the-CS-in-r.patch} | 0 ...-the-sampler-GL-init-through-the-CS.patch} | 0 ...d-Create-initial-DCs-through-the-CS.patch} | 0 ...read-buffer-when-discarding-a-new-t.patch} | 0 ...ery-available-GPU-memory-on-main-th.patch} | 0 ...rect-return-value-in-wined3d_cs_exe.patch} | 0 ...xt_acquire-not-being-called-from-th.patch} | 0 ...gnal-CS-event-when-we-manage-to-uns.patch} | 0 .../wined3d-CSMT_Main/9999-IfDefined.patch | 818 ++++++++++++------ patches/wined3d-CSMT_Main/definition | 1 - 136 files changed, 1610 insertions(+), 267 deletions(-) create mode 100644 patches/wined3d-CSMT_Main/0001-Revert-wined3d-Return-location-from-wined3d_buffer_g.patch create mode 100644 patches/wined3d-CSMT_Main/0002-Revert-wined3d-Use-unsynchronized-buffer-updates-onl.patch create mode 100644 patches/wined3d-CSMT_Main/0003-Revert-wined3d-Avoid-unsynchronized-buffer-update-wh.patch create mode 100644 patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch create mode 100644 patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch create mode 100644 patches/wined3d-CSMT_Main/0006-Revert-wined3d-Mark-buffers-as-used-in-wined3d_buffe.patch create mode 100644 patches/wined3d-CSMT_Main/0007-Revert-wined3d-Use-wined3d_vec4-in-fixup_transformed.patch create mode 100644 patches/wined3d-CSMT_Main/0008-Revert-wined3d-Invalidate-STATE_CONSTANT_BUFFER-devi.patch create mode 100644 patches/wined3d-CSMT_Main/0009-Revert-wined3d-Fix-style-issues-in-delete_gl_buffer.patch create mode 100644 patches/wined3d-CSMT_Main/0010-Revert-wined3d-Pass-context-to-delete_gl_buffer.patch create mode 100644 patches/wined3d-CSMT_Main/0011-Revert-wined3d-Invalidate-device-state-based-on-buff.patch create mode 100644 patches/wined3d-CSMT_Main/0012-Revert-wined3d-Compute-buffer_type_hint-from-buffer-.patch rename patches/wined3d-CSMT_Main/{0001-Revert-wined3d-Use-buffer_bind-in-buffer_conversion_.patch => 0013-Revert-wined3d-Use-buffer_bind-in-buffer_conversion_.patch} (100%) rename patches/wined3d-CSMT_Main/{0002-Revert-wined3d-Fix-index-offset-for-immediate-mode-d.patch => 0014-Revert-wined3d-Fix-index-offset-for-immediate-mode-d.patch} (100%) rename patches/wined3d-CSMT_Main/{0003-Revert-wined3d-Introduce-buffer_conversion_upload-he.patch => 0015-Revert-wined3d-Introduce-buffer_conversion_upload-he.patch} (100%) rename patches/wined3d-CSMT_Main/{0004-Revert-wined3d-Replace-wined3d_buffer_load_sysmem-ca.patch => 0016-Revert-wined3d-Replace-wined3d_buffer_load_sysmem-ca.patch} (100%) rename patches/wined3d-CSMT_Main/{0005-Revert-wined3d-Prefer-current-locations-to-WINED3D_L.patch => 0017-Revert-wined3d-Prefer-current-locations-to-WINED3D_L.patch} (100%) rename patches/wined3d-CSMT_Main/{0006-Revert-wined3d-Introduce-wined3d_buffer_get_memory.patch => 0018-Revert-wined3d-Introduce-wined3d_buffer_get_memory.patch} (100%) rename patches/wined3d-CSMT_Main/{0007-Revert-wined3d-Implement-wined3d_buffer_prepare_loca.patch => 0019-Revert-wined3d-Implement-wined3d_buffer_prepare_loca.patch} (100%) rename patches/wined3d-CSMT_Main/{0008-Revert-wined3d-Move-buffer_get_memory-under-wined3d_.patch => 0020-Revert-wined3d-Move-buffer_get_memory-under-wined3d_.patch} (100%) rename patches/wined3d-CSMT_Main/{0009-Revert-wined3d-Do-not-assume-that-WINED3D_LOCATION_S.patch => 0021-Revert-wined3d-Do-not-assume-that-WINED3D_LOCATION_S.patch} (100%) rename patches/wined3d-CSMT_Main/{0010-Revert-wined3d-Introduce-wined3d_buffer_load_locatio.patch => 0022-Revert-wined3d-Introduce-wined3d_buffer_load_locatio.patch} (100%) rename patches/wined3d-CSMT_Main/{0011-Revert-wined3d-Introduce-wined3d_buffer_prepapre_loc.patch => 0023-Revert-wined3d-Introduce-wined3d_buffer_prepapre_loc.patch} (100%) rename patches/wined3d-CSMT_Main/{0012-Revert-wined3d-Explicitly-track-locations-for-buffer.patch => 0024-Revert-wined3d-Explicitly-track-locations-for-buffer.patch} (100%) rename patches/wined3d-CSMT_Main/{0013-Revert-wined3d-Clean-up-buffer_internal_preload.patch => 0025-Revert-wined3d-Clean-up-buffer_internal_preload.patch} (100%) rename patches/wined3d-CSMT_Main/{0014-Revert-wined3d-Let-buffer_direct_upload-invalidate-S.patch => 0026-Revert-wined3d-Let-buffer_direct_upload-invalidate-S.patch} (100%) rename patches/wined3d-CSMT_Main/{0015-Revert-wined3d-Sanitise-resource-map-flags-in-wined3.patch => 0027-Revert-wined3d-Sanitise-resource-map-flags-in-wined3.patch} (100%) rename patches/wined3d-CSMT_Main/{0016-Revert-wined3d-Send-resource-unmaps-through-the-comm.patch => 0028-Revert-wined3d-Send-resource-unmaps-through-the-comm.patch} (100%) rename patches/wined3d-CSMT_Main/{0017-Revert-wined3d-Send-resource-maps-through-the-comman.patch => 0029-Revert-wined3d-Send-resource-maps-through-the-comman.patch} (100%) rename patches/wined3d-CSMT_Main/{0018-Revert-wined3d-Send-shader-constant-updates-through-.patch => 0030-Revert-wined3d-Send-shader-constant-updates-through-.patch} (100%) rename patches/wined3d-CSMT_Main/{0019-wined3d-Make-surface_load_location-return-nothing.patch => 0031-wined3d-Make-surface_load_location-return-nothing.patch} (100%) rename patches/wined3d-CSMT_Main/{0020-wined3d-Call-texture_load_location-instead-of-surfac.patch => 0032-wined3d-Call-texture_load_location-instead-of-surfac.patch} (100%) rename patches/wined3d-CSMT_Main/{0021-wined3d-Share-surface-and-volume-system-memory-loadi.patch => 0033-wined3d-Share-surface-and-volume-system-memory-loadi.patch} (100%) rename patches/wined3d-CSMT_Main/{0022-wined3d-Don-t-call-the-public-map-function-in-surfac.patch => 0034-wined3d-Don-t-call-the-public-map-function-in-surfac.patch} (100%) rename patches/wined3d-CSMT_Main/{0023-wined3d-Don-t-call-the-public-map-function-in-surfac.patch => 0035-wined3d-Don-t-call-the-public-map-function-in-surfac.patch} (100%) rename patches/wined3d-CSMT_Main/{0024-wined3d-Move-the-framebuffer-into-wined3d_state.patch => 0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch} (100%) rename patches/wined3d-CSMT_Main/{0025-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch => 0037-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch} (100%) rename patches/wined3d-CSMT_Main/{0026-wined3d-Hackily-introduce-a-multithreaded-command-st.patch => 0038-wined3d-Hackily-introduce-a-multithreaded-command-st.patch} (100%) rename patches/wined3d-CSMT_Main/{0027-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch => 0039-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch} (100%) rename patches/wined3d-CSMT_Main/{0028-wined3d-Wait-for-the-cs-before-destroying-objects.patch => 0040-wined3d-Wait-for-the-cs-before-destroying-objects.patch} (100%) rename patches/wined3d-CSMT_Main/{0029-wined3d-Give-the-cs-its-own-state.patch => 0041-wined3d-Give-the-cs-its-own-state.patch} (100%) rename patches/wined3d-CSMT_Main/{0030-wined3d-Send-float-constant-updates-through-the-comm.patch => 0042-wined3d-Send-float-constant-updates-through-the-comm.patch} (100%) rename patches/wined3d-CSMT_Main/{0031-wined3d-Request-a-glFinish-before-modifying-resource.patch => 0043-wined3d-Request-a-glFinish-before-modifying-resource.patch} (100%) rename patches/wined3d-CSMT_Main/{0032-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch => 0044-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch} (100%) rename patches/wined3d-CSMT_Main/{0033-wined3d-Don-t-call-glFinish-after-clears.patch => 0045-wined3d-Don-t-call-glFinish-after-clears.patch} (100%) rename patches/wined3d-CSMT_Main/{0034-wined3d-Don-t-call-glFinish-after-draws.patch => 0046-wined3d-Don-t-call-glFinish-after-draws.patch} (100%) rename patches/wined3d-CSMT_Main/{0035-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch => 0047-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch} (100%) rename patches/wined3d-CSMT_Main/{0036-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch => 0048-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch} (100%) rename patches/wined3d-CSMT_Main/{0037-wined3d-Send-base-vertex-index-updates-through-the-c.patch => 0049-wined3d-Send-base-vertex-index-updates-through-the-c.patch} (100%) rename patches/wined3d-CSMT_Main/{0038-wined3d-Send-primitive-type-updates-through-the-comm.patch => 0050-wined3d-Send-primitive-type-updates-through-the-comm.patch} (100%) rename patches/wined3d-CSMT_Main/{0039-wined3d-Send-bool-constant-updates-through-the-comma.patch => 0051-wined3d-Send-bool-constant-updates-through-the-comma.patch} (100%) rename patches/wined3d-CSMT_Main/{0040-wined3d-Send-int-constant-updates-through-the-comman.patch => 0052-wined3d-Send-int-constant-updates-through-the-comman.patch} (100%) rename patches/wined3d-CSMT_Main/{0041-wined3d-Send-light-updates-through-the-command-strea.patch => 0053-wined3d-Send-light-updates-through-the-command-strea.patch} (100%) rename patches/wined3d-CSMT_Main/{0042-wined3d-Prevent-the-command-stream-from-running-ahea.patch => 0054-wined3d-Prevent-the-command-stream-from-running-ahea.patch} (100%) rename patches/wined3d-CSMT_Main/{0043-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch => 0055-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch} (100%) rename patches/wined3d-CSMT_Main/{0044-wined3d-Run-the-cs-asynchronously.patch => 0056-wined3d-Run-the-cs-asynchronously.patch} (100%) rename patches/wined3d-CSMT_Main/{0045-wined3d-Send-blits-through-the-command-stream.patch => 0057-wined3d-Send-blits-through-the-command-stream.patch} (100%) rename patches/wined3d-CSMT_Main/{0046-wined3d-Hack-to-reject-unsupported-color-fills.patch => 0058-wined3d-Hack-to-reject-unsupported-color-fills.patch} (100%) rename patches/wined3d-CSMT_Main/{0047-wined3d-Restore-some-wined3d_device_copy_sub_resourc.patch => 0059-wined3d-Restore-some-wined3d_device_copy_sub_resourc.patch} (100%) rename patches/wined3d-CSMT_Main/{0048-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch => 0060-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch} (100%) rename patches/wined3d-CSMT_Main/{0049-wined3d-Send-render-target-view-clears-through-the-c.patch => 0061-wined3d-Send-render-target-view-clears-through-the-c.patch} (100%) rename patches/wined3d-CSMT_Main/{0050-wined3d-send-texture-maps-through-the-command-stream.patch => 0062-wined3d-send-texture-maps-through-the-command-stream.patch} (100%) rename patches/wined3d-CSMT_Main/{0051-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch => 0063-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch} (100%) rename patches/wined3d-CSMT_Main/{0052-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch => 0064-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch} (100%) rename patches/wined3d-CSMT_Main/{0053-wined3d-Don-t-preload-buffers-on-unmap.patch => 0065-wined3d-Don-t-preload-buffers-on-unmap.patch} (100%) rename patches/wined3d-CSMT_Main/{0054-wined3d-Don-t-call-glFinish-before-swapping.patch => 0066-wined3d-Don-t-call-glFinish-before-swapping.patch} (100%) rename patches/wined3d-CSMT_Main/{0055-wined3d-Add-query-support-to-the-command-stream.patch => 0067-wined3d-Add-query-support-to-the-command-stream.patch} (100%) rename patches/wined3d-CSMT_Main/{0056-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch => 0068-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch} (100%) rename patches/wined3d-CSMT_Main/{0057-wined3d-Poll-queries-automatically-in-the-CS.patch => 0069-wined3d-Poll-queries-automatically-in-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0058-wined3d-Introduce-a-separate-queue-for-priority-comm.patch => 0070-wined3d-Introduce-a-separate-queue-for-priority-comm.patch} (100%) rename patches/wined3d-CSMT_Main/{0059-wined3d-Don-t-poll-queries-that-failed-to-start.patch => 0071-wined3d-Don-t-poll-queries-that-failed-to-start.patch} (100%) rename patches/wined3d-CSMT_Main/{0060-wined3d-Remove-restated-queries-from-the-poll-list.patch => 0072-wined3d-Remove-restated-queries-from-the-poll-list.patch} (100%) rename patches/wined3d-CSMT_Main/{0061-wined3d-Put-this-into-the-query-poll-patch.patch => 0073-wined3d-Put-this-into-the-query-poll-patch.patch} (100%) rename patches/wined3d-CSMT_Main/{0062-wined3d-Don-t-access-device-state-in-clears.patch => 0074-wined3d-Don-t-access-device-state-in-clears.patch} (100%) rename patches/wined3d-CSMT_Main/{0063-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch => 0075-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch} (100%) rename patches/wined3d-CSMT_Main/{0064-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch => 0076-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch} (100%) rename patches/wined3d-CSMT_Main/{0065-wined3d-Send-update_texture-calls-through-the-CS.patch => 0077-wined3d-Send-update_texture-calls-through-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0066-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch => 0078-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch} (100%) rename patches/wined3d-CSMT_Main/{0067-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch => 0079-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch} (100%) rename patches/wined3d-CSMT_Main/{0068-wined3d-Fence-update_texture-calls.patch => 0080-wined3d-Fence-update_texture-calls.patch} (100%) rename patches/wined3d-CSMT_Main/{0069-wined3d-Dirtify-resources-on-unmap.patch => 0081-wined3d-Dirtify-resources-on-unmap.patch} (100%) rename patches/wined3d-CSMT_Main/{0070-wined3d-Fence-render-targets-and-depth-stencils.patch => 0082-wined3d-Fence-render-targets-and-depth-stencils.patch} (100%) rename patches/wined3d-CSMT_Main/{0071-wined3d-Fence-blit-operations.patch => 0083-wined3d-Fence-blit-operations.patch} (100%) rename patches/wined3d-CSMT_Main/{0072-wined3d-Fence-color_fill-operations.patch => 0084-wined3d-Fence-color_fill-operations.patch} (100%) rename patches/wined3d-CSMT_Main/{0073-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch => 0085-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch} (100%) rename patches/wined3d-CSMT_Main/{0074-wined3d-Send-update_sub_resource-calls-through-the-c.patch => 0086-wined3d-Send-update_sub_resource-calls-through-the-c.patch} (100%) rename patches/wined3d-CSMT_Main/{0075-wined3d-Dirtify-changed-textures-through-the-command.patch => 0087-wined3d-Dirtify-changed-textures-through-the-command.patch} (100%) rename patches/wined3d-CSMT_Main/{0076-wined3d-Wrap-GL-BOs-in-a-structure.patch => 0088-wined3d-Wrap-GL-BOs-in-a-structure.patch} (100%) rename patches/wined3d-CSMT_Main/{0077-wined3d-Separate-resource-map-and-draw-buffers.patch => 0089-wined3d-Separate-resource-map-and-draw-buffers.patch} (100%) rename patches/wined3d-CSMT_Main/{0078-wined3d-Implement-DISCARD-texture-maps-with-PBOs.patch => 0090-wined3d-Implement-DISCARD-texture-maps-with-PBOs.patch} (100%) rename patches/wined3d-CSMT_Main/{0079-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch => 0091-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch} (100%) rename patches/wined3d-CSMT_Main/{0080-wined3d-Unset-some-objects-in-state_init_default.patch => 0092-wined3d-Unset-some-objects-in-state_init_default.patch} (100%) rename patches/wined3d-CSMT_Main/{0081-wined3d-Use-double-buffered-buffers-for-multithreade.patch => 0093-wined3d-Use-double-buffered-buffers-for-multithreade.patch} (100%) rename patches/wined3d-CSMT_Main/{0082-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch => 0094-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch} (100%) rename patches/wined3d-CSMT_Main/{0083-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch => 0095-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch} (100%) rename patches/wined3d-CSMT_Main/{0084-wined3d-Accelerate-DISCARD-buffer-maps.patch => 0096-wined3d-Accelerate-DISCARD-buffer-maps.patch} (100%) rename patches/wined3d-CSMT_Main/{0085-wined3d-Accelerate-READONLY-buffer-maps.patch => 0097-wined3d-Accelerate-READONLY-buffer-maps.patch} (100%) rename patches/wined3d-CSMT_Main/{0086-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch => 0098-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0087-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch => 0099-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0088-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch => 0100-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch} (100%) rename patches/wined3d-CSMT_Main/{0089-wined3d-Separate-GL-buffer-discard-control-from-igno.patch => 0101-wined3d-Separate-GL-buffer-discard-control-from-igno.patch} (100%) rename patches/wined3d-CSMT_Main/{0090-wined3d-Create-buffers-before-mapping-them.patch => 0102-wined3d-Create-buffers-before-mapping-them.patch} (100%) rename patches/wined3d-CSMT_Main/{0091-wined3d-Remove-another-glFinish.patch => 0103-wined3d-Remove-another-glFinish.patch} (100%) rename patches/wined3d-CSMT_Main/{0092-wined3d-Create-VBOs-through-the-command-stream.patch => 0104-wined3d-Create-VBOs-through-the-command-stream.patch} (100%) rename patches/wined3d-CSMT_Main/{0093-Swapchain-waits.patch => 0105-Swapchain-waits.patch} (100%) rename patches/wined3d-CSMT_Main/{0094-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch => 0106-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch} (100%) rename patches/wined3d-CSMT_Main/{0095-wined3d-Unload-resources-through-the-CS-in-device_re.patch => 0107-wined3d-Unload-resources-through-the-CS-in-device_re.patch} (100%) rename patches/wined3d-CSMT_Main/{0096-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch => 0108-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch} (100%) rename patches/wined3d-CSMT_Main/{0097-wined3d-Use-surface_blt_ugly-in-swapchain_gl_present.patch => 0109-wined3d-Use-surface_blt_ugly-in-swapchain_gl_present.patch} (100%) rename patches/wined3d-CSMT_Main/{0098-wined3d-Use-an-event-to-block-the-worker-thread-when.patch => 0110-wined3d-Use-an-event-to-block-the-worker-thread-when.patch} (100%) rename patches/wined3d-CSMT_Main/{0099-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch => 0111-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch} (100%) rename patches/wined3d-CSMT_Main/{0100-wined3d-Wait-only-for-the-buffer-to-be-idle.patch => 0112-wined3d-Wait-only-for-the-buffer-to-be-idle.patch} (100%) rename patches/wined3d-CSMT_Main/{0101-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch => 0113-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch} (100%) rename patches/wined3d-CSMT_Main/{0102-wined3d-Don-t-sync-on-redundant-discard-calls.patch => 0114-wined3d-Don-t-sync-on-redundant-discard-calls.patch} (100%) rename patches/wined3d-CSMT_Main/{0103-wined3d-Don-t-discard-new-buffers.patch => 0115-wined3d-Don-t-discard-new-buffers.patch} (100%) rename patches/wined3d-CSMT_Main/{0104-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch => 0116-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch} (100%) rename patches/wined3d-CSMT_Main/{0105-wined3d-Only-discard-buffers-that-are-in-use.patch => 0117-wined3d-Only-discard-buffers-that-are-in-use.patch} (100%) rename patches/wined3d-CSMT_Main/{0106-wined3d-Send-getdc-and-releasedc-through-the-command.patch => 0118-wined3d-Send-getdc-and-releasedc-through-the-command.patch} (100%) rename patches/wined3d-CSMT_Main/{0107-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch => 0119-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch} (100%) rename patches/wined3d-CSMT_Main/{0108-wined3d-Create-dummy-textures-through-the-CS.patch => 0120-wined3d-Create-dummy-textures-through-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0109-wined3d-Create-the-initial-context-through-the-CS.patch => 0121-wined3d-Create-the-initial-context-through-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0110-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch => 0122-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch} (100%) rename patches/wined3d-CSMT_Main/{0111-wined3d-Call-create_default_sampler-from-create_dumm.patch => 0123-wined3d-Call-create_default_sampler-from-create_dumm.patch} (100%) rename patches/wined3d-CSMT_Main/{0112-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch => 0124-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch} (100%) rename patches/wined3d-CSMT_Main/{0113-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch => 0125-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch} (100%) rename patches/wined3d-CSMT_Main/{0114-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch => 0126-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch} (100%) rename patches/wined3d-CSMT_Main/{0115-wined3d-Do-the-sampler-GL-init-through-the-CS.patch => 0127-wined3d-Do-the-sampler-GL-init-through-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0116-wined3d-Create-initial-DCs-through-the-CS.patch => 0128-wined3d-Create-initial-DCs-through-the-CS.patch} (100%) rename patches/wined3d-CSMT_Main/{0117-wined3d-Assign-a-read-buffer-when-discarding-a-new-t.patch => 0129-wined3d-Assign-a-read-buffer-when-discarding-a-new-t.patch} (100%) rename patches/wined3d-CSMT_Main/{0118-wined3d-Do-not-query-available-GPU-memory-on-main-th.patch => 0130-wined3d-Do-not-query-available-GPU-memory-on-main-th.patch} (100%) rename patches/wined3d-CSMT_Main/{0119-wined3d-Fix-incorrect-return-value-in-wined3d_cs_exe.patch => 0131-wined3d-Fix-incorrect-return-value-in-wined3d_cs_exe.patch} (100%) rename patches/wined3d-CSMT_Main/{0120-wined3d-Fix-context_acquire-not-being-called-from-th.patch => 0132-wined3d-Fix-context_acquire-not-being-called-from-th.patch} (100%) rename patches/wined3d-CSMT_Main/{0121-wined3d-Do-not-signal-CS-event-when-we-manage-to-uns.patch => 0133-wined3d-Do-not-signal-CS-event-when-we-manage-to-uns.patch} (100%) diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 3b7406f6..001b70ec 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -370,6 +370,7 @@ patch_enable_all () enable_wined3d_1DTextures="$1" enable_wined3d_Accounting="$1" enable_wined3d_CSMT_Helper="$1" + enable_wined3d_CSMT_Main="$1" enable_wined3d_DXTn="$1" enable_wined3d_GTX_560M="$1" enable_wined3d_Limit_Vram="$1" @@ -1295,6 +1296,9 @@ patch_enable () wined3d-CSMT_Helper) enable_wined3d_CSMT_Helper="$2" ;; + wined3d-CSMT_Main) + enable_wined3d_CSMT_Main="$2" + ;; wined3d-DXTn) enable_wined3d_DXTn="$2" ;; @@ -2018,6 +2022,13 @@ if test "$enable_wpcap_Dynamic_Linking" -eq 1; then enable_wpcap_Several_Fixes=1 fi +if test "$enable_wined3d_CSMT_Main" -eq 1; then + if test "$enable_wined3d_CSMT_Helper" -gt 1; then + abort "Patchset wined3d-CSMT_Helper disabled, but wined3d-CSMT_Main depends on that." + fi + enable_wined3d_CSMT_Helper=1 +fi + if test "$enable_wined3d_CSMT_Helper" -eq 1; then if test "$enable_makedep_PARENTSPEC" -gt 1; then abort "Patchset makedep-PARENTSPEC disabled, but wined3d-CSMT_Helper depends on that." @@ -7707,6 +7718,163 @@ if test "$enable_wined3d_check_format_support" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-CSMT_Main +# | +# | This patchset has the following (direct or indirect) dependencies: +# | * makedep-PARENTSPEC, ntdll-Attach_Process_DLLs, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, +# | wined3d-1DTextures, wined3d-Accounting, wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Revert_Pixel_Center_Offset, wined3d- +# | Silence_FIXMEs, wined3d-CSMT_Helper +# | +# | This patchset fixes the following Wine bugs: +# | * [#11674] Support for CSMT (command stream) to increase graphic performance +# | +# | Modified files: +# | * dlls/wined3d/arb_program_shader.c, dlls/wined3d/buffer.c, dlls/wined3d/context.c, dlls/wined3d/cs.c, +# | dlls/wined3d/device.c, dlls/wined3d/drawprim.c, dlls/wined3d/glsl_shader.c, dlls/wined3d/query.c, +# | dlls/wined3d/resource.c, dlls/wined3d/sampler.c, dlls/wined3d/shader.c, dlls/wined3d/state.c, dlls/wined3d/stateblock.c, +# | dlls/wined3d/surface.c, dlls/wined3d/swapchain.c, dlls/wined3d/texture.c, dlls/wined3d/utils.c, dlls/wined3d/view.c, +# | dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h +# | +if test "$enable_wined3d_CSMT_Main" -eq 1; then + patch_apply wined3d-CSMT_Main/9999-IfDefined.patch + ( + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Return location from wined3d_buffer_get_memory().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use unsynchronized buffer updates only if there has been at least one buffer map.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Avoid unsynchronized buffer update when reloading whole buffer.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_rendertarget_view_get_drawable_size() as replacement for surface_get_drawable_size().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Move surface_get_drawable_size() to view.c file.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Mark buffers as used in wined3d_buffer_copy().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use wined3d_vec4 in fixup_transformed_pos().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Invalidate STATE_CONSTANT_BUFFER(*) device state in buffer_destroy_buffer_object() when needed.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Fix style issues in delete_gl_buffer().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Pass context to delete_gl_buffer().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Invalidate device state based on buffer bind flags when buffer is deleted.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Compute \"buffer_type_hint\" from buffer bind flags.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use buffer_bind() in buffer_conversion_upload().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Fix index offset for immediate mode draws.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce buffer_conversion_upload() helper function.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Replace wined3d_buffer_load_sysmem() calls with wined3d_buffer_load_location().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Prefer current locations to WINED3D_LOCATION_SYSMEM in wined3d_buffer_copy().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_get_memory().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Implement wined3d_buffer_prepare_location() for WINED3D_LOCATION_BUFFER.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Move buffer_get_memory() under wined3d_buffer_load_sysmem().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Do not assume that WINED3D_LOCATION_SYSMEM is always valid for double buffered buffers.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_load_location().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_prepapre_location().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Explicitly track locations for buffers.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Clean up buffer_internal_preload().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Let buffer_direct_upload() invalidate STATE_INDEXBUFFER if needed.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Sanitise resource map flags in wined3d_resource_map().\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send resource unmaps through the command stream.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send resource maps through the command stream.\".", 1 },'; + echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send shader constant updates through the command stream.\".", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Make surface_load_location return nothing.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Call texture_load_location instead of surface_load_location.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Share surface and volume system memory loading code.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_convert_format.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_cpu_blt.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Preload buffers if streamsrc is not dirty.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Hackily introduce a multithreaded command stream.", 1 },'; + echo '+ { "Henri Verbeet", "wined3d: Wait for resource updates to finish when using the multithreaded command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs before destroying objects.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Give the cs its own state.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send float constant updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Request a glFinish before modifying resources outside the cs.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Finish the cs before changing the texture lod.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after clears.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after draws.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Pass the depth stencil to swapchain->present.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Keep track of the onscreen depth stencil in the command stream instead of the device.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send base vertex index updates through the cs.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send primitive type updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send bool constant updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send int constant updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send light updates through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Run the cs asynchronously.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Hack to reject unsupported color fills.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Restore some wined3d_device_copy_sub_resource_region checks.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t force strict draw ordering for multithreaded CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send render target view clears through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send texture maps through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Replace the linked lists with a ringbuffer.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t preload buffers on unmap.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish before swapping.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Add query support to the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Check our CS state to find out if a query is done.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Poll queries automatically in the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Introduce a separate queue for priority commands.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t poll queries that failed to start.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Remove restated queries from the poll list.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Put this into the query poll patch.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t access device state in clears.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Avoid destroying views in color and depth fills.", 1 },'; + echo '+ { "Matteo Bruni", "wined3d: Avoid calling wined3d_surface_blt() from surface_upload_from_surface().", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Get rid of the surface_upload_data glFinish.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t lock the src volume in device_update_volume.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence update_texture calls.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Dirtify resources on unmap.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence render targets and depth stencils.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence blit operations.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Fence color_fill operations.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Make resource maps and unmaps a priority command.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send update_sub_resource calls through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Dirtify changed textures through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Separate resource map and draw buffers.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD texture maps with PBOs.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD resource maps with heap memory.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Unset some objects in state_init_default.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use double-buffered buffers for multithreaded CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t synchronize NOOVERWRITE buffer maps.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Separate buffer map write and draw read memory pointers.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Accelerate DISCARD buffer maps.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Accelerate READONLY buffer maps.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Access the buffer dirty areas through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Ignore buffer->resource.map_count in the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use glBufferSubData instead of glMapBufferRange.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Separate GL buffer discard control from ignoring MAP_DISCARD.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create buffers before mapping them.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Remove another glFinish.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create VBOs through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "Swapchain waits.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in uninit_3d.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in device_reset.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t glFinish after a depth buffer blit.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use surface_blt_ugly in swapchain_gl_present.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Use an event to block the worker thread when it is idle.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Set map_heap_memory = NULL when allocating a PBO.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Wait only for the buffer to be idle.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Put GL_APPLE_flush_buffer_range syncing back in place.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t sync on redundant discard calls.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t discard new buffers.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Don'\''t try to sync VBOs manually on OSX with CSMT.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Only discard buffers that are in use.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Send getdc and releasedc through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create dummy textures through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create the initial context through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Recreate ctx and dummy textures through the CS after resets.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Call create_default_sampler from create_dummy_textures.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in reset.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in uninit_3d.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Do the sampler GL init through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Create initial DCs through the CS.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Assign a read buffer when discarding a new texture.", 1 },'; + echo '+ { "Sebastian Lackner", "wined3d: Do not query available GPU memory on main thread when CSMT is enabled.", 1 },'; + echo '+ { "Nils Kuhnhenn", "wined3d: Fix incorrect return value in wined3d_cs_exec_set_light.", 1 },'; + echo '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },'; + echo '+ { "Sebastian Lackner", "wined3d: Do not signal CS event when we manage to unset waiting_for_event quickly enough.", 1 },'; + echo '+ { "Sebastian Lackner", "wined3d: Enable CSMT by default, print a winediag message informing about this patchset.", 1 },'; + ) >> "$patchlist" +fi + # Patchset winedevice-Fix_Relocation # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wined3d-CSMT_Main/0001-Revert-wined3d-Return-location-from-wined3d_buffer_g.patch b/patches/wined3d-CSMT_Main/0001-Revert-wined3d-Return-location-from-wined3d_buffer_g.patch new file mode 100644 index 00000000..97afa280 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0001-Revert-wined3d-Return-location-from-wined3d_buffer_g.patch @@ -0,0 +1,79 @@ +From 103b66b00488084c7245407a61b2bb09d2c0cfdc Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:07:19 +0100 +Subject: Revert "wined3d: Return location from wined3d_buffer_get_memory()." + +This reverts commit e2733ed7fbcc9ca205e5e9b7507f301021b742cc. +--- + dlls/wined3d/buffer.c | 10 +++++----- + dlls/wined3d/wined3d_private.h | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 58c273c..6b59965 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -631,7 +631,7 @@ BYTE *wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_c + return buffer->resource.heap_memory; + } + +-DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, ++void wined3d_buffer_get_memory(struct wined3d_buffer *buffer, + struct wined3d_bo_address *data, DWORD locations) + { + TRACE("buffer %p, data %p, locations %s.\n", +@@ -641,19 +641,18 @@ DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, + { + data->buffer_object = buffer->buffer_object; + data->addr = NULL; +- return WINED3D_LOCATION_BUFFER; ++ return; + } + if (locations & WINED3D_LOCATION_SYSMEM) + { + data->buffer_object = 0; + data->addr = buffer->resource.heap_memory; +- return WINED3D_LOCATION_SYSMEM; ++ return; + } + + ERR("Unexpected locations %s.\n", wined3d_debug_location(locations)); + data->buffer_object = 0; + data->addr = NULL; +- return 0; + } + + static void buffer_unload(struct wined3d_resource *resource) +@@ -1275,7 +1274,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ + context = context_acquire(device, NULL); + gl_info = context->gl_info; + +- dst_location = wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations); ++ wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations); + wined3d_buffer_get_memory(src_buffer, &src, src_buffer->locations); + + if (dst.buffer_object && src.buffer_object) +@@ -1327,6 +1326,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ + memcpy(dst.addr + dst_offset, src.addr + src_offset, size); + } + ++ dst_location = dst.buffer_object ? WINED3D_LOCATION_BUFFER : WINED3D_LOCATION_SYSMEM; + wined3d_buffer_invalidate_range(dst_buffer, ~dst_location, dst_offset, size); + + context_release(context); +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 6e742f6..503f7f2 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -3179,7 +3179,7 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc + } + + void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; +-DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, ++void wined3d_buffer_get_memory(struct wined3d_buffer *buffer, + struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN; + void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD location) DECLSPEC_HIDDEN; + void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context, +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0002-Revert-wined3d-Use-unsynchronized-buffer-updates-onl.patch b/patches/wined3d-CSMT_Main/0002-Revert-wined3d-Use-unsynchronized-buffer-updates-onl.patch new file mode 100644 index 00000000..c36c8566 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0002-Revert-wined3d-Use-unsynchronized-buffer-updates-onl.patch @@ -0,0 +1,80 @@ +From 2accc03254f24b7fb290d99d0bec7a689386c9e1 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:07:28 +0100 +Subject: Revert "wined3d: Use unsynchronized buffer updates only if there has + been at least one buffer map." + +This reverts commit 085ae6ed08710fedfdcd1febe580d04baeebd596. +--- + dlls/wined3d/buffer.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 6b59965..f686855 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -34,8 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ + #define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ + #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ +-#define WINED3D_BUFFER_MAP 0x20 /* There has been at least one map since the last preload. */ +-#define WINED3D_BUFFER_APPLESYNC 0x40 /* Using sync as in GL_APPLE_flush_buffer_range. */ ++#define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ + + #define VB_MAXDECLCHANGES 100 /* After that number of decl changes we stop converting */ + #define VB_RESETDECLCHANGE 1000 /* Reset the decl changecount after that number of draws */ +@@ -819,7 +818,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con + mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT; + if (flags & WINED3D_BUFFER_DISCARD) + mapflags |= GL_MAP_INVALIDATE_BUFFER_BIT; +- else if (flags & WINED3D_BUFFER_MAP && !(flags & WINED3D_BUFFER_SYNC)) ++ else if (!(flags & WINED3D_BUFFER_SYNC)) + mapflags |= GL_MAP_UNSYNCHRONIZED_BIT; + map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0, + This->resource.size, mapflags)); +@@ -832,7 +831,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con + DWORD syncflags = 0; + if (flags & WINED3D_BUFFER_DISCARD) + syncflags |= WINED3D_MAP_DISCARD; +- else if (flags & WINED3D_BUFFER_MAP && !(flags & WINED3D_BUFFER_SYNC)) ++ else if (!(flags & WINED3D_BUFFER_SYNC)) + syncflags |= WINED3D_MAP_NOOVERWRITE; + buffer_sync_apple(This, syncflags, gl_info); + } +@@ -930,14 +929,14 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined + + void buffer_mark_used(struct wined3d_buffer *buffer) + { +- buffer->flags &= ~(WINED3D_BUFFER_MAP | WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); ++ buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); + } + + /* Context activation is done by the caller. */ + void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context, + const struct wined3d_state *state) + { +- DWORD flags = buffer->flags & (WINED3D_BUFFER_MAP | WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); ++ DWORD flags = buffer->flags & (WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); + const struct wined3d_gl_info *gl_info = context->gl_info; + BOOL decl_changed = FALSE; + +@@ -1012,7 +1011,7 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * + /* Avoid unfenced updates, we might overwrite more areas of the buffer than the application + * cleared for unsynchronized updates. + */ +- flags = 0; ++ flags = WINED3D_BUFFER_SYNC; + } + else + { +@@ -1172,7 +1171,6 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI + } + } + +- buffer->flags |= WINED3D_BUFFER_MAP; + if (flags & WINED3D_MAP_DISCARD) + buffer->flags |= WINED3D_BUFFER_DISCARD; + else if (!(flags & WINED3D_MAP_NOOVERWRITE)) +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0003-Revert-wined3d-Avoid-unsynchronized-buffer-update-wh.patch b/patches/wined3d-CSMT_Main/0003-Revert-wined3d-Avoid-unsynchronized-buffer-update-wh.patch new file mode 100644 index 00000000..6fe798c8 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0003-Revert-wined3d-Avoid-unsynchronized-buffer-update-wh.patch @@ -0,0 +1,30 @@ +From 289f21e74582e376903f3f987b839f2b66fe29af Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:07:39 +0100 +Subject: Revert "wined3d: Avoid unsynchronized buffer update when reloading + whole buffer." + +This reverts commit c259854a0afc5e4fb8644af7c5c979f312f954f3. +--- + dlls/wined3d/buffer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index f686855..564b1fc 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1009,9 +1009,9 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * + buffer_invalidate_bo_range(buffer, 0, 0); + + /* Avoid unfenced updates, we might overwrite more areas of the buffer than the application +- * cleared for unsynchronized updates. ++ * cleared for unsynchronized updates + */ +- flags = WINED3D_BUFFER_SYNC; ++ flags = 0; + } + else + { +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch b/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch new file mode 100644 index 00000000..47262964 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Introduce-wined3d_rendertarget_view_g.patch @@ -0,0 +1,124 @@ +From 2bd4f2e4ad2310471f7c3cd85f59f261314cd6c4 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:07:56 +0100 +Subject: Revert "wined3d: Introduce + wined3d_rendertarget_view_get_drawable_size() as replacement for + surface_get_drawable_size()." + +This reverts commit 5cdb8f2486cf00a61c1aac20daef8c7cac0d8312. +--- + dlls/wined3d/device.c | 5 ++--- + dlls/wined3d/state.c | 6 +++--- + dlls/wined3d/view.c | 17 +++-------------- + dlls/wined3d/wined3d_private.h | 5 ++--- + 4 files changed, 10 insertions(+), 23 deletions(-) + +diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c +index d7349fcf..a611531 100644 +--- a/dlls/wined3d/device.c ++++ b/dlls/wined3d/device.c +@@ -291,8 +291,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + UINT rect_count, const RECT *clear_rect, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color, + float depth, DWORD stencil) + { +- struct wined3d_rendertarget_view *rtv = rt_count ? fb->render_targets[0] : NULL; +- struct wined3d_surface *target = rtv ? wined3d_rendertarget_view_get_surface(rtv) : NULL; ++ struct wined3d_surface *target = rt_count ? wined3d_rendertarget_view_get_surface(fb->render_targets[0]) : NULL; + struct wined3d_rendertarget_view *dsv = fb->depth_stencil; + struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL; + const struct wined3d_state *state = &device->state; +@@ -340,7 +339,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + if (target) + { + render_offscreen = context->render_offscreen; +- wined3d_rendertarget_view_get_drawable_size(rtv, context, &drawable_width, &drawable_height); ++ surface_get_drawable_size(target, context, &drawable_width, &drawable_height); + } + else + { +diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c +index cd3763c..9e36bcd 100644 +--- a/dlls/wined3d/state.c ++++ b/dlls/wined3d/state.c +@@ -4624,7 +4624,7 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine + if (vp.height > target->height) + vp.height = target->height; + +- wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height); ++ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); + } + else if (depth_stencil) + { +@@ -4668,7 +4668,7 @@ static void viewport_miscpart_cc(struct wined3d_context *context, + if (vp.height > target->height) + vp.height = target->height; + +- wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height); ++ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); + } + else if (depth_stencil) + { +@@ -4853,7 +4853,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st + UINT height; + UINT width; + +- wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height); ++ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); + gl_info->gl_ops.gl.p_glScissor(r->left, height - r->bottom, r->right - r->left, r->bottom - r->top); + } + checkGLcall("glScissor"); +diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c +index a67c506..1f819e6 100644 +--- a/dlls/wined3d/view.c ++++ b/dlls/wined3d/view.c +@@ -94,21 +94,10 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str + return view->resource; + } + +-void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, +- const struct wined3d_context *context, unsigned int *width, unsigned int *height) ++void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, ++ unsigned int *width, unsigned int *height) + { +- const struct wined3d_texture *texture; +- +- if (view->resource->type != WINED3D_RTYPE_TEXTURE_2D) +- { +- FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(view->resource->type)); +- *width = 0; +- *height = 0; +- return; +- } +- +- texture = texture_from_resource(view->resource); +- if (texture->swapchain) ++ if (surface->container->swapchain) + { + /* The drawable size of an onscreen drawable is the surface size. + * (Actually: The window size, but the surface is created in window +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 503f7f2..19b650e 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2908,6 +2908,8 @@ HRESULT surface_color_fill(struct wined3d_surface *s, + const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; + HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_surface_destroy_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, ++ unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; + void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, + struct wined3d_context *context) DECLSPEC_HIDDEN; + HRESULT surface_load_location(struct wined3d_surface *surface, +@@ -3224,9 +3226,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( + return texture->sub_resources[view->sub_resource_idx].u.surface; + } + +-void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, +- const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; +- + struct wined3d_shader_resource_view + { + LONG refcount; +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch b/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch new file mode 100644 index 00000000..703df53f --- /dev/null +++ b/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Move-surface_get_drawable_size-to-vie.patch @@ -0,0 +1,102 @@ +From 1a411d1906c961dc1d754181823b2ce92301937a Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:08:06 +0100 +Subject: Revert "wined3d: Move surface_get_drawable_size() to view.c file." + +This reverts commit 4beb9e5922301b76c16f6ea885bc1cb604f9eb91. +--- + dlls/wined3d/surface.c | 33 +++++++++++++++++++++++++++++++++ + dlls/wined3d/view.c | 33 --------------------------------- + 2 files changed, 33 insertions(+), 33 deletions(-) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index bba855a..1c211ed 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -36,6 +36,39 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); + static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM + | WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_BUFFER; + ++void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, ++ unsigned int *width, unsigned int *height) ++{ ++ if (surface->container->swapchain) ++ { ++ /* The drawable size of an onscreen drawable is the surface size. ++ * (Actually: The window size, but the surface is created in window ++ * size.) */ ++ *width = context->current_rt.texture->resource.width; ++ *height = context->current_rt.texture->resource.height; ++ } ++ else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) ++ { ++ const struct wined3d_swapchain *swapchain = context->swapchain; ++ ++ /* The drawable size of a backbuffer / aux buffer offscreen target is ++ * the size of the current context's drawable, which is the size of ++ * the back buffer of the swapchain the active context belongs to. */ ++ *width = swapchain->desc.backbuffer_width; ++ *height = swapchain->desc.backbuffer_height; ++ } ++ else ++ { ++ struct wined3d_surface *rt; ++ ++ /* The drawable size of an FBO target is the OpenGL texture size, ++ * which is the power of two size. */ ++ rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; ++ *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level); ++ *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level); ++ } ++} ++ + struct blt_info + { + GLenum binding; +diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c +index 1f819e6..7f07d57 100644 +--- a/dlls/wined3d/view.c ++++ b/dlls/wined3d/view.c +@@ -94,39 +94,6 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str + return view->resource; + } + +-void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, +- unsigned int *width, unsigned int *height) +-{ +- if (surface->container->swapchain) +- { +- /* The drawable size of an onscreen drawable is the surface size. +- * (Actually: The window size, but the surface is created in window +- * size.) */ +- *width = context->current_rt.texture->resource.width; +- *height = context->current_rt.texture->resource.height; +- } +- else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) +- { +- const struct wined3d_swapchain *swapchain = context->swapchain; +- +- /* The drawable size of a backbuffer / aux buffer offscreen target is +- * the size of the current context's drawable, which is the size of +- * the back buffer of the swapchain the active context belongs to. */ +- *width = swapchain->desc.backbuffer_width; +- *height = swapchain->desc.backbuffer_height; +- } +- else +- { +- struct wined3d_surface *rt; +- +- /* The drawable size of an FBO target is the OpenGL texture size, +- * which is the power of two size. */ +- rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; +- *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level); +- *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level); +- } +-} +- + static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, + const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, + void *parent, const struct wined3d_parent_ops *parent_ops) +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0006-Revert-wined3d-Mark-buffers-as-used-in-wined3d_buffe.patch b/patches/wined3d-CSMT_Main/0006-Revert-wined3d-Mark-buffers-as-used-in-wined3d_buffe.patch new file mode 100644 index 00000000..dd4f0a94 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0006-Revert-wined3d-Mark-buffers-as-used-in-wined3d_buffe.patch @@ -0,0 +1,27 @@ +From b80300afc09521dddf8d025ba5df8243bd044681 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:08:32 +0100 +Subject: Revert "wined3d: Mark buffers as used in wined3d_buffer_copy()." + +This reverts commit 20b989ef86de7e36b7ec9feee49b0bfa9f284b43. +--- + dlls/wined3d/buffer.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 564b1fc..202ce32 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1264,9 +1264,6 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ + DWORD dst_location; + HRESULT hr; + +- buffer_mark_used(dst_buffer); +- buffer_mark_used(src_buffer); +- + device = dst_buffer->resource.device; + + context = context_acquire(device, NULL); +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0007-Revert-wined3d-Use-wined3d_vec4-in-fixup_transformed.patch b/patches/wined3d-CSMT_Main/0007-Revert-wined3d-Use-wined3d_vec4-in-fixup_transformed.patch new file mode 100644 index 00000000..8215d10f --- /dev/null +++ b/patches/wined3d-CSMT_Main/0007-Revert-wined3d-Use-wined3d_vec4-in-fixup_transformed.patch @@ -0,0 +1,54 @@ +From 01e29442c38eff41c69cc4b99d91d8eee5bcb5ef Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:09:25 +0100 +Subject: Revert "wined3d: Use wined3d_vec4 in fixup_transformed_pos()." + +This reverts commit 07cfeac3dd7ca41d9d9fde3a490425451c4b26b7. +--- + dlls/wined3d/buffer.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 202ce32..aed9e26 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -509,19 +509,19 @@ static inline unsigned int fixup_d3dcolor(DWORD *dst_color) + return sizeof(*dst_color); + } + +-static inline unsigned int fixup_transformed_pos(struct wined3d_vec4 *p) ++static inline unsigned int fixup_transformed_pos(float *p) + { + /* rhw conversion like in position_float4(). */ +- if (p->w != 1.0f && p->w != 0.0f) ++ if (p[3] != 1.0f && p[3] != 0.0f) + { +- float w = 1.0f / p->w; +- p->x *= w; +- p->y *= w; +- p->z *= w; +- p->w = w; ++ float w = 1.0f / p[3]; ++ p[0] *= w; ++ p[1] *= w; ++ p[2] *= w; ++ p[3] = w; + } + +- return sizeof(*p); ++ return 4 * sizeof(*p); + } + + ULONG CDECL wined3d_buffer_incref(struct wined3d_buffer *buffer) +@@ -909,7 +909,7 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined + j += fixup_d3dcolor((DWORD *) (data + i * buffer->stride + j)); + break; + case CONV_POSITIONT: +- j += fixup_transformed_pos((struct wined3d_vec4 *) (data + i * buffer->stride + j)); ++ j += fixup_transformed_pos((float *) (data + i * buffer->stride + j)); + break; + default: + FIXME("Unimplemented conversion %d in shifted conversion.\n", buffer->conversion_map[j]); +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0008-Revert-wined3d-Invalidate-STATE_CONSTANT_BUFFER-devi.patch b/patches/wined3d-CSMT_Main/0008-Revert-wined3d-Invalidate-STATE_CONSTANT_BUFFER-devi.patch new file mode 100644 index 00000000..8a258223 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0008-Revert-wined3d-Invalidate-STATE_CONSTANT_BUFFER-devi.patch @@ -0,0 +1,34 @@ +From 753504b584ef9c248fe9165cd07ec89b8ab401c2 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:09:45 +0100 +Subject: Revert "wined3d: Invalidate STATE_CONSTANT_BUFFER(*) device state in + buffer_destroy_buffer_object() when needed." + +This reverts commit de19ba7c23b3fd3c80ce7221bdb3ce138b3d4400. +--- + dlls/wined3d/buffer.c | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index aed9e26..6e6d189 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -162,15 +162,6 @@ static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const st + device_invalidate_state(resource->device, STATE_STREAMSRC); + if (buffer->bind_flags & WINED3D_BIND_INDEX_BUFFER) + device_invalidate_state(resource->device, STATE_INDEXBUFFER); +- if (buffer->bind_flags & WINED3D_BIND_CONSTANT_BUFFER) +- { +- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX)); +- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_HULL)); +- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_DOMAIN)); +- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GEOMETRY)); +- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_PIXEL)); +- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_COMPUTE)); +- } + } + + if (buffer->query) +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0009-Revert-wined3d-Fix-style-issues-in-delete_gl_buffer.patch b/patches/wined3d-CSMT_Main/0009-Revert-wined3d-Fix-style-issues-in-delete_gl_buffer.patch new file mode 100644 index 00000000..cde3ebe4 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0009-Revert-wined3d-Fix-style-issues-in-delete_gl_buffer.patch @@ -0,0 +1,92 @@ +From 7c6279ec1995b6987669524f9c03aac4423394d0 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:09:53 +0100 +Subject: Revert "wined3d: Fix style issues in delete_gl_buffer()." + +This reverts commit 01b8bea329a34d946aa2efbeabae9ad00a5e9868. +--- + dlls/wined3d/buffer.c | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 6e6d189..a3d7dfd 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -139,17 +139,16 @@ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *c + } + + /* Context activation is done by the caller. */ +-static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const struct wined3d_context *context) ++static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_context *context) + { + const struct wined3d_gl_info *gl_info = context->gl_info; +- struct wined3d_resource *resource = &buffer->resource; ++ struct wined3d_resource *resource = &This->resource; + +- if (!buffer->buffer_object) +- return; ++ if(!This->buffer_object) return; + +- GL_EXTCALL(glDeleteBuffers(1, &buffer->buffer_object)); ++ GL_EXTCALL(glDeleteBuffers(1, &This->buffer_object)); + checkGLcall("glDeleteBuffers"); +- buffer->buffer_object = 0; ++ This->buffer_object = 0; + + /* The stream source state handler might have read the memory of the + * vertex buffer already and got the memory in the vbo which is not +@@ -158,18 +157,18 @@ static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const st + * rarely. */ + if (resource->bind_count) + { +- if (buffer->bind_flags & WINED3D_BIND_VERTEX_BUFFER) ++ if (This->bind_flags & WINED3D_BIND_VERTEX_BUFFER) + device_invalidate_state(resource->device, STATE_STREAMSRC); +- if (buffer->bind_flags & WINED3D_BIND_INDEX_BUFFER) ++ if (This->bind_flags & WINED3D_BIND_INDEX_BUFFER) + device_invalidate_state(resource->device, STATE_INDEXBUFFER); + } + +- if (buffer->query) ++ if(This->query) + { +- wined3d_event_query_destroy(buffer->query); +- buffer->query = NULL; ++ wined3d_event_query_destroy(This->query); ++ This->query = NULL; + } +- buffer->flags &= ~WINED3D_BUFFER_APPLESYNC; ++ This->flags &= ~WINED3D_BUFFER_APPLESYNC; + } + + /* Context activation is done by the caller. */ +@@ -258,7 +257,7 @@ fail: + /* Clean up all BO init, but continue because we can work without a BO :-) */ + ERR("Failed to create a buffer object. Continuing, but performance issues may occur.\n"); + buffer->flags &= ~WINED3D_BUFFER_USE_BO; +- buffer_destroy_buffer_object(buffer, context); ++ delete_gl_buffer(buffer, context); + buffer_clear_dirty_areas(buffer); + return FALSE; + } +@@ -664,7 +663,7 @@ static void buffer_unload(struct wined3d_resource *resource) + buffer->flags &= ~WINED3D_BUFFER_DOUBLEBUFFER; + + wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER); +- buffer_destroy_buffer_object(buffer, context); ++ delete_gl_buffer(buffer, context); + buffer_clear_dirty_areas(buffer); + + context_release(context); +@@ -693,7 +692,7 @@ static void wined3d_buffer_destroy_object(void *object) + if (buffer->buffer_object) + { + context = context_acquire(buffer->resource.device, NULL); +- buffer_destroy_buffer_object(buffer, context); ++ delete_gl_buffer(buffer, context); + context_release(context); + + HeapFree(GetProcessHeap(), 0, buffer->conversion_map); +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0010-Revert-wined3d-Pass-context-to-delete_gl_buffer.patch b/patches/wined3d-CSMT_Main/0010-Revert-wined3d-Pass-context-to-delete_gl_buffer.patch new file mode 100644 index 00000000..4238257b --- /dev/null +++ b/patches/wined3d-CSMT_Main/0010-Revert-wined3d-Pass-context-to-delete_gl_buffer.patch @@ -0,0 +1,57 @@ +From d826efd7c8bce9cc50f79ab5589455d8e7882561 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:10:01 +0100 +Subject: Revert "wined3d: Pass context to delete_gl_buffer()." + +This reverts commit 20eb55fdefa9f0b7a0864dce3b4a12b132dba651. +--- + dlls/wined3d/buffer.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index a3d7dfd..43b3366 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -138,10 +138,9 @@ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *c + GL_EXTCALL(glBindBuffer(buffer->buffer_type_hint, buffer->buffer_object)); + } + +-/* Context activation is done by the caller. */ +-static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_context *context) ++/* Context activation is done by the caller */ ++static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info) + { +- const struct wined3d_gl_info *gl_info = context->gl_info; + struct wined3d_resource *resource = &This->resource; + + if(!This->buffer_object) return; +@@ -257,7 +256,7 @@ fail: + /* Clean up all BO init, but continue because we can work without a BO :-) */ + ERR("Failed to create a buffer object. Continuing, but performance issues may occur.\n"); + buffer->flags &= ~WINED3D_BUFFER_USE_BO; +- delete_gl_buffer(buffer, context); ++ delete_gl_buffer(buffer, gl_info); + buffer_clear_dirty_areas(buffer); + return FALSE; + } +@@ -663,7 +662,7 @@ static void buffer_unload(struct wined3d_resource *resource) + buffer->flags &= ~WINED3D_BUFFER_DOUBLEBUFFER; + + wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER); +- delete_gl_buffer(buffer, context); ++ delete_gl_buffer(buffer, context->gl_info); + buffer_clear_dirty_areas(buffer); + + context_release(context); +@@ -692,7 +691,7 @@ static void wined3d_buffer_destroy_object(void *object) + if (buffer->buffer_object) + { + context = context_acquire(buffer->resource.device, NULL); +- delete_gl_buffer(buffer, context); ++ delete_gl_buffer(buffer, context->gl_info); + context_release(context); + + HeapFree(GetProcessHeap(), 0, buffer->conversion_map); +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0011-Revert-wined3d-Invalidate-device-state-based-on-buff.patch b/patches/wined3d-CSMT_Main/0011-Revert-wined3d-Invalidate-device-state-based-on-buff.patch new file mode 100644 index 00000000..abc9d5de --- /dev/null +++ b/patches/wined3d-CSMT_Main/0011-Revert-wined3d-Invalidate-device-state-based-on-buff.patch @@ -0,0 +1,99 @@ +From 9d42f1e7b7426a61c7e7b1c355c5563ffbdc8c59 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:10:09 +0100 +Subject: Revert "wined3d: Invalidate device state based on buffer bind flags + when buffer is deleted." + +This reverts commit cc35b6c8b3896a2020dc45db3aab61673f7c7268. +--- + dlls/wined3d/buffer.c | 32 +++++++++++++++----------------- + dlls/wined3d/wined3d_private.h | 1 - + 2 files changed, 15 insertions(+), 18 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 43b3366..a30e467 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -141,27 +141,12 @@ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *c + /* Context activation is done by the caller */ + static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info) + { +- struct wined3d_resource *resource = &This->resource; +- + if(!This->buffer_object) return; + + GL_EXTCALL(glDeleteBuffers(1, &This->buffer_object)); + checkGLcall("glDeleteBuffers"); + This->buffer_object = 0; + +- /* The stream source state handler might have read the memory of the +- * vertex buffer already and got the memory in the vbo which is not +- * valid any longer. Dirtify the stream source to force a reload. This +- * happens only once per changed vertexbuffer and should occur rather +- * rarely. */ +- if (resource->bind_count) +- { +- if (This->bind_flags & WINED3D_BIND_VERTEX_BUFFER) +- device_invalidate_state(resource->device, STATE_STREAMSRC); +- if (This->bind_flags & WINED3D_BIND_INDEX_BUFFER) +- device_invalidate_state(resource->device, STATE_INDEXBUFFER); +- } +- + if(This->query) + { + wined3d_event_query_destroy(This->query); +@@ -652,9 +637,10 @@ static void buffer_unload(struct wined3d_resource *resource) + + if (buffer->buffer_object) + { ++ struct wined3d_device *device = resource->device; + struct wined3d_context *context; + +- context = context_acquire(resource->device, NULL); ++ context = context_acquire(device, NULL); + + /* Download the buffer, but don't permanently enable double buffering. */ + wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_SYSMEM); +@@ -672,6 +658,19 @@ static void buffer_unload(struct wined3d_resource *resource) + buffer->stride = 0; + buffer->conversion_stride = 0; + buffer->flags &= ~WINED3D_BUFFER_HASDESC; ++ ++ /* The stream source state handler might have read the memory of the ++ * vertex buffer already and got the memory in the vbo which is not ++ * valid any longer. Dirtify the stream source to force a reload. This ++ * happens only once per changed vertexbuffer and should occur rather ++ * rarely. */ ++ if (resource->bind_count) ++ { ++ device_invalidate_state(device, STATE_STREAMSRC); ++ ++ if (buffer->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER) ++ device_invalidate_state(device, STATE_INDEXBUFFER); ++ } + } + + resource_unload(resource); +@@ -1454,7 +1453,6 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + return hr; + } + buffer->buffer_type_hint = buffer_type_hint_from_bind_flags(bind_flags); +- buffer->bind_flags = bind_flags; + buffer->locations = WINED3D_LOCATION_SYSMEM; + + TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n", +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 19b650e..c56558d 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -3158,7 +3158,6 @@ struct wined3d_buffer + GLuint buffer_object; + GLenum buffer_object_usage; + GLenum buffer_type_hint; +- unsigned int bind_flags; + DWORD flags; + void *map_ptr; + +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0012-Revert-wined3d-Compute-buffer_type_hint-from-buffer-.patch b/patches/wined3d-CSMT_Main/0012-Revert-wined3d-Compute-buffer_type_hint-from-buffer-.patch new file mode 100644 index 00000000..c65126c0 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0012-Revert-wined3d-Compute-buffer_type_hint-from-buffer-.patch @@ -0,0 +1,112 @@ +From 280cb6e8d37df26215688bfe2ec13ad76faff8d4 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 15 Nov 2016 22:13:29 +0100 +Subject: Revert "wined3d: Compute "buffer_type_hint" from buffer bind flags." + +This reverts commit e3c692151f9199d7e37b2c788daa629d0c2c1b3b. +--- + dlls/wined3d/buffer.c | 31 ++++++++----------------------- + include/wine/wined3d.h | 9 --------- + 2 files changed, 8 insertions(+), 32 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index a30e467..5cecce5 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1410,28 +1410,14 @@ static const struct wined3d_resource_ops buffer_resource_ops = + buffer_resource_sub_resource_unmap, + }; + +-static GLenum buffer_type_hint_from_bind_flags(unsigned int bind_flags) +-{ +- if (bind_flags == WINED3D_BIND_INDEX_BUFFER) +- return GL_ELEMENT_ARRAY_BUFFER; +- +- if (bind_flags & WINED3D_BIND_CONSTANT_BUFFER) +- return GL_UNIFORM_BUFFER; +- +- if (bind_flags & ~(WINED3D_BIND_VERTEX_BUFFER | WINED3D_BIND_INDEX_BUFFER)) +- FIXME("Unhandled bind flags %#x.\n", bind_flags); +- +- return GL_ARRAY_BUFFER; +-} +- + static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, +- UINT size, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, unsigned int bind_flags, ++ UINT size, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, GLenum bind_hint, + const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops) + { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + const struct wined3d_format *format = wined3d_get_format(gl_info, format_id); +- BOOL dynamic_buffer_ok; + HRESULT hr; ++ BOOL dynamic_buffer_ok; + + if (!size) + { +@@ -1452,12 +1438,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + WARN("Failed to initialize resource, hr %#x.\n", hr); + return hr; + } +- buffer->buffer_type_hint = buffer_type_hint_from_bind_flags(bind_flags); ++ buffer->buffer_type_hint = bind_hint; + buffer->locations = WINED3D_LOCATION_SYSMEM; + +- TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n", +- buffer, buffer->resource.size, buffer->resource.usage, +- debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory); ++ TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, ++ debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); + + if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING || pool == WINED3D_POOL_MANAGED) + { +@@ -1524,7 +1509,7 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct + FIXME("Ignoring access flags (pool).\n"); + + hr = buffer_init(object, device, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN, +- WINED3D_POOL_MANAGED, desc->bind_flags, data, parent, parent_ops); ++ WINED3D_POOL_MANAGED, GL_ARRAY_BUFFER_ARB, data, parent, parent_ops); + if (FAILED(hr)) + { + WARN("Failed to initialize buffer, hr %#x.\n", hr); +@@ -1566,7 +1551,7 @@ HRESULT CDECL wined3d_buffer_create_vb(struct wined3d_device *device, UINT size, + } + + hr = buffer_init(object, device, size, usage, WINED3DFMT_UNKNOWN, +- pool, WINED3D_BIND_VERTEX_BUFFER, NULL, parent, parent_ops); ++ pool, GL_ARRAY_BUFFER_ARB, NULL, parent, parent_ops); + if (FAILED(hr)) + { + WARN("Failed to initialize buffer, hr %#x.\n", hr); +@@ -1597,7 +1582,7 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, + } + + hr = buffer_init(object, device, size, usage | WINED3DUSAGE_STATICDECL, +- WINED3DFMT_UNKNOWN, pool, WINED3D_BIND_INDEX_BUFFER, NULL, ++ WINED3DFMT_UNKNOWN, pool, GL_ELEMENT_ARRAY_BUFFER_ARB, NULL, + parent, parent_ops); + if (FAILED(hr)) + { +diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h +index c7ecef1..8cbb76c 100644 +--- a/include/wine/wined3d.h ++++ b/include/wine/wined3d.h +@@ -833,15 +833,6 @@ enum wined3d_display_rotation + + #define WINED3DDP_MAXTEXCOORD 8 + +-#define WINED3D_BIND_VERTEX_BUFFER 0x00000001 +-#define WINED3D_BIND_INDEX_BUFFER 0x00000002 +-#define WINED3D_BIND_CONSTANT_BUFFER 0x00000004 +-#define WINED3D_BIND_SHADER_RESOURCE 0x00000008 +-#define WINED3D_BIND_STREAM_OUTPUT 0x00000010 +-#define WINED3D_BIND_RENDER_TARGET 0x00000020 +-#define WINED3D_BIND_DEPTH_STENCIL 0x00000040 +-#define WINED3D_BIND_UNORDERED_ACCESS 0x00000080 +- + #define WINED3DUSAGE_RENDERTARGET 0x00000001 + #define WINED3DUSAGE_DEPTHSTENCIL 0x00000002 + #define WINED3DUSAGE_WRITEONLY 0x00000008 +-- +2.9.0 + diff --git a/patches/wined3d-CSMT_Main/0001-Revert-wined3d-Use-buffer_bind-in-buffer_conversion_.patch b/patches/wined3d-CSMT_Main/0013-Revert-wined3d-Use-buffer_bind-in-buffer_conversion_.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0001-Revert-wined3d-Use-buffer_bind-in-buffer_conversion_.patch rename to patches/wined3d-CSMT_Main/0013-Revert-wined3d-Use-buffer_bind-in-buffer_conversion_.patch diff --git a/patches/wined3d-CSMT_Main/0002-Revert-wined3d-Fix-index-offset-for-immediate-mode-d.patch b/patches/wined3d-CSMT_Main/0014-Revert-wined3d-Fix-index-offset-for-immediate-mode-d.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0002-Revert-wined3d-Fix-index-offset-for-immediate-mode-d.patch rename to patches/wined3d-CSMT_Main/0014-Revert-wined3d-Fix-index-offset-for-immediate-mode-d.patch diff --git a/patches/wined3d-CSMT_Main/0003-Revert-wined3d-Introduce-buffer_conversion_upload-he.patch b/patches/wined3d-CSMT_Main/0015-Revert-wined3d-Introduce-buffer_conversion_upload-he.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0003-Revert-wined3d-Introduce-buffer_conversion_upload-he.patch rename to patches/wined3d-CSMT_Main/0015-Revert-wined3d-Introduce-buffer_conversion_upload-he.patch diff --git a/patches/wined3d-CSMT_Main/0004-Revert-wined3d-Replace-wined3d_buffer_load_sysmem-ca.patch b/patches/wined3d-CSMT_Main/0016-Revert-wined3d-Replace-wined3d_buffer_load_sysmem-ca.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0004-Revert-wined3d-Replace-wined3d_buffer_load_sysmem-ca.patch rename to patches/wined3d-CSMT_Main/0016-Revert-wined3d-Replace-wined3d_buffer_load_sysmem-ca.patch diff --git a/patches/wined3d-CSMT_Main/0005-Revert-wined3d-Prefer-current-locations-to-WINED3D_L.patch b/patches/wined3d-CSMT_Main/0017-Revert-wined3d-Prefer-current-locations-to-WINED3D_L.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0005-Revert-wined3d-Prefer-current-locations-to-WINED3D_L.patch rename to patches/wined3d-CSMT_Main/0017-Revert-wined3d-Prefer-current-locations-to-WINED3D_L.patch diff --git a/patches/wined3d-CSMT_Main/0006-Revert-wined3d-Introduce-wined3d_buffer_get_memory.patch b/patches/wined3d-CSMT_Main/0018-Revert-wined3d-Introduce-wined3d_buffer_get_memory.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0006-Revert-wined3d-Introduce-wined3d_buffer_get_memory.patch rename to patches/wined3d-CSMT_Main/0018-Revert-wined3d-Introduce-wined3d_buffer_get_memory.patch diff --git a/patches/wined3d-CSMT_Main/0007-Revert-wined3d-Implement-wined3d_buffer_prepare_loca.patch b/patches/wined3d-CSMT_Main/0019-Revert-wined3d-Implement-wined3d_buffer_prepare_loca.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0007-Revert-wined3d-Implement-wined3d_buffer_prepare_loca.patch rename to patches/wined3d-CSMT_Main/0019-Revert-wined3d-Implement-wined3d_buffer_prepare_loca.patch diff --git a/patches/wined3d-CSMT_Main/0008-Revert-wined3d-Move-buffer_get_memory-under-wined3d_.patch b/patches/wined3d-CSMT_Main/0020-Revert-wined3d-Move-buffer_get_memory-under-wined3d_.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0008-Revert-wined3d-Move-buffer_get_memory-under-wined3d_.patch rename to patches/wined3d-CSMT_Main/0020-Revert-wined3d-Move-buffer_get_memory-under-wined3d_.patch diff --git a/patches/wined3d-CSMT_Main/0009-Revert-wined3d-Do-not-assume-that-WINED3D_LOCATION_S.patch b/patches/wined3d-CSMT_Main/0021-Revert-wined3d-Do-not-assume-that-WINED3D_LOCATION_S.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0009-Revert-wined3d-Do-not-assume-that-WINED3D_LOCATION_S.patch rename to patches/wined3d-CSMT_Main/0021-Revert-wined3d-Do-not-assume-that-WINED3D_LOCATION_S.patch diff --git a/patches/wined3d-CSMT_Main/0010-Revert-wined3d-Introduce-wined3d_buffer_load_locatio.patch b/patches/wined3d-CSMT_Main/0022-Revert-wined3d-Introduce-wined3d_buffer_load_locatio.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0010-Revert-wined3d-Introduce-wined3d_buffer_load_locatio.patch rename to patches/wined3d-CSMT_Main/0022-Revert-wined3d-Introduce-wined3d_buffer_load_locatio.patch diff --git a/patches/wined3d-CSMT_Main/0011-Revert-wined3d-Introduce-wined3d_buffer_prepapre_loc.patch b/patches/wined3d-CSMT_Main/0023-Revert-wined3d-Introduce-wined3d_buffer_prepapre_loc.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0011-Revert-wined3d-Introduce-wined3d_buffer_prepapre_loc.patch rename to patches/wined3d-CSMT_Main/0023-Revert-wined3d-Introduce-wined3d_buffer_prepapre_loc.patch diff --git a/patches/wined3d-CSMT_Main/0012-Revert-wined3d-Explicitly-track-locations-for-buffer.patch b/patches/wined3d-CSMT_Main/0024-Revert-wined3d-Explicitly-track-locations-for-buffer.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0012-Revert-wined3d-Explicitly-track-locations-for-buffer.patch rename to patches/wined3d-CSMT_Main/0024-Revert-wined3d-Explicitly-track-locations-for-buffer.patch diff --git a/patches/wined3d-CSMT_Main/0013-Revert-wined3d-Clean-up-buffer_internal_preload.patch b/patches/wined3d-CSMT_Main/0025-Revert-wined3d-Clean-up-buffer_internal_preload.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0013-Revert-wined3d-Clean-up-buffer_internal_preload.patch rename to patches/wined3d-CSMT_Main/0025-Revert-wined3d-Clean-up-buffer_internal_preload.patch diff --git a/patches/wined3d-CSMT_Main/0014-Revert-wined3d-Let-buffer_direct_upload-invalidate-S.patch b/patches/wined3d-CSMT_Main/0026-Revert-wined3d-Let-buffer_direct_upload-invalidate-S.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0014-Revert-wined3d-Let-buffer_direct_upload-invalidate-S.patch rename to patches/wined3d-CSMT_Main/0026-Revert-wined3d-Let-buffer_direct_upload-invalidate-S.patch diff --git a/patches/wined3d-CSMT_Main/0015-Revert-wined3d-Sanitise-resource-map-flags-in-wined3.patch b/patches/wined3d-CSMT_Main/0027-Revert-wined3d-Sanitise-resource-map-flags-in-wined3.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0015-Revert-wined3d-Sanitise-resource-map-flags-in-wined3.patch rename to patches/wined3d-CSMT_Main/0027-Revert-wined3d-Sanitise-resource-map-flags-in-wined3.patch diff --git a/patches/wined3d-CSMT_Main/0016-Revert-wined3d-Send-resource-unmaps-through-the-comm.patch b/patches/wined3d-CSMT_Main/0028-Revert-wined3d-Send-resource-unmaps-through-the-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0016-Revert-wined3d-Send-resource-unmaps-through-the-comm.patch rename to patches/wined3d-CSMT_Main/0028-Revert-wined3d-Send-resource-unmaps-through-the-comm.patch diff --git a/patches/wined3d-CSMT_Main/0017-Revert-wined3d-Send-resource-maps-through-the-comman.patch b/patches/wined3d-CSMT_Main/0029-Revert-wined3d-Send-resource-maps-through-the-comman.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0017-Revert-wined3d-Send-resource-maps-through-the-comman.patch rename to patches/wined3d-CSMT_Main/0029-Revert-wined3d-Send-resource-maps-through-the-comman.patch diff --git a/patches/wined3d-CSMT_Main/0018-Revert-wined3d-Send-shader-constant-updates-through-.patch b/patches/wined3d-CSMT_Main/0030-Revert-wined3d-Send-shader-constant-updates-through-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0018-Revert-wined3d-Send-shader-constant-updates-through-.patch rename to patches/wined3d-CSMT_Main/0030-Revert-wined3d-Send-shader-constant-updates-through-.patch diff --git a/patches/wined3d-CSMT_Main/0019-wined3d-Make-surface_load_location-return-nothing.patch b/patches/wined3d-CSMT_Main/0031-wined3d-Make-surface_load_location-return-nothing.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0019-wined3d-Make-surface_load_location-return-nothing.patch rename to patches/wined3d-CSMT_Main/0031-wined3d-Make-surface_load_location-return-nothing.patch diff --git a/patches/wined3d-CSMT_Main/0020-wined3d-Call-texture_load_location-instead-of-surfac.patch b/patches/wined3d-CSMT_Main/0032-wined3d-Call-texture_load_location-instead-of-surfac.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0020-wined3d-Call-texture_load_location-instead-of-surfac.patch rename to patches/wined3d-CSMT_Main/0032-wined3d-Call-texture_load_location-instead-of-surfac.patch diff --git a/patches/wined3d-CSMT_Main/0021-wined3d-Share-surface-and-volume-system-memory-loadi.patch b/patches/wined3d-CSMT_Main/0033-wined3d-Share-surface-and-volume-system-memory-loadi.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0021-wined3d-Share-surface-and-volume-system-memory-loadi.patch rename to patches/wined3d-CSMT_Main/0033-wined3d-Share-surface-and-volume-system-memory-loadi.patch diff --git a/patches/wined3d-CSMT_Main/0022-wined3d-Don-t-call-the-public-map-function-in-surfac.patch b/patches/wined3d-CSMT_Main/0034-wined3d-Don-t-call-the-public-map-function-in-surfac.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0022-wined3d-Don-t-call-the-public-map-function-in-surfac.patch rename to patches/wined3d-CSMT_Main/0034-wined3d-Don-t-call-the-public-map-function-in-surfac.patch diff --git a/patches/wined3d-CSMT_Main/0023-wined3d-Don-t-call-the-public-map-function-in-surfac.patch b/patches/wined3d-CSMT_Main/0035-wined3d-Don-t-call-the-public-map-function-in-surfac.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0023-wined3d-Don-t-call-the-public-map-function-in-surfac.patch rename to patches/wined3d-CSMT_Main/0035-wined3d-Don-t-call-the-public-map-function-in-surfac.patch diff --git a/patches/wined3d-CSMT_Main/0024-wined3d-Move-the-framebuffer-into-wined3d_state.patch b/patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0024-wined3d-Move-the-framebuffer-into-wined3d_state.patch rename to patches/wined3d-CSMT_Main/0036-wined3d-Move-the-framebuffer-into-wined3d_state.patch diff --git a/patches/wined3d-CSMT_Main/0025-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch b/patches/wined3d-CSMT_Main/0037-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0025-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch rename to patches/wined3d-CSMT_Main/0037-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch diff --git a/patches/wined3d-CSMT_Main/0026-wined3d-Hackily-introduce-a-multithreaded-command-st.patch b/patches/wined3d-CSMT_Main/0038-wined3d-Hackily-introduce-a-multithreaded-command-st.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0026-wined3d-Hackily-introduce-a-multithreaded-command-st.patch rename to patches/wined3d-CSMT_Main/0038-wined3d-Hackily-introduce-a-multithreaded-command-st.patch diff --git a/patches/wined3d-CSMT_Main/0027-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch b/patches/wined3d-CSMT_Main/0039-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0027-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch rename to patches/wined3d-CSMT_Main/0039-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch diff --git a/patches/wined3d-CSMT_Main/0028-wined3d-Wait-for-the-cs-before-destroying-objects.patch b/patches/wined3d-CSMT_Main/0040-wined3d-Wait-for-the-cs-before-destroying-objects.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0028-wined3d-Wait-for-the-cs-before-destroying-objects.patch rename to patches/wined3d-CSMT_Main/0040-wined3d-Wait-for-the-cs-before-destroying-objects.patch diff --git a/patches/wined3d-CSMT_Main/0029-wined3d-Give-the-cs-its-own-state.patch b/patches/wined3d-CSMT_Main/0041-wined3d-Give-the-cs-its-own-state.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0029-wined3d-Give-the-cs-its-own-state.patch rename to patches/wined3d-CSMT_Main/0041-wined3d-Give-the-cs-its-own-state.patch diff --git a/patches/wined3d-CSMT_Main/0030-wined3d-Send-float-constant-updates-through-the-comm.patch b/patches/wined3d-CSMT_Main/0042-wined3d-Send-float-constant-updates-through-the-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0030-wined3d-Send-float-constant-updates-through-the-comm.patch rename to patches/wined3d-CSMT_Main/0042-wined3d-Send-float-constant-updates-through-the-comm.patch diff --git a/patches/wined3d-CSMT_Main/0031-wined3d-Request-a-glFinish-before-modifying-resource.patch b/patches/wined3d-CSMT_Main/0043-wined3d-Request-a-glFinish-before-modifying-resource.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0031-wined3d-Request-a-glFinish-before-modifying-resource.patch rename to patches/wined3d-CSMT_Main/0043-wined3d-Request-a-glFinish-before-modifying-resource.patch diff --git a/patches/wined3d-CSMT_Main/0032-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch b/patches/wined3d-CSMT_Main/0044-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0032-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch rename to patches/wined3d-CSMT_Main/0044-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch diff --git a/patches/wined3d-CSMT_Main/0033-wined3d-Don-t-call-glFinish-after-clears.patch b/patches/wined3d-CSMT_Main/0045-wined3d-Don-t-call-glFinish-after-clears.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0033-wined3d-Don-t-call-glFinish-after-clears.patch rename to patches/wined3d-CSMT_Main/0045-wined3d-Don-t-call-glFinish-after-clears.patch diff --git a/patches/wined3d-CSMT_Main/0034-wined3d-Don-t-call-glFinish-after-draws.patch b/patches/wined3d-CSMT_Main/0046-wined3d-Don-t-call-glFinish-after-draws.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0034-wined3d-Don-t-call-glFinish-after-draws.patch rename to patches/wined3d-CSMT_Main/0046-wined3d-Don-t-call-glFinish-after-draws.patch diff --git a/patches/wined3d-CSMT_Main/0035-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch b/patches/wined3d-CSMT_Main/0047-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0035-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch rename to patches/wined3d-CSMT_Main/0047-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch diff --git a/patches/wined3d-CSMT_Main/0036-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch b/patches/wined3d-CSMT_Main/0048-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0036-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch rename to patches/wined3d-CSMT_Main/0048-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch diff --git a/patches/wined3d-CSMT_Main/0037-wined3d-Send-base-vertex-index-updates-through-the-c.patch b/patches/wined3d-CSMT_Main/0049-wined3d-Send-base-vertex-index-updates-through-the-c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0037-wined3d-Send-base-vertex-index-updates-through-the-c.patch rename to patches/wined3d-CSMT_Main/0049-wined3d-Send-base-vertex-index-updates-through-the-c.patch diff --git a/patches/wined3d-CSMT_Main/0038-wined3d-Send-primitive-type-updates-through-the-comm.patch b/patches/wined3d-CSMT_Main/0050-wined3d-Send-primitive-type-updates-through-the-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0038-wined3d-Send-primitive-type-updates-through-the-comm.patch rename to patches/wined3d-CSMT_Main/0050-wined3d-Send-primitive-type-updates-through-the-comm.patch diff --git a/patches/wined3d-CSMT_Main/0039-wined3d-Send-bool-constant-updates-through-the-comma.patch b/patches/wined3d-CSMT_Main/0051-wined3d-Send-bool-constant-updates-through-the-comma.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0039-wined3d-Send-bool-constant-updates-through-the-comma.patch rename to patches/wined3d-CSMT_Main/0051-wined3d-Send-bool-constant-updates-through-the-comma.patch diff --git a/patches/wined3d-CSMT_Main/0040-wined3d-Send-int-constant-updates-through-the-comman.patch b/patches/wined3d-CSMT_Main/0052-wined3d-Send-int-constant-updates-through-the-comman.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0040-wined3d-Send-int-constant-updates-through-the-comman.patch rename to patches/wined3d-CSMT_Main/0052-wined3d-Send-int-constant-updates-through-the-comman.patch diff --git a/patches/wined3d-CSMT_Main/0041-wined3d-Send-light-updates-through-the-command-strea.patch b/patches/wined3d-CSMT_Main/0053-wined3d-Send-light-updates-through-the-command-strea.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0041-wined3d-Send-light-updates-through-the-command-strea.patch rename to patches/wined3d-CSMT_Main/0053-wined3d-Send-light-updates-through-the-command-strea.patch diff --git a/patches/wined3d-CSMT_Main/0042-wined3d-Prevent-the-command-stream-from-running-ahea.patch b/patches/wined3d-CSMT_Main/0054-wined3d-Prevent-the-command-stream-from-running-ahea.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0042-wined3d-Prevent-the-command-stream-from-running-ahea.patch rename to patches/wined3d-CSMT_Main/0054-wined3d-Prevent-the-command-stream-from-running-ahea.patch diff --git a/patches/wined3d-CSMT_Main/0043-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch b/patches/wined3d-CSMT_Main/0055-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0043-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch rename to patches/wined3d-CSMT_Main/0055-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch diff --git a/patches/wined3d-CSMT_Main/0044-wined3d-Run-the-cs-asynchronously.patch b/patches/wined3d-CSMT_Main/0056-wined3d-Run-the-cs-asynchronously.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0044-wined3d-Run-the-cs-asynchronously.patch rename to patches/wined3d-CSMT_Main/0056-wined3d-Run-the-cs-asynchronously.patch diff --git a/patches/wined3d-CSMT_Main/0045-wined3d-Send-blits-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0057-wined3d-Send-blits-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0045-wined3d-Send-blits-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0057-wined3d-Send-blits-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0046-wined3d-Hack-to-reject-unsupported-color-fills.patch b/patches/wined3d-CSMT_Main/0058-wined3d-Hack-to-reject-unsupported-color-fills.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0046-wined3d-Hack-to-reject-unsupported-color-fills.patch rename to patches/wined3d-CSMT_Main/0058-wined3d-Hack-to-reject-unsupported-color-fills.patch diff --git a/patches/wined3d-CSMT_Main/0047-wined3d-Restore-some-wined3d_device_copy_sub_resourc.patch b/patches/wined3d-CSMT_Main/0059-wined3d-Restore-some-wined3d_device_copy_sub_resourc.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0047-wined3d-Restore-some-wined3d_device_copy_sub_resourc.patch rename to patches/wined3d-CSMT_Main/0059-wined3d-Restore-some-wined3d_device_copy_sub_resourc.patch diff --git a/patches/wined3d-CSMT_Main/0048-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch b/patches/wined3d-CSMT_Main/0060-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0048-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch rename to patches/wined3d-CSMT_Main/0060-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch diff --git a/patches/wined3d-CSMT_Main/0049-wined3d-Send-render-target-view-clears-through-the-c.patch b/patches/wined3d-CSMT_Main/0061-wined3d-Send-render-target-view-clears-through-the-c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0049-wined3d-Send-render-target-view-clears-through-the-c.patch rename to patches/wined3d-CSMT_Main/0061-wined3d-Send-render-target-view-clears-through-the-c.patch diff --git a/patches/wined3d-CSMT_Main/0050-wined3d-send-texture-maps-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0062-wined3d-send-texture-maps-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0050-wined3d-send-texture-maps-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0062-wined3d-send-texture-maps-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0051-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch b/patches/wined3d-CSMT_Main/0063-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0051-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch rename to patches/wined3d-CSMT_Main/0063-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch diff --git a/patches/wined3d-CSMT_Main/0052-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch b/patches/wined3d-CSMT_Main/0064-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0052-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch rename to patches/wined3d-CSMT_Main/0064-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch diff --git a/patches/wined3d-CSMT_Main/0053-wined3d-Don-t-preload-buffers-on-unmap.patch b/patches/wined3d-CSMT_Main/0065-wined3d-Don-t-preload-buffers-on-unmap.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0053-wined3d-Don-t-preload-buffers-on-unmap.patch rename to patches/wined3d-CSMT_Main/0065-wined3d-Don-t-preload-buffers-on-unmap.patch diff --git a/patches/wined3d-CSMT_Main/0054-wined3d-Don-t-call-glFinish-before-swapping.patch b/patches/wined3d-CSMT_Main/0066-wined3d-Don-t-call-glFinish-before-swapping.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0054-wined3d-Don-t-call-glFinish-before-swapping.patch rename to patches/wined3d-CSMT_Main/0066-wined3d-Don-t-call-glFinish-before-swapping.patch diff --git a/patches/wined3d-CSMT_Main/0055-wined3d-Add-query-support-to-the-command-stream.patch b/patches/wined3d-CSMT_Main/0067-wined3d-Add-query-support-to-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0055-wined3d-Add-query-support-to-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0067-wined3d-Add-query-support-to-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0056-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch b/patches/wined3d-CSMT_Main/0068-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0056-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch rename to patches/wined3d-CSMT_Main/0068-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch diff --git a/patches/wined3d-CSMT_Main/0057-wined3d-Poll-queries-automatically-in-the-CS.patch b/patches/wined3d-CSMT_Main/0069-wined3d-Poll-queries-automatically-in-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0057-wined3d-Poll-queries-automatically-in-the-CS.patch rename to patches/wined3d-CSMT_Main/0069-wined3d-Poll-queries-automatically-in-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0058-wined3d-Introduce-a-separate-queue-for-priority-comm.patch b/patches/wined3d-CSMT_Main/0070-wined3d-Introduce-a-separate-queue-for-priority-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0058-wined3d-Introduce-a-separate-queue-for-priority-comm.patch rename to patches/wined3d-CSMT_Main/0070-wined3d-Introduce-a-separate-queue-for-priority-comm.patch diff --git a/patches/wined3d-CSMT_Main/0059-wined3d-Don-t-poll-queries-that-failed-to-start.patch b/patches/wined3d-CSMT_Main/0071-wined3d-Don-t-poll-queries-that-failed-to-start.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0059-wined3d-Don-t-poll-queries-that-failed-to-start.patch rename to patches/wined3d-CSMT_Main/0071-wined3d-Don-t-poll-queries-that-failed-to-start.patch diff --git a/patches/wined3d-CSMT_Main/0060-wined3d-Remove-restated-queries-from-the-poll-list.patch b/patches/wined3d-CSMT_Main/0072-wined3d-Remove-restated-queries-from-the-poll-list.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0060-wined3d-Remove-restated-queries-from-the-poll-list.patch rename to patches/wined3d-CSMT_Main/0072-wined3d-Remove-restated-queries-from-the-poll-list.patch diff --git a/patches/wined3d-CSMT_Main/0061-wined3d-Put-this-into-the-query-poll-patch.patch b/patches/wined3d-CSMT_Main/0073-wined3d-Put-this-into-the-query-poll-patch.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0061-wined3d-Put-this-into-the-query-poll-patch.patch rename to patches/wined3d-CSMT_Main/0073-wined3d-Put-this-into-the-query-poll-patch.patch diff --git a/patches/wined3d-CSMT_Main/0062-wined3d-Don-t-access-device-state-in-clears.patch b/patches/wined3d-CSMT_Main/0074-wined3d-Don-t-access-device-state-in-clears.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0062-wined3d-Don-t-access-device-state-in-clears.patch rename to patches/wined3d-CSMT_Main/0074-wined3d-Don-t-access-device-state-in-clears.patch diff --git a/patches/wined3d-CSMT_Main/0063-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch b/patches/wined3d-CSMT_Main/0075-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0063-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch rename to patches/wined3d-CSMT_Main/0075-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch diff --git a/patches/wined3d-CSMT_Main/0064-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch b/patches/wined3d-CSMT_Main/0076-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0064-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch rename to patches/wined3d-CSMT_Main/0076-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch diff --git a/patches/wined3d-CSMT_Main/0065-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0077-wined3d-Send-update_texture-calls-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0065-wined3d-Send-update_texture-calls-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0077-wined3d-Send-update_texture-calls-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0066-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch b/patches/wined3d-CSMT_Main/0078-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0066-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch rename to patches/wined3d-CSMT_Main/0078-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0067-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch b/patches/wined3d-CSMT_Main/0079-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0067-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch rename to patches/wined3d-CSMT_Main/0079-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch diff --git a/patches/wined3d-CSMT_Main/0068-wined3d-Fence-update_texture-calls.patch b/patches/wined3d-CSMT_Main/0080-wined3d-Fence-update_texture-calls.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0068-wined3d-Fence-update_texture-calls.patch rename to patches/wined3d-CSMT_Main/0080-wined3d-Fence-update_texture-calls.patch diff --git a/patches/wined3d-CSMT_Main/0069-wined3d-Dirtify-resources-on-unmap.patch b/patches/wined3d-CSMT_Main/0081-wined3d-Dirtify-resources-on-unmap.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0069-wined3d-Dirtify-resources-on-unmap.patch rename to patches/wined3d-CSMT_Main/0081-wined3d-Dirtify-resources-on-unmap.patch diff --git a/patches/wined3d-CSMT_Main/0070-wined3d-Fence-render-targets-and-depth-stencils.patch b/patches/wined3d-CSMT_Main/0082-wined3d-Fence-render-targets-and-depth-stencils.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0070-wined3d-Fence-render-targets-and-depth-stencils.patch rename to patches/wined3d-CSMT_Main/0082-wined3d-Fence-render-targets-and-depth-stencils.patch diff --git a/patches/wined3d-CSMT_Main/0071-wined3d-Fence-blit-operations.patch b/patches/wined3d-CSMT_Main/0083-wined3d-Fence-blit-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0071-wined3d-Fence-blit-operations.patch rename to patches/wined3d-CSMT_Main/0083-wined3d-Fence-blit-operations.patch diff --git a/patches/wined3d-CSMT_Main/0072-wined3d-Fence-color_fill-operations.patch b/patches/wined3d-CSMT_Main/0084-wined3d-Fence-color_fill-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0072-wined3d-Fence-color_fill-operations.patch rename to patches/wined3d-CSMT_Main/0084-wined3d-Fence-color_fill-operations.patch diff --git a/patches/wined3d-CSMT_Main/0073-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch b/patches/wined3d-CSMT_Main/0085-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0073-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch rename to patches/wined3d-CSMT_Main/0085-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch diff --git a/patches/wined3d-CSMT_Main/0074-wined3d-Send-update_sub_resource-calls-through-the-c.patch b/patches/wined3d-CSMT_Main/0086-wined3d-Send-update_sub_resource-calls-through-the-c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0074-wined3d-Send-update_sub_resource-calls-through-the-c.patch rename to patches/wined3d-CSMT_Main/0086-wined3d-Send-update_sub_resource-calls-through-the-c.patch diff --git a/patches/wined3d-CSMT_Main/0075-wined3d-Dirtify-changed-textures-through-the-command.patch b/patches/wined3d-CSMT_Main/0087-wined3d-Dirtify-changed-textures-through-the-command.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0075-wined3d-Dirtify-changed-textures-through-the-command.patch rename to patches/wined3d-CSMT_Main/0087-wined3d-Dirtify-changed-textures-through-the-command.patch diff --git a/patches/wined3d-CSMT_Main/0076-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0088-wined3d-Wrap-GL-BOs-in-a-structure.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0076-wined3d-Wrap-GL-BOs-in-a-structure.patch rename to patches/wined3d-CSMT_Main/0088-wined3d-Wrap-GL-BOs-in-a-structure.patch diff --git a/patches/wined3d-CSMT_Main/0077-wined3d-Separate-resource-map-and-draw-buffers.patch b/patches/wined3d-CSMT_Main/0089-wined3d-Separate-resource-map-and-draw-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0077-wined3d-Separate-resource-map-and-draw-buffers.patch rename to patches/wined3d-CSMT_Main/0089-wined3d-Separate-resource-map-and-draw-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0078-wined3d-Implement-DISCARD-texture-maps-with-PBOs.patch b/patches/wined3d-CSMT_Main/0090-wined3d-Implement-DISCARD-texture-maps-with-PBOs.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0078-wined3d-Implement-DISCARD-texture-maps-with-PBOs.patch rename to patches/wined3d-CSMT_Main/0090-wined3d-Implement-DISCARD-texture-maps-with-PBOs.patch diff --git a/patches/wined3d-CSMT_Main/0079-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch b/patches/wined3d-CSMT_Main/0091-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0079-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch rename to patches/wined3d-CSMT_Main/0091-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch diff --git a/patches/wined3d-CSMT_Main/0080-wined3d-Unset-some-objects-in-state_init_default.patch b/patches/wined3d-CSMT_Main/0092-wined3d-Unset-some-objects-in-state_init_default.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0080-wined3d-Unset-some-objects-in-state_init_default.patch rename to patches/wined3d-CSMT_Main/0092-wined3d-Unset-some-objects-in-state_init_default.patch diff --git a/patches/wined3d-CSMT_Main/0081-wined3d-Use-double-buffered-buffers-for-multithreade.patch b/patches/wined3d-CSMT_Main/0093-wined3d-Use-double-buffered-buffers-for-multithreade.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0081-wined3d-Use-double-buffered-buffers-for-multithreade.patch rename to patches/wined3d-CSMT_Main/0093-wined3d-Use-double-buffered-buffers-for-multithreade.patch diff --git a/patches/wined3d-CSMT_Main/0082-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch b/patches/wined3d-CSMT_Main/0094-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0082-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0094-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0083-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch b/patches/wined3d-CSMT_Main/0095-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0083-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch rename to patches/wined3d-CSMT_Main/0095-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch diff --git a/patches/wined3d-CSMT_Main/0084-wined3d-Accelerate-DISCARD-buffer-maps.patch b/patches/wined3d-CSMT_Main/0096-wined3d-Accelerate-DISCARD-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0084-wined3d-Accelerate-DISCARD-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0096-wined3d-Accelerate-DISCARD-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0085-wined3d-Accelerate-READONLY-buffer-maps.patch b/patches/wined3d-CSMT_Main/0097-wined3d-Accelerate-READONLY-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0085-wined3d-Accelerate-READONLY-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0097-wined3d-Accelerate-READONLY-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0086-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch b/patches/wined3d-CSMT_Main/0098-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0086-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0098-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0087-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch b/patches/wined3d-CSMT_Main/0099-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0087-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch rename to patches/wined3d-CSMT_Main/0099-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0088-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch b/patches/wined3d-CSMT_Main/0100-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0088-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch rename to patches/wined3d-CSMT_Main/0100-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch diff --git a/patches/wined3d-CSMT_Main/0089-wined3d-Separate-GL-buffer-discard-control-from-igno.patch b/patches/wined3d-CSMT_Main/0101-wined3d-Separate-GL-buffer-discard-control-from-igno.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0089-wined3d-Separate-GL-buffer-discard-control-from-igno.patch rename to patches/wined3d-CSMT_Main/0101-wined3d-Separate-GL-buffer-discard-control-from-igno.patch diff --git a/patches/wined3d-CSMT_Main/0090-wined3d-Create-buffers-before-mapping-them.patch b/patches/wined3d-CSMT_Main/0102-wined3d-Create-buffers-before-mapping-them.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0090-wined3d-Create-buffers-before-mapping-them.patch rename to patches/wined3d-CSMT_Main/0102-wined3d-Create-buffers-before-mapping-them.patch diff --git a/patches/wined3d-CSMT_Main/0091-wined3d-Remove-another-glFinish.patch b/patches/wined3d-CSMT_Main/0103-wined3d-Remove-another-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0091-wined3d-Remove-another-glFinish.patch rename to patches/wined3d-CSMT_Main/0103-wined3d-Remove-another-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0092-wined3d-Create-VBOs-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0104-wined3d-Create-VBOs-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0092-wined3d-Create-VBOs-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0104-wined3d-Create-VBOs-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0093-Swapchain-waits.patch b/patches/wined3d-CSMT_Main/0105-Swapchain-waits.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0093-Swapchain-waits.patch rename to patches/wined3d-CSMT_Main/0105-Swapchain-waits.patch diff --git a/patches/wined3d-CSMT_Main/0094-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch b/patches/wined3d-CSMT_Main/0106-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0094-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch rename to patches/wined3d-CSMT_Main/0106-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch diff --git a/patches/wined3d-CSMT_Main/0095-wined3d-Unload-resources-through-the-CS-in-device_re.patch b/patches/wined3d-CSMT_Main/0107-wined3d-Unload-resources-through-the-CS-in-device_re.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0095-wined3d-Unload-resources-through-the-CS-in-device_re.patch rename to patches/wined3d-CSMT_Main/0107-wined3d-Unload-resources-through-the-CS-in-device_re.patch diff --git a/patches/wined3d-CSMT_Main/0096-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch b/patches/wined3d-CSMT_Main/0108-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0096-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch rename to patches/wined3d-CSMT_Main/0108-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch diff --git a/patches/wined3d-CSMT_Main/0097-wined3d-Use-surface_blt_ugly-in-swapchain_gl_present.patch b/patches/wined3d-CSMT_Main/0109-wined3d-Use-surface_blt_ugly-in-swapchain_gl_present.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0097-wined3d-Use-surface_blt_ugly-in-swapchain_gl_present.patch rename to patches/wined3d-CSMT_Main/0109-wined3d-Use-surface_blt_ugly-in-swapchain_gl_present.patch diff --git a/patches/wined3d-CSMT_Main/0098-wined3d-Use-an-event-to-block-the-worker-thread-when.patch b/patches/wined3d-CSMT_Main/0110-wined3d-Use-an-event-to-block-the-worker-thread-when.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0098-wined3d-Use-an-event-to-block-the-worker-thread-when.patch rename to patches/wined3d-CSMT_Main/0110-wined3d-Use-an-event-to-block-the-worker-thread-when.patch diff --git a/patches/wined3d-CSMT_Main/0099-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch b/patches/wined3d-CSMT_Main/0111-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0099-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch rename to patches/wined3d-CSMT_Main/0111-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch diff --git a/patches/wined3d-CSMT_Main/0100-wined3d-Wait-only-for-the-buffer-to-be-idle.patch b/patches/wined3d-CSMT_Main/0112-wined3d-Wait-only-for-the-buffer-to-be-idle.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0100-wined3d-Wait-only-for-the-buffer-to-be-idle.patch rename to patches/wined3d-CSMT_Main/0112-wined3d-Wait-only-for-the-buffer-to-be-idle.patch diff --git a/patches/wined3d-CSMT_Main/0101-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch b/patches/wined3d-CSMT_Main/0113-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0101-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch rename to patches/wined3d-CSMT_Main/0113-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch diff --git a/patches/wined3d-CSMT_Main/0102-wined3d-Don-t-sync-on-redundant-discard-calls.patch b/patches/wined3d-CSMT_Main/0114-wined3d-Don-t-sync-on-redundant-discard-calls.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0102-wined3d-Don-t-sync-on-redundant-discard-calls.patch rename to patches/wined3d-CSMT_Main/0114-wined3d-Don-t-sync-on-redundant-discard-calls.patch diff --git a/patches/wined3d-CSMT_Main/0103-wined3d-Don-t-discard-new-buffers.patch b/patches/wined3d-CSMT_Main/0115-wined3d-Don-t-discard-new-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0103-wined3d-Don-t-discard-new-buffers.patch rename to patches/wined3d-CSMT_Main/0115-wined3d-Don-t-discard-new-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0104-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch b/patches/wined3d-CSMT_Main/0116-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0104-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch rename to patches/wined3d-CSMT_Main/0116-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch diff --git a/patches/wined3d-CSMT_Main/0105-wined3d-Only-discard-buffers-that-are-in-use.patch b/patches/wined3d-CSMT_Main/0117-wined3d-Only-discard-buffers-that-are-in-use.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0105-wined3d-Only-discard-buffers-that-are-in-use.patch rename to patches/wined3d-CSMT_Main/0117-wined3d-Only-discard-buffers-that-are-in-use.patch diff --git a/patches/wined3d-CSMT_Main/0106-wined3d-Send-getdc-and-releasedc-through-the-command.patch b/patches/wined3d-CSMT_Main/0118-wined3d-Send-getdc-and-releasedc-through-the-command.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0106-wined3d-Send-getdc-and-releasedc-through-the-command.patch rename to patches/wined3d-CSMT_Main/0118-wined3d-Send-getdc-and-releasedc-through-the-command.patch diff --git a/patches/wined3d-CSMT_Main/0107-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch b/patches/wined3d-CSMT_Main/0119-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0107-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch rename to patches/wined3d-CSMT_Main/0119-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch diff --git a/patches/wined3d-CSMT_Main/0108-wined3d-Create-dummy-textures-through-the-CS.patch b/patches/wined3d-CSMT_Main/0120-wined3d-Create-dummy-textures-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0108-wined3d-Create-dummy-textures-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0120-wined3d-Create-dummy-textures-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0109-wined3d-Create-the-initial-context-through-the-CS.patch b/patches/wined3d-CSMT_Main/0121-wined3d-Create-the-initial-context-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0109-wined3d-Create-the-initial-context-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0121-wined3d-Create-the-initial-context-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0110-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch b/patches/wined3d-CSMT_Main/0122-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0110-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch rename to patches/wined3d-CSMT_Main/0122-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch diff --git a/patches/wined3d-CSMT_Main/0111-wined3d-Call-create_default_sampler-from-create_dumm.patch b/patches/wined3d-CSMT_Main/0123-wined3d-Call-create_default_sampler-from-create_dumm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0111-wined3d-Call-create_default_sampler-from-create_dumm.patch rename to patches/wined3d-CSMT_Main/0123-wined3d-Call-create_default_sampler-from-create_dumm.patch diff --git a/patches/wined3d-CSMT_Main/0112-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch b/patches/wined3d-CSMT_Main/0124-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0112-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch rename to patches/wined3d-CSMT_Main/0124-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch diff --git a/patches/wined3d-CSMT_Main/0113-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch b/patches/wined3d-CSMT_Main/0125-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0113-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch rename to patches/wined3d-CSMT_Main/0125-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch diff --git a/patches/wined3d-CSMT_Main/0114-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch b/patches/wined3d-CSMT_Main/0126-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0114-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch rename to patches/wined3d-CSMT_Main/0126-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch diff --git a/patches/wined3d-CSMT_Main/0115-wined3d-Do-the-sampler-GL-init-through-the-CS.patch b/patches/wined3d-CSMT_Main/0127-wined3d-Do-the-sampler-GL-init-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0115-wined3d-Do-the-sampler-GL-init-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0127-wined3d-Do-the-sampler-GL-init-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0116-wined3d-Create-initial-DCs-through-the-CS.patch b/patches/wined3d-CSMT_Main/0128-wined3d-Create-initial-DCs-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0116-wined3d-Create-initial-DCs-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0128-wined3d-Create-initial-DCs-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0117-wined3d-Assign-a-read-buffer-when-discarding-a-new-t.patch b/patches/wined3d-CSMT_Main/0129-wined3d-Assign-a-read-buffer-when-discarding-a-new-t.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0117-wined3d-Assign-a-read-buffer-when-discarding-a-new-t.patch rename to patches/wined3d-CSMT_Main/0129-wined3d-Assign-a-read-buffer-when-discarding-a-new-t.patch diff --git a/patches/wined3d-CSMT_Main/0118-wined3d-Do-not-query-available-GPU-memory-on-main-th.patch b/patches/wined3d-CSMT_Main/0130-wined3d-Do-not-query-available-GPU-memory-on-main-th.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0118-wined3d-Do-not-query-available-GPU-memory-on-main-th.patch rename to patches/wined3d-CSMT_Main/0130-wined3d-Do-not-query-available-GPU-memory-on-main-th.patch diff --git a/patches/wined3d-CSMT_Main/0119-wined3d-Fix-incorrect-return-value-in-wined3d_cs_exe.patch b/patches/wined3d-CSMT_Main/0131-wined3d-Fix-incorrect-return-value-in-wined3d_cs_exe.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0119-wined3d-Fix-incorrect-return-value-in-wined3d_cs_exe.patch rename to patches/wined3d-CSMT_Main/0131-wined3d-Fix-incorrect-return-value-in-wined3d_cs_exe.patch diff --git a/patches/wined3d-CSMT_Main/0120-wined3d-Fix-context_acquire-not-being-called-from-th.patch b/patches/wined3d-CSMT_Main/0132-wined3d-Fix-context_acquire-not-being-called-from-th.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0120-wined3d-Fix-context_acquire-not-being-called-from-th.patch rename to patches/wined3d-CSMT_Main/0132-wined3d-Fix-context_acquire-not-being-called-from-th.patch diff --git a/patches/wined3d-CSMT_Main/0121-wined3d-Do-not-signal-CS-event-when-we-manage-to-uns.patch b/patches/wined3d-CSMT_Main/0133-wined3d-Do-not-signal-CS-event-when-we-manage-to-uns.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0121-wined3d-Do-not-signal-CS-event-when-we-manage-to-uns.patch rename to patches/wined3d-CSMT_Main/0133-wined3d-Do-not-signal-CS-event-when-we-manage-to-uns.patch diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 67ee031f..b08066a4 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -86,19 +86,23 @@ diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -32,7 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); +@@ -32,17 +32,27 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ #define WINED3D_BUFFER_USE_BO 0x02 /* Use a buffer object for this buffer. */ #define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */ +#if !defined(STAGING_CSMT) #define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */ + #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ + #define WINED3D_BUFFER_MAP 0x20 /* There has been at least one map since the last preload. */ + #define WINED3D_BUFFER_APPLESYNC 0x40 /* Using sync as in GL_APPLE_flush_buffer_range. */ +#else /* STAGING_CSMT */ +#define WINED3D_BUFFER_DISCARD 0x08 /* The next PreLoad may discard the buffer contents. */ ++#define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ ++#define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ +#endif /* STAGING_CSMT */ - #define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */ - #define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */ -@@ -41,7 +45,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); + #define VB_MAXDECLCHANGES 100 /* After that number of decl changes we stop converting */ + #define VB_RESETDECLCHANGE 1000 /* Reset the decl changecount after that number of draws */ #define VB_MAXFULLCONVERSIONS 5 /* Number of full conversions before we stop converting */ #define VB_RESETFULLCONVS 20 /* Reset full conversion counts after that number of draws */ @@ -110,7 +114,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { if (!offset && (!size || size == buffer->resource.size)) goto invalidate_all; -@@ -93,6 +101,7 @@ static BOOL buffer_is_fully_dirty(const struct wined3d_buffer *buffer) +@@ -94,6 +104,7 @@ static BOOL buffer_is_fully_dirty(const struct wined3d_buffer *buffer) && !buffer->maps->offset && buffer->maps->size == buffer->resource.size; } @@ -118,7 +122,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c void wined3d_buffer_validate_location(struct wined3d_buffer *buffer, DWORD location) { TRACE("buffer %p, location %s.\n", buffer, wined3d_debug_location(location)); -@@ -127,6 +136,7 @@ void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD loc +@@ -128,6 +139,7 @@ void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD loc wined3d_buffer_invalidate_range(buffer, location, 0, 0); } @@ -126,7 +130,35 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c /* Context activation is done by the caller. */ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *context) { -@@ -156,6 +166,7 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g +@@ -139,6 +151,7 @@ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *c + GL_EXTCALL(glBindBuffer(buffer->buffer_type_hint, buffer->buffer_object)); + } + ++#if !defined(STAGING_CSMT) + /* Context activation is done by the caller. */ + static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const struct wined3d_context *context) + { +@@ -180,9 +193,27 @@ static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const st + buffer->query = NULL; + } + buffer->flags &= ~WINED3D_BUFFER_APPLESYNC; ++#else /* STAGING_CSMT */ ++/* Context activation is done by the caller */ ++static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info) ++{ ++ if(!This->buffer_object) return; ++ ++ GL_EXTCALL(glDeleteBuffers(1, &This->buffer_object)); ++ checkGLcall("glDeleteBuffers"); ++ This->buffer_object = 0; ++ ++ if(This->query) ++ { ++ wined3d_event_query_destroy(This->query); ++ This->query = NULL; ++ } ++ This->flags &= ~WINED3D_BUFFER_APPLESYNC; ++#endif /* STAGING_CSMT */ } /* Context activation is done by the caller. */ @@ -134,7 +166,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wined3d_context *context) { const struct wined3d_gl_info *gl_info = context->gl_info; -@@ -170,6 +181,22 @@ static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wi +@@ -197,6 +228,22 @@ static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wi * if an error during VBO creation occurs we can fall back to non-VBO operation * with full functionality(but performance loss). */ @@ -157,7 +189,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c while (gl_info->gl_ops.gl.p_glGetError() != GL_NO_ERROR); /* Basically the FVF parameter passed to CreateVertexBuffer is no good. -@@ -178,27 +205,48 @@ static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wi +@@ -205,27 +252,48 @@ static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wi * to be verified to check if the rhw and color values are in the correct * format. */ @@ -206,7 +238,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (gl_info->supported[APPLE_FLUSH_BUFFER_RANGE]) { GL_EXTCALL(glBufferParameteriAPPLE(buffer->buffer_type_hint, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE)); -@@ -207,21 +255,46 @@ static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wi +@@ -234,21 +302,46 @@ static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wi buffer->flags |= WINED3D_BUFFER_APPLESYNC; } /* No setup is needed here for GL_ARB_map_buffer_range. */ @@ -253,8 +285,8 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c buffer->buffer_object_usage = gl_usage; if (buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER) -@@ -244,6 +317,26 @@ fail: - delete_gl_buffer(buffer, gl_info); +@@ -271,6 +364,26 @@ fail: + buffer_destroy_buffer_object(buffer, context); buffer_clear_dirty_areas(buffer); return FALSE; +#else /* STAGING_CSMT */ @@ -280,7 +312,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } static BOOL buffer_process_converted_attribute(struct wined3d_buffer *buffer, -@@ -462,7 +555,11 @@ static BOOL buffer_find_decl(struct wined3d_buffer *This, const struct wined3d_s +@@ -489,7 +602,11 @@ static BOOL buffer_find_decl(struct wined3d_buffer *This, const struct wined3d_s return ret; } @@ -292,7 +324,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { DWORD src_color = *dst_color; -@@ -479,11 +576,17 @@ static inline unsigned int fixup_d3dcolor(DWORD *dst_color) +@@ -506,6 +623,7 @@ static inline unsigned int fixup_d3dcolor(DWORD *dst_color) *dst_color |= (src_color & 0xff00ff00u); /* Alpha Green */ *dst_color |= (src_color & 0x00ff0000u) >> 16; /* Red */ *dst_color |= (src_color & 0x000000ffu) << 16; /* Blue */ @@ -300,31 +332,26 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c return sizeof(*dst_color); } - - static inline unsigned int fixup_transformed_pos(float *p) -+#else /* STAGING_CSMT */ -+} -+ -+static inline void fixup_transformed_pos(float *p) -+#endif /* STAGING_CSMT */ - { - /* rhw conversion like in position_float4(). */ - if (p[3] != 1.0f && p[3] != 0.0f) -@@ -494,6 +597,7 @@ static inline unsigned int fixup_transformed_pos(float *p) - p[2] *= w; - p[3] = w; - } -+#if !defined(STAGING_CSMT) - - return 4 * sizeof(*p); - } -@@ -595,11 +699,49 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, +@@ -622,11 +740,62 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, wined3d_buffer_validate_location(buffer, location); return TRUE; +#else /* STAGING_CSMT */ +} + ++static inline void fixup_transformed_pos(float *p) ++{ ++ /* rhw conversion like in position_float4(). */ ++ if (p[3] != 1.0f && p[3] != 0.0f) ++ { ++ float w = 1.0f / p[3]; ++ p[0] *= w; ++ p[1] *= w; ++ p[2] *= w; ++ p[3] = w; ++ } ++} ++ +/* Context activation is done by the caller. */ +void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *context, + struct wined3d_bo_address *data) @@ -368,10 +395,10 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_SYSMEM); return buffer->resource.heap_memory; } -@@ -626,12 +768,32 @@ void wined3d_buffer_get_memory(struct wined3d_buffer *buffer, - ERR("Unexpected locations %s.\n", wined3d_debug_location(locations)); +@@ -654,17 +823,38 @@ DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, data->buffer_object = 0; data->addr = NULL; + return 0; +#else /* STAGING_CSMT */ + const struct wined3d_gl_info *gl_info = context->gl_info; + @@ -401,18 +428,22 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c TRACE("buffer %p.\n", buffer); -@@ -642,12 +804,22 @@ static void buffer_unload(struct wined3d_resource *resource) - - context = context_acquire(device, NULL); - + if (buffer->buffer_object) + { +#if !defined(STAGING_CSMT) - /* Download the buffer, but don't permanently enable double buffering. */ - wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_SYSMEM); - if (!(flags & WINED3D_BUFFER_DOUBLEBUFFER)) - buffer->flags &= ~WINED3D_BUFFER_DOUBLEBUFFER; + struct wined3d_context *context; + + context = context_acquire(resource->device, NULL); +@@ -676,6 +866,21 @@ static void buffer_unload(struct wined3d_resource *resource) wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER); + buffer_destroy_buffer_object(buffer, context); +#else /* STAGING_CSMT */ ++ struct wined3d_device *device = resource->device; ++ struct wined3d_context *context; ++ ++ context = context_acquire(device, NULL); ++ + /* Download the buffer, but don't permanently enable double buffering */ + if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)) + { @@ -420,28 +451,41 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c + buffer->flags &= ~WINED3D_BUFFER_DOUBLEBUFFER; + } + ++ delete_gl_buffer(buffer, context->gl_info); +#endif /* STAGING_CSMT */ - delete_gl_buffer(buffer, context->gl_info); buffer_clear_dirty_areas(buffer); -@@ -665,12 +837,16 @@ static void buffer_unload(struct wined3d_resource *resource) - * happens only once per changed vertexbuffer and should occur rather - * rarely. */ - if (resource->bind_count) -+#if !defined(STAGING_CSMT) - { - device_invalidate_state(device, STATE_STREAMSRC); - - if (buffer->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER) - device_invalidate_state(device, STATE_INDEXBUFFER); - } -+#else /* STAGING_CSMT */ + context_release(context); +@@ -685,6 +890,16 @@ static void buffer_unload(struct wined3d_resource *resource) + buffer->stride = 0; + buffer->conversion_stride = 0; + buffer->flags &= ~WINED3D_BUFFER_HASDESC; ++#if defined(STAGING_CSMT) ++ ++ /* The stream source state handler might have read the memory of the ++ * vertex buffer already and got the memory in the vbo which is not ++ * valid any longer. Dirtify the stream source to force a reload. This ++ * happens only once per changed vertexbuffer and should occur rather ++ * rarely. */ ++ if (resource->bind_count) + device_invalidate_state(device, STATE_STREAMSRC); +#endif /* STAGING_CSMT */ } resource_unload(resource); -@@ -793,6 +969,7 @@ drop_query: +@@ -704,7 +919,11 @@ static void wined3d_buffer_destroy_object(void *object) + if (buffer->buffer_object) + { + context = context_acquire(buffer->resource.device, NULL); ++#if !defined(STAGING_CSMT) + buffer_destroy_buffer_object(buffer, context); ++#else /* STAGING_CSMT */ ++ delete_gl_buffer(buffer, context->gl_info); ++#endif /* STAGING_CSMT */ + context_release(context); + + HeapFree(GetProcessHeap(), 0, buffer->conversion_map); +@@ -807,6 +1026,7 @@ drop_query: } /* The caller provides a GL context */ @@ -449,7 +493,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_context *context, DWORD flags) { const struct wined3d_gl_info *gl_info = context->gl_info; -@@ -830,6 +1007,33 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con +@@ -844,6 +1064,33 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con { ERR("Failed to map OpenGL buffer.\n"); return; @@ -483,7 +527,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } while (This->modified_areas) -@@ -838,6 +1042,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con +@@ -852,6 +1099,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con start = This->maps[This->modified_areas].offset; len = This->maps[This->modified_areas].size; @@ -491,10 +535,10 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c memcpy(map + start, (BYTE *)This->resource.heap_memory + start, len); if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) -@@ -916,6 +1121,14 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined - } - +@@ -932,18 +1180,39 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined void buffer_mark_used(struct wined3d_buffer *buffer) + { + buffer->flags &= ~(WINED3D_BUFFER_MAP | WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); +#else /* STAGING_CSMT */ + GL_EXTCALL(glBufferSubData(This->buffer_type_hint, start, len, (BYTE *)This->resource.heap_memory + start)); + checkGLcall("glBufferSubData"); @@ -502,20 +546,25 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +} + +static void buffer_mark_used(struct wined3d_buffer *buffer) ++{ ++ buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); +#endif /* STAGING_CSMT */ - { - buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); } -@@ -926,10 +1139,19 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * + + /* Context activation is done by the caller. */ + void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context, + const struct wined3d_state *state) { - DWORD flags = buffer->flags & (WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); - const struct wined3d_gl_info *gl_info = context->gl_info; +#if !defined(STAGING_CSMT) -+ BOOL decl_changed = FALSE; + DWORD flags = buffer->flags & (WINED3D_BUFFER_MAP | WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); + const struct wined3d_gl_info *gl_info = context->gl_info; + BOOL decl_changed = FALSE; +#else /* STAGING_CSMT */ ++ DWORD flags = buffer->flags & (WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); ++ const struct wined3d_gl_info *gl_info = context->gl_info; + struct wined3d_device *device = buffer->resource.device; + UINT start, end, len, vertices; - BOOL decl_changed = FALSE; ++ BOOL decl_changed = FALSE; + unsigned int i, j; + BYTE *data; +#endif /* STAGING_CSMT */ @@ -526,7 +575,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (buffer->resource.map_count) { WARN("Buffer is mapped, skipping preload.\n"); -@@ -946,6 +1168,23 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * +@@ -960,6 +1229,23 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * } wined3d_buffer_prepare_location(buffer, context, WINED3D_LOCATION_BUFFER); @@ -550,7 +599,23 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c /* Reading the declaration makes only sense if we have valid state information * (i.e., if this function is called during draws). */ -@@ -1027,15 +1266,29 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * +@@ -1010,9 +1296,15 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * + WARN("Reloading buffer because of a vertex declaration change.\n"); + buffer_invalidate_bo_range(buffer, 0, 0); + ++#if !defined(STAGING_CSMT) + /* Avoid unfenced updates, we might overwrite more areas of the buffer than the application + * cleared for unsynchronized updates. + */ ++#else /* STAGING_CSMT */ ++ /* Avoid unfenced updates, we might overwrite more areas of the buffer than the application ++ * cleared for unsynchronized updates ++ */ ++#endif /* STAGING_CSMT */ + flags = 0; + } + else +@@ -1041,15 +1333,29 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * } } @@ -580,7 +645,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c /* Nothing to do because heap memory exists if the buffer is double buffer or has no BO at all. */ if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)) return; -@@ -1046,6 +1299,69 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * +@@ -1060,6 +1366,69 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * { buffer_conversion_upload(buffer, context); } @@ -650,7 +715,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) -@@ -1057,13 +1373,21 @@ struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffe +@@ -1071,13 +1440,21 @@ struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffe static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UINT size, BYTE **data, DWORD flags) { @@ -672,7 +737,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture * fill rate test seems to depend on this. When we map a buffer with * GL_MAP_INVALIDATE_BUFFER_BIT, the driver is free to discard the -@@ -1071,18 +1395,50 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI +@@ -1085,18 +1462,50 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI * the buffer is currently in use, while the proprietary NVIDIA driver * appears to do this unconditionally. */ if (buffer->flags & WINED3D_BUFFER_DISCARD) @@ -723,7 +788,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { dirty_offset = 0; dirty_size = 0; -@@ -1108,6 +1464,25 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI +@@ -1122,6 +1531,25 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI if (count == 1) { const struct wined3d_gl_info *gl_info; @@ -749,7 +814,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c context = context_acquire(device, NULL); gl_info = context->gl_info; -@@ -1150,14 +1525,21 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI +@@ -1164,14 +1592,21 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI else { TRACE("Falling back to doublebuffered operation.\n"); @@ -769,9 +834,9 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } +#if !defined(STAGING_CSMT) + buffer->flags |= WINED3D_BUFFER_MAP; if (flags & WINED3D_MAP_DISCARD) - buffer->flags |= WINED3D_BUFFER_DISCARD; -@@ -1166,6 +1548,43 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI +@@ -1181,6 +1616,43 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI } base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; @@ -815,7 +880,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c *data = base + offset; TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset); -@@ -1228,28 +1647,44 @@ static void wined3d_buffer_unmap(struct wined3d_buffer *buffer) +@@ -1243,22 +1715,31 @@ static void wined3d_buffer_unmap(struct wined3d_buffer *buffer) } GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint)); @@ -847,25 +912,26 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c const struct wined3d_gl_info *gl_info; struct wined3d_bo_address dst, src; struct wined3d_context *context; - struct wined3d_device *device; - BYTE *dst_ptr, *src_ptr; - DWORD dst_location; +@@ -1269,23 +1750,47 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ + + buffer_mark_used(dst_buffer); + buffer_mark_used(src_buffer); +#else /* STAGING_CSMT */ + BYTE *dst_buffer_mem, *src_buffer_mem, *dst_ptr, *src_ptr; + struct wined3d_bo_address dst_bo_address, src_bo_address; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + struct wined3d_device *device; ++ HRESULT hr; +#endif /* STAGING_CSMT */ - HRESULT hr; device = dst_buffer->resource.device; -@@ -1257,17 +1692,33 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ + context = context_acquire(device, NULL); gl_info = context->gl_info; +#if !defined(STAGING_CSMT) - wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations); + dst_location = wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations); wined3d_buffer_get_memory(src_buffer, &src, src_buffer->locations); if (dst.buffer_object && src.buffer_object) @@ -894,7 +960,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c checkGLcall("direct buffer copy"); } else -@@ -1292,6 +1743,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ +@@ -1310,6 +1815,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ wined3d_buffer_unmap(dst_buffer); } } @@ -902,7 +968,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c else if (!dst.buffer_object && src.buffer_object) { buffer_bind(src_buffer, context); -@@ -1302,15 +1754,35 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ +@@ -1320,14 +1826,34 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_ { buffer_bind(dst_buffer, context); GL_EXTCALL(glBufferSubData(dst_buffer->buffer_type_hint, dst_offset, size, src.addr + src_offset)); @@ -926,7 +992,6 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c memcpy(dst.addr + dst_offset, src.addr + src_offset, size); } - dst_location = dst.buffer_object ? WINED3D_LOCATION_BUFFER : WINED3D_LOCATION_SYSMEM; wined3d_buffer_invalidate_range(dst_buffer, ~dst_location, dst_offset, size); +#else /* STAGING_CSMT */ + memcpy(dst_buffer_mem + dst_offset, src_buffer_mem + src_offset, size); @@ -938,7 +1003,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c context_release(context); return WINED3D_OK; -@@ -1357,6 +1829,14 @@ static void buffer_resource_preload(struct wined3d_resource *resource) +@@ -1374,6 +1900,14 @@ static void buffer_resource_preload(struct wined3d_resource *resource) { struct wined3d_context *context; @@ -953,19 +1018,59 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c context = context_acquire(resource->device, NULL); wined3d_buffer_load(buffer_from_resource(resource), context, NULL); context_release(context); -@@ -1439,7 +1919,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - return hr; - } - buffer->buffer_type_hint = bind_hint; +@@ -1427,6 +1961,7 @@ static const struct wined3d_resource_ops buffer_resource_ops = + buffer_resource_sub_resource_unmap, + }; + +#if !defined(STAGING_CSMT) - buffer->locations = WINED3D_LOCATION_SYSMEM; + static GLenum buffer_type_hint_from_bind_flags(unsigned int bind_flags) + { + if (bind_flags == WINED3D_BIND_INDEX_BUFFER) +@@ -1443,12 +1978,21 @@ static GLenum buffer_type_hint_from_bind_flags(unsigned int bind_flags) + + static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, + UINT size, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, unsigned int bind_flags, +#else /* STAGING_CSMT */ -+ buffer->ignore_discard = TRUE; ++static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, ++ UINT size, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, GLenum bind_hint, ++#endif /* STAGING_CSMT */ + const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops) + { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + const struct wined3d_format *format = wined3d_get_format(gl_info, format_id); ++#if !defined(STAGING_CSMT) + BOOL dynamic_buffer_ok; + HRESULT hr; ++#else /* STAGING_CSMT */ ++ HRESULT hr; ++ BOOL dynamic_buffer_ok; +#endif /* STAGING_CSMT */ - TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, - debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); -@@ -1475,6 +1959,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + if (!size) + { +@@ -1469,6 +2013,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + WARN("Failed to initialize resource, hr %#x.\n", hr); + return hr; + } ++#if !defined(STAGING_CSMT) + buffer->buffer_type_hint = buffer_type_hint_from_bind_flags(bind_flags); + buffer->bind_flags = bind_flags; + buffer->locations = WINED3D_LOCATION_SYSMEM; +@@ -1476,6 +2021,13 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n", + buffer, buffer->resource.size, buffer->resource.usage, + debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory); ++#else /* STAGING_CSMT */ ++ buffer->buffer_type_hint = bind_hint; ++ buffer->ignore_discard = TRUE; ++ ++ TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, ++ debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); ++#endif /* STAGING_CSMT */ + + if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING || pool == WINED3D_POOL_MANAGED) + { +@@ -1508,6 +2060,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device buffer->flags |= WINED3D_BUFFER_USE_BO; } @@ -977,7 +1082,43 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (!(buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)))) { ERR("Out of memory.\n"); -@@ -1596,3 +2085,12 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, +@@ -1542,7 +2099,11 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct + FIXME("Ignoring access flags (pool).\n"); + + hr = buffer_init(object, device, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN, ++#if !defined(STAGING_CSMT) + WINED3D_POOL_MANAGED, desc->bind_flags, data, parent, parent_ops); ++#else /* STAGING_CSMT */ ++ WINED3D_POOL_MANAGED, GL_ARRAY_BUFFER_ARB, data, parent, parent_ops); ++#endif /* STAGING_CSMT */ + if (FAILED(hr)) + { + WARN("Failed to initialize buffer, hr %#x.\n", hr); +@@ -1584,7 +2145,11 @@ HRESULT CDECL wined3d_buffer_create_vb(struct wined3d_device *device, UINT size, + } + + hr = buffer_init(object, device, size, usage, WINED3DFMT_UNKNOWN, ++#if !defined(STAGING_CSMT) + pool, WINED3D_BIND_VERTEX_BUFFER, NULL, parent, parent_ops); ++#else /* STAGING_CSMT */ ++ pool, GL_ARRAY_BUFFER_ARB, NULL, parent, parent_ops); ++#endif /* STAGING_CSMT */ + if (FAILED(hr)) + { + WARN("Failed to initialize buffer, hr %#x.\n", hr); +@@ -1615,7 +2180,11 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, + } + + hr = buffer_init(object, device, size, usage | WINED3DUSAGE_STATICDECL, ++#if !defined(STAGING_CSMT) + WINED3DFMT_UNKNOWN, pool, WINED3D_BIND_INDEX_BUFFER, NULL, ++#else /* STAGING_CSMT */ ++ WINED3DFMT_UNKNOWN, pool, GL_ELEMENT_ARRAY_BUFFER_ARB, NULL, ++#endif /* STAGING_CSMT */ + parent, parent_ops); + if (FAILED(hr)) + { +@@ -1629,3 +2198,12 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, return WINED3D_OK; } @@ -4051,17 +4192,37 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c SetRect(out_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); } -@@ -294,7 +300,9 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c - struct wined3d_surface *target = rt_count ? wined3d_rendertarget_view_get_surface(fb->render_targets[0]) : NULL; +@@ -291,11 +297,17 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + UINT rect_count, const RECT *clear_rect, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color, + float depth, DWORD stencil) + { ++#if !defined(STAGING_CSMT) + struct wined3d_rendertarget_view *rtv = rt_count ? fb->render_targets[0] : NULL; + struct wined3d_surface *target = rtv ? wined3d_rendertarget_view_get_surface(rtv) : NULL; struct wined3d_rendertarget_view *dsv = fb->depth_stencil; struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL; -+#if !defined(STAGING_CSMT) const struct wined3d_state *state = &device->state; ++#else /* STAGING_CSMT */ ++ struct wined3d_surface *target = rt_count ? wined3d_rendertarget_view_get_surface(fb->render_targets[0]) : NULL; ++ struct wined3d_rendertarget_view *dsv = fb->depth_stencil; ++ struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL; +#endif /* STAGING_CSMT */ const struct wined3d_gl_info *gl_info; UINT drawable_width, drawable_height; struct wined3d_color corrected_color; -@@ -358,13 +366,22 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c +@@ -340,7 +352,11 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c + if (target) + { + render_offscreen = context->render_offscreen; ++#if !defined(STAGING_CSMT) + wined3d_rendertarget_view_get_drawable_size(rtv, context, &drawable_width, &drawable_height); ++#else /* STAGING_CSMT */ ++ surface_get_drawable_size(target, context, &drawable_width, &drawable_height); ++#endif /* STAGING_CSMT */ + } + else + { +@@ -359,13 +375,22 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c { DWORD location = render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE; @@ -4084,7 +4245,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { context_release(context); WARN("Failed to apply clear state, skipping clear.\n"); -@@ -420,7 +437,11 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c +@@ -421,7 +446,11 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c wined3d_texture_invalidate_location(texture, rtv->sub_resource_idx, ~rtv->resource->draw_binding); } @@ -4096,7 +4257,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { if (rt_count > 1) WARN("Clearing multiple sRGB render targets with no GL_ARB_framebuffer_sRGB " -@@ -680,7 +701,44 @@ out: +@@ -681,7 +710,44 @@ out: } /* Context activation is done by the caller. */ @@ -4141,7 +4302,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -791,6 +849,9 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ +@@ -792,6 +858,9 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ } context_bind_dummy_textures(device, context); @@ -4151,7 +4312,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } /* Context activation is done by the caller. */ -@@ -822,6 +883,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d +@@ -823,6 +892,7 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d } /* Context activation is done by the caller. */ @@ -4159,7 +4320,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void create_default_samplers(struct wined3d_device *device, struct wined3d_context *context) { const struct wined3d_gl_info *gl_info = context->gl_info; -@@ -855,6 +917,7 @@ static void create_default_samplers(struct wined3d_device *device, struct wined3 +@@ -856,6 +926,7 @@ static void create_default_samplers(struct wined3d_device *device, struct wined3 } /* Context activation is done by the caller. */ @@ -4167,7 +4328,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void destroy_default_samplers(struct wined3d_device *device, struct wined3d_context *context) { const struct wined3d_gl_info *gl_info = context->gl_info; -@@ -1001,7 +1064,11 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi +@@ -1002,7 +1073,11 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil; unsigned int i; @@ -4179,7 +4340,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -1019,9 +1086,13 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1020,9 +1095,13 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc) { static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -4193,7 +4354,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c DWORD clear_flags = 0; HRESULT hr; -@@ -1032,9 +1103,11 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1033,9 +1112,11 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, if (device->wined3d->flags & WINED3D_NO3D) return WINED3DERR_INVALIDCALL; @@ -4205,7 +4366,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = device->shader_backend->shader_alloc_private(device, device->adapter->vertex_pipe, device->adapter->fragment_pipe))) { -@@ -1083,17 +1156,23 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1084,17 +1165,23 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, device->swapchains[0] = swapchain; device_init_swapchain_state(device, swapchain); @@ -4229,7 +4390,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Clear the screen */ if (swapchain->back_buffers && swapchain->back_buffers[0]) clear_flags |= WINED3DCLEAR_TARGET; -@@ -1109,7 +1188,9 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, +@@ -1110,7 +1197,9 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, return WINED3D_OK; err_out: @@ -4239,7 +4400,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) -@@ -1166,8 +1247,10 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) +@@ -1167,8 +1256,10 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { struct wined3d_resource *resource, *cursor; @@ -4250,7 +4411,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_surface *surface; UINT i; -@@ -1176,17 +1259,23 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1177,17 +1268,23 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (!device->d3d_initialized) return WINED3DERR_INVALIDCALL; @@ -4274,7 +4435,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c state_unbind_resources(&device->state); /* Unload resources */ -@@ -1220,9 +1309,21 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1221,9 +1318,21 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { surface = device->onscreen_depth_stencil; device->onscreen_depth_stencil = NULL; @@ -4296,7 +4457,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->fb.depth_stencil) { struct wined3d_rendertarget_view *view = device->fb.depth_stencil; -@@ -1232,9 +1333,13 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1233,9 +1342,13 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->fb.depth_stencil = NULL; wined3d_rendertarget_view_decref(view); } @@ -4310,7 +4471,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_rendertarget_view *view = device->auto_depth_stencil_view; device->auto_depth_stencil_view = NULL; -@@ -1246,6 +1351,24 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1247,6 +1360,24 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) { wined3d_device_set_rendertarget_view(device, i, NULL, FALSE); } @@ -4335,7 +4496,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->back_buffer_view) { wined3d_rendertarget_view_decref(device->back_buffer_view); -@@ -1263,9 +1386,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1264,9 +1395,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) device->swapchains = NULL; device->swapchain_count = 0; @@ -4347,7 +4508,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1310,7 +1435,11 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device +@@ -1311,7 +1444,11 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device /* We can not acquire the context unless there is a swapchain. */ if (device->swapchains && gl_info->supported[NVX_GPU_MEMORY_INFO] && @@ -4359,7 +4520,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { GLint vram_free_kb; UINT64 vram_free; -@@ -1651,6 +1780,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1652,6 +1789,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, light->direction.x, light->direction.y, light->direction.z, light->range, light->falloff, light->theta, light->phi); @@ -4367,7 +4528,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update the live definitions if the light is currently assigned a glIndex. */ if (object->glIndex != -1 && !device->recording) { -@@ -1659,6 +1789,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1660,6 +1798,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex)); } @@ -4375,7 +4536,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Save away the information. */ object->OriginalParms = *light; -@@ -1738,6 +1869,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1739,6 +1878,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, FIXME("Unrecognized light type %#x.\n", light->type); } @@ -4387,7 +4548,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1810,12 +1946,14 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1811,12 +1955,14 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN { if (light_info->glIndex != -1) { @@ -4402,7 +4563,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state->lights[light_info->glIndex] = NULL; light_info->glIndex = -1; } -@@ -1857,6 +1995,7 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1858,6 +2004,7 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -4410,7 +4571,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* i == light_info->glIndex */ if (!device->recording) -@@ -1864,9 +2003,15 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1865,9 +2012,15 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN device_invalidate_state(device, STATE_LIGHT_TYPE); device_invalidate_state(device, STATE_ACTIVELIGHT(i)); } @@ -4426,7 +4587,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2037,6 +2182,11 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I +@@ -2038,6 +2191,11 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -4438,7 +4599,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) -@@ -2082,7 +2232,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) +@@ -2083,7 +2241,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; @@ -4450,7 +4611,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; if (src_view->resource->type == WINED3D_RTYPE_BUFFER) { -@@ -2443,6 +2597,18 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 +@@ -2444,6 +2606,18 @@ struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3 return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -4469,7 +4630,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, unsigned int start_idx, unsigned int count, const BOOL *constants) { -@@ -2470,7 +2636,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, +@@ -2471,7 +2645,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, } else { @@ -4482,7 +4643,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2519,7 +2690,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, +@@ -2520,7 +2699,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, } else { @@ -4495,7 +4656,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2564,7 +2740,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, +@@ -2565,7 +2749,12 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, memset(&device->recording->changed.vs_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.vs_consts_f)); else @@ -4508,7 +4669,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2703,7 +2884,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, +@@ -2704,7 +2893,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, } else { @@ -4521,7 +4682,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2752,7 +2938,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, +@@ -2753,7 +2947,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, } else { @@ -4534,7 +4695,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2798,7 +2989,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, +@@ -2799,7 +2998,12 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, memset(&device->recording->changed.ps_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.ps_consts_f)); else @@ -4547,7 +4708,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2963,6 +3159,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO +@@ -2964,6 +3168,15 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO } dest_ptr = map_desc.data; @@ -4563,7 +4724,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat); -@@ -3228,7 +3433,9 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, +@@ -3229,7 +3442,9 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, { GL_EXTCALL(glDeleteBuffers(1, &buffer->buffer_object)); buffer->buffer_object = 0; @@ -4573,7 +4734,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (e->data.addr) e->data.addr += e->stride * src_start_idx; -@@ -3525,8 +3732,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) +@@ -3526,8 +3741,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -4584,7 +4745,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3535,6 +3744,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3536,6 +3753,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) return WINED3DERR_INVALIDCALL; } @@ -4592,7 +4753,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c context = context_acquire(device, NULL); /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ context->gl_info->gl_ops.gl.p_glFlush(); -@@ -3542,6 +3752,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3543,6 +3761,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) * fails. */ context_release(context); @@ -4600,7 +4761,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3549,6 +3760,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3550,6 +3769,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { @@ -4611,7 +4772,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, debug_color(color), depth, stencil); -@@ -3560,7 +3775,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3561,7 +3784,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -4623,7 +4784,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3569,8 +3788,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3570,8 +3797,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -4637,7 +4798,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3616,7 +3840,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +@@ -3617,7 +3849,9 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -4647,7 +4808,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type)); gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); -@@ -3624,8 +3850,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +@@ -3625,8 +3859,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -4661,7 +4822,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, -@@ -3685,10 +3916,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3686,10 +3925,16 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -4678,7 +4839,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_const_bo_address data; struct wined3d_context *context; struct wined3d_map_desc src; -@@ -3713,6 +3950,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3714,6 +3959,14 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, } context = context_acquire(device, NULL); @@ -4693,7 +4854,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3720,6 +3965,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3721,6 +3974,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { @@ -4701,7 +4862,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_resource_map(&src_texture->resource, src_level + i, &src, NULL, WINED3D_MAP_READONLY))) goto done; -@@ -3736,16 +3982,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3737,16 +3991,94 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, done: context_release(context); return hr; @@ -4796,7 +4957,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3782,6 +4106,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3783,6 +4115,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -4804,7 +4965,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3804,9 +4129,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3805,9 +4138,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, context_release(context); /* Update every surface level of the texture. */ @@ -4826,7 +4987,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { unsigned int src_levels = src_texture->level_count; unsigned int dst_levels = dst_texture->level_count; -@@ -3839,6 +4176,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3840,6 +4185,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, FIXME("Unsupported texture type %#x.\n", type); return WINED3DERR_INVALIDCALL; } @@ -4865,7 +5026,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) -@@ -3886,8 +4255,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -3887,8 +4264,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -4879,7 +5040,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -4076,6 +4450,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4077,6 +4459,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev struct wined3d_texture *dst_texture, *src_texture; RECT dst_rect, src_rect; HRESULT hr; @@ -4889,7 +5050,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", -@@ -4163,6 +4540,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4164,6 +4549,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev if (src_box) { @@ -4906,7 +5067,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom); } else -@@ -4176,6 +4563,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4177,6 +4572,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left), dst_y + (src_rect.bottom - src_rect.top)); @@ -4932,7 +5093,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) WARN("Failed to blit, hr %#x.\n", hr); -@@ -4188,6 +4594,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4189,6 +4603,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str unsigned int depth_pitch) { struct wined3d_texture_sub_resource *sub_resource; @@ -4940,7 +5101,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c const struct wined3d_gl_info *gl_info; struct wined3d_const_bo_address addr; unsigned int width, height, level; -@@ -4196,6 +4603,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4197,6 +4612,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str struct wined3d_surface *surface; POINT dst_point; RECT src_rect; @@ -4950,7 +5111,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); -@@ -4229,6 +4639,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4230,6 +4648,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); return; } @@ -4958,7 +5119,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c surface = sub_resource->u.surface; level = sub_resource_idx % texture->level_count; -@@ -4239,6 +4650,17 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4240,6 +4659,17 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str src_rect.top = 0; if (box) { @@ -4976,7 +5137,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (box->left >= box->right || box->right > width || box->top >= box->bottom || box->bottom > height || box->front >= box->back) -@@ -4246,6 +4668,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4247,6 +4677,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str WARN("Invalid box %s specified.\n", debug_box(box)); return; } @@ -4984,7 +5145,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c src_rect.right = box->right - box->left; src_rect.bottom = box->bottom - box->top; -@@ -4280,6 +4703,11 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4281,6 +4712,11 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -4996,7 +5157,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4288,8 +4716,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4289,8 +4725,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi { const struct blit_shader *blitter; struct wined3d_resource *resource; @@ -5010,7 +5171,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n", device, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil); -@@ -4328,10 +4761,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4329,10 +4770,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return WINED3DERR_INVALIDCALL; } @@ -5026,7 +5187,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -4345,20 +4783,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co +@@ -4346,20 +4792,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -5058,7 +5219,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -4395,13 +4844,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4396,13 +4853,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -5080,7 +5241,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -4413,18 +4870,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4414,18 +4879,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -5110,7 +5271,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4658,19 +5126,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) +@@ -4659,19 +5135,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) } } @@ -5137,7 +5298,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) { device->shader_backend->shader_destroy(shader); -@@ -4702,12 +5177,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d +@@ -4703,12 +5186,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -5168,7 +5329,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4724,6 +5217,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4725,6 +5226,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru return hr; } @@ -5176,7 +5337,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Recreate the primary swapchain's context */ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); if (!swapchain->context) -@@ -4736,10 +5230,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4737,10 +5239,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer; if (!(context = context_create(swapchain, target, swapchain->ds_format))) @@ -5192,7 +5353,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HeapFree(GetProcessHeap(), 0, swapchain->context); return E_FAIL; } -@@ -4749,6 +5248,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4750,6 +5257,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru create_dummy_textures(device, context); create_default_samplers(device, context); context_release(context); @@ -5205,7 +5366,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4767,6 +5272,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4768,6 +5281,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", device, swapchain_desc, mode, callback, reset_state); @@ -5220,7 +5381,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { ERR("Failed to get the first implicit swapchain.\n"); -@@ -4785,10 +5298,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4786,10 +5307,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -5237,7 +5398,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4797,10 +5316,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4798,10 +5325,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -5260,7 +5421,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4965,27 +5496,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4966,27 +5505,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -5309,7 +5470,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4993,7 +5545,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4994,7 +5554,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, { if (reset_state) hr = create_primary_opengl_context(device, swapchain); @@ -5321,7 +5482,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } /* All done. There is no need to reload resources or shaders, this will happen automatically on the -@@ -5075,11 +5631,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -5076,11 +5640,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -5341,7 +5502,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); switch (type) -@@ -5204,8 +5768,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -5205,8 +5777,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -5359,7 +5520,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state = &device->state; if (!(device->cs = wined3d_cs_create(device))) -@@ -5299,3 +5872,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5300,3 +5881,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -6087,7 +6248,19 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; unsigned int width, height; -@@ -4660,8 +4697,13 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine +@@ -4633,7 +4670,11 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine + if (vp.height > target->height) + vp.height = target->height; + ++#if !defined(STAGING_CSMT) + wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height); ++#else /* STAGING_CSMT */ ++ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); ++#endif /* STAGING_CSMT */ + } + else if (depth_stencil) + { +@@ -4660,8 +4701,13 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine static void viewport_miscpart_cc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -6101,7 +6274,19 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c float pixel_center_offset = context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER ? 0.5f : 0.0f; const struct wined3d_gl_info *gl_info = context->gl_info; -@@ -4856,7 +4898,11 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st +@@ -4675,7 +4721,11 @@ static void viewport_miscpart_cc(struct wined3d_context *context, + if (vp.height > target->height) + vp.height = target->height; + ++#if !defined(STAGING_CSMT) + wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height); ++#else /* STAGING_CSMT */ ++ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); ++#endif /* STAGING_CSMT */ + } + else if (depth_stencil) + { +@@ -4856,11 +4906,19 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st } else { @@ -6113,7 +6298,15 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c UINT height; UINT width; -@@ -4932,7 +4978,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state ++#if !defined(STAGING_CSMT) + wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height); ++#else /* STAGING_CSMT */ ++ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); ++#endif /* STAGING_CSMT */ + gl_info->gl_ops.gl.p_glScissor(r->left, height - r->bottom, r->right - r->left, r->bottom - r->top); + } + checkGLcall("glScissor"); +@@ -4932,7 +4990,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); @@ -6278,7 +6471,7 @@ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -36,6 +36,13 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); +@@ -36,6 +36,46 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_BUFFER; @@ -6288,11 +6481,44 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + const struct wined3d_box *src_box, DWORD flags, const struct wined3d_blt_fx *fx, + enum wined3d_texture_filter_type filter); + ++void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, ++ unsigned int *width, unsigned int *height) ++{ ++ if (surface->container->swapchain) ++ { ++ /* The drawable size of an onscreen drawable is the surface size. ++ * (Actually: The window size, but the surface is created in window ++ * size.) */ ++ *width = context->current_rt.texture->resource.width; ++ *height = context->current_rt.texture->resource.height; ++ } ++ else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) ++ { ++ const struct wined3d_swapchain *swapchain = context->swapchain; ++ ++ /* The drawable size of a backbuffer / aux buffer offscreen target is ++ * the size of the current context's drawable, which is the size of ++ * the back buffer of the swapchain the active context belongs to. */ ++ *width = swapchain->desc.backbuffer_width; ++ *height = swapchain->desc.backbuffer_height; ++ } ++ else ++ { ++ struct wined3d_surface *rt; ++ ++ /* The drawable size of an FBO target is the OpenGL texture size, ++ * which is the power of two size. */ ++ rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; ++ *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level); ++ *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level); ++ } ++} ++ +#endif /* STAGING_CSMT */ - void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, - unsigned int *width, unsigned int *height) + struct blt_info { -@@ -317,7 +324,11 @@ void wined3d_surface_destroy_dc(struct wined3d_surface *surface) + GLenum binding; +@@ -284,7 +324,11 @@ void wined3d_surface_destroy_dc(struct wined3d_surface *surface) gl_info = context->gl_info; } @@ -6304,7 +6530,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_unmap_bo_address(&data, gl_info, GL_PIXEL_UNPACK_BUFFER); if (context) -@@ -353,7 +364,11 @@ HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) +@@ -320,7 +364,11 @@ HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) gl_info = context->gl_info; } @@ -6316,7 +6542,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c desc.pMemory = wined3d_texture_map_bo_address(&data, texture->sub_resources[sub_resource_idx].size, gl_info, GL_PIXEL_UNPACK_BUFFER, 0); -@@ -619,7 +634,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, +@@ -586,7 +634,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter); checkGLcall("glBlitFramebuffer()"); @@ -6329,7 +6555,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && dst_texture->swapchain->front_buffer == dst_texture)) gl_info->gl_ops.gl.p_glFlush(); -@@ -708,8 +728,12 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const +@@ -675,8 +728,12 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const { struct wined3d_resource *resource = &surface->container->resource; struct wined3d_device *device = resource->device; @@ -6342,7 +6568,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct blit_shader *blitter; HRESULT hr; -@@ -720,6 +744,7 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const +@@ -687,6 +744,7 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const return WINED3DERR_INVALIDCALL; } @@ -6350,7 +6576,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c view_desc.format_id = resource->format->id; view_desc.u.texture.level_idx = surface->texture_level; view_desc.u.texture.layer_idx = surface->texture_layer; -@@ -733,6 +758,19 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const +@@ -700,6 +758,19 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const hr = blitter->depth_fill(device, view, rect, WINED3DCLEAR_ZBUFFER, depth, 0); wined3d_rendertarget_view_decref(view); @@ -6370,7 +6596,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -797,7 +835,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct +@@ -764,7 +835,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct } } @@ -6382,7 +6608,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED) { -@@ -1177,9 +1219,22 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1144,9 +1219,22 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P return WINED3DERR_INVALIDCALL; } @@ -6405,7 +6631,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context = context_acquire(dst_texture->resource.device, NULL); gl_info = context->gl_info; -@@ -1194,7 +1249,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -1161,7 +1249,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &data, @@ -6417,7 +6643,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_get_pitch(src_texture, src_surface->texture_level, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -1695,11 +1754,22 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1662,11 +1754,22 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr { unsigned int texture_level = sub_resource_idx % src_texture->level_count; const struct wined3d_format *src_format = src_texture->resource.format; @@ -6440,7 +6666,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(conv = find_converter(src_format->id, dst_format->id)) && (!device->d3d_initialized || !is_identity_fixup(src_format->color_fixup) || src_format->convert -@@ -1729,6 +1799,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1696,6 +1799,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr return NULL; } @@ -6448,7 +6674,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memset(&src_map, 0, sizeof(src_map)); if (FAILED(wined3d_resource_map(&src_texture->resource, sub_resource_idx, &src_map, NULL, WINED3D_MAP_READONLY))) -@@ -1753,10 +1824,51 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1720,10 +1824,51 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr conv->convert(src_map.data, dst_map.data, src_map.row_pitch, dst_map.row_pitch, desc.width, desc.height); wined3d_resource_unmap(&dst_texture->resource, 0); @@ -6500,7 +6726,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c RECT src_rect = {0, 0, desc.width, desc.height}; const struct wined3d_gl_info *gl_info; struct wined3d_context *context; -@@ -1769,16 +1881,40 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1736,16 +1881,40 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr wined3d_texture_prepare_texture(dst_texture, context, FALSE); wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); wined3d_surface_upload_data(dst_texture->sub_resources[0].u.surface, gl_info, src_format, @@ -6541,7 +6767,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, -@@ -1856,7 +1992,11 @@ static void read_from_framebuffer(struct wined3d_surface *surface, +@@ -1823,7 +1992,11 @@ static void read_from_framebuffer(struct wined3d_surface *surface, BOOL srcIsUpsideDown; struct wined3d_bo_address data; @@ -6553,7 +6779,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c restore_rt = context_get_rt_surface(old_ctx); if (restore_rt != surface) -@@ -2383,7 +2523,13 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st +@@ -2350,7 +2523,13 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st checkGLcall("glDeleteTextures(1, &backup)"); } @@ -6567,7 +6793,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ context_release(context); -@@ -2448,9 +2594,15 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -2415,9 +2594,15 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, gl_info = context->gl_info; @@ -6583,7 +6809,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_texture, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -2493,8 +2645,16 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -2460,8 +2645,16 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -6600,7 +6826,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. */ if (restore_rt) -@@ -2505,8 +2665,12 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2472,8 +2665,12 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st { struct wined3d_resource *resource = &s->container->resource; struct wined3d_device *device = resource->device; @@ -6613,7 +6839,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c const struct blit_shader *blitter; HRESULT hr; -@@ -2517,6 +2681,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2484,6 +2681,7 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st return WINED3DERR_INVALIDCALL; } @@ -6621,7 +6847,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c view_desc.format_id = resource->format->id; view_desc.u.texture.level_idx = s->texture_level; view_desc.u.texture.layer_idx = s->texture_layer; -@@ -2530,6 +2695,19 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st +@@ -2497,6 +2695,19 @@ HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const st hr = blitter->color_fill(device, view, rect, color); wined3d_rendertarget_view_decref(view); @@ -6641,7 +6867,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -2540,7 +2718,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -2507,7 +2718,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE { struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; @@ -6653,7 +6879,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_texture *src_texture; -@@ -2841,7 +3023,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win +@@ -2808,7 +3023,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6667,7 +6893,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) -@@ -2858,7 +3046,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win +@@ -2825,7 +3046,13 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -6681,7 +6907,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 -@@ -2867,6 +3061,7 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win +@@ -2834,6 +3061,7 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win } } @@ -6689,7 +6915,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static DWORD resource_access_from_location(DWORD location) { switch (location) -@@ -2928,6 +3123,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -2895,6 +3123,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD memcpy(dst.addr, src.addr, sub_resource->size); } @@ -6697,7 +6923,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_load_sysmem(struct wined3d_surface *surface, struct wined3d_context *context, DWORD dst_location) -@@ -2940,12 +3136,14 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -2907,12 +3136,14 @@ static void surface_load_sysmem(struct wined3d_surface *surface, wined3d_texture_prepare_location(texture, sub_resource_idx, context, dst_location); sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -6712,7 +6938,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB); -@@ -3094,7 +3292,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3061,7 +3292,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -6724,7 +6950,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3102,7 +3304,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3069,7 +3304,11 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_texture_set_map_binding(texture, WINED3D_LOCATION_SYSMEM); } @@ -6736,7 +6962,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. */ -@@ -3185,16 +3391,23 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi +@@ -3152,16 +3391,23 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi } /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ @@ -6760,7 +6986,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_w = wined3d_texture_get_level_width(texture, surface->texture_level); surface_h = wined3d_texture_get_level_height(texture, surface->texture_level); -@@ -3229,6 +3442,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3196,6 +3442,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED); return surface_load_location(surface, context, location); } @@ -6770,7 +6996,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { -@@ -3241,7 +3457,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3208,7 +3457,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", wined3d_debug_location(sub_resource->locations), wined3d_debug_location(location)); @@ -6782,7 +7008,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -3254,7 +3474,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3221,7 +3474,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co case WINED3D_LOCATION_DRAWABLE: if (FAILED(hr = surface_load_drawable(surface, context))) @@ -6794,7 +7020,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; case WINED3D_LOCATION_RB_RESOLVED: -@@ -3266,7 +3490,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3233,7 +3490,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co case WINED3D_LOCATION_TEXTURE_SRGB: if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) @@ -6806,7 +7032,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -3275,6 +3503,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co +@@ -3242,6 +3503,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co } done: @@ -6814,7 +7040,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_validate_location(texture, sub_resource_idx, location); if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) -@@ -3284,6 +3513,9 @@ done: +@@ -3251,6 +3513,9 @@ done: } return WINED3D_OK; @@ -6824,7 +7050,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; } -@@ -3617,16 +3849,41 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3584,16 +3849,41 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int const BYTE *sbuf; BYTE *dbuf; int x, y; @@ -6866,7 +7092,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_map = dst_map; src_format = dst_texture->resource.format; dst_format = src_format; -@@ -3651,7 +3908,20 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3618,7 +3908,20 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_texture = converted_texture; src_sub_resource_idx = 0; } @@ -6887,7 +7113,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_texture->resource.format; src_fmt_flags = src_texture->resource.format_flags; } -@@ -3661,7 +3931,17 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3628,7 +3931,17 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_fmt_flags = dst_fmt_flags; } @@ -6905,7 +7131,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_format->byte_count; -@@ -3675,12 +3955,18 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3642,12 +3955,18 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int sbase = (BYTE *)src_map.data + ((src_box->top / src_format->block_height) * src_map.row_pitch) + ((src_box->left / src_format->block_width) * src_format->block_byte_count); @@ -6924,7 +7150,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4073,16 +4359,42 @@ do { \ +@@ -4040,16 +4359,42 @@ do { \ } } @@ -6967,7 +7193,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4127,7 +4439,11 @@ const struct blit_shader cpu_blit = { +@@ -4094,7 +4439,11 @@ const struct blit_shader cpu_blit = { cpu_blit_blit_surface, }; @@ -6979,7 +7205,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { -@@ -4137,9 +4453,14 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4104,9 +4453,14 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; struct wined3d_swapchain *src_swapchain, *dst_swapchain; @@ -6994,7 +7220,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD src_ds_flags, dst_ds_flags; BOOL scale, convert; -@@ -4152,6 +4473,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4119,6 +4473,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst | WINED3D_BLT_DO_NOT_WAIT | WINED3D_BLT_ALPHA_TEST; @@ -7002,7 +7228,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), flags, fx, debug_d3dtexturefiltertype(filter)); -@@ -4169,10 +4491,12 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4136,10 +4491,12 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst fx->src_color_key.color_space_high_value); } @@ -7015,7 +7241,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (dst_texture->sub_resources[dst_sub_resource_idx].map_count -@@ -4230,6 +4554,15 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4197,6 +4554,15 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst if (!once++) FIXME("Can't handle WINED3D_BLT_DO_NOT_WAIT flag.\n"); flags &= ~WINED3D_BLT_DO_NOT_WAIT; @@ -7031,7 +7257,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (!device->d3d_initialized) -@@ -4254,11 +4587,13 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4221,11 +4587,13 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst goto fallback; } @@ -7045,7 +7271,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dst_swapchain = dst_texture->swapchain; /* This isn't strictly needed. FBO blits for example could deal with -@@ -4294,13 +4629,21 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4261,13 +4629,21 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->fill_color, &depth)) @@ -7067,7 +7293,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_ds_flags != dst_ds_flags) { WARN("Rejecting depth / stencil blit between incompatible formats.\n"); -@@ -4310,6 +4653,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4277,6 +4653,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_texture->resource.draw_binding, src_rect, dst_surface, dst_texture->resource.draw_binding, dst_rect))) return WINED3D_OK; @@ -7079,7 +7305,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -4345,7 +4693,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4312,7 +4693,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst goto fallback; if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color))) @@ -7091,7 +7317,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4388,7 +4740,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4355,7 +4740,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst context, dst_texture->resource.draw_binding); context_release(context); } @@ -7103,7 +7329,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4412,7 +4768,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4379,7 +4768,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -7115,7 +7341,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } if (fbo_blit_supported(&device->adapter->gl_info, blit_op, -@@ -4433,7 +4793,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4400,7 +4793,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding); @@ -7127,7 +7353,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, -@@ -4443,7 +4807,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4410,7 +4807,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst { blitter->blit_surface(device, blit_op, filter, src_surface, src_rect, dst_surface, dst_rect, color_key); @@ -7139,7 +7365,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4451,9 +4819,156 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst +@@ -4418,9 +4819,156 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst fallback: /* Special cases for render targets. */ if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter))) @@ -8564,7 +8790,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -4544,7 +4544,11 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w +@@ -4594,7 +4594,11 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w float y_offset = flip ? (center_offset - (2.0f * y) - h) / h : (center_offset - (2.0f * y) - h) / -h; @@ -8576,7 +8802,7 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE; float z_scale = zenable ? clip_control ? 1.0f : 2.0f : 0.0f; float z_offset = zenable ? clip_control ? 0.0f : -1.0f : 0.0f; -@@ -5343,7 +5347,11 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d +@@ -5393,7 +5397,11 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d break; } } @@ -8588,6 +8814,25 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c if (d3d_info->vs_clipping || !use_vs(state) || !state->render_states[WINED3D_RS_CLIPPING] || !state->render_states[WINED3D_RS_CLIPPLANEENABLE]) { +diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c +--- a/dlls/wined3d/view.c ++++ b/dlls/wined3d/view.c +@@ -94,6 +94,7 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str + return view->resource; + } + ++#if !defined(STAGING_CSMT) + void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, + const struct wined3d_context *context, unsigned int *width, unsigned int *height) + { +@@ -138,6 +139,7 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg + } + } + ++#endif /* STAGING_CSMT */ + static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, + const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, + void *parent, const struct wined3d_parent_ops *parent_ops) diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -8925,19 +9170,25 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; -@@ -2915,7 +3046,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru - unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; +@@ -2911,9 +3042,17 @@ HRESULT surface_color_fill(struct wined3d_surface *s, + const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN; + HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_surface_destroy_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++#if !defined(STAGING_CSMT) void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; -+#if !defined(STAGING_CSMT) HRESULT surface_load_location(struct wined3d_surface *surface, +#else /* STAGING_CSMT */ ++void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, ++ unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; ++void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, ++ struct wined3d_context *context) DECLSPEC_HIDDEN; +void surface_load_location(struct wined3d_surface *surface, +#endif /* STAGING_CSMT */ struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, -@@ -2926,6 +3061,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -2924,6 +3063,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; @@ -8949,7 +9200,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; -@@ -2940,6 +3080,12 @@ struct wined3d_sampler +@@ -2938,6 +3082,12 @@ struct wined3d_sampler GLuint name; }; @@ -8962,7 +9213,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; -@@ -3035,6 +3181,7 @@ struct wined3d_stateblock +@@ -3033,6 +3183,7 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -8970,7 +9221,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; -@@ -3048,54 +3195,150 @@ enum wined3d_push_constants +@@ -3046,54 +3197,150 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_I, WINED3D_PUSH_CONSTANTS_VS_B, WINED3D_PUSH_CONSTANTS_PS_B, @@ -9039,13 +9290,13 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; +#if !defined(STAGING_CSMT) -+ -+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; + + 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; +#else /* STAGING_CSMT */ +void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, + struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; - ++ +void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface, + const RECT *dst_rect, struct wined3d_surface *src_surface, + const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, @@ -9054,8 +9305,8 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h + struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN; +void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer, + BYTE *mem) DECLSPEC_HIDDEN; - 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; ++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; +void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, + const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil, + const struct blit_shader *blitter) DECLSPEC_HIDDEN; @@ -9080,11 +9331,11 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN; +#if !defined(STAGING_CSMT) - void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; +#else /* STAGING_CSMT */ +void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture, + unsigned int sub_resource_idx) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; + void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; +void wined3d_cs_emit_sampler_init(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; +void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, + UINT base_vertex_index) DECLSPEC_HIDDEN; @@ -9121,7 +9372,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, -@@ -3125,6 +3368,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -3123,6 +3370,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform 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; @@ -9129,7 +9380,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN; -@@ -3136,6 +3380,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d +@@ -3134,6 +3382,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d { cs->ops->push_constants(cs, p, start_idx, count, constants); } @@ -9154,11 +9405,15 @@ 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 */ -@@ -3162,11 +3424,16 @@ struct wined3d_buffer +@@ -3159,13 +3425,20 @@ struct wined3d_buffer + GLuint buffer_object; GLenum buffer_object_usage; GLenum buffer_type_hint; ++#if !defined(STAGING_CSMT) + unsigned int bind_flags; DWORD flags; -+#if defined(STAGING_CSMT) ++#else /* STAGING_CSMT */ ++ DWORD flags; + BOOL ignore_discard; +#endif /* STAGING_CSMT */ void *map_ptr; @@ -9171,15 +9426,15 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_event_query *query; /* conversion stuff */ -@@ -3182,6 +3449,7 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc +@@ -3181,6 +3454,7 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc return CONTAINING_RECORD(resource, struct wined3d_buffer, resource); } +#if !defined(STAGING_CSMT) void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; - void wined3d_buffer_get_memory(struct wined3d_buffer *buffer, + DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN; -@@ -3190,12 +3458,25 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * +@@ -3189,12 +3463,25 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context * const struct wined3d_state *state) DECLSPEC_HIDDEN; BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -9205,7 +9460,19 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -3257,7 +3538,12 @@ struct wined3d_unordered_access_view +@@ -3227,9 +3514,11 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( + return texture->sub_resources[view->sub_resource_idx].u.surface; + } + ++#if !defined(STAGING_CSMT) + void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, + const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; + ++#endif /* STAGING_CSMT */ + struct wined3d_shader_resource_view + { + LONG refcount; +@@ -3259,7 +3548,12 @@ struct wined3d_unordered_access_view struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -9218,7 +9485,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3294,6 +3580,10 @@ struct wined3d_swapchain +@@ -3296,6 +3590,10 @@ struct wined3d_swapchain void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN; struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -9229,3 +9496,22 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h 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; +diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h +--- a/include/wine/wined3d.h ++++ b/include/wine/wined3d.h +@@ -871,6 +871,7 @@ enum wined3d_format_support + + #define WINED3DDP_MAXTEXCOORD 8 + ++#if !defined(STAGING_CSMT) + #define WINED3D_BIND_VERTEX_BUFFER 0x00000001 + #define WINED3D_BIND_INDEX_BUFFER 0x00000002 + #define WINED3D_BIND_CONSTANT_BUFFER 0x00000004 +@@ -880,6 +881,7 @@ enum wined3d_format_support + #define WINED3D_BIND_DEPTH_STENCIL 0x00000040 + #define WINED3D_BIND_UNORDERED_ACCESS 0x00000080 + ++#endif /* STAGING_CSMT */ + #define WINED3DUSAGE_RENDERTARGET 0x00000001 + #define WINED3DUSAGE_DEPTHSTENCIL 0x00000002 + #define WINED3DUSAGE_WRITEONLY 0x00000008 diff --git a/patches/wined3d-CSMT_Main/definition b/patches/wined3d-CSMT_Main/definition index dcae18bb..b3acc9dd 100644 --- a/patches/wined3d-CSMT_Main/definition +++ b/patches/wined3d-CSMT_Main/definition @@ -5,7 +5,6 @@ Fixes: [11674] Support for CSMT (command stream) to increase graphic performance Apply-After: dlls/wined3d/* Depends: wined3d-CSMT_Helper IfDefined: STAGING_CSMT -Disabled: true # Known issues: # https://bugs.wine-staging.com/buglist.cgi?component=Bugs&keywords=csmt%2C%20&keywords_type=allwords&list_id=3690&query_format=advanced&resolution=---