diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4d2fcb6c..38027e88 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -5558,10 +5558,11 @@ fi # | Modified files: # | * dlls/d3d8/tests/visual.c, dlls/d3d9/tests/visual.c, dlls/wined3d/arb_program_shader.c, dlls/wined3d/buffer.c, # | dlls/wined3d/context.c, dlls/wined3d/cs.c, dlls/wined3d/device.c, dlls/wined3d/directx.c, dlls/wined3d/drawprim.c, -# | dlls/wined3d/glsl_shader.c, dlls/wined3d/query.c, dlls/wined3d/resource.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/vertexdeclaration.c, dlls/wined3d/view.c, dlls/wined3d/volume.c, -# | dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h, dlls/winex11.drv/opengl.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/vertexdeclaration.c, +# | dlls/wined3d/view.c, dlls/wined3d/volume.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h, +# | dlls/winex11.drv/opengl.c # | if test "$enable_wined3d_CSMT_Main" -eq 1; then patch_apply wined3d-CSMT_Main/0001-wined3d-Properly-initialize-format_flags-for-surface.patch @@ -5640,106 +5641,109 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then patch_apply wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch patch_apply wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch patch_apply wined3d-CSMT_Main/0076-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch - patch_apply wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch - patch_apply wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch - patch_apply wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch - patch_apply wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch - patch_apply wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch - patch_apply wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch - patch_apply wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch - patch_apply wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch - patch_apply wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch - patch_apply wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch - patch_apply wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch - patch_apply wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch - patch_apply wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch - patch_apply wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch - patch_apply wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch - patch_apply wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch - patch_apply wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch - patch_apply wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch - patch_apply wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch - patch_apply wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch - patch_apply wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch - patch_apply wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch - patch_apply wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch - patch_apply wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch - patch_apply wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch - patch_apply wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch - patch_apply wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch - patch_apply wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch - patch_apply wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch - patch_apply wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch - patch_apply wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch - patch_apply wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch - patch_apply wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch - patch_apply wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch - patch_apply wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch - patch_apply wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch - patch_apply wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch - patch_apply wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch - patch_apply wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch - patch_apply wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch - patch_apply wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch - patch_apply wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch - patch_apply wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch - patch_apply wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch - patch_apply wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch - patch_apply wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch - patch_apply wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch - patch_apply wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch - patch_apply wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch - patch_apply wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch - patch_apply wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch - patch_apply wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch - patch_apply wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch - patch_apply wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch - patch_apply wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch - patch_apply wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch - patch_apply wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch - patch_apply wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch - patch_apply wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch - patch_apply wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch - patch_apply wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch - patch_apply wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch - patch_apply wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch - patch_apply wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch - patch_apply wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch - patch_apply wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch - patch_apply wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch - patch_apply wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch - patch_apply wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch - patch_apply wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch - patch_apply wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch - patch_apply wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch - patch_apply wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch - patch_apply wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch - patch_apply wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch - patch_apply wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch - patch_apply wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch - patch_apply wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch - patch_apply wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch + patch_apply wined3d-CSMT_Main/0077-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch + patch_apply wined3d-CSMT_Main/0078-wined3d-Send-render-target-view-clears-through-the-c.patch + patch_apply wined3d-CSMT_Main/0079-wined3d-Wait-for-the-CS-in-GetDC.patch + patch_apply wined3d-CSMT_Main/0080-wined3d-send-resource-maps-through-the-command-strea.patch + patch_apply wined3d-CSMT_Main/0081-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch + patch_apply wined3d-CSMT_Main/0082-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch + patch_apply wined3d-CSMT_Main/0083-wined3d-Don-t-preload-buffers-on-unmap.patch + patch_apply wined3d-CSMT_Main/0084-wined3d-Don-t-call-glFinish-before-swapping.patch + patch_apply wined3d-CSMT_Main/0085-wined3d-wined3d_-_query_issue-never-fails.patch + patch_apply wined3d-CSMT_Main/0086-wined3d-Add-query-support-to-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0087-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch + patch_apply wined3d-CSMT_Main/0088-wined3d-Poll-queries-automatically-in-the-CS.patch + patch_apply wined3d-CSMT_Main/0089-wined3d-Introduce-a-separate-queue-for-priority-comm.patch + patch_apply wined3d-CSMT_Main/0090-wined3d-Destroy-queries-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0091-wined3d-Separate-main-and-worker-thread-query-state.patch + patch_apply wined3d-CSMT_Main/0092-wined3d-Don-t-poll-queries-that-failed-to-start.patch + patch_apply wined3d-CSMT_Main/0093-wined3d-Remove-restated-queries-from-the-poll-list.patch + patch_apply wined3d-CSMT_Main/0094-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch + patch_apply wined3d-CSMT_Main/0095-wined3d-Put-this-into-the-query-poll-patch.patch + patch_apply wined3d-CSMT_Main/0096-wined3d-Send-update_surface-commands-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0097-wined3d-Send-texture-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0098-wined3d-Send-surface-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0099-wined3d-Send-update_texture-calls-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0100-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch + patch_apply wined3d-CSMT_Main/0101-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch + patch_apply wined3d-CSMT_Main/0102-wined3d-Handle-evit_managed_resources-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0103-wined3d-Send-flips-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0104-wined3d-Introduce-resource-fencing.patch + patch_apply wined3d-CSMT_Main/0105-wined3d-Fence-update_texture-and-update_surface-call.patch + patch_apply wined3d-CSMT_Main/0106-wined3d-Dirtify-resources-on-unmap.patch + patch_apply wined3d-CSMT_Main/0107-wined3d-Fence-texture-reads-in-draws.patch + patch_apply wined3d-CSMT_Main/0108-wined3d-Fence-render-targets-and-depth-stencils.patch + patch_apply wined3d-CSMT_Main/0109-wined3d-Fence-blit-operations.patch + patch_apply wined3d-CSMT_Main/0110-wined3d-Fence-color_fill-operations.patch + patch_apply wined3d-CSMT_Main/0111-wined3d-Fence-clear-calls.patch + patch_apply wined3d-CSMT_Main/0112-wined3d-Fence-present-calls.patch + patch_apply wined3d-CSMT_Main/0113-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch + patch_apply wined3d-CSMT_Main/0114-wined3d-Dirtify-changed-textures-through-the-command.patch + patch_apply wined3d-CSMT_Main/0115-wined3d-Wrap-GL-BOs-in-a-structure.patch + patch_apply wined3d-CSMT_Main/0116-wined3d-Separate-resource-map-and-draw-buffers.patch + patch_apply wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch + patch_apply wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch + patch_apply wined3d-CSMT_Main/0119-wined3d-Unset-some-objects-in-state_init_default.patch + patch_apply wined3d-CSMT_Main/0120-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch + patch_apply wined3d-CSMT_Main/0121-wined3d-Use-double-buffered-buffers-for-multithreade.patch + patch_apply wined3d-CSMT_Main/0122-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0123-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch + patch_apply wined3d-CSMT_Main/0124-wined3d-Accelerate-DISCARD-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0125-wined3d-Accelerate-READONLY-buffer-maps.patch + patch_apply wined3d-CSMT_Main/0126-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0127-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch + patch_apply wined3d-CSMT_Main/0128-wined3d-Send-buffer-preloads-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0129-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch + patch_apply wined3d-CSMT_Main/0130-wined3d-Separate-GL-buffer-discard-control-from-igno.patch + patch_apply wined3d-CSMT_Main/0131-wined3d-Create-buffers-before-mapping-them.patch + patch_apply wined3d-CSMT_Main/0132-wined3d-Destroy-views-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0133-wined3d-Remove-another-glFinish.patch + patch_apply wined3d-CSMT_Main/0134-wined3d-Destroy-vertex-declarations-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0135-wined3d-Destroy-shaders-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0136-wined3d-Create-VBOs-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0137-wined3d-Clean-up-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0138-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0139-wined3d-Clean-up-volume-resource-data-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0140-wined3d-Clean-up-surfaces-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0141-wined3d-Clean-up-texture-resources-through-the-cs.patch + patch_apply wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch + patch_apply wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-device_re.patch + patch_apply wined3d-CSMT_Main/0144-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch + patch_apply wined3d-CSMT_Main/0145-wined3d-Remove-software-cursor-support.patch + patch_apply wined3d-CSMT_Main/0146-wined3d-Create-dummy-textures-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0147-wined3d-Create-the-initial-context-through-the-CS.patch + patch_apply wined3d-CSMT_Main/0148-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch + patch_apply wined3d-CSMT_Main/0149-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch + patch_apply wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch + patch_apply wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch + patch_apply wined3d-CSMT_Main/0152-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch + patch_apply wined3d-CSMT_Main/0153-wined3d-Use-an-event-to-block-the-worker-thread-when.patch + patch_apply wined3d-CSMT_Main/0154-wined3d-Fence-preload-operations.patch + patch_apply wined3d-CSMT_Main/0155-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0156-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch + patch_apply wined3d-CSMT_Main/0157-wined3d-Completely-reset-the-state-on-reset.patch + patch_apply wined3d-CSMT_Main/0158-wined3d-Send-getdc-and-releasedc-through-the-command.patch + patch_apply wined3d-CSMT_Main/0159-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch + patch_apply wined3d-CSMT_Main/0160-wined3d-Wait-only-for-the-buffer-to-be-idle.patch + patch_apply wined3d-CSMT_Main/0161-wined3d-Add-a-comment-about-worker-thread-lag.patch + patch_apply wined3d-CSMT_Main/0162-wined3d-Remove-the-texture-destroy-glFinish.patch + patch_apply wined3d-CSMT_Main/0163-wined3d-Move-FBO-destruction-into-the-worker-thread.patch + patch_apply wined3d-CSMT_Main/0164-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch + patch_apply wined3d-CSMT_Main/0165-Winex11-complain-about-glfinish.patch + patch_apply wined3d-CSMT_Main/0166-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch + patch_apply wined3d-CSMT_Main/0167-wined3d-Remove-the-device_reset-CS-sync-fixme.patch + patch_apply wined3d-CSMT_Main/0168-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch + patch_apply wined3d-CSMT_Main/0169-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch + patch_apply wined3d-CSMT_Main/0170-wined3d-Don-t-sync-on-redundant-discard-calls.patch + patch_apply wined3d-CSMT_Main/0171-wined3d-Don-t-discard-new-buffers.patch + patch_apply wined3d-CSMT_Main/0172-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch + patch_apply wined3d-CSMT_Main/0173-wined3d-Render-target-lock-hack.patch + patch_apply wined3d-CSMT_Main/0174-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch + patch_apply wined3d-CSMT_Main/0175-wined3d-Only-discard-buffers-that-are-in-use.patch + patch_apply wined3d-CSMT_Main/0176-wined3d-Destroy-samplers-through-the-command-stream.patch + patch_apply wined3d-CSMT_Main/0177-wined3d-Hack-to-reject-unsupported-color-fills.patch + patch_apply wined3d-CSMT_Main/0178-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch + patch_apply wined3d-CSMT_Main/9998-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch patch_apply wined3d-CSMT_Main/9999-IfDefined.patch ( echo '+ { "Sebastian Lackner", "wined3d: Properly initialize format_flags for surfaces and volumes.", 1 },'; @@ -5818,7 +5822,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then echo '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Put update_surface checks back in place.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Get rid of WINED3D_BUFFER_FLUSH.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Add cs waiting debug code.", 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: Wait for the CS in GetDC.", 1 },'; @@ -5917,6 +5920,10 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then echo '+ { "Stefan Dösinger", "wined3d: Don'\''t try to sync VBOs manually on OSX with CSMT.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Render target lock hack.", 1 },'; echo '+ { "Matteo Bruni", "wined3d: Avoid calling wined3d_surface_blt() from surface_upload_from_surface().", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Only discard buffers that are in use.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Destroy samplers through the command stream.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Hack to reject unsupported color fills.", 1 },'; + echo '+ { "Stefan Dösinger", "wined3d: Alloc the buffer map array before mapping the buffer.", 1 },'; echo '+ { "Sebastian Lackner", "wined3d: Enable CSMT by default, print a winediag message informing about this patchset.", 1 },'; echo '+ { "Wine Staging Team", "Autogenerated #ifdef patch for wined3d-CSMT_Main.", 1 },'; ) >> "$patchlist" diff --git a/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch b/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch index aa975b96..93d0dc6b 100644 --- a/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch +++ b/patches/wined3d-CSMT_Main/0002-wined3d-Merge-get_pitch-functions.patch @@ -1,15 +1,15 @@ -From fb1391dc1f2274d4336846720bb9869a3b751b0c Mon Sep 17 00:00:00 2001 +From 0bff3caeafd1080f6fd6244abdf8a87ddff6c3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 14:22:24 +0200 Subject: wined3d: Merge get_pitch functions. --- - dlls/wined3d/resource.c | 31 ++++++++++++++++ - dlls/wined3d/surface.c | 81 ++++++++++++++++++++---------------------- + dlls/wined3d/resource.c | 31 +++++++++++++++++ + dlls/wined3d/surface.c | 78 ++++++++++++++++++++---------------------- dlls/wined3d/texture.c | 2 +- dlls/wined3d/volume.c | 28 ++------------- dlls/wined3d/wined3d_private.h | 5 +-- - 5 files changed, 75 insertions(+), 72 deletions(-) + 5 files changed, 74 insertions(+), 70 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 1891165..0968cd2 100644 @@ -51,7 +51,7 @@ index 1891165..0968cd2 100644 + TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 3b033db..bb2278d 100644 +index 2b5e734..c96c44c 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -158,7 +158,7 @@ index 3b033db..bb2278d 100644 } HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) -@@ -2109,20 +2100,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, +@@ -2109,20 +2100,22 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; } @@ -177,16 +177,15 @@ index 3b033db..bb2278d 100644 else { /* User memory surfaces don't have the regular surface alignment. */ -- surface->resource.size = wined3d_format_calculate_size(texture_resource->format, -- 1, width, height, 1); + surface->resource.size = wined3d_format_calculate_size(texture_resource->format, + 1, width, height, 1); - surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width); -+ surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); + surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); + surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */ } /* The format might be changed to a format that needs conversion. -@@ -2742,7 +2734,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, +@@ -2589,7 +2582,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) map_desc->row_pitch = surface->resource.width * format->byte_count; else @@ -195,26 +194,26 @@ index 3b033db..bb2278d 100644 map_desc->slice_pitch = 0; if (!rect) -@@ -2869,6 +2861,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2716,6 +2709,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc int i; BOOL srcIsUpsideDown; struct wined3d_bo_address data; -+ UINT row_pitch, slice_pitch; ++ DWORD slice_pitch, pitch; surface_get_memory(surface, &data, dst_location); -@@ -2905,8 +2898,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2752,8 +2746,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc } /* Setup pixel store pack state -- to glReadPixels into the correct place */ - gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, - wined3d_surface_get_pitch(surface) / surface->resource.format->byte_count); -+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); -+ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count); ++ wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch); ++ gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, pitch / surface->resource.format->byte_count); checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2923,7 +2916,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc +@@ -2770,7 +2764,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -225,7 +224,7 @@ index 3b033db..bb2278d 100644 if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -4107,7 +4102,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3967,7 +3963,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; struct wined3d_context *context; @@ -234,7 +233,7 @@ index 3b033db..bb2278d 100644 struct wined3d_bo_address data; struct wined3d_format format; POINT dst_point = {0, 0}; -@@ -4195,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4055,7 +4051,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, wined3d_texture_bind_and_dirtify(texture, context, srgb); width = surface->resource.width; @@ -243,7 +242,7 @@ index 3b033db..bb2278d 100644 format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -4233,9 +4228,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4093,9 +4089,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, context_release(context); return E_OUTOFMEMORY; } @@ -255,7 +254,7 @@ index 3b033db..bb2278d 100644 data.addr = mem; } else if (conversion) -@@ -4255,14 +4250,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4115,14 +4111,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -274,10 +273,10 @@ index 3b033db..bb2278d 100644 context_release(context); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 1e039e4..f4e77fb 100644 +index b369809..3485ac2 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1233,7 +1233,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso +@@ -1242,7 +1242,7 @@ static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_reso struct wined3d_const_bo_address addr; unsigned int row_pitch, slice_pitch; @@ -287,7 +286,7 @@ index 1e039e4..f4e77fb 100644 FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 424938a..b672d4a 100644 +index 4e1c415..eec1492 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) @@ -340,10 +339,10 @@ index 424938a..b672d4a 100644 if (!box) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 5786db0..7f989dc 100644 +index d1ba5e4..77463aa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2162,6 +2162,7 @@ struct wined3d_resource +@@ -2164,6 +2164,7 @@ struct wined3d_resource UINT size; DWORD priority; void *heap_memory; @@ -351,7 +350,7 @@ index 5786db0..7f989dc 100644 struct list resource_list_entry; void *parent; -@@ -2189,6 +2190,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2191,6 +2192,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -360,7 +359,7 @@ index 5786db0..7f989dc 100644 GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN; -@@ -2326,7 +2329,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN +@@ -2328,7 +2331,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, unsigned int level, struct wined3d_volume **volume) DECLSPEC_HIDDEN; void wined3d_volume_destroy(struct wined3d_volume *volume) DECLSPEC_HIDDEN; @@ -368,7 +367,7 @@ index 5786db0..7f989dc 100644 void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) DECLSPEC_HIDDEN; void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; -@@ -2376,7 +2378,6 @@ struct wined3d_surface +@@ -2378,7 +2380,6 @@ struct wined3d_surface DWORD flags; @@ -377,5 +376,5 @@ index 5786db0..7f989dc 100644 UINT pow2Height; -- -2.4.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch b/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch index a7217c75..6660e02c 100644 --- a/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch +++ b/patches/wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch @@ -1,18 +1,18 @@ -From f322a8e12cfa32650bcbb970f41a84c2430ac00e Mon Sep 17 00:00:00 2001 +From 0f7f57e440a198c31920c7077a6c7b0661945039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 19:34:26 +0100 Subject: wined3d: Pass a context to surface_load_drawable and surface_blt_to_drawable. --- - dlls/wined3d/surface.c | 40 ++++++++++++++++++++++++++++++++++------ - 1 file changed, 34 insertions(+), 6 deletions(-) + dlls/wined3d/surface.c | 41 +++++++++++++++++++++++++++++++++++------ + 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 4e2063f..1f97857 100644 +index 9351ab2..1b3def9 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -3533,19 +3533,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW +@@ -3536,19 +3536,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW rect->bottom = drawable_height - rect->bottom; } @@ -49,7 +49,7 @@ index 4e2063f..1f97857 100644 gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use -@@ -3598,7 +3614,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -3601,7 +3617,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ @@ -63,7 +63,7 @@ index 4e2063f..1f97857 100644 } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -4095,8 +4116,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface, +@@ -4101,8 +4122,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface, surface, wined3d_debug_location(surface->locations)); } @@ -74,7 +74,7 @@ index 4e2063f..1f97857 100644 { RECT r; -@@ -4109,7 +4131,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -4115,7 +4137,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, surface_get_rect(surface, NULL, &r); surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); @@ -83,7 +83,7 @@ index 4e2063f..1f97857 100644 WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); return WINED3D_OK; -@@ -4367,7 +4389,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4373,7 +4395,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) break; case WINED3D_LOCATION_DRAWABLE: @@ -95,13 +95,16 @@ index 4e2063f..1f97857 100644 return hr; break; -@@ -4546,13 +4571,16 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, +@@ -4547,6 +4572,8 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, + struct wined3d_surface *dst_surface, const RECT *dst_rect, + const struct wined3d_color_key *color_key) + { ++ struct wined3d_context *context; ++ /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; DWORD old_color_key_flags = src_surface->container->async.color_key_flags; -+ struct wined3d_context *context; - - TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); +@@ -4555,8 +4582,10 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, DWORD filter, wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); @@ -114,5 +117,5 @@ index 4e2063f..1f97857 100644 /* Restore the color key parameters */ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, -- -2.3.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch b/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch index 62c91f2d..33e9afb9 100644 --- a/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch +++ b/patches/wined3d-CSMT_Main/0033-wined3d-Introduce-a-function-to-retrieve-resource-me.patch @@ -1,4 +1,4 @@ -From ddfa60053cfc7b215fdf041cd0e0b8401bb1a86b Mon Sep 17 00:00:00 2001 +From 42dbd273c1097c5dcd5fb13e94ee7950551db75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 16 Sep 2013 22:44:33 +0200 Subject: wined3d: Introduce a function to retrieve resource memory. @@ -51,7 +51,7 @@ index b756bf1..40267e7 100644 void wined3d_resource_load_location(struct wined3d_resource *resource, struct wined3d_context *context, DWORD location) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index cf21b54..a6b98f1 100644 +index 4fe3d72..1f51116 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -479,39 +479,6 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -112,16 +112,16 @@ index cf21b54..a6b98f1 100644 wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, -@@ -2865,7 +2832,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, +@@ -2713,7 +2680,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, struct wined3d_bo_address data; - UINT row_pitch, slice_pitch; + DWORD slice_pitch, pitch; - surface_get_memory(surface, &data, dst_location); + wined3d_resource_get_memory(&surface->resource, dst_location, &data); /* Context_release does not restore the original context in case of * nested context_acquire calls. Only read_from_framebuffer and -@@ -4007,8 +3974,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD +@@ -3868,8 +3835,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD struct wined3d_bo_address dst, src; UINT size = surface->resource.size; @@ -132,7 +132,7 @@ index cf21b54..a6b98f1 100644 if (dst.buffer_object) { -@@ -4220,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -4081,7 +4048,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, surface_remove_pbo(surface, gl_info); } @@ -142,10 +142,10 @@ index cf21b54..a6b98f1 100644 { /* This code is entered for texture formats which need a fixup. */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f28994d..a640145 100644 +index f3ab20f..ab938f0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2198,6 +2198,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE +@@ -2200,6 +2200,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; @@ -155,5 +155,5 @@ index f28994d..a640145 100644 UINT *slice_pitch) DECLSPEC_HIDDEN; GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; -- -2.4.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch b/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch index be0a4c65..bd661378 100644 --- a/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch +++ b/patches/wined3d-CSMT_Main/0035-wined3d-Move-check_block_align-to-resource.c.patch @@ -1,4 +1,4 @@ -From da397c28f35b9220eb4bf258a49b3a778732cd28 Mon Sep 17 00:00:00 2001 +From 5b260f3eff9c924a8e6cc0b9496c2639dc52e9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 19 Sep 2013 14:55:00 +0200 Subject: wined3d: Move check_block_align to resource.c @@ -6,15 +6,15 @@ Subject: wined3d: Move check_block_align to resource.c --- dlls/wined3d/resource.c | 28 ++++++++++++++++++++++++++++ dlls/wined3d/surface.c | 27 +++++++++++---------------- - dlls/wined3d/volume.c | 31 ++----------------------------- + dlls/wined3d/volume.c | 30 +----------------------------- dlls/wined3d/wined3d_private.h | 2 ++ - 4 files changed, 43 insertions(+), 45 deletions(-) + 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 0ef2155..ddcfdad 100644 +index 40267e7..c8bbf3d 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -618,3 +618,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru +@@ -689,3 +689,31 @@ BOOL wined3d_resource_prepare_map_memory(struct wined3d_resource *resource, stru return FALSE; } } @@ -47,10 +47,10 @@ index 0ef2155..ddcfdad 100644 + return TRUE; +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 178a949..0f58be1 100644 +index a47f1fa..a728e7d 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1475,23 +1475,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w +@@ -1477,23 +1477,18 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) { @@ -86,7 +86,7 @@ index 178a949..0f58be1 100644 HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 1cfeb04..4d7b349 100644 +index 4faa22d..b902b18 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -379,34 +379,6 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum @@ -124,21 +124,20 @@ index 1cfeb04..4d7b349 100644 static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume, const struct wined3d_box *box) { -@@ -457,7 +429,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +@@ -457,7 +429,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, WARN("Map box is invalid.\n"); return WINED3DERR_INVALIDCALL; } - if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box)) -+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && -+ !wined3d_resource_check_block_align(&volume->resource, box)) ++ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !wined3d_resource_check_block_align(&volume->resource, box)) { WARN("Map box is misaligned for %ux%u blocks.\n", format->block_width, format->block_height); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 96cdac5..855375d 100644 +index ff07e53..9dab51b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2155,6 +2155,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -2197,6 +2197,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN; DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -148,5 +147,5 @@ index 96cdac5..855375d 100644 BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, const struct wined3d_context *context, DWORD flags) DECLSPEC_HIDDEN; -- -2.3.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch b/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch index 53b12c5c..a78eea4f 100644 --- a/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch +++ b/patches/wined3d-CSMT_Main/0070-wined3d-Send-light-updates-through-the-command-strea.patch @@ -1,4 +1,4 @@ -From a1458d85e82bcde47262c579ef3be209a1ee1324 Mon Sep 17 00:00:00 2001 +From 4e5db60def2e093e529a2f7b8c5c0c081fd48723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 10 Apr 2013 17:16:02 +0200 Subject: wined3d: Send light updates through the command stream @@ -10,7 +10,7 @@ Subject: wined3d: Send light updates through the command stream 3 files changed, 174 insertions(+), 65 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 85bc039..cff6212 100644 +index 434ce9a..562323e 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -63,7 +63,6 @@ enum wined3d_cs_op @@ -63,7 +63,7 @@ index 85bc039..cff6212 100644 /* FIXME: The list synchronization probably isn't particularly fast. */ static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) { -@@ -996,35 +1004,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -997,35 +1005,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined cs->ops->submit(cs); } @@ -99,7 +99,7 @@ index 85bc039..cff6212 100644 static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_set_shader_resource_view *op = data; -@@ -1584,6 +1563,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ +@@ -1585,6 +1564,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ cs->ops->submit(cs); } @@ -132,12 +132,6 @@ index 85bc039..cff6212 100644 + object->OriginalIndex = light_idx; + } + -+ object->OriginalParms = op->light.OriginalParms; -+ memcpy(&object->position, &op->light.position, sizeof(object->position)); -+ memcpy(&object->direction, &op->light.direction, sizeof(object->direction)); -+ object->exponent = op->light.exponent; -+ object->cutoff = op->light.cutoff; -+ + /* Update the live definitions if the light is currently assigned a glIndex. */ + if (object->glIndex != -1) + { @@ -146,6 +140,12 @@ index 85bc039..cff6212 100644 + device_invalidate_state(cs->device, STATE_ACTIVELIGHT(object->glIndex)); + } + ++ object->OriginalParms = op->light.OriginalParms; ++ object->position = op->light.position; ++ object->direction = op->light.direction; ++ object->exponent = op->light.exponent; ++ object->cutoff = op->light.cutoff; ++ + return sizeof(*op); +} + @@ -252,7 +252,7 @@ index 85bc039..cff6212 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1613,7 +1738,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1614,7 +1739,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, @@ -260,7 +260,7 @@ index 85bc039..cff6212 100644 /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, -@@ -1623,6 +1747,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1624,6 +1748,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, @@ -270,10 +270,10 @@ index 85bc039..cff6212 100644 static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 2a40538..de1bbfb 100644 +index d2ce327..74bff19 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -1470,14 +1470,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1469,14 +1469,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n", light->range, light->falloff, light->theta, light->phi); @@ -288,7 +288,7 @@ index 2a40538..de1bbfb 100644 /* Save away the information. */ object->OriginalParms = *light; -@@ -1550,6 +1542,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, +@@ -1556,6 +1548,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, FIXME("Unrecognized light type %#x.\n", light->type); } @@ -298,7 +298,7 @@ index 2a40538..de1bbfb 100644 return WINED3D_OK; } -@@ -1622,12 +1617,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1628,12 +1623,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN { if (light_info->glIndex != -1) { @@ -311,7 +311,7 @@ index 2a40538..de1bbfb 100644 device->update_state->lights[light_info->glIndex] = NULL; light_info->glIndex = -1; } -@@ -1669,16 +1658,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN +@@ -1675,16 +1664,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -331,7 +331,7 @@ index 2a40538..de1bbfb 100644 return WINED3D_OK; } -@@ -3405,7 +3390,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT +@@ -3395,7 +3380,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT return WINED3DERR_INVALIDCALL; } @@ -339,7 +339,7 @@ index 2a40538..de1bbfb 100644 wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); return WINED3D_OK; -@@ -3440,8 +3424,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic +@@ -3430,8 +3414,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic return WINED3DERR_INVALIDCALL; } @@ -348,7 +348,7 @@ index 2a40538..de1bbfb 100644 wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); return WINED3D_OK; -@@ -3453,7 +3435,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3443,7 +3425,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n", device, start_idx, index_count, start_instance, instance_count); @@ -357,10 +357,10 @@ index 2a40538..de1bbfb 100644 } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9eb612d..7b2eaec 100644 +index 13e28d4..5862540 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2581,7 +2581,9 @@ struct wined3d_cs_block +@@ -2622,7 +2622,9 @@ struct wined3d_cs_block { struct list entry; UINT pos; @@ -371,7 +371,7 @@ index 9eb612d..7b2eaec 100644 }; struct wined3d_cs_ops -@@ -2626,8 +2628,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -2667,8 +2669,6 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; @@ -380,7 +380,7 @@ index 9eb612d..7b2eaec 100644 void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -2673,6 +2673,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, +@@ -2714,6 +2714,8 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, UINT base_vertex_index) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) DECLSPEC_HIDDEN; @@ -390,5 +390,5 @@ index 9eb612d..7b2eaec 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.3.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch index 145d66d3..95cbc0a8 100644 --- a/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0074-wined3d-Send-blits-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From 3783cc16737b9ebebc9b00d90e981207843bc01e Mon Sep 17 00:00:00 2001 +From ff38f01388324b055bcda33d46929169f76ce3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 29 Apr 2013 18:49:53 +0200 Subject: wined3d: Send blits through the command stream. @@ -7,12 +7,12 @@ This needs more work. This patch breaks error handling, and the split between surface_blt and surface_blt_ugly isn't particularly nice. --- dlls/wined3d/cs.c | 50 +++++++ - dlls/wined3d/surface.c | 307 ++++++++++++++++++++++------------------- + dlls/wined3d/surface.c | 309 +++++++++++++++++++++++------------------ dlls/wined3d/wined3d_private.h | 8 ++ - 3 files changed, 226 insertions(+), 139 deletions(-) + 3 files changed, 228 insertions(+), 139 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 77bb485..b5b5ece 100644 +index fcc5ed7..550206f 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -74,6 +74,7 @@ enum wined3d_cs_op @@ -42,7 +42,7 @@ index 77bb485..b5b5ece 100644 /* FIXME: The list synchronization probably isn't particularly fast. */ static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) { -@@ -1506,6 +1519,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) +@@ -1507,6 +1520,9 @@ static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) struct wined3d_device *device = cs->device; struct wined3d_context *context; @@ -52,7 +52,7 @@ index 77bb485..b5b5ece 100644 context = context_acquire(device, NULL); context->gl_info->gl_ops.gl.p_glFinish(); context_release(context); -@@ -1717,6 +1733,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1718,6 +1734,38 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab cs->ops->submit(cs); } @@ -91,7 +91,7 @@ index 77bb485..b5b5ece 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1757,6 +1805,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1758,6 +1806,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, @@ -99,7 +99,7 @@ index 77bb485..b5b5ece 100644 }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -@@ -1831,6 +1880,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) +@@ -1832,6 +1881,7 @@ static DWORD WINAPI wined3d_cs_run(void *thread_param) TRACE("Started.\n"); @@ -108,10 +108,10 @@ index 77bb485..b5b5ece 100644 { struct wined3d_cs_block *block; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 0c25884..8883c9c 100644 +index bd048c2..8cec730 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -5003,14 +5003,13 @@ const struct blit_shader cpu_blit = { +@@ -5002,14 +5002,13 @@ const struct blit_shader cpu_blit = { cpu_blit_blit_surface, }; @@ -128,7 +128,7 @@ index 0c25884..8883c9c 100644 BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -5021,111 +5020,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5020,111 +5019,6 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -240,7 +240,7 @@ index 0c25884..8883c9c 100644 if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5168,8 +5062,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5167,8 +5061,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC } scale = src_surface @@ -251,7 +251,7 @@ index 0c25884..8883c9c 100644 convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->container->resource.format_flags -@@ -5189,22 +5083,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5188,22 +5082,16 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -279,7 +279,7 @@ index 0c25884..8883c9c 100644 } } else -@@ -5235,8 +5123,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5234,8 +5122,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -290,7 +290,7 @@ index 0c25884..8883c9c 100644 } else { -@@ -5264,9 +5152,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5263,9 +5151,9 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC TRACE("Not doing upload because of format conversion.\n"); else { @@ -302,7 +302,7 @@ index 0c25884..8883c9c 100644 { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) { -@@ -5275,7 +5163,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5274,7 +5162,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC dst_surface->container->resource.draw_binding); context_release(context); } @@ -311,7 +311,7 @@ index 0c25884..8883c9c 100644 } } } -@@ -5299,50 +5187,191 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC +@@ -5298,50 +5186,193 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -469,8 +469,10 @@ index 0c25884..8883c9c 100644 + return WINEDDERR_INVALIDRECT; + } + -+ dst_ds_flags = dst_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); -+ src_ds_flags = src_surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); ++ dst_ds_flags = dst_surface->container->resource.format_flags ++ & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); ++ src_ds_flags = src_surface->container->resource.format_flags ++ & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL); + if (src_ds_flags != dst_ds_flags) + { + WARN("Rejecting depth / stencil blit between incompatible formats.\n"); @@ -517,10 +519,10 @@ index 0c25884..8883c9c 100644 static const struct wined3d_resource_ops surface_resource_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ff3d49b..9fc2181 100644 +index e153b0b..77317a5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2463,6 +2463,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; +@@ -2491,6 +2491,9 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN; 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; @@ -530,7 +532,7 @@ index ff3d49b..9fc2181 100644 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; -@@ -2612,6 +2615,7 @@ struct wined3d_cs +@@ -2640,6 +2643,7 @@ struct wined3d_cs struct wined3d_device *device; struct wined3d_state state; HANDLE thread; @@ -538,7 +540,7 @@ index ff3d49b..9fc2181 100644 DWORD tls_idx; struct wined3d_surface *onscreen_depth_stencil; -@@ -2690,6 +2694,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, +@@ -2718,6 +2722,10 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; @@ -550,5 +552,5 @@ index ff3d49b..9fc2181 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.4.2 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch b/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch index c57e759c..9baf76ff 100644 --- a/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch +++ b/patches/wined3d-CSMT_Main/0075-wined3d-Put-update_surface-checks-back-in-place.patch @@ -1,4 +1,4 @@ -From b642658723b5728d3ea2384f6f40680436bcdeb0 Mon Sep 17 00:00:00 2001 +From 6e1f3fcac566581cd786a66405633ed4a674793d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 20 Aug 2014 14:14:23 +0200 Subject: wined3d: Put update_surface checks back in place @@ -6,16 +6,16 @@ Subject: wined3d: Put update_surface checks back in place Unfortunately I can't remove the code from surface_update_from_surface yet because blits depend on them. --- - dlls/wined3d/device.c | 66 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/device.c | 68 ++++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/surface.c | 2 +- dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 68 insertions(+), 1 deletion(-) + 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 65a34a5..71be9eb 100644 +index b95dfde..f0b2849 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3788,6 +3788,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, +@@ -3773,6 +3773,13 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -29,7 +29,7 @@ index 65a34a5..71be9eb 100644 TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", device, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_point(dst_point)); -@@ -3799,6 +3806,65 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, +@@ -3784,6 +3791,67 @@ HRESULT CDECL wined3d_device_update_surface(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -79,14 +79,16 @@ index 65a34a5..71be9eb 100644 + return WINED3DERR_INVALIDCALL; + } + -+ if ((src_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(src_surface, src_rect)) ++ if ((src_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) ++ && !surface_check_block_align(src_surface, src_rect)) + { + WARN("Source rectangle not block-aligned.\n"); + return WINED3DERR_INVALIDCALL; + } + + SetRect(&dst_rect, dst_point->x, dst_point->y, dst_point->x + update_w, dst_point->y + update_h); -+ if ((dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(dst_surface, &dst_rect)) ++ if ((dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) ++ && !surface_check_block_align(dst_surface, &dst_rect)) + { + WARN("Destination rectangle not block-aligned.\n"); + return WINED3DERR_INVALIDCALL; @@ -96,7 +98,7 @@ index 65a34a5..71be9eb 100644 { FIXME("Waiting for cs.\n"); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 8883c9c..676200d 100644 +index 8cec730..1376d97 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1366,7 +1366,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w @@ -109,10 +111,10 @@ index 8883c9c..676200d 100644 struct wined3d_box box; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 9fc2181..5828bd3 100644 +index 77317a5..e09927b6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2466,6 +2466,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w +@@ -2494,6 +2494,7 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, struct wined3d_surface *src_surface, const RECT *src_rect_in, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; @@ -121,5 +123,5 @@ index 9fc2181..5828bd3 100644 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; -- -2.4.2 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch b/patches/wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch deleted file mode 100644 index e8d6fe7b..00000000 --- a/patches/wined3d-CSMT_Main/0077-wined3d-Add-cs-waiting-debug-code.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b41844b91cb9817f378c3c666b3129c3c870d014 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Thu, 4 Jul 2013 20:40:39 +0200 -Subject: wined3d: Add cs waiting debug code - ---- - dlls/wined3d/texture.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index eb4996b..240e8fa 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -610,6 +610,14 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, - return WINED3DERR_INVALIDCALL; - } - -+ /* -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("waiting for cs\n"); -+ texture->resource.device->cs->ops->finish(texture->resource.device->cs); -+ } -+ */ -+ - wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key); - - return WINED3D_OK; --- -2.3.5 - diff --git a/patches/wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch b/patches/wined3d-CSMT_Main/0077-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0078-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch rename to patches/wined3d-CSMT_Main/0077-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch diff --git a/patches/wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch b/patches/wined3d-CSMT_Main/0078-wined3d-Send-render-target-view-clears-through-the-c.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0079-wined3d-Send-render-target-view-clears-through-the-c.patch rename to patches/wined3d-CSMT_Main/0078-wined3d-Send-render-target-view-clears-through-the-c.patch diff --git a/patches/wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch b/patches/wined3d-CSMT_Main/0079-wined3d-Wait-for-the-CS-in-GetDC.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0080-wined3d-Wait-for-the-CS-in-GetDC.patch rename to patches/wined3d-CSMT_Main/0079-wined3d-Wait-for-the-CS-in-GetDC.patch diff --git a/patches/wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch b/patches/wined3d-CSMT_Main/0080-wined3d-send-resource-maps-through-the-command-strea.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0081-wined3d-send-resource-maps-through-the-command-strea.patch rename to patches/wined3d-CSMT_Main/0080-wined3d-send-resource-maps-through-the-command-strea.patch diff --git a/patches/wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch b/patches/wined3d-CSMT_Main/0081-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0082-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch rename to patches/wined3d-CSMT_Main/0081-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch diff --git a/patches/wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch b/patches/wined3d-CSMT_Main/0082-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0083-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch rename to patches/wined3d-CSMT_Main/0082-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch diff --git a/patches/wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch b/patches/wined3d-CSMT_Main/0083-wined3d-Don-t-preload-buffers-on-unmap.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0084-wined3d-Don-t-preload-buffers-on-unmap.patch rename to patches/wined3d-CSMT_Main/0083-wined3d-Don-t-preload-buffers-on-unmap.patch diff --git a/patches/wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch b/patches/wined3d-CSMT_Main/0084-wined3d-Don-t-call-glFinish-before-swapping.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0085-wined3d-Don-t-call-glFinish-before-swapping.patch rename to patches/wined3d-CSMT_Main/0084-wined3d-Don-t-call-glFinish-before-swapping.patch diff --git a/patches/wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch b/patches/wined3d-CSMT_Main/0085-wined3d-wined3d_-_query_issue-never-fails.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0086-wined3d-wined3d_-_query_issue-never-fails.patch rename to patches/wined3d-CSMT_Main/0085-wined3d-wined3d_-_query_issue-never-fails.patch diff --git a/patches/wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch b/patches/wined3d-CSMT_Main/0086-wined3d-Add-query-support-to-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0087-wined3d-Add-query-support-to-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0086-wined3d-Add-query-support-to-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch b/patches/wined3d-CSMT_Main/0087-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0088-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch rename to patches/wined3d-CSMT_Main/0087-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch diff --git a/patches/wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch b/patches/wined3d-CSMT_Main/0088-wined3d-Poll-queries-automatically-in-the-CS.patch similarity index 93% rename from patches/wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch rename to patches/wined3d-CSMT_Main/0088-wined3d-Poll-queries-automatically-in-the-CS.patch index 5ee4bc32..588b13ef 100644 --- a/patches/wined3d-CSMT_Main/0089-wined3d-Poll-queries-automatically-in-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0088-wined3d-Poll-queries-automatically-in-the-CS.patch @@ -1,16 +1,16 @@ -From 3c2152778b13105e423a33889692c3b12f58653b Mon Sep 17 00:00:00 2001 +From 70b1167ff814efa7b8e397fdaa8fdfd9988a4868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 19:18:48 +0200 Subject: wined3d: Poll queries automatically in the CS --- dlls/wined3d/cs.c | 76 ++++++-------- - dlls/wined3d/query.c | 221 ++++++++++++++++++++++++++--------------- + dlls/wined3d/query.c | 225 ++++++++++++++++++++++++++--------------- dlls/wined3d/wined3d_private.h | 7 +- - 3 files changed, 178 insertions(+), 126 deletions(-) + 3 files changed, 180 insertions(+), 128 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d97ef5b..8256707 100644 +index 0c8284e..29d963e 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -69,7 +69,6 @@ enum wined3d_cs_op @@ -38,7 +38,7 @@ index d97ef5b..8256707 100644 static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1822,8 +1811,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) +@@ -1823,8 +1812,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) query->query_ops->query_issue(query, op->flags); @@ -50,7 +50,7 @@ index d97ef5b..8256707 100644 return sizeof(*op); } -@@ -1840,37 +1830,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1841,37 +1831,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu cs->ops->submit(cs, sizeof(*op)); } @@ -88,7 +88,7 @@ index d97ef5b..8256707 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -1918,7 +1877,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1919,7 +1878,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, @@ -96,7 +96,7 @@ index d97ef5b..8256707 100644 }; static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -@@ -2033,17 +1991,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, +@@ -2034,17 +1992,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, wined3d_surface_incref(cs->onscreen_depth_stencil); } @@ -143,7 +143,7 @@ index d97ef5b..8256707 100644 { continue; diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 9bdb35e..9f1f5ad 100644 +index 9bdb35e..690903e 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -241,6 +241,15 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) @@ -406,10 +406,10 @@ index 9bdb35e..9f1f5ad 100644 GLuint available; GLuint64 timestamp; - HRESULT res; -- -- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); + BOOL ret; +- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); +- - if (!tq->context) - query->state = QUERY_CREATED; - @@ -468,7 +468,7 @@ index 9bdb35e..9f1f5ad 100644 } static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) -@@ -657,7 +709,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer +@@ -657,15 +709,14 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer void *data, DWORD size, DWORD flags) { TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); @@ -476,6 +476,16 @@ index 9bdb35e..9f1f5ad 100644 if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) { static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; + + if (query->state == QUERY_BUILDING) + { +- TRACE("Query is building, returning S_FALSE.\n"); +- return S_FALSE; ++ TRACE("Query is building, returning S_FALSE.\n"); ++ return S_FALSE; + } + + fill_query_data(data, size, &disjoint_data, sizeof(disjoint_data)); @@ -679,6 +730,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer return S_OK; } @@ -526,10 +536,10 @@ index 9bdb35e..9f1f5ad 100644 return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 56d9b0c..4c4ee51 100644 +index dd230d6..ebd928a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1090,6 +1090,7 @@ struct wined3d_occlusion_query +@@ -1101,6 +1101,7 @@ struct wined3d_occlusion_query struct list entry; GLuint id; struct wined3d_context *context; @@ -537,7 +547,7 @@ index 56d9b0c..4c4ee51 100644 }; union wined3d_gl_query_object -@@ -1125,6 +1126,7 @@ struct wined3d_timestamp_query +@@ -1136,6 +1137,7 @@ struct wined3d_timestamp_query struct list entry; GLuint id; struct wined3d_context *context; @@ -545,7 +555,7 @@ index 56d9b0c..4c4ee51 100644 }; void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; -@@ -2610,6 +2612,7 @@ struct wined3d_cs +@@ -2651,6 +2653,7 @@ struct wined3d_cs struct wined3d_cs_queue queue; LONG pending_presents; @@ -553,7 +563,7 @@ index 56d9b0c..4c4ee51 100644 }; struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; -@@ -2705,6 +2708,7 @@ enum query_state { +@@ -2746,6 +2749,7 @@ enum query_state { struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -561,7 +571,7 @@ index 56d9b0c..4c4ee51 100644 void (*query_issue)(struct wined3d_query *query, DWORD flags); }; -@@ -2720,7 +2724,8 @@ struct wined3d_query +@@ -2761,7 +2765,8 @@ struct wined3d_query DWORD data_size; void *extendedData; @@ -572,5 +582,5 @@ index 56d9b0c..4c4ee51 100644 /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other -- -2.3.7 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch b/patches/wined3d-CSMT_Main/0089-wined3d-Introduce-a-separate-queue-for-priority-comm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0090-wined3d-Introduce-a-separate-queue-for-priority-comm.patch rename to patches/wined3d-CSMT_Main/0089-wined3d-Introduce-a-separate-queue-for-priority-comm.patch diff --git a/patches/wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch b/patches/wined3d-CSMT_Main/0090-wined3d-Destroy-queries-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0091-wined3d-Destroy-queries-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0090-wined3d-Destroy-queries-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch b/patches/wined3d-CSMT_Main/0091-wined3d-Separate-main-and-worker-thread-query-state.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0092-wined3d-Separate-main-and-worker-thread-query-state.patch rename to patches/wined3d-CSMT_Main/0091-wined3d-Separate-main-and-worker-thread-query-state.patch diff --git a/patches/wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch b/patches/wined3d-CSMT_Main/0092-wined3d-Don-t-poll-queries-that-failed-to-start.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0093-wined3d-Don-t-poll-queries-that-failed-to-start.patch rename to patches/wined3d-CSMT_Main/0092-wined3d-Don-t-poll-queries-that-failed-to-start.patch diff --git a/patches/wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch b/patches/wined3d-CSMT_Main/0093-wined3d-Remove-restated-queries-from-the-poll-list.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0094-wined3d-Remove-restated-queries-from-the-poll-list.patch rename to patches/wined3d-CSMT_Main/0093-wined3d-Remove-restated-queries-from-the-poll-list.patch diff --git a/patches/wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch b/patches/wined3d-CSMT_Main/0094-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0095-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch rename to patches/wined3d-CSMT_Main/0094-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch diff --git a/patches/wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch b/patches/wined3d-CSMT_Main/0095-wined3d-Put-this-into-the-query-poll-patch.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0096-wined3d-Put-this-into-the-query-poll-patch.patch rename to patches/wined3d-CSMT_Main/0095-wined3d-Put-this-into-the-query-poll-patch.patch diff --git a/patches/wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch b/patches/wined3d-CSMT_Main/0096-wined3d-Send-update_surface-commands-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0097-wined3d-Send-update_surface-commands-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0096-wined3d-Send-update_surface-commands-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0097-wined3d-Send-texture-preloads-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0098-wined3d-Send-texture-preloads-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0097-wined3d-Send-texture-preloads-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0098-wined3d-Send-surface-preloads-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0099-wined3d-Send-surface-preloads-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0098-wined3d-Send-surface-preloads-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0099-wined3d-Send-update_texture-calls-through-the-CS.patch similarity index 90% rename from patches/wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0099-wined3d-Send-update_texture-calls-through-the-CS.patch index f6b161bd..aece247e 100644 --- a/patches/wined3d-CSMT_Main/0100-wined3d-Send-update_texture-calls-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0099-wined3d-Send-update_texture-calls-through-the-CS.patch @@ -1,16 +1,16 @@ -From 59bc0b8c16cd0e7c3a1d899c140c88ccba9f99ad Mon Sep 17 00:00:00 2001 +From a67a9a39ffcf23526dbabc064d02520c41a5ecdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 00:33:48 +0200 Subject: wined3d: Send update_texture calls through the CS --- dlls/wined3d/cs.c | 33 ++++++++++++ - dlls/wined3d/device.c | 114 ++++++++++++++++++----------------------- + dlls/wined3d/device.c | 119 +++++++++++++++++++---------------------- dlls/wined3d/wined3d_private.h | 4 ++ - 3 files changed, 86 insertions(+), 65 deletions(-) + 3 files changed, 91 insertions(+), 65 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4210ddf..93e6e5f 100644 +index f17a222..31f7087 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -73,6 +73,7 @@ enum wined3d_cs_op @@ -34,7 +34,7 @@ index 4210ddf..93e6e5f 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2001,6 +2008,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa +@@ -2002,6 +2009,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa cs->ops->submit(cs, sizeof(*op)); } @@ -66,7 +66,7 @@ index 4210ddf..93e6e5f 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2052,6 +2084,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2053,6 +2085,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, @@ -75,10 +75,10 @@ index 4210ddf..93e6e5f 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 0e4e2ba..c55505e 100644 +index d302b17..e7c5bcc 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3430,16 +3430,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3420,16 +3420,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -98,7 +98,7 @@ index 0e4e2ba..c55505e 100644 if (src_volume->resource.format != dst_volume->resource.format) { -@@ -3457,8 +3456,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, +@@ -3447,8 +3446,6 @@ static HRESULT device_update_volume(struct wined3d_device *device, if (FAILED(hr = wined3d_volume_map(src_volume, &src, NULL, WINED3D_MAP_READONLY))) return hr; @@ -107,7 +107,7 @@ index 0e4e2ba..c55505e 100644 /* Only a prepare, since we're uploading the entire volume. */ wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); -@@ -3468,48 +3465,17 @@ static HRESULT device_update_volume(struct wined3d_device *device, +@@ -3458,48 +3455,17 @@ static HRESULT device_update_volume(struct wined3d_device *device, wined3d_volume_upload_data(dst_volume, context, &data); wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -160,7 +160,7 @@ index 0e4e2ba..c55505e 100644 level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3527,17 +3493,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3517,17 +3483,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, ++src_skip_levels; } @@ -178,7 +178,7 @@ index 0e4e2ba..c55505e 100644 /* Update every surface level of the texture. */ switch (type) -@@ -3552,12 +3509,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3542,12 +3499,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -192,7 +192,7 @@ index 0e4e2ba..c55505e 100644 } break; } -@@ -3577,12 +3529,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3567,12 +3519,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); @@ -206,7 +206,7 @@ index 0e4e2ba..c55505e 100644 } } break; -@@ -3592,14 +3539,15 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3582,14 +3529,15 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, { for (i = 0; i < level_count; ++i) { @@ -224,13 +224,13 @@ index 0e4e2ba..c55505e 100644 } } break; -@@ -3607,8 +3555,44 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3597,9 +3545,50 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, default: FIXME("Unsupported texture type %#x.\n", type); - return WINED3DERR_INVALIDCALL; + return; - } ++ } +} + +HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, @@ -245,8 +245,8 @@ index 0e4e2ba..c55505e 100644 + { + WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n"); + return WINED3DERR_INVALIDCALL; -+ } -+ + } + + if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM) + { + WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n"); @@ -257,6 +257,11 @@ index 0e4e2ba..c55505e 100644 + WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n"); + return WINED3DERR_INVALIDCALL; + } ++ if (dst_texture->resource.format != src_texture->resource.format) ++ { ++ WARN("Formats do not match, returning WINED3DERR_INVALIDCALL.\n"); ++ return WINED3DERR_INVALIDCALL; ++ } + + /* Verify that the source and destination textures are the same type. */ + type = src_texture->resource.type; @@ -267,14 +272,15 @@ index 0e4e2ba..c55505e 100644 + } + + wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); - ++ return WINED3D_OK; } + diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d141e3e..fa9270a 100644 +index 3081be5..3297c5e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2114,6 +2114,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource +@@ -2152,6 +2152,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; @@ -283,7 +289,7 @@ index d141e3e..fa9270a 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2703,6 +2705,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac +@@ -2744,6 +2746,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN; void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; @@ -293,5 +299,5 @@ index d141e3e..fa9270a 100644 /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -- -2.3.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch b/patches/wined3d-CSMT_Main/0100-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0101-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch rename to patches/wined3d-CSMT_Main/0100-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch b/patches/wined3d-CSMT_Main/0101-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch similarity index 89% rename from patches/wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch rename to patches/wined3d-CSMT_Main/0101-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch index f607d8c6..0285aff7 100644 --- a/patches/wined3d-CSMT_Main/0102-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch +++ b/patches/wined3d-CSMT_Main/0101-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch @@ -1,4 +1,4 @@ -From ef5650c2467c6902fca699bb05d0302a0f42d900 Mon Sep 17 00:00:00 2001 +From 39991b8b55a61f725745fde7e8a2622ec6a457a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 29 Aug 2013 22:25:14 +0200 Subject: wined3d: Don't lock the src volume in device_update_volume @@ -9,14 +9,14 @@ assumption of the work queue. FIXME: Maybe merge this with the previous patch or change their order. --- - dlls/wined3d/device.c | 31 +++++++------------------------ - 1 file changed, 7 insertions(+), 24 deletions(-) + dlls/wined3d/device.c | 30 +++++++----------------------- + 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c55505e..1db616d 100644 +index e7c5bcc..e3b4217 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3430,12 +3430,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3420,12 +3420,10 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -31,7 +31,7 @@ index c55505e..1db616d 100644 TRACE("src_volume %p, dst_volume %p.\n", src_volume, dst_volume); -@@ -3443,31 +3441,22 @@ static HRESULT device_update_volume(struct wined3d_context *context, +@@ -3433,31 +3431,23 @@ static HRESULT device_update_volume(struct wined3d_context *context, if (src_volume->resource.format != dst_volume->resource.format) { FIXME("Source and destination formats do not match.\n"); @@ -53,7 +53,7 @@ index c55505e..1db616d 100644 /* Only a prepare, since we're uploading the entire volume. */ wined3d_texture_prepare_texture(dst_volume->container, context, FALSE); wined3d_texture_bind_and_dirtify(dst_volume->container, context, FALSE); -- + - data.buffer_object = 0; - data.addr = src.data; - wined3d_volume_upload_data(dst_volume, context, &data); @@ -67,7 +67,7 @@ index c55505e..1db616d 100644 } /* Context activation is done by the caller */ -@@ -3539,16 +3528,10 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ +@@ -3529,16 +3519,10 @@ void device_exec_update_texture(struct wined3d_context *context, struct wined3d_ { for (i = 0; i < level_count; ++i) { @@ -86,5 +86,5 @@ index c55505e..1db616d 100644 break; } -- -2.3.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch b/patches/wined3d-CSMT_Main/0102-wined3d-Handle-evit_managed_resources-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0103-wined3d-Handle-evit_managed_resources-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0102-wined3d-Handle-evit_managed_resources-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0103-wined3d-Send-flips-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0104-wined3d-Send-flips-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0103-wined3d-Send-flips-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch b/patches/wined3d-CSMT_Main/0104-wined3d-Introduce-resource-fencing.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0105-wined3d-Introduce-resource-fencing.patch rename to patches/wined3d-CSMT_Main/0104-wined3d-Introduce-resource-fencing.patch diff --git a/patches/wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch b/patches/wined3d-CSMT_Main/0105-wined3d-Fence-update_texture-and-update_surface-call.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0106-wined3d-Fence-update_texture-and-update_surface-call.patch rename to patches/wined3d-CSMT_Main/0105-wined3d-Fence-update_texture-and-update_surface-call.patch diff --git a/patches/wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch b/patches/wined3d-CSMT_Main/0106-wined3d-Dirtify-resources-on-unmap.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0107-wined3d-Dirtify-resources-on-unmap.patch rename to patches/wined3d-CSMT_Main/0106-wined3d-Dirtify-resources-on-unmap.patch diff --git a/patches/wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch b/patches/wined3d-CSMT_Main/0107-wined3d-Fence-texture-reads-in-draws.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0108-wined3d-Fence-texture-reads-in-draws.patch rename to patches/wined3d-CSMT_Main/0107-wined3d-Fence-texture-reads-in-draws.patch diff --git a/patches/wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch b/patches/wined3d-CSMT_Main/0108-wined3d-Fence-render-targets-and-depth-stencils.patch similarity index 83% rename from patches/wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch rename to patches/wined3d-CSMT_Main/0108-wined3d-Fence-render-targets-and-depth-stencils.patch index 36bdd8e6..eeb69409 100644 --- a/patches/wined3d-CSMT_Main/0109-wined3d-Fence-render-targets-and-depth-stencils.patch +++ b/patches/wined3d-CSMT_Main/0108-wined3d-Fence-render-targets-and-depth-stencils.patch @@ -1,4 +1,4 @@ -From 093a05f4ff44d45e81e9e0f3dada8fb6551cf382 Mon Sep 17 00:00:00 2001 +From 18f06f3fccac3871c0db9d0229a137f920edfbef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 27 Sep 2013 16:55:58 +0200 Subject: wined3d: Fence render targets and depth stencils @@ -8,10 +8,10 @@ Subject: wined3d: Fence render targets and depth stencils 1 file changed, 38 insertions(+) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 0277a1e..a4b996e 100644 +index cc73bdc..73c3dc6 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -571,6 +571,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -581,6 +581,30 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * cs->ops->submit(cs, size); } @@ -42,11 +42,11 @@ index 0277a1e..a4b996e 100644 static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_draw *op = data; -@@ -606,6 +630,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -616,6 +640,13 @@ static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) if (cs->state.textures[i]) wined3d_resource_dec_fence(&cs->state.textures[i]->resource); } -+ for (i = 0; i < sizeof(cs->state.fb.render_targets) / sizeof(*cs->state.fb.render_targets); i++) ++ for (i = 0; i < gl_info->limits.buffers; i++) + { + if (cs->state.fb.render_targets[i] && wined3d_cs_colorwrite_enabled(&cs->state, i)) + wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); @@ -56,11 +56,11 @@ index 0277a1e..a4b996e 100644 return sizeof(*op); } -@@ -637,6 +668,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun +@@ -647,6 +678,13 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun if (state->textures[i]) wined3d_resource_inc_fence(&state->textures[i]->resource); } -+ for (i = 0; i < sizeof(state->fb.render_targets) / sizeof(*state->fb.render_targets); i++) ++ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) + { + if (state->fb.render_targets[i] && wined3d_cs_colorwrite_enabled(state, i)) + wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); @@ -71,5 +71,5 @@ index 0277a1e..a4b996e 100644 cs->ops->submit(cs, sizeof(*op)); } -- -2.1.3 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch b/patches/wined3d-CSMT_Main/0109-wined3d-Fence-blit-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0110-wined3d-Fence-blit-operations.patch rename to patches/wined3d-CSMT_Main/0109-wined3d-Fence-blit-operations.patch diff --git a/patches/wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch b/patches/wined3d-CSMT_Main/0110-wined3d-Fence-color_fill-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0111-wined3d-Fence-color_fill-operations.patch rename to patches/wined3d-CSMT_Main/0110-wined3d-Fence-color_fill-operations.patch diff --git a/patches/wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch b/patches/wined3d-CSMT_Main/0111-wined3d-Fence-clear-calls.patch similarity index 80% rename from patches/wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch rename to patches/wined3d-CSMT_Main/0111-wined3d-Fence-clear-calls.patch index 88804282..e06f0dcc 100644 --- a/patches/wined3d-CSMT_Main/0112-wined3d-Fence-clear-calls.patch +++ b/patches/wined3d-CSMT_Main/0111-wined3d-Fence-clear-calls.patch @@ -1,4 +1,4 @@ -From d95011df395938acfe6f6c7a33f7c5c094e7df83 Mon Sep 17 00:00:00 2001 +From bf044ed200f71fa0d27d5b74254afb4cef8fe7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 27 Sep 2013 17:04:47 +0200 Subject: wined3d: Fence clear calls. @@ -8,10 +8,10 @@ Subject: wined3d: Fence clear calls. 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index fb92286..bdb9279 100644 +index 23683d0..78731a0 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -540,7 +540,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +@@ -550,7 +550,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) const struct wined3d_cs_clear *op = data; struct wined3d_device *device; RECT draw_rect; @@ -20,13 +20,13 @@ index fb92286..bdb9279 100644 device = cs->device; wined3d_get_draw_rect(&cs->state, &draw_rect); -@@ -548,6 +548,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +@@ -558,6 +558,17 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) &cs->state.fb, op->rect_count, op->rect_count ? op->rects : NULL, &draw_rect, op->flags, &op->color, op->depth, op->stencil); + if (op->flags & WINED3DCLEAR_TARGET) + { -+ for (i = 0; i < sizeof(cs->state.fb.render_targets) / sizeof(*cs->state.fb.render_targets); i++) ++ for (i = 0; i < device->adapter->gl_info.limits.buffers; i++) + { + if (cs->state.fb.render_targets[i]) + wined3d_resource_dec_fence(cs->state.fb.render_targets[i]->resource); @@ -38,7 +38,7 @@ index fb92286..bdb9279 100644 return sizeof(*op) + sizeof(*op->rects) * extra_rects; } -@@ -555,8 +566,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -565,8 +576,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { struct wined3d_cs_clear *op; @@ -49,13 +49,13 @@ index fb92286..bdb9279 100644 op = cs->ops->require_space(cs, size); op->opcode = WINED3D_CS_OP_CLEAR; -@@ -568,6 +580,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -578,6 +590,17 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * op->depth = depth; op->stencil = stencil; + if (flags & WINED3DCLEAR_TARGET) + { -+ for (i = 0; i < sizeof(state->fb.render_targets) / sizeof(*state->fb.render_targets); i++) ++ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; i++) + { + if (state->fb.render_targets[i]) + wined3d_resource_inc_fence(state->fb.render_targets[i]->resource); @@ -68,5 +68,5 @@ index fb92286..bdb9279 100644 } -- -2.1.3 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch b/patches/wined3d-CSMT_Main/0112-wined3d-Fence-present-calls.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0113-wined3d-Fence-present-calls.patch rename to patches/wined3d-CSMT_Main/0112-wined3d-Fence-present-calls.patch diff --git a/patches/wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch b/patches/wined3d-CSMT_Main/0113-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0114-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch rename to patches/wined3d-CSMT_Main/0113-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch diff --git a/patches/wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch b/patches/wined3d-CSMT_Main/0114-wined3d-Dirtify-changed-textures-through-the-command.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0115-wined3d-Dirtify-changed-textures-through-the-command.patch rename to patches/wined3d-CSMT_Main/0114-wined3d-Dirtify-changed-textures-through-the-command.patch diff --git a/patches/wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch b/patches/wined3d-CSMT_Main/0115-wined3d-Wrap-GL-BOs-in-a-structure.patch similarity index 90% rename from patches/wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch rename to patches/wined3d-CSMT_Main/0115-wined3d-Wrap-GL-BOs-in-a-structure.patch index 95250bff..fd13e00d 100644 --- a/patches/wined3d-CSMT_Main/0116-wined3d-Wrap-GL-BOs-in-a-structure.patch +++ b/patches/wined3d-CSMT_Main/0115-wined3d-Wrap-GL-BOs-in-a-structure.patch @@ -1,4 +1,4 @@ -From e9a13b9c7f3776005db0f8f32a43241c6c66b5be Mon Sep 17 00:00:00 2001 +From 08092b494b98ca7ca22998b5afb4adcd6172a0fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 17:00:35 +0200 Subject: wined3d: Wrap GL BOs in a structure @@ -14,10 +14,10 @@ them for DISCARD maps. 5 files changed, 86 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 18b1784..039ca85 100644 +index eb0c0ba..d0fcba2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -5052,3 +5052,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5139,3 +5139,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -42,7 +42,7 @@ index 18b1784..039ca85 100644 + gl_info = context->gl_info; + + GL_EXTCALL(glGenBuffers(1, &ret->name)); -+ if (type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) ++ if (type_hint == GL_ELEMENT_ARRAY_BUFFER) + context_invalidate_state(context, STATE_INDEXBUFFER); + GL_EXTCALL(glBindBuffer(type_hint, ret->name)); + GL_EXTCALL(glBufferData(type_hint, size, NULL, gl_usage)); @@ -75,10 +75,10 @@ index 18b1784..039ca85 100644 + wined3d_device_destroy_bo(device, context, bo); +} diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 2530ee0..4496c9b 100644 +index 49ef6b9..37a2644 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c -@@ -154,12 +154,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * +@@ -226,12 +226,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void wined3d_resource_free_bo(struct wined3d_resource *resource) { struct wined3d_context *context = context_acquire(resource->device, NULL); @@ -94,7 +94,7 @@ index 2530ee0..4496c9b 100644 context_release(context); } -@@ -175,7 +173,7 @@ void resource_cleanup(struct wined3d_resource *resource) +@@ -247,7 +245,7 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); } @@ -103,7 +103,7 @@ index 2530ee0..4496c9b 100644 wined3d_resource_free_bo(resource); wined3d_resource_free_sysmem(resource); -@@ -188,7 +186,7 @@ void resource_unload(struct wined3d_resource *resource) +@@ -260,7 +258,7 @@ void resource_unload(struct wined3d_resource *resource) if (resource->map_count) ERR("Resource %p is being unloaded while mapped.\n", resource); @@ -112,7 +112,7 @@ index 2530ee0..4496c9b 100644 wined3d_resource_free_bo(resource); context_resource_unloaded(resource->device, -@@ -437,7 +435,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, +@@ -511,7 +509,7 @@ void wined3d_resource_get_memory(const struct wined3d_resource *resource, { if (location & WINED3D_LOCATION_BUFFER) { @@ -121,7 +121,7 @@ index 2530ee0..4496c9b 100644 data->addr = NULL; return; } -@@ -546,7 +544,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, +@@ -620,7 +618,7 @@ BYTE *wined3d_resource_get_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -130,7 +130,7 @@ index 2530ee0..4496c9b 100644 if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { -@@ -589,7 +587,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -663,7 +661,7 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, { case WINED3D_LOCATION_BUFFER: gl_info = context->gl_info; @@ -139,7 +139,7 @@ index 2530ee0..4496c9b 100644 GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER)); GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); checkGLcall("Unmap GL buffer"); -@@ -607,20 +605,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, +@@ -681,20 +679,14 @@ void wined3d_resource_release_map_ptr(const struct wined3d_resource *resource, } /* Context activation is done by the caller. */ @@ -166,7 +166,7 @@ index 2530ee0..4496c9b 100644 BOOL wined3d_resource_prepare_system_memory(struct wined3d_resource *resource) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index fc719e7..d1020df 100644 +index 025e85e1..fc1fc45 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -48,7 +48,7 @@ static void surface_cleanup(struct wined3d_surface *surface) @@ -178,7 +178,7 @@ index fc719e7..d1020df 100644 || surface->rb_resolved || !list_empty(&surface->renderbuffers)) { struct wined3d_renderbuffer_entry *entry, *entry2; -@@ -2591,7 +2591,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) +@@ -2586,7 +2586,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM @@ -187,7 +187,7 @@ index fc719e7..d1020df 100644 surface->resource.map_binding = WINED3D_LOCATION_DIB; } -@@ -3897,7 +3897,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, +@@ -3905,7 +3905,7 @@ 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. */ @@ -197,7 +197,7 @@ index fc719e7..d1020df 100644 TRACE("Removing the pbo attached to surface %p.\n", surface); diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c -index 6fc23f3..f6d2e8f 100644 +index b79f44e..ea9a047 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -218,7 +218,7 @@ static void wined3d_volume_load_location(struct wined3d_resource *resource, @@ -225,10 +225,10 @@ index 6fc23f3..f6d2e8f 100644 if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(volume->container, context, FALSE); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b23757b..2f85556 100644 +index 8a25420..9eb038e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2007,6 +2007,14 @@ struct wined3d_state +@@ -2048,6 +2048,14 @@ struct wined3d_state DWORD render_states[WINEHIGHEST_RENDER_STATE + 1]; }; @@ -243,7 +243,7 @@ index b23757b..2f85556 100644 #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2113,6 +2121,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D +@@ -2154,6 +2162,11 @@ void device_invalidate_state(const struct wined3d_device *device, DWORD state) D void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN; @@ -255,7 +255,7 @@ index b23757b..2f85556 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2156,7 +2169,7 @@ struct wined3d_resource +@@ -2199,7 +2212,7 @@ struct wined3d_resource DWORD priority; void *heap_memory, *user_memory, *bitmap_data; UINT custom_row_pitch, custom_slice_pitch; @@ -265,5 +265,5 @@ index b23757b..2f85556 100644 DWORD locations; LONG access_fence; -- -2.3.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch b/patches/wined3d-CSMT_Main/0116-wined3d-Separate-resource-map-and-draw-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0117-wined3d-Separate-resource-map-and-draw-buffers.patch rename to patches/wined3d-CSMT_Main/0116-wined3d-Separate-resource-map-and-draw-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch b/patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch rename to patches/wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch b/patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0119-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch rename to patches/wined3d-CSMT_Main/0118-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch diff --git a/patches/wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch b/patches/wined3d-CSMT_Main/0119-wined3d-Unset-some-objects-in-state_init_default.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0120-wined3d-Unset-some-objects-in-state_init_default.patch rename to patches/wined3d-CSMT_Main/0119-wined3d-Unset-some-objects-in-state_init_default.patch diff --git a/patches/wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch b/patches/wined3d-CSMT_Main/0120-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0121-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch rename to patches/wined3d-CSMT_Main/0120-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch diff --git a/patches/wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch b/patches/wined3d-CSMT_Main/0121-wined3d-Use-double-buffered-buffers-for-multithreade.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0122-wined3d-Use-double-buffered-buffers-for-multithreade.patch rename to patches/wined3d-CSMT_Main/0121-wined3d-Use-double-buffered-buffers-for-multithreade.patch diff --git a/patches/wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch b/patches/wined3d-CSMT_Main/0122-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0123-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0122-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch b/patches/wined3d-CSMT_Main/0123-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0124-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch rename to patches/wined3d-CSMT_Main/0123-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch diff --git a/patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch b/patches/wined3d-CSMT_Main/0124-wined3d-Accelerate-DISCARD-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-DISCARD-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0124-wined3d-Accelerate-DISCARD-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch b/patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-READONLY-buffer-maps.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0126-wined3d-Accelerate-READONLY-buffer-maps.patch rename to patches/wined3d-CSMT_Main/0125-wined3d-Accelerate-READONLY-buffer-maps.patch diff --git a/patches/wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch b/patches/wined3d-CSMT_Main/0126-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0127-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0126-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch b/patches/wined3d-CSMT_Main/0127-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0128-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch rename to patches/wined3d-CSMT_Main/0127-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0128-wined3d-Send-buffer-preloads-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0129-wined3d-Send-buffer-preloads-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0128-wined3d-Send-buffer-preloads-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch b/patches/wined3d-CSMT_Main/0129-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0130-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch rename to patches/wined3d-CSMT_Main/0129-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch diff --git a/patches/wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch b/patches/wined3d-CSMT_Main/0130-wined3d-Separate-GL-buffer-discard-control-from-igno.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0131-wined3d-Separate-GL-buffer-discard-control-from-igno.patch rename to patches/wined3d-CSMT_Main/0130-wined3d-Separate-GL-buffer-discard-control-from-igno.patch diff --git a/patches/wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch b/patches/wined3d-CSMT_Main/0131-wined3d-Create-buffers-before-mapping-them.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0132-wined3d-Create-buffers-before-mapping-them.patch rename to patches/wined3d-CSMT_Main/0131-wined3d-Create-buffers-before-mapping-them.patch diff --git a/patches/wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch b/patches/wined3d-CSMT_Main/0132-wined3d-Destroy-views-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0133-wined3d-Destroy-views-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0132-wined3d-Destroy-views-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch b/patches/wined3d-CSMT_Main/0133-wined3d-Remove-another-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0134-wined3d-Remove-another-glFinish.patch rename to patches/wined3d-CSMT_Main/0133-wined3d-Remove-another-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch b/patches/wined3d-CSMT_Main/0134-wined3d-Destroy-vertex-declarations-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0135-wined3d-Destroy-vertex-declarations-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0134-wined3d-Destroy-vertex-declarations-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch b/patches/wined3d-CSMT_Main/0135-wined3d-Destroy-shaders-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0136-wined3d-Destroy-shaders-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0135-wined3d-Destroy-shaders-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0136-wined3d-Create-VBOs-through-the-command-stream.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0137-wined3d-Create-VBOs-through-the-command-stream.patch rename to patches/wined3d-CSMT_Main/0136-wined3d-Create-VBOs-through-the-command-stream.patch diff --git a/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-resource-data-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-resource-data-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0137-wined3d-Clean-up-resource-data-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0138-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch b/patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-volume-resource-data-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-volume-resource-data-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0139-wined3d-Clean-up-volume-resource-data-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch b/patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-surfaces-through-the-cs.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-surfaces-through-the-cs.patch rename to patches/wined3d-CSMT_Main/0140-wined3d-Clean-up-surfaces-through-the-cs.patch diff --git a/patches/wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch b/patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-texture-resources-through-the-cs.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0142-wined3d-Clean-up-texture-resources-through-the-cs.patch rename to patches/wined3d-CSMT_Main/0141-wined3d-Clean-up-texture-resources-through-the-cs.patch diff --git a/patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch b/patches/wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch rename to patches/wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch diff --git a/patches/wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch b/patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-device_re.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0144-wined3d-Unload-resources-through-the-CS-in-device_re.patch rename to patches/wined3d-CSMT_Main/0143-wined3d-Unload-resources-through-the-CS-in-device_re.patch diff --git a/patches/wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch b/patches/wined3d-CSMT_Main/0144-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0145-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch rename to patches/wined3d-CSMT_Main/0144-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch diff --git a/patches/wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch b/patches/wined3d-CSMT_Main/0145-wined3d-Remove-software-cursor-support.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0146-wined3d-Remove-software-cursor-support.patch rename to patches/wined3d-CSMT_Main/0145-wined3d-Remove-software-cursor-support.patch diff --git a/patches/wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch b/patches/wined3d-CSMT_Main/0146-wined3d-Create-dummy-textures-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0147-wined3d-Create-dummy-textures-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0146-wined3d-Create-dummy-textures-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch b/patches/wined3d-CSMT_Main/0147-wined3d-Create-the-initial-context-through-the-CS.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0148-wined3d-Create-the-initial-context-through-the-CS.patch rename to patches/wined3d-CSMT_Main/0147-wined3d-Create-the-initial-context-through-the-CS.patch diff --git a/patches/wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch b/patches/wined3d-CSMT_Main/0148-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0149-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch rename to patches/wined3d-CSMT_Main/0148-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch diff --git a/patches/wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch b/patches/wined3d-CSMT_Main/0149-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0150-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch rename to patches/wined3d-CSMT_Main/0149-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch diff --git a/patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch b/patches/wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch rename to patches/wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch diff --git a/patches/wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch b/patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch similarity index 76% rename from patches/wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch rename to patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch index c2aa6c18..d6383adf 100644 --- a/patches/wined3d-CSMT_Main/0152-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch +++ b/patches/wined3d-CSMT_Main/0151-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch @@ -1,14 +1,14 @@ -From 4dd8d4df940d07ac83180fd8efa576d5f9cbfdae Mon Sep 17 00:00:00 2001 +From b596845e64e0d1f5d0674508066409f8eb88bed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 11 Oct 2013 10:17:42 +0200 Subject: wined3d: Delete GL contexts through the CS in uninit_3d. --- - dlls/wined3d/device.c | 35 ++++------------------------------- - 1 file changed, 4 insertions(+), 31 deletions(-) + dlls/wined3d/device.c | 32 +++----------------------------- + 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index ee5139b..72e472e 100644 +index 15868f2..d20d3b1 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1013,8 +1013,6 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context) @@ -33,15 +33,15 @@ index ee5139b..72e472e 100644 if (device->logo_texture) wined3d_texture_decref(device->logo_texture); -@@ -1061,30 +1053,8 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) +@@ -1061,30 +1053,11 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) TRACE("Unloading resource %p.\n", resource); wined3d_cs_emit_evict_resource(device->cs, resource); } - if (wined3d_settings.cs_multithreaded) - device->cs->ops->finish(device->cs); -- -- wine_rb_clear(&device->samplers, device_free_sampler, NULL); -- + + wine_rb_clear(&device->samplers, device_free_sampler, NULL); + - /* Destroy the depth blt resources, they will be invalid after the reset. Also free shader - * private data, it might contain opengl pointers - */ @@ -55,26 +55,18 @@ index ee5139b..72e472e 100644 - device->blitter->free_private(device); - device->shader_backend->shader_free_private(device); - destroy_dummy_textures(device, gl_info); - +- - /* Release the context again as soon as possible. In particular, - * releasing the render target views below may release the last reference - * to the swapchain associated with this context, which in turn will - * destroy the context. */ - context_release(context); ++ /* FIXME: Is this in the right place??? */ + wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); if (device->back_buffer_view) { -@@ -4180,6 +4150,8 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine - context = context_acquire(device, NULL); - gl_info = context->gl_info; - -+ wine_rb_clear(&device->samplers, device_free_sampler, NULL); -+ - if (device->depth_blt_texture) - { - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); -@@ -4199,6 +4171,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine +@@ -4366,6 +4339,7 @@ void device_delete_opengl_contexts_cs(struct wined3d_device *device, struct wine HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -83,5 +75,5 @@ index ee5139b..72e472e 100644 static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain) -- -2.3.5 +2.5.1 diff --git a/patches/wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch b/patches/wined3d-CSMT_Main/0152-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0153-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch rename to patches/wined3d-CSMT_Main/0152-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch diff --git a/patches/wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch b/patches/wined3d-CSMT_Main/0153-wined3d-Use-an-event-to-block-the-worker-thread-when.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0154-wined3d-Use-an-event-to-block-the-worker-thread-when.patch rename to patches/wined3d-CSMT_Main/0153-wined3d-Use-an-event-to-block-the-worker-thread-when.patch diff --git a/patches/wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch b/patches/wined3d-CSMT_Main/0154-wined3d-Fence-preload-operations.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0155-wined3d-Fence-preload-operations.patch rename to patches/wined3d-CSMT_Main/0154-wined3d-Fence-preload-operations.patch diff --git a/patches/wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch b/patches/wined3d-CSMT_Main/0155-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0156-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch rename to patches/wined3d-CSMT_Main/0155-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch diff --git a/patches/wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch b/patches/wined3d-CSMT_Main/0156-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0157-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch rename to patches/wined3d-CSMT_Main/0156-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch diff --git a/patches/wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch b/patches/wined3d-CSMT_Main/0157-wined3d-Completely-reset-the-state-on-reset.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0158-wined3d-Completely-reset-the-state-on-reset.patch rename to patches/wined3d-CSMT_Main/0157-wined3d-Completely-reset-the-state-on-reset.patch diff --git a/patches/wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch b/patches/wined3d-CSMT_Main/0158-wined3d-Send-getdc-and-releasedc-through-the-command.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0159-wined3d-Send-getdc-and-releasedc-through-the-command.patch rename to patches/wined3d-CSMT_Main/0158-wined3d-Send-getdc-and-releasedc-through-the-command.patch diff --git a/patches/wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch b/patches/wined3d-CSMT_Main/0159-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0160-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch rename to patches/wined3d-CSMT_Main/0159-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch diff --git a/patches/wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch b/patches/wined3d-CSMT_Main/0160-wined3d-Wait-only-for-the-buffer-to-be-idle.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0161-wined3d-Wait-only-for-the-buffer-to-be-idle.patch rename to patches/wined3d-CSMT_Main/0160-wined3d-Wait-only-for-the-buffer-to-be-idle.patch diff --git a/patches/wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch b/patches/wined3d-CSMT_Main/0161-wined3d-Add-a-comment-about-worker-thread-lag.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0162-wined3d-Add-a-comment-about-worker-thread-lag.patch rename to patches/wined3d-CSMT_Main/0161-wined3d-Add-a-comment-about-worker-thread-lag.patch diff --git a/patches/wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch b/patches/wined3d-CSMT_Main/0162-wined3d-Remove-the-texture-destroy-glFinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0163-wined3d-Remove-the-texture-destroy-glFinish.patch rename to patches/wined3d-CSMT_Main/0162-wined3d-Remove-the-texture-destroy-glFinish.patch diff --git a/patches/wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch b/patches/wined3d-CSMT_Main/0163-wined3d-Move-FBO-destruction-into-the-worker-thread.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0164-wined3d-Move-FBO-destruction-into-the-worker-thread.patch rename to patches/wined3d-CSMT_Main/0163-wined3d-Move-FBO-destruction-into-the-worker-thread.patch diff --git a/patches/wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch b/patches/wined3d-CSMT_Main/0164-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0165-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch rename to patches/wined3d-CSMT_Main/0164-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch diff --git a/patches/wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch b/patches/wined3d-CSMT_Main/0165-Winex11-complain-about-glfinish.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0166-Winex11-complain-about-glfinish.patch rename to patches/wined3d-CSMT_Main/0165-Winex11-complain-about-glfinish.patch diff --git a/patches/wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch b/patches/wined3d-CSMT_Main/0166-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0167-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch rename to patches/wined3d-CSMT_Main/0166-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch diff --git a/patches/wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch b/patches/wined3d-CSMT_Main/0167-wined3d-Remove-the-device_reset-CS-sync-fixme.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0168-wined3d-Remove-the-device_reset-CS-sync-fixme.patch rename to patches/wined3d-CSMT_Main/0167-wined3d-Remove-the-device_reset-CS-sync-fixme.patch diff --git a/patches/wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch b/patches/wined3d-CSMT_Main/0168-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0169-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch rename to patches/wined3d-CSMT_Main/0168-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch diff --git a/patches/wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch b/patches/wined3d-CSMT_Main/0169-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0170-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch rename to patches/wined3d-CSMT_Main/0169-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch diff --git a/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch b/patches/wined3d-CSMT_Main/0170-wined3d-Don-t-sync-on-redundant-discard-calls.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0171-wined3d-Don-t-sync-on-redundant-discard-calls.patch rename to patches/wined3d-CSMT_Main/0170-wined3d-Don-t-sync-on-redundant-discard-calls.patch diff --git a/patches/wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch b/patches/wined3d-CSMT_Main/0171-wined3d-Don-t-discard-new-buffers.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0172-wined3d-Don-t-discard-new-buffers.patch rename to patches/wined3d-CSMT_Main/0171-wined3d-Don-t-discard-new-buffers.patch diff --git a/patches/wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch b/patches/wined3d-CSMT_Main/0172-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0173-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch rename to patches/wined3d-CSMT_Main/0172-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch diff --git a/patches/wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch b/patches/wined3d-CSMT_Main/0173-wined3d-Render-target-lock-hack.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0174-wined3d-Render-target-lock-hack.patch rename to patches/wined3d-CSMT_Main/0173-wined3d-Render-target-lock-hack.patch diff --git a/patches/wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch b/patches/wined3d-CSMT_Main/0174-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0175-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch rename to patches/wined3d-CSMT_Main/0174-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch diff --git a/patches/wined3d-CSMT_Main/0175-wined3d-Only-discard-buffers-that-are-in-use.patch b/patches/wined3d-CSMT_Main/0175-wined3d-Only-discard-buffers-that-are-in-use.patch new file mode 100644 index 00000000..f297286b --- /dev/null +++ b/patches/wined3d-CSMT_Main/0175-wined3d-Only-discard-buffers-that-are-in-use.patch @@ -0,0 +1,33 @@ +From b5d14c60d7533217f9ea6b96c2fafc14eb9870cc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 16 Jan 2015 19:19:05 +0100 +Subject: wined3d: Only discard buffers that are in use. + +No need to mess around with memory if it is idle. +--- + dlls/wined3d/buffer.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index f5bd06d..6995264 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1057,9 +1057,12 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN + BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING; + if (flags & WINED3D_MAP_DISCARD && !swvp) + { +- buffer->ignore_discard = TRUE; +- wined3d_resource_allocate_sysmem(&buffer->resource); +- wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); ++ if (buffer->resource.access_fence) ++ { ++ buffer->ignore_discard = TRUE; ++ wined3d_resource_allocate_sysmem(&buffer->resource); ++ wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory); ++ } + } + else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard) + { +-- +2.5.1 + diff --git a/patches/wined3d-CSMT_Main/0176-wined3d-Destroy-samplers-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0176-wined3d-Destroy-samplers-through-the-command-stream.patch new file mode 100644 index 00000000..f0017f9d --- /dev/null +++ b/patches/wined3d-CSMT_Main/0176-wined3d-Destroy-samplers-through-the-command-stream.patch @@ -0,0 +1,135 @@ +From 94db69addfe7d9049300393410664dee39f695f4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Thu, 27 Aug 2015 23:43:08 +0200 +Subject: wined3d: Destroy samplers through the command stream. + +--- + dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++ + dlls/wined3d/sampler.c | 21 +++++++++++++-------- + dlls/wined3d/wined3d_private.h | 3 +++ + 3 files changed, 44 insertions(+), 8 deletions(-) + +diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +index e89e053..01c4ba3 100644 +--- a/dlls/wined3d/cs.c ++++ b/dlls/wined3d/cs.c +@@ -93,6 +93,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_DELETE_GL_CONTEXTS, + WINED3D_CS_OP_GETDC, + WINED3D_CS_OP_RELEASEDC, ++ WINED3D_CS_OP_SAMPLER_DESTROY, + WINED3D_CS_OP_STOP, + }; + +@@ -557,6 +558,12 @@ struct wined3d_cs_releasedc + struct wined3d_surface *surface; + }; + ++struct wined3d_cs_sampler_destroy ++{ ++ enum wined3d_cs_op opcode; ++ struct wined3d_sampler *sampler; ++}; ++ + static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) + { + LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); +@@ -2758,6 +2765,26 @@ void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *su + cs->ops->finish(cs); + } + ++static UINT wined3d_cs_exec_sampler_destroy(struct wined3d_cs *cs, const void *data) ++{ ++ const struct wined3d_cs_sampler_destroy *op = data; ++ ++ wined3d_sampler_destroy(op->sampler); ++ ++ return sizeof(*op); ++} ++ ++void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) ++{ ++ struct wined3d_cs_sampler_destroy *op; ++ ++ op = cs->ops->require_space(cs, sizeof(*op)); ++ op->opcode = WINED3D_CS_OP_SAMPLER_DESTROY; ++ op->sampler = sampler; ++ ++ cs->ops->submit(cs, sizeof(*op)); ++} ++ + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, +@@ -2829,6 +2856,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, + /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, + /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, ++ /* WINED3D_CS_OP_SAMPLER_DESTROY */ wined3d_cs_exec_sampler_destroy, + }; + + static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c +index ffa1155..81bdb51 100644 +--- a/dlls/wined3d/sampler.c ++++ b/dlls/wined3d/sampler.c +@@ -33,22 +33,27 @@ ULONG CDECL wined3d_sampler_incref(struct wined3d_sampler *sampler) + return refcount; + } + ++void wined3d_sampler_destroy(struct wined3d_sampler *sampler) ++{ ++ struct wined3d_context *context = context_acquire(sampler->device, NULL); ++ const struct wined3d_gl_info *gl_info = context->gl_info; ++ ++ GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); ++ context_release(context); ++ ++ HeapFree(GetProcessHeap(), 0, sampler); ++} ++ + ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler) + { + ULONG refcount = InterlockedDecrement(&sampler->refcount); +- const struct wined3d_gl_info *gl_info; +- struct wined3d_context *context; + + TRACE("%p decreasing refcount to %u.\n", sampler, refcount); + + if (!refcount) + { +- context = context_acquire(sampler->device, NULL); +- gl_info = context->gl_info; +- GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); +- context_release(context); +- +- HeapFree(GetProcessHeap(), 0, sampler); ++ struct wined3d_device *device = sampler->device; ++ wined3d_cs_emit_sampler_destroy(device->cs, sampler); + } + + return refcount; +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index 0adce02..9f4c9e1 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -2566,6 +2566,8 @@ struct wined3d_sampler + GLuint name; + }; + ++void wined3d_sampler_destroy(struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; ++ + struct wined3d_vertex_declaration_element + { + const struct wined3d_format *format; +@@ -2821,6 +2823,7 @@ void wined3d_cs_emit_delete_opengl_contexts(struct wined3d_cs *cs, + struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; + void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; + + /* Direct3D terminology with little modifications. We do not have an issued state + * because only the driver knows about it, but we have a created state because d3d +-- +2.5.1 + diff --git a/patches/wined3d-CSMT_Main/0177-wined3d-Hack-to-reject-unsupported-color-fills.patch b/patches/wined3d-CSMT_Main/0177-wined3d-Hack-to-reject-unsupported-color-fills.patch new file mode 100644 index 00000000..6d1c26d9 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0177-wined3d-Hack-to-reject-unsupported-color-fills.patch @@ -0,0 +1,31 @@ +From e366ff98587ac212a25fd28f9f26f18ca5f30382 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 28 Aug 2015 00:01:39 +0200 +Subject: wined3d: Hack to reject unsupported color fills. + +--- + dlls/wined3d/surface.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index e318bf106..f815b65 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -5302,6 +5302,14 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC + memset(&src_rect, 0, sizeof(src_rect)); + } + ++ /* FIXME: We should select the blitter in the main thread, that way we can return an error if the blit ++ * is unsupported without duplicating all the checks... */ ++ if (flags & WINEDDBLT_COLORFILL && (dst_surface->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)) ++ { ++ WARN("Block color fill, returning WINED3DERR_INVALIDCALL\n"); ++ return WINED3DERR_INVALIDCALL; ++ } ++ + if (!fx || !(fx->dwDDFX)) + flags &= ~WINEDDBLT_DDFX; + +-- +2.5.1 + diff --git a/patches/wined3d-CSMT_Main/0178-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch b/patches/wined3d-CSMT_Main/0178-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch new file mode 100644 index 00000000..ef3a8703 --- /dev/null +++ b/patches/wined3d-CSMT_Main/0178-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch @@ -0,0 +1,59 @@ +From 3f00564e2ed6f37b857d0724dea00646285c747c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20D=C3=B6singer?= +Date: Fri, 28 Aug 2015 01:13:32 +0200 +Subject: wined3d: Alloc the buffer map array before mapping the buffer. + +FIXME: This needs to go into whatever patch creates the VBO on first map. +--- + dlls/wined3d/buffer.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +index 6995264..753e38c 100644 +--- a/dlls/wined3d/buffer.c ++++ b/dlls/wined3d/buffer.c +@@ -1250,6 +1250,16 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + buffer->flags |= WINED3D_BUFFER_CREATEBO; + } + ++ buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); ++ if (!buffer->maps) ++ { ++ ERR("Out of memory\n"); ++ buffer_unload(&buffer->resource); ++ resource_cleanup(&buffer->resource); ++ return E_OUTOFMEMORY; ++ } ++ buffer->maps_size = 1; ++ + if (data) + { + BYTE *ptr; +@@ -1258,6 +1268,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + if (FAILED(hr)) + { + ERR("Failed to map buffer, hr %#x\n", hr); ++ HeapFree(GetProcessHeap(), 0, buffer->maps); + buffer_unload(&buffer->resource); + resource_cleanup(&buffer->resource); + return hr; +@@ -1268,16 +1279,6 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device + wined3d_buffer_unmap(buffer); + } + +- buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); +- if (!buffer->maps) +- { +- ERR("Out of memory\n"); +- buffer_unload(&buffer->resource); +- resource_cleanup(&buffer->resource); +- return E_OUTOFMEMORY; +- } +- buffer->maps_size = 1; +- + if (wined3d_settings.cs_multithreaded) + buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; + +-- +2.5.1 + diff --git a/patches/wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch b/patches/wined3d-CSMT_Main/9998-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch similarity index 100% rename from patches/wined3d-CSMT_Main/0176-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch rename to patches/wined3d-CSMT_Main/9998-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 669be747..10fd8a9f 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -906,7 +906,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; const struct wined3d_format *format = volume->resource.format; const unsigned int fmt_flags = volume->container->resource.format_flags; -@@ -439,6 +714,148 @@ +@@ -438,6 +713,148 @@ return hr; return hr; @@ -1055,7 +1055,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -@@ -448,6 +865,7 @@ +@@ -447,6 +864,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) { @@ -1063,7 +1063,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c HRESULT hr; if (volume->resource.unmap_dirtify) -@@ -457,6 +875,33 @@ +@@ -456,6 +874,33 @@ if (hr == WINEDDERR_NOTLOCKED) return WINED3DERR_INVALIDCALL; return hr; @@ -1097,7 +1097,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c } static ULONG volume_resource_incref(struct wined3d_resource *resource) -@@ -469,6 +914,7 @@ +@@ -468,6 +913,7 @@ return wined3d_volume_decref(volume_from_resource(resource)); } @@ -1105,7 +1105,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location) { struct wined3d_volume *volume = volume_from_resource(resource); -@@ -484,6 +930,13 @@ +@@ -483,6 +929,13 @@ volume_unload, wined3d_volume_location_invalidated, wined3d_volume_load_location, @@ -1119,7 +1119,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c }; static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, -@@ -515,7 +968,11 @@ +@@ -514,7 +967,11 @@ } volume->texture_level = level; @@ -1131,7 +1131,7 @@ diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] -@@ -523,11 +980,17 @@ +@@ -522,11 +979,17 @@ { wined3d_resource_free_sysmem(&volume->resource); volume->resource.map_binding = WINED3D_LOCATION_BUFFER; @@ -2185,7 +2185,18 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ -@@ -2592,8 +2766,10 @@ +@@ -2564,8 +2738,10 @@ + GLuint name; + }; + ++#if defined(STAGING_CSMT) + void wined3d_sampler_destroy(struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; + ++#endif /* STAGING_CSMT */ + struct wined3d_vertex_declaration_element + { + const struct wined3d_format *format; +@@ -2594,8 +2770,10 @@ BOOL half_float_conv_needed; }; @@ -2196,7 +2207,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_saved_states { DWORD transform[(HIGHEST_TRANSFORMSTATE >> 5) + 1]; -@@ -2661,6 +2837,7 @@ +@@ -2663,6 +2841,7 @@ void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2204,7 +2215,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2711,6 +2888,32 @@ +@@ -2713,6 +2892,32 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; @@ -2237,7 +2248,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -2760,6 +2963,7 @@ +@@ -2762,6 +2967,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -2245,15 +2256,15 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, UINT start_register, const float *constants, UINT vector4f_count, enum wined3d_shader_type type) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_consts_b(struct wined3d_cs *cs, UINT start_register, -@@ -2819,6 +3023,7 @@ - struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; +@@ -2822,6 +3028,7 @@ void wined3d_cs_emit_getdc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; void wined3d_cs_emit_releasedc(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN; + void wined3d_cs_emit_sampler_destroy(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN; +#endif /* STAGING_CSMT */ /* Direct3D terminology with little modifications. We do not have an issued state * because only the driver knows about it, but we have a created state because d3d -@@ -2833,8 +3038,12 @@ +@@ -2836,8 +3043,12 @@ struct wined3d_query_ops { HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); @@ -2266,7 +2277,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_query -@@ -2848,12 +3057,16 @@ +@@ -2851,12 +3062,16 @@ enum wined3d_query_type type; DWORD data_size; void *extendedData; @@ -2283,7 +2294,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -2880,7 +3093,9 @@ +@@ -2883,7 +3098,9 @@ GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -2293,7 +2304,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -2905,11 +3120,15 @@ +@@ -2908,11 +3125,15 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -2309,7 +2320,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -2948,8 +3167,10 @@ +@@ -2951,8 +3172,10 @@ return surface_from_resource(resource); } @@ -2320,7 +2331,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_shader_resource_view { LONG refcount; -@@ -2962,8 +3183,12 @@ +@@ -2965,8 +3188,12 @@ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect, @@ -2333,7 +2344,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_swapchain -@@ -3002,8 +3227,10 @@ +@@ -3005,8 +3232,10 @@ void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; @@ -2344,7 +2355,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /***************************************************************************** * Utility function prototypes -@@ -3207,7 +3434,9 @@ +@@ -3210,7 +3439,9 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN; BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN; @@ -2827,10 +2838,10 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c return TRUE; return FALSE; } -@@ -703,6 +940,18 @@ - void *data, DWORD size, DWORD flags) - { - TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); +@@ -711,6 +948,26 @@ + { + TRACE("Query is building, returning S_FALSE.\n"); + return S_FALSE; +#else /* STAGING_CSMT */ + query->state = QUERY_SIGNALLED; + @@ -2842,11 +2853,19 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +{ + TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); + ++ if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) ++ { ++ static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; ++ ++ if (query->state == QUERY_BUILDING) ++ { ++ TRACE("Query is building, returning S_FALSE.\n"); ++ return S_FALSE; +#endif /* STAGING_CSMT */ - if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) - { - static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; -@@ -724,6 +973,7 @@ + } + + fill_query_data(data, size, &disjoint_data, sizeof(disjoint_data)); +@@ -724,6 +981,7 @@ return S_OK; } @@ -2854,7 +2873,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) { return TRUE; -@@ -760,6 +1010,41 @@ +@@ -760,6 +1018,41 @@ { wined3d_timestamp_disjoint_query_ops_get_data, wined3d_timestamp_disjoint_query_ops_poll, @@ -2896,7 +2915,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c wined3d_timestamp_disjoint_query_ops_issue, }; -@@ -781,6 +1066,7 @@ +@@ -781,6 +1074,7 @@ } query->query_ops = &occlusion_query_ops; query->data_size = sizeof(DWORD); @@ -2904,7 +2923,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c query->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct wined3d_occlusion_query)); if (!query->extendedData) -@@ -788,6 +1074,15 @@ +@@ -788,6 +1082,15 @@ ERR("Failed to allocate occlusion query extended data.\n"); return E_OUTOFMEMORY; } @@ -2920,7 +2939,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c break; case WINED3D_QUERY_TYPE_EVENT: -@@ -860,7 +1155,9 @@ +@@ -860,7 +1163,9 @@ query->state = QUERY_CREATED; query->device = device; query->ref = 1; @@ -3377,8 +3396,8 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_settings.cs_multithreaded) device->cs->ops->finish(device->cs); -@@ -1056,6 +1154,82 @@ - +@@ -1059,6 +1157,82 @@ + /* FIXME: Is this in the right place??? */ wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]); +#else /* STAGING_CSMT */ @@ -3460,7 +3479,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); -@@ -1073,6 +1247,11 @@ +@@ -1076,6 +1250,11 @@ device->swapchains = NULL; device->swapchain_count = 0; @@ -3472,7 +3491,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->d3d_initialized = FALSE; return WINED3D_OK; -@@ -1458,6 +1637,16 @@ +@@ -1461,6 +1640,16 @@ TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n", light->range, light->falloff, light->theta, light->phi); @@ -3489,7 +3508,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Save away the information. */ object->OriginalParms = *light; -@@ -1537,9 +1726,11 @@ +@@ -1540,9 +1729,11 @@ FIXME("Unrecognized light type %#x.\n", light->type); } @@ -3501,7 +3520,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1612,6 +1803,14 @@ +@@ -1615,6 +1806,14 @@ { if (light_info->glIndex != -1) { @@ -3516,7 +3535,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; } -@@ -1653,11 +1852,23 @@ +@@ -1656,11 +1855,23 @@ WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -3540,7 +3559,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1832,9 +2043,11 @@ +@@ -1835,9 +2046,11 @@ TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -3552,7 +3571,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) -@@ -1879,7 +2092,11 @@ +@@ -1882,7 +2095,11 @@ || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); @@ -3564,7 +3583,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -2199,7 +2416,11 @@ +@@ -2202,7 +2419,11 @@ return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -3576,7 +3595,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { UINT i; -@@ -2232,8 +2453,12 @@ +@@ -2235,8 +2456,12 @@ } else { @@ -3589,7 +3608,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2280,8 +2505,12 @@ +@@ -2283,8 +2508,12 @@ } else { @@ -3602,7 +3621,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2332,8 +2561,13 @@ +@@ -2335,8 +2564,13 @@ memset(device->recording->changed.vertexShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count); else @@ -3616,7 +3635,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2468,8 +2702,12 @@ +@@ -2471,8 +2705,12 @@ } else { @@ -3629,7 +3648,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2516,8 +2754,12 @@ +@@ -2519,8 +2757,12 @@ } else { @@ -3642,7 +3661,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2569,8 +2811,12 @@ +@@ -2572,8 +2814,12 @@ memset(device->recording->changed.pixelShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count); else @@ -3655,7 +3674,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2730,6 +2976,7 @@ +@@ -2733,6 +2979,7 @@ return hr; } @@ -3663,7 +3682,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_settings.cs_multithreaded) { FIXME("Waiting for cs.\n"); -@@ -2737,6 +2984,7 @@ +@@ -2740,6 +2987,7 @@ device->cs->ops->finish(device->cs); } @@ -3671,7 +3690,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); -@@ -3222,6 +3470,10 @@ +@@ -3225,6 +3473,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -3682,7 +3701,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3230,6 +3482,15 @@ +@@ -3233,6 +3485,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3698,7 +3717,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3255,8 +3516,10 @@ +@@ -3258,8 +3519,10 @@ 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) { @@ -3709,7 +3728,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); -@@ -3265,12 +3528,19 @@ +@@ -3268,12 +3531,19 @@ WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); return WINED3D_OK; } @@ -3729,7 +3748,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"); -@@ -3279,8 +3549,13 @@ +@@ -3282,8 +3552,13 @@ } else if (flags & WINED3DCLEAR_TARGET) { @@ -3743,7 +3762,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; -@@ -3326,6 +3601,9 @@ +@@ -3329,6 +3604,9 @@ enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -3753,7 +3772,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); -@@ -3333,8 +3611,13 @@ +@@ -3336,8 +3614,13 @@ device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -3767,7 +3786,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, -@@ -3357,6 +3640,14 @@ +@@ -3360,6 +3643,14 @@ return WINED3DERR_INVALIDCALL; } @@ -3782,7 +3801,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); return WINED3D_OK; -@@ -3373,6 +3664,10 @@ +@@ -3376,6 +3667,10 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { @@ -3793,7 +3812,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); if (!device->state.index_buffer) -@@ -3391,6 +3686,15 @@ +@@ -3394,6 +3689,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3809,7 +3828,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); return WINED3D_OK; -@@ -3406,6 +3710,7 @@ +@@ -3409,6 +3713,7 @@ } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -3817,7 +3836,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { -@@ -3441,6 +3746,88 @@ +@@ -3445,6 +3750,88 @@ { enum wined3d_resource_type type = src_texture->resource.type; unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; @@ -3906,7 +3925,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)); -@@ -3459,7 +3846,13 @@ +@@ -3463,7 +3850,13 @@ } /* Make sure that the destination texture is loaded. */ @@ -3920,7 +3939,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update every surface level of the texture. */ switch (type) -@@ -3474,7 +3867,16 @@ +@@ -3478,7 +3871,16 @@ src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -3937,7 +3956,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3494,7 +3896,16 @@ +@@ -3498,7 +3900,16 @@ i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); @@ -3954,7 +3973,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -3504,6 +3915,7 @@ +@@ -3508,6 +3919,7 @@ { for (i = 0; i < level_count; ++i) { @@ -3962,7 +3981,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device_update_volume(context, volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)), -@@ -3552,6 +3964,25 @@ +@@ -3561,6 +3973,25 @@ } wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); @@ -3988,7 +4007,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -3614,8 +4045,13 @@ +@@ -3623,8 +4054,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -4002,7 +4021,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3714,6 +4150,7 @@ +@@ -3723,6 +4159,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -4010,7 +4029,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c const struct wined3d_format *src_format = src_surface->resource.format; const struct wined3d_format *dst_format = dst_surface->resource.format; UINT update_w, update_h; -@@ -3721,6 +4158,7 @@ +@@ -3730,6 +4167,7 @@ RECT r, dst_rect; POINT p; @@ -4018,7 +4037,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", device, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_point(dst_point)); -@@ -3732,6 +4170,7 @@ +@@ -3741,6 +4179,7 @@ return WINED3DERR_INVALIDCALL; } @@ -4026,7 +4045,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (src_format->id != dst_format->id) { WARN("Source and destination surfaces should have the same format.\n"); -@@ -3794,6 +4233,9 @@ +@@ -3805,6 +4244,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -4036,7 +4055,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -4007,7 +4449,11 @@ +@@ -4018,7 +4460,11 @@ && src_rect.bottom == sub_resource->height) wined3d_texture_prepare_texture(texture, context, FALSE); else @@ -4048,7 +4067,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_texture_bind_and_dirtify(texture, context, FALSE); wined3d_surface_upload_data(surface, gl_info, resource->format, -@@ -4015,8 +4461,13 @@ +@@ -4026,8 +4472,13 @@ context_release(context); @@ -4062,7 +4081,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4047,8 +4498,14 @@ +@@ -4058,8 +4509,14 @@ rect = &r; } @@ -4077,7 +4096,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, -@@ -4062,6 +4519,7 @@ +@@ -4073,6 +4530,7 @@ return NULL; } @@ -4085,7 +4104,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -4077,6 +4535,22 @@ +@@ -4088,6 +4546,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4108,7 +4127,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); -@@ -4116,6 +4590,7 @@ +@@ -4127,6 +4601,7 @@ } @@ -4116,7 +4135,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c prev = fb->render_targets[view_idx]; if (view == prev) return WINED3D_OK; -@@ -4123,6 +4598,15 @@ +@@ -4134,6 +4609,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4132,7 +4151,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. */ -@@ -4134,6 +4618,7 @@ +@@ -4145,6 +4629,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4140,7 +4159,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -4158,6 +4643,79 @@ +@@ -4169,6 +4654,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4220,7 +4239,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image) { -@@ -4193,8 +4751,16 @@ +@@ -4204,8 +4762,16 @@ * release it after setting the cursor image. Windows doesn't * addref the set surface, so we can't do this either without * creating circular refcount dependencies. */ @@ -4237,7 +4256,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4294,6 +4860,12 @@ +@@ -4305,6 +4871,12 @@ else SetCursor(NULL); } @@ -4250,7 +4269,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4304,8 +4876,10 @@ +@@ -4315,8 +4887,10 @@ TRACE("device %p.\n", device); @@ -4261,7 +4280,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4313,6 +4887,7 @@ +@@ -4324,6 +4898,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4269,10 +4288,10 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4333,6 +4908,37 @@ - gl_info = context->gl_info; +@@ -4342,6 +4917,37 @@ - wine_rb_clear(&device->samplers, device_free_sampler, NULL); + context = context_acquire(device, NULL); + gl_info = context->gl_info; +#else /* STAGING_CSMT */ + resource->resource_ops->resource_unload(resource); + } @@ -4307,7 +4326,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4353,6 +4959,7 @@ +@@ -4362,6 +4968,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4315,7 +4334,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4372,6 +4979,14 @@ +@@ -4381,6 +4988,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4330,7 +4349,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, -@@ -4388,6 +5003,7 @@ +@@ -4397,6 +5012,7 @@ return hr; } @@ -4338,7 +4357,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4398,6 +5014,34 @@ +@@ -4407,6 +5023,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4373,7 +4392,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4414,8 +5058,10 @@ +@@ -4423,8 +5067,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4384,7 +4403,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4431,9 +5077,21 @@ +@@ -4440,9 +5086,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4406,7 +4425,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4442,6 +5100,7 @@ +@@ -4451,6 +5109,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4414,7 +4433,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4451,6 +5110,12 @@ +@@ -4460,6 +5119,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4427,7 +4446,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4463,6 +5128,7 @@ +@@ -4472,6 +5137,7 @@ } } @@ -4435,7 +4454,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4484,6 +5150,7 @@ +@@ -4493,6 +5159,7 @@ } device->cs->ops->finish(device->cs); @@ -4443,7 +4462,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("New params:\n"); TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width); TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height); -@@ -4610,6 +5277,13 @@ +@@ -4619,6 +5286,13 @@ swapchain_desc->multisample_type, swapchain_desc->multisample_quality))) return hr; @@ -4457,7 +4476,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc surface_desc; -@@ -4647,6 +5321,13 @@ +@@ -4656,6 +5330,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4471,7 +4490,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4667,12 +5348,20 @@ +@@ -4676,12 +5357,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4492,7 +4511,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4681,6 +5370,7 @@ +@@ -4690,6 +5379,7 @@ } else if (device->back_buffer_view) { @@ -4500,7 +4519,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4696,6 +5386,24 @@ +@@ -4705,6 +5395,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4525,7 +4544,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4771,6 +5479,10 @@ +@@ -4780,6 +5488,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4536,7 +4555,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4781,6 +5493,7 @@ +@@ -4790,6 +5502,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4544,7 +4563,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4792,6 +5505,19 @@ +@@ -4801,6 +5514,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4564,7 +4583,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4954,7 +5680,11 @@ +@@ -4963,7 +5689,11 @@ device->blitter = adapter->blitter; @@ -4576,7 +4595,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -5053,6 +5783,7 @@ +@@ -5062,6 +5792,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4584,7 +4603,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -5106,3 +5837,4 @@ +@@ -5115,3 +5846,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -4684,7 +4703,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c WINED3D_CS_OP_SET_VS_CONSTS_F, WINED3D_CS_OP_SET_VS_CONSTS_B, WINED3D_CS_OP_SET_VS_CONSTS_I, -@@ -131,6 +139,30 @@ +@@ -132,6 +140,30 @@ float depth; DWORD stencil; RECT rects[1]; @@ -4715,7 +4734,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_draw -@@ -153,6 +185,7 @@ +@@ -154,6 +186,7 @@ struct wined3d_cs_set_viewport { enum wined3d_cs_op opcode; @@ -4723,7 +4742,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_viewport viewport; }; -@@ -160,6 +193,15 @@ +@@ -161,6 +194,15 @@ { enum wined3d_cs_op opcode; RECT rect; @@ -4739,7 +4758,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_set_rendertarget_view -@@ -287,6 +329,7 @@ +@@ -288,6 +330,7 @@ { enum wined3d_cs_op opcode; enum wined3d_transform_state state; @@ -4747,7 +4766,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_matrix matrix; }; -@@ -301,6 +344,22 @@ +@@ -302,6 +345,22 @@ { enum wined3d_cs_op opcode; struct wined3d_material material; @@ -4770,7 +4789,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_reset_state -@@ -308,6 +367,7 @@ +@@ -309,6 +368,7 @@ enum wined3d_cs_op opcode; }; @@ -4778,120 +4797,29 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_set_consts_f { enum wined3d_cs_op opcode; -@@ -2763,190 +2823,964 @@ - /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, - /* WINED3D_CS_OP_SKIP */ wined3d_cs_exec_skip, - /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -- /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, -- /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, -- /* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw, -- /* WINED3D_CS_OP_SET_PREDICATION */ wined3d_cs_exec_set_predication, -- /* WINED3D_CS_OP_SET_VIEWPORT */ wined3d_cs_exec_set_viewport, -- /* WINED3D_CS_OP_SET_SCISSOR_RECT */ wined3d_cs_exec_set_scissor_rect, -- /* WINED3D_CS_OP_SET_RENDERTARGET_VIEW */ wined3d_cs_exec_set_rendertarget_view, -- /* WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW */ wined3d_cs_exec_set_depth_stencil_view, -- /* WINED3D_CS_OP_SET_VERTEX_DECLARATION */ wined3d_cs_exec_set_vertex_declaration, -- /* WINED3D_CS_OP_SET_STREAM_SOURCE */ wined3d_cs_exec_set_stream_source, -- /* WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ */ wined3d_cs_exec_set_stream_source_freq, -- /* WINED3D_CS_OP_SET_STREAM_OUTPUT */ wined3d_cs_exec_set_stream_output, -- /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, -- /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, -- /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, -- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, -- /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, -- /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, -- /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, -- /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, -- /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, -- /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, -- /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, -- /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, -- /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, -- /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, -- /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, -- /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, -- /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, -- /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, -- /* WINED3D_CS_OP_SET_PS_CONSTS_B */ wined3d_cs_exec_set_ps_consts_b, -- /* WINED3D_CS_OP_SET_PS_CONSTS_I */ wined3d_cs_exec_set_ps_consts_i, -- /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, -- /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, -- /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, -- /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, -- /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, -- /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, -- /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, -- /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, -- /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, -- /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, -- /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, -- /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, -- /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload, -- /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -- /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, -- /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -- /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, -- /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, -- /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, -- /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, -- /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, -- /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, -- /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, -- /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, -- /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, -- /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, -- /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, -- /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, -- /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, -- /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, -- /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, -- /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, -- /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, -- /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, --}; -- --static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) +@@ -1043,6 +1103,243 @@ + } + + static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) +#else /* STAGING_CSMT */ +static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) - { -- struct wined3d_cs_queue *queue = prio ? &cs->prio_queue : &cs->queue; -- size_t queue_size = sizeof(queue->data) / sizeof(*queue->data); ++{ + const struct wined3d_cs_present *op = data; + struct wined3d_swapchain *swapchain; - -- if (queue_size - size < queue->head) -- { -- struct wined3d_cs_skip *skip; -- size_t nop_size = queue_size - queue->head; ++ + swapchain = op->swapchain; + wined3d_swapchain_set_window(swapchain, op->dst_window_override); - -- skip = _wined3d_cs_mt_require_space(cs, nop_size, prio); -- if (nop_size < sizeof(*skip)) -- { -- skip->opcode = WINED3D_CS_OP_NOP; -- } -- else -- { -- skip->opcode = WINED3D_CS_OP_SKIP; -- skip->size = nop_size; -- } ++ + swapchain->swapchain_ops->swapchain_present(swapchain, + op->src_rect, op->dst_rect, op->dirty_region, op->flags); +} - -- if (prio) -- cs->ops->submit_prio(cs, nop_size); -- else -- cs->ops->submit(cs, nop_size); ++ +void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, + const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, + const RGNDATA *dirty_region, DWORD flags) +{ + struct wined3d_cs_present *op; - -- assert(!queue->head); -- } ++ + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_PRESENT; + op->dst_window_override = dst_window_override; @@ -4900,47 +4828,26 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + op->dst_rect = dst_rect; + op->dirty_region = dirty_region; + op->flags = flags; - -- while(1) -- { -- LONG head = queue->head; -- LONG tail = *((volatile LONG *)&queue->tail); -- LONG new_pos; -- /* Empty */ -- if (head == tail) -- break; -- /* Head ahead of tail, take care of wrap-around */ -- new_pos = (head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -- if (head > tail && (new_pos || tail)) -- break; -- /* Tail ahead of head, but still enough space */ -- if (new_pos < tail && new_pos) -- break; ++ + cs->ops->submit(cs); +} - -- TRACE("Waiting for free space. Head %u, tail %u, want %u\n", head, tail, -- (unsigned int) size); -- } ++ +static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_clear *op = data; + struct wined3d_device *device; + RECT draw_rect; - -- return &queue->data[queue->head]; ++ + device = cs->device; + wined3d_get_draw_rect(&device->state, &draw_rect); + device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, + &device->fb, op->rect_count, op->rects, &draw_rect, op->flags, + op->color, op->depth, op->stencil); - } - --static inline void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) ++} ++ +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) - { -- return _wined3d_cs_mt_require_space(cs, size, FALSE); ++{ + struct wined3d_cs_clear *op; + + op = cs->ops->require_space(cs, sizeof(*op)); @@ -4953,29 +4860,21 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + op->stencil = stencil; + + cs->ops->submit(cs); - } - --static inline void *wined3d_cs_mt_require_space_prio(struct wined3d_cs *cs, size_t size) ++} ++ +static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) - { -- return _wined3d_cs_mt_require_space(cs, size, TRUE); ++{ + const struct wined3d_cs_draw *op = data; + + draw_primitive(cs->device, op->start_idx, op->index_count, + op->start_instance, op->instance_count, op->indexed); - } - --/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -- * OP itself. */ --static void wined3d_cs_emit_stop(struct wined3d_cs *cs) ++} ++ +void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_count, + UINT start_instance, UINT instance_count, BOOL indexed) - { -- struct wined3d_cs_stop *op; ++{ + struct wined3d_cs_draw *op; - -- op = wined3d_cs_mt_require_space(cs, sizeof(*op)); -- op->opcode = WINED3D_CS_OP_STOP; ++ + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_DRAW; + op->start_idx = start_idx; @@ -4983,75 +4882,42 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + op->start_instance = start_instance; + op->instance_count = instance_count; + op->indexed = indexed; - -- wined3d_cs_mt_submit(cs, sizeof(*op)); ++ + cs->ops->submit(cs); - } - --static void wined3d_cs_mt_finish(struct wined3d_cs *cs) ++} ++ +static void wined3d_cs_exec_set_predication(struct wined3d_cs *cs, const void *data) - { -- BOOL fence; ++{ + const struct wined3d_cs_set_predication *op = data; - -- if (cs->thread_id == GetCurrentThreadId()) -- { -- static BOOL once; -- if (!once) -- { -- FIXME("flush_and_wait called from cs thread\n"); -- once = TRUE; -- } -- return; -- } ++ + cs->state.predicate = op->predicate; + cs->state.predicate_value = op->value; +} - -- wined3d_cs_emit_fence(cs, &fence); ++ +void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) +{ + struct wined3d_cs_set_predication *op; - -- /* A busy wait should be fine, we're not supposed to have to wait very -- * long. */ -- while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); ++ + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_PREDICATION; + op->predicate = predicate; + op->value = value; + + cs->ops->submit(cs); - } - --static void wined3d_cs_mt_finish_prio(struct wined3d_cs *cs) ++} ++ +static void wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) - { -- BOOL fence; ++{ + const struct wined3d_cs_set_viewport *op = data; - -- if (cs->thread_id == GetCurrentThreadId()) -- { -- static BOOL once; -- if (!once) -- { -- FIXME("flush_and_wait called from cs thread\n"); -- once = TRUE; -- } -- return; -- } ++ + cs->state.viewport = *op->viewport; + device_invalidate_state(cs->device, STATE_VIEWPORT); +} - -- wined3d_cs_emit_fence_prio(cs, &fence); ++ +void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) +{ + struct wined3d_cs_set_viewport *op; - -- /* A busy wait should be fine, we're not supposed to have to wait very -- * long. */ -- while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); ++ + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_VIEWPORT; + op->viewport = viewport; @@ -5171,23 +5037,48 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +} + +static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_stream_source *op = data; -+ struct wined3d_stream_state *stream; -+ struct wined3d_buffer *prev; -+ -+ stream = &cs->state.streams[op->stream_idx]; -+ prev = stream->buffer; -+ stream->buffer = op->buffer; -+ stream->offset = op->offset; -+ stream->stride = op->stride; -+ -+ if (op->buffer) -+ InterlockedIncrement(&op->buffer->resource.bind_count); -+ if (prev) -+ InterlockedDecrement(&prev->resource.bind_count); -+ -+ device_invalidate_state(cs->device, STATE_STREAMSRC); ++#endif /* STAGING_CSMT */ + { + const struct wined3d_cs_set_stream_source *op = data; + struct wined3d_stream_state *stream; +@@ -1060,6 +1357,7 @@ + InterlockedDecrement(&prev->resource.bind_count); + + device_invalidate_state(cs->device, STATE_STREAMSRC); ++#if defined(STAGING_CSMT) + + return sizeof(*op); + } +@@ -2790,32 +3088,554 @@ + /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, + /* WINED3D_CS_OP_SKIP */ wined3d_cs_exec_skip, + /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, +- /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, +- /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, +- /* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw, +- /* WINED3D_CS_OP_SET_PREDICATION */ wined3d_cs_exec_set_predication, +- /* WINED3D_CS_OP_SET_VIEWPORT */ wined3d_cs_exec_set_viewport, +- /* WINED3D_CS_OP_SET_SCISSOR_RECT */ wined3d_cs_exec_set_scissor_rect, +- /* WINED3D_CS_OP_SET_RENDERTARGET_VIEW */ wined3d_cs_exec_set_rendertarget_view, +- /* WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW */ wined3d_cs_exec_set_depth_stencil_view, +- /* WINED3D_CS_OP_SET_VERTEX_DECLARATION */ wined3d_cs_exec_set_vertex_declaration, +- /* WINED3D_CS_OP_SET_STREAM_SOURCE */ wined3d_cs_exec_set_stream_source, +- /* WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ */ wined3d_cs_exec_set_stream_source_freq, +- /* WINED3D_CS_OP_SET_STREAM_OUTPUT */ wined3d_cs_exec_set_stream_output, +- /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, +- /* WINED3D_CS_OP_SET_CONSTANT_BUFFER */ wined3d_cs_exec_set_constant_buffer, +- /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, +- /* WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW */ wined3d_cs_exec_set_shader_resource_view, +- /* WINED3D_CS_OP_SET_SAMPLER */ wined3d_cs_exec_set_sampler, +- /* WINED3D_CS_OP_SET_SHADER */ wined3d_cs_exec_set_shader, +- /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, +- /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, +- /* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state, +- /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, +- /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, +- /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, +- /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, ++#else /* STAGING_CSMT */ +} + +void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, @@ -5733,170 +5624,12 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + /* WINED3D_CS_OP_SET_CLIP_PLANE */ wined3d_cs_exec_set_clip_plane, + /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, + /* WINED3D_CS_OP_SET_MATERIAL */ wined3d_cs_exec_set_material, -+ /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, + /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, +#if defined(STAGING_CSMT) -+ /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, -+ /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, -+ /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, -+ /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, -+ /* WINED3D_CS_OP_SET_PS_CONSTS_B */ wined3d_cs_exec_set_ps_consts_b, -+ /* WINED3D_CS_OP_SET_PS_CONSTS_I */ wined3d_cs_exec_set_ps_consts_i, -+ /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, -+ /* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index, -+ /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, -+ /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, -+ /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, -+ /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, -+ /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, -+ /* WINED3D_CS_OP_RESOURCE_CHANGED */ wined3d_cs_exec_resource_changed, -+ /* WINED3D_CS_OP_RESOURCE_MAP */ wined3d_cs_exec_resource_map, -+ /* WINED3D_CS_OP_RESOURCE_UNMAP */ wined3d_cs_exec_resource_unmap, -+ /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, -+ /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, -+ /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload, -+ /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -+ /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy, -+ /* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface, -+ /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, -+ /* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload, -+ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, -+ /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource, -+ /* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy, -+ /* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy, -+ /* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup, -+ /* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo, -+ /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup, -+ /* WINED3D_CS_OP_BUFFER_CLEANUP */ wined3d_cs_exec_buffer_cleanup, -+ /* WINED3D_CS_OP_VOLUME_CLEANUP */ wined3d_cs_exec_volume_cleanup, -+ /* WINED3D_CS_OP_SURFACE_CLEANUP */ wined3d_cs_exec_surface_cleanup, -+ /* WINED3D_CS_OP_TEXTURE_CLEANUP */ wined3d_cs_exec_texture_cleanup, -+ /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures, -+ /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context, -+ /* WINED3D_CS_OP_DELETE_GL_CONTEXTS */ wined3d_cs_exec_delete_gl_contexts, -+ /* WINED3D_CS_OP_GETDC */ wined3d_cs_exec_getdc, -+ /* WINED3D_CS_OP_RELEASEDC */ wined3d_cs_exec_releasedc, -+}; -+ -+static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) -+{ -+ struct wined3d_cs_queue *queue = prio ? &cs->prio_queue : &cs->queue; -+ size_t queue_size = sizeof(queue->data) / sizeof(*queue->data); -+ -+ if (queue_size - size < queue->head) -+ { -+ struct wined3d_cs_skip *skip; -+ size_t nop_size = queue_size - queue->head; -+ -+ skip = _wined3d_cs_mt_require_space(cs, nop_size, prio); -+ if (nop_size < sizeof(*skip)) -+ { -+ skip->opcode = WINED3D_CS_OP_NOP; -+ } -+ else -+ { -+ skip->opcode = WINED3D_CS_OP_SKIP; -+ skip->size = nop_size; -+ } -+ -+ if (prio) -+ cs->ops->submit_prio(cs, nop_size); -+ else -+ cs->ops->submit(cs, nop_size); -+ -+ assert(!queue->head); -+ } -+ -+ while(1) -+ { -+ LONG head = queue->head; -+ LONG tail = *((volatile LONG *)&queue->tail); -+ LONG new_pos; -+ /* Empty */ -+ if (head == tail) -+ break; -+ /* Head ahead of tail, take care of wrap-around */ -+ new_pos = (head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -+ if (head > tail && (new_pos || tail)) -+ break; -+ /* Tail ahead of head, but still enough space */ -+ if (new_pos < tail && new_pos) -+ break; -+ -+ TRACE("Waiting for free space. Head %u, tail %u, want %u\n", head, tail, -+ (unsigned int) size); -+ } -+ -+ return &queue->data[queue->head]; -+} -+ -+static inline void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -+{ -+ return _wined3d_cs_mt_require_space(cs, size, FALSE); -+} -+ -+static inline void *wined3d_cs_mt_require_space_prio(struct wined3d_cs *cs, size_t size) -+{ -+ return _wined3d_cs_mt_require_space(cs, size, TRUE); -+} -+ -+/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -+ * OP itself. */ -+static void wined3d_cs_emit_stop(struct wined3d_cs *cs) -+{ -+ struct wined3d_cs_stop *op; -+ -+ op = wined3d_cs_mt_require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_STOP; -+ -+ wined3d_cs_mt_submit(cs, sizeof(*op)); -+} -+ -+static void wined3d_cs_mt_finish(struct wined3d_cs *cs) -+{ -+ BOOL fence; -+ -+ if (cs->thread_id == GetCurrentThreadId()) -+ { -+ static BOOL once; -+ if (!once) -+ { -+ FIXME("flush_and_wait called from cs thread\n"); -+ once = TRUE; -+ } -+ return; -+ } -+ -+ wined3d_cs_emit_fence(cs, &fence); -+ -+ /* A busy wait should be fine, we're not supposed to have to wait very -+ * long. */ -+ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); -+} -+ -+static void wined3d_cs_mt_finish_prio(struct wined3d_cs *cs) -+{ -+ BOOL fence; -+ -+ if (cs->thread_id == GetCurrentThreadId()) -+ { -+ static BOOL once; -+ if (!once) -+ { -+ FIXME("flush_and_wait called from cs thread\n"); -+ once = TRUE; -+ } -+ return; -+ } -+ -+ wined3d_cs_emit_fence_prio(cs, &fence); -+ -+ /* A busy wait should be fine, we're not supposed to have to wait very -+ * long. */ -+ while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); - } - - static const struct wined3d_cs_ops wined3d_cs_mt_ops = -@@ -3174,5 +4008,80 @@ + /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, + /* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b, + /* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i, +@@ -3202,5 +4022,80 @@ ERR("Closing event failed.\n"); } @@ -6076,23 +5809,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->lod = lod; texture->texture_rgb.base_level = ~0u; -@@ -596,6 +626,7 @@ - return WINED3DERR_INVALIDCALL; - } - -+#if defined(STAGING_CSMT) - /* - if (wined3d_settings.cs_multithreaded) - { -@@ -604,6 +635,7 @@ - } - */ - -+#endif /* STAGING_CSMT */ - wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key); - - return WINED3D_OK; -@@ -659,10 +691,14 @@ +@@ -651,10 +681,14 @@ } if (device->d3d_initialized) @@ -6107,7 +5824,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->resource.format = format; texture->resource.multisample_type = multisample_type; -@@ -788,6 +824,7 @@ +@@ -780,6 +814,7 @@ static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource, struct wined3d_context *context, BOOL srgb) { @@ -6115,7 +5832,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c surface_load(surface_from_resource(sub_resource), context, srgb); } -@@ -802,6 +839,19 @@ +@@ -794,6 +829,19 @@ wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); context_release(context); wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding); @@ -6135,7 +5852,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) -@@ -813,12 +863,25 @@ +@@ -805,12 +853,25 @@ static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -6161,7 +5878,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -897,6 +960,7 @@ +@@ -889,6 +950,7 @@ if (gl_info->supported[APPLE_CLIENT_STORAGE]) { @@ -6169,7 +5886,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (surface->flags & (SFLAG_NONPOW2) || texture->flags & WINED3D_TEXTURE_CONVERTED) { -@@ -905,12 +969,26 @@ +@@ -897,12 +959,26 @@ * WINED3D_TEXTURE_CONVERTED: The conversion destination memory is freed after loading the surface * heap_memory == NULL: Not defined in the extension. Seems to disable client storage effectively */ @@ -6196,7 +5913,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c surface->flags |= SFLAG_CLIENT; mem = surface->resource.heap_memory; -@@ -980,6 +1058,7 @@ +@@ -972,6 +1048,7 @@ wined3d_texture_unload_gl_texture(texture); } @@ -6204,7 +5921,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location) { ERR("Should not be called on textures.\n"); -@@ -999,6 +1078,13 @@ +@@ -991,6 +1068,13 @@ wined3d_texture_unload, wined3d_texture_load_location_invalidated, wined3d_texture_load_location, @@ -6218,7 +5935,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c }; static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, -@@ -1015,7 +1101,9 @@ +@@ -1007,7 +1091,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6228,7 +5945,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1025,6 +1113,7 @@ +@@ -1017,6 +1103,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6236,7 +5953,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1033,6 +1122,14 @@ +@@ -1025,6 +1112,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6251,7 +5968,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1053,7 +1150,9 @@ +@@ -1045,7 +1140,9 @@ else { WARN("Attempted to create a NPOT cube texture (edge length %u) without GL support.\n", desc->width); @@ -6261,7 +5978,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1063,7 +1162,9 @@ +@@ -1055,7 +1152,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x\n", hr); @@ -6271,7 +5988,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1126,7 +1227,9 @@ +@@ -1118,7 +1217,9 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6281,7 +5998,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1157,7 +1260,9 @@ +@@ -1149,7 +1250,9 @@ else { WARN("Attempted to create a mipmapped NPOT texture without unconditional NPOT support.\n"); @@ -6291,7 +6008,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1170,6 +1275,7 @@ +@@ -1162,6 +1265,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n"); @@ -6299,7 +6016,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1178,6 +1284,14 @@ +@@ -1170,6 +1274,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6314,7 +6031,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1186,7 +1300,9 @@ +@@ -1178,7 +1290,9 @@ surface_flags, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6324,7 +6041,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1272,12 +1388,25 @@ +@@ -1264,12 +1378,25 @@ static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) { @@ -6350,7 +6067,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, -@@ -1287,7 +1416,11 @@ +@@ -1279,7 +1406,11 @@ struct wined3d_const_bo_address addr; unsigned int row_pitch, slice_pitch; @@ -6362,7 +6079,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (row_pitch != data->row_pitch || slice_pitch != data->slice_pitch) FIXME("Ignoring row/slice pitch (%u/%u).\n", data->row_pitch, data->slice_pitch); -@@ -1312,7 +1445,11 @@ +@@ -1304,7 +1435,11 @@ void *mem = NULL; if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert @@ -6374,7 +6091,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c { TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume); gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); -@@ -1359,6 +1496,7 @@ +@@ -1351,6 +1486,7 @@ if (WINED3DFMT_UNKNOWN >= desc->format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture); @@ -6382,7 +6099,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1367,6 +1505,14 @@ +@@ -1359,6 +1495,14 @@ { WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture); HeapFree(GetProcessHeap(), 0, texture); @@ -6397,7 +6114,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } -@@ -1376,6 +1522,7 @@ +@@ -1368,6 +1512,7 @@ if (!gl_info->supported[SGIS_GENERATE_MIPMAP]) { WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n"); @@ -6405,7 +6122,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c HeapFree(GetProcessHeap(), 0, texture); return WINED3DERR_INVALIDCALL; } -@@ -1384,6 +1531,14 @@ +@@ -1376,6 +1521,14 @@ { WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n"); HeapFree(GetProcessHeap(), 0, texture); @@ -6420,7 +6137,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1411,7 +1566,9 @@ +@@ -1403,7 +1556,9 @@ { WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n", desc->width, desc->height, desc->depth); @@ -6430,7 +6147,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3DERR_INVALIDCALL; } } -@@ -1421,7 +1578,9 @@ +@@ -1413,7 +1568,9 @@ 0, device, parent, parent_ops, &texture_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -6440,7 +6157,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return hr; } -@@ -1498,6 +1657,9 @@ +@@ -1490,6 +1647,9 @@ if (FAILED(hr)) { WARN("Failed to initialize texture, returning %#x.\n", hr); @@ -7330,8 +7047,8 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.user_memory = mem)) { surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; -@@ -1963,6 +2444,27 @@ - surface->resource.size = wined3d_format_calculate_size(texture_resource->format, 1, width, height, 1); +@@ -1964,6 +2445,27 @@ + 1, width, height, 1); surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width); surface->resource.custom_slice_pitch = surface->resource.custom_row_pitch * surface->resource.height; /* FIXME */ +#else /* STAGING_CSMT */ @@ -7358,7 +7075,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* The format might be changed to a format that needs conversion. -@@ -1985,11 +2487,19 @@ +@@ -1986,11 +2488,19 @@ if (!valid_location) { @@ -7378,7 +7095,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -2348,6 +2858,7 @@ +@@ -2349,6 +2859,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt) { @@ -7386,7 +7103,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *dst_data = NULL, *src_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const struct d3dfmt_converter_desc *conv; -@@ -2356,6 +2867,13 @@ +@@ -2357,6 +2868,13 @@ struct wined3d_surface *dst; struct wined3d_context *context = NULL; struct wined3d_device *device = source->resource.device; @@ -7400,7 +7117,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conv = find_converter(source->resource.format->id, to_fmt); if (!conv) -@@ -2379,6 +2897,7 @@ +@@ -2380,6 +2898,7 @@ } dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0)); @@ -7408,7 +7125,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch); wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch); -@@ -2419,6 +2938,32 @@ +@@ -2420,6 +2939,32 @@ if (context) context_release(context); return NULL; @@ -7441,7 +7158,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, -@@ -2486,6 +3031,7 @@ +@@ -2487,6 +3032,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface) { @@ -7449,7 +7166,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p.\n", surface); -@@ -2504,18 +3050,59 @@ +@@ -2505,17 +3051,58 @@ struct wined3d_box box; const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -7462,15 +7179,12 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { - WARN("Map rect %s is misaligned for %ux%u blocks.\n", - wine_dbgstr_rect(rect), format->block_width, format->block_height); -- -- if (surface->resource.pool == WINED3D_POOL_DEFAULT) -- return WINED3DERR_INVALIDCALL; + WARN("Trying to unmap unmapped surface.\n"); + return WINEDDERR_NOTLOCKED; - } ++ } + --surface->resource.map_count; -- /* Performance optimization: Count how often a surface is mapped, if it is +- if (surface->resource.pool == WINED3D_POOL_DEFAULT) + surface->surface_ops->surface_unmap(surface); + + return WINED3D_OK; @@ -7503,9 +7217,9 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + wine_dbgstr_rect(rect), format->block_width, format->block_height); + + if (surface->resource.pool == WINED3D_POOL_DEFAULT) -+ return WINED3DERR_INVALIDCALL; -+ } -+ + return WINED3DERR_INVALIDCALL; + } + +#if !defined(STAGING_CSMT) + ++surface->resource.map_count; + @@ -7513,11 +7227,10 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + WARN("Trying to lock unlockable surface.\n"); + +#endif /* STAGING_CSMT */ -+ /* Performance optimization: Count how often a surface is mapped, if it is + /* Performance optimization: Count how often a surface is mapped, if it is * mapped regularly do not throw away the system memory copy. This avoids * the need to download the surface from OpenGL all the time. The surface - * is still downloaded if the OpenGL texture is changed. Note that this -@@ -2530,6 +3117,7 @@ +@@ -2531,6 +3118,7 @@ } } @@ -7525,7 +7238,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (rect) { surface->lockedRect = *rect; -@@ -2635,6 +3223,140 @@ +@@ -2636,6 +3224,140 @@ if (context) context_release(context); } @@ -7666,7 +7379,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) -@@ -2654,6 +3376,7 @@ +@@ -2655,6 +3377,7 @@ surface->resource.map_count--; surface->flags &= ~SFLAG_DCINUSE; @@ -7674,7 +7387,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_cs_emit_releasedc(surface->resource.device->cs, surface); return WINED3D_OK; -@@ -2690,6 +3413,40 @@ +@@ -2691,6 +3414,40 @@ context = context_acquire(device, surface); } @@ -7715,13 +7428,13 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c context_apply_blit_state(context, device); gl_info = context->gl_info; -@@ -2722,8 +3479,13 @@ +@@ -2723,8 +3480,13 @@ } /* Setup pixel store pack state -- to glReadPixels into the correct place */ +#if defined(STAGING_CSMT) - wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch); - gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count); + wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch); + gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, pitch / surface->resource.format->byte_count); +#else /* STAGING_CSMT */ + gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, + wined3d_surface_get_pitch(surface) / surface->resource.format->byte_count); @@ -7729,7 +7442,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, -@@ -2740,9 +3502,13 @@ +@@ -2741,9 +3503,13 @@ { /* glReadPixels returns the image upside down, and there is no way to prevent this. * Flip the lines in software. */ @@ -7743,7 +7456,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch))) goto error; -@@ -2778,12 +3544,16 @@ +@@ -2779,12 +3545,16 @@ checkGLcall("glBindBuffer"); } @@ -7760,7 +7473,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Read the framebuffer contents into a texture. Note that this function -@@ -2858,6 +3628,85 @@ +@@ -2859,6 +3629,85 @@ } } @@ -7846,7 +7559,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, -@@ -2964,8 +3813,13 @@ +@@ -2965,8 +3814,13 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ @@ -7860,7 +7573,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Uses the hardware to stretch and flip the image */ -@@ -3033,7 +3887,11 @@ +@@ -3034,7 +3888,11 @@ checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ @@ -7872,7 +7585,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag -@@ -3230,6 +4088,7 @@ +@@ -3231,6 +4089,7 @@ checkGLcall("glDeleteTextures(1, &backup)"); } @@ -7880,7 +7593,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -3241,6 +4100,17 @@ +@@ -3242,6 +4101,17 @@ * and has a drawable, this path is never entered. */ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB); wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -7898,7 +7611,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Front buffer coordinates are always full screen coordinates, but our GL -@@ -3271,6 +4141,7 @@ +@@ -3272,6 +4142,7 @@ rect->bottom = drawable_height - rect->bottom; } @@ -7906,7 +7619,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c /* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, struct wined3d_context *old_ctx, -@@ -3305,6 +4176,26 @@ +@@ -3306,6 +4177,26 @@ /* Make sure the surface is up-to-date. This should probably use * wined3d_resource_load_location() and worry about the destination * surface too, unless we're overwriting it completely. */ @@ -7933,7 +7646,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_texture_load(src_surface->container, context, FALSE); /* Activate the destination context, set it up for blitting */ -@@ -3347,6 +4238,7 @@ +@@ -3348,6 +4239,7 @@ /* Leave the opengl state valid for blitting */ device->blitter->unset_shader(context->gl_info); @@ -7941,7 +7654,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering -@@ -3360,6 +4252,14 @@ +@@ -3361,6 +4253,14 @@ context = context_acquire(device, restore_rt); context_release(context); } @@ -7956,7 +7669,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3383,8 +4283,13 @@ +@@ -3384,8 +4284,13 @@ enum wined3d_texture_filter_type filter) { struct wined3d_device *device = dst_surface->resource.device; @@ -7970,7 +7683,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, blt_fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect), -@@ -3575,6 +4480,7 @@ +@@ -3576,6 +4481,7 @@ { TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); @@ -7978,7 +7691,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) -@@ -3583,6 +4489,15 @@ +@@ -3584,6 +4490,15 @@ surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; surface->resource.locations = location; @@ -7994,7 +7707,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } /* Context activation is done by the caller. */ -@@ -3597,7 +4512,11 @@ +@@ -3598,7 +4513,11 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -8006,7 +7719,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; -@@ -3623,7 +4542,11 @@ +@@ -3624,7 +4543,11 @@ return; } @@ -8018,7 +7731,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Surface was discarded, no need copy data.\n"); switch (location) -@@ -3643,6 +4566,7 @@ +@@ -3644,6 +4567,7 @@ default: FIXME("Unhandled location %#x\n", location); } @@ -8026,7 +7739,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED; surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; -@@ -3654,6 +4578,19 @@ +@@ -3655,6 +4579,19 @@ { FIXME("No up to date depth stencil location.\n"); surface->resource.locations |= location; @@ -8046,7 +7759,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; return; -@@ -3718,9 +4655,13 @@ +@@ -3719,9 +4656,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -8060,7 +7773,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) -@@ -3736,9 +4677,13 @@ +@@ -3737,9 +4678,13 @@ context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -8074,7 +7787,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 -@@ -3746,6 +4691,7 @@ +@@ -3747,6 +4692,7 @@ ERR("Invalid location (%#x) specified.\n", location); } @@ -8082,7 +7795,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface->resource.locations |= location; surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; -@@ -3791,6 +4737,135 @@ +@@ -3792,6 +4738,135 @@ TRACE("Surface was discarded, nothing to do.\n"); return WINED3D_OK; } @@ -8218,7 +7931,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && wined3d_resource_is_offscreen(&surface->container->resource)) -@@ -3800,6 +4875,7 @@ +@@ -3801,6 +4876,7 @@ } surface_get_rect(surface, NULL, &r); @@ -8226,7 +7939,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_load_location(&surface->resource, context, WINED3D_LOCATION_TEXTURE_RGB); surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); -@@ -3868,6 +4944,66 @@ +@@ -3869,6 +4945,66 @@ RECT rect = {0, 0, surface->resource.width, surface->resource.height}; surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, @@ -8293,7 +8006,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c &rect, surface, dst_location, &rect); return WINED3D_OK; -@@ -3877,6 +5013,7 @@ +@@ -3878,6 +5014,7 @@ if (srgb) { @@ -8301,7 +8014,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { -@@ -3911,6 +5048,45 @@ +@@ -3912,6 +5049,45 @@ width = surface->resource.width; wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch); @@ -8347,7 +8060,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c format = *texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) -@@ -3919,7 +5095,11 @@ +@@ -3920,7 +5096,11 @@ /* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is * getting called. */ @@ -8359,7 +8072,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { TRACE("Removing the pbo attached to surface %p.\n", surface); -@@ -3928,6 +5108,7 @@ +@@ -3929,6 +5109,7 @@ else surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; @@ -8367,7 +8080,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c wined3d_resource_prepare_map_memory(&surface->resource, context); wined3d_resource_load_location(&surface->resource, context, surface->resource.map_binding); wined3d_resource_free_bo(&surface->resource); -@@ -3935,6 +5116,14 @@ +@@ -3936,6 +5117,14 @@ } wined3d_resource_get_memory(&surface->resource, surface->resource.locations, &data); @@ -8382,7 +8095,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. */ -@@ -3949,9 +5138,15 @@ +@@ -3950,9 +5139,15 @@ context_release(context); return E_OUTOFMEMORY; } @@ -8398,7 +8111,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c data.addr = mem; } else if (conversion) -@@ -3971,6 +5166,7 @@ +@@ -3972,6 +5167,7 @@ } if (texture->swapchain && texture->swapchain->palette) palette = texture->swapchain->palette; @@ -8406,7 +8119,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c conversion->convert(data.addr, src_row_pitch, mem, dst_pitch, width, height, palette, &texture->async.gl_color_key); src_row_pitch = dst_pitch; -@@ -4003,6 +5199,40 @@ +@@ -4004,6 +5200,40 @@ struct wined3d_context *context, DWORD location) { struct wined3d_surface *surface = surface_from_resource(resource); @@ -8447,7 +8160,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); -@@ -4010,6 +5240,7 @@ +@@ -4011,30 +5241,73 @@ if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { if (location == WINED3D_LOCATION_TEXTURE_RGB @@ -8455,13 +8168,15 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { surface_load_ds_location(surface, context, location); -@@ -4019,21 +5250,63 @@ - && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) - { - /* Already up to date, nothing to do. */ - return; + return; + } ++ else if (location & surface->resource.locations ++ && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) ++ { ++ /* Already up to date, nothing to do. */ ++ return; ++ } + else + { + FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", @@ -8482,11 +8197,13 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + surface_load_ds_location(surface, context, location); + context_release(context); + return WINED3D_OK; -+ } + } +- else if (location & surface->resource.locations + else if (location & surface->locations -+ && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) -+ { -+ /* Already up to date, nothing to do. */ + && surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE) + { + /* Already up to date, nothing to do. */ +- return; + return WINED3D_OK; } else @@ -8524,7 +8241,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } switch (location) -@@ -4042,6 +5315,7 @@ +@@ -4043,6 +5316,7 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: @@ -8532,7 +8249,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c surface_load_sysmem(surface, context, location); break; -@@ -4059,6 +5333,24 @@ +@@ -4060,6 +5334,24 @@ if (FAILED(hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB))) return; @@ -8557,7 +8274,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c break; default: -@@ -4066,12 +5358,21 @@ +@@ -4067,12 +5359,21 @@ break; } @@ -8579,7 +8296,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; } -@@ -4179,6 +5480,7 @@ +@@ -4180,6 +5481,7 @@ const RECT *dst_rect, const struct wined3d_color *color) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8587,7 +8304,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view, *view_ptr = &view; struct wined3d_fb_state fb = {&view_ptr, NULL, 1}; struct wined3d_texture *texture = dst_surface->container; -@@ -4199,6 +5501,21 @@ +@@ -4200,6 +5502,21 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 1, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_TARGET, color, 0.0f, 0); @@ -8609,7 +8326,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4207,6 +5524,7 @@ +@@ -4208,6 +5525,7 @@ const RECT *dst_rect, float depth) { const RECT draw_rect = {0, 0, dst_surface->resource.width, dst_surface->resource.height}; @@ -8617,7 +8334,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c struct wined3d_rendertarget_view view; struct wined3d_fb_state fb = {NULL, &view}; struct wined3d_texture *texture = dst_surface->container; -@@ -4222,6 +5540,20 @@ +@@ -4223,6 +5541,20 @@ view.sub_resource_idx = dst_surface->texture_layer * texture->level_count + dst_surface->texture_level; device_clear_render_targets(device, 0, &fb, 1, dst_rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0); @@ -8638,24 +8355,30 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return WINED3D_OK; } -@@ -4234,6 +5566,7 @@ - /* Blit from offscreen surface to render target */ - struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; - DWORD old_color_key_flags = src_surface->container->async.color_key_flags; +@@ -4232,8 +5564,10 @@ + struct wined3d_surface *dst_surface, const RECT *dst_rect, + const struct wined3d_color_key *color_key) + { +#if defined(STAGING_CSMT) struct wined3d_context *context; - TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -4251,6 +5584,22 @@ ++#endif /* STAGING_CSMT */ + /* Blit from offscreen surface to render target */ + struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; + DWORD old_color_key_flags = src_surface->container->async.color_key_flags; +@@ -4242,6 +5576,7 @@ + + wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); + ++#if defined(STAGING_CSMT) + context = context_acquire(device, dst_surface); + surface_blt_to_drawable(device, context, filter, + !!color_key, src_surface, src_rect, dst_surface, dst_rect); +@@ -4253,6 +5588,17 @@ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding); wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding); +#else /* STAGING_CSMT */ -+ -+ TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -+ -+ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); -+ + surface_blt_to_drawable(device, filter, + !!color_key, src_surface, src_rect, dst_surface, dst_rect); + @@ -8669,7 +8392,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } const struct blit_shader ffp_blit = { -@@ -4410,6 +5759,7 @@ +@@ -4412,6 +5758,7 @@ const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; struct wined3d_texture *src_texture = NULL; @@ -8677,7 +8400,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void *src_data = NULL, *dst_data = NULL; UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const BYTE *sbase = NULL; -@@ -4440,6 +5790,23 @@ +@@ -4442,6 +5789,23 @@ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch); src_data = dst_data; src_row_pitch = dst_row_pitch; @@ -8701,7 +8424,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = dst_surface->resource.format; dst_format = src_format; dst_fmt_flags = dst_surface->container->resource.format_flags; -@@ -4451,12 +5818,14 @@ +@@ -4453,12 +5817,14 @@ dst_fmt_flags = dst_surface->container->resource.format_flags; if (src_surface) { @@ -8716,7 +8439,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_surface->resource.format->id != src_surface->resource.format->id) { if (!(src_texture = surface_convert_format(src_surface, dst_format->id))) -@@ -4467,9 +5836,13 @@ +@@ -4469,9 +5835,13 @@ } src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0)); } @@ -8730,7 +8453,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format = src_surface->resource.format; src_fmt_flags = src_surface->container->resource.format_flags; } -@@ -4479,8 +5852,12 @@ +@@ -4481,8 +5851,12 @@ src_fmt_flags = dst_fmt_flags; } @@ -8743,7 +8466,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } bpp = dst_surface->resource.format->byte_count; -@@ -4491,12 +5868,24 @@ +@@ -4493,12 +5867,24 @@ width = (dst_rect->right - dst_rect->left) * bpp; if (src_surface) @@ -8768,7 +8491,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) { -@@ -4531,7 +5920,11 @@ +@@ -4533,7 +5919,11 @@ } hr = surface_cpu_blt_compressed(sbase, dbuf, @@ -8780,7 +8503,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c src_format, flags, fx); goto release; } -@@ -4539,7 +5932,11 @@ +@@ -4541,7 +5931,11 @@ /* First, all the 'source-less' blits */ if (flags & WINEDDBLT_COLORFILL) { @@ -8792,7 +8515,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c flags &= ~WINEDDBLT_COLORFILL; } -@@ -4588,6 +5985,7 @@ +@@ -4590,6 +5984,7 @@ for (y = 0; y < dstheight; ++y) { memcpy(dbuf, sbuf, width); @@ -8800,7 +8523,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf += src_row_pitch; dbuf += dst_row_pitch; } -@@ -4601,6 +5999,21 @@ +@@ -4603,6 +5998,21 @@ { sbuf -= src_row_pitch; dbuf -= dst_row_pitch; @@ -8822,7 +8545,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c memcpy(dbuf, sbuf, width); } } -@@ -4610,8 +6023,13 @@ +@@ -4612,8 +6022,13 @@ for (y = 0; y < dstheight; ++y) { memmove(dbuf, sbuf, width); @@ -8836,7 +8559,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4620,9 +6038,15 @@ +@@ -4622,9 +6037,15 @@ /* Stretching in y direction only. */ for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8852,7 +8575,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -4632,6 +6056,7 @@ +@@ -4634,6 +6055,7 @@ int last_sy = -1; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8860,7 +8583,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c sbuf = sbase + (sy >> 16) * src_row_pitch; if ((sy >> 16) == (last_sy >> 16)) -@@ -4639,6 +6064,15 @@ +@@ -4641,6 +6063,15 @@ /* This source row is the same as last source row - * Copy the already stretched row. */ memcpy(dbuf, dbuf - dst_row_pitch, width); @@ -8876,7 +8599,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -4685,6 +6119,7 @@ +@@ -4687,6 +6118,7 @@ } #undef STRETCH_ROW } @@ -8884,7 +8607,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dbuf += dst_row_pitch; last_sy = sy; } -@@ -4693,6 +6128,16 @@ +@@ -4695,6 +6127,16 @@ else { LONG dstyinc = dst_row_pitch, dstxinc = bpp; @@ -8901,7 +8624,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff; DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff; if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE)) -@@ -4742,7 +6187,11 @@ +@@ -4744,7 +6186,11 @@ LONG tmpxy; dTopLeft = dbuf; dTopRight = dbuf + ((dstwidth - 1) * bpp); @@ -8913,7 +8636,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp); if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY) -@@ -4819,6 +6268,7 @@ +@@ -4821,6 +6267,7 @@ flags &= ~(WINEDDBLT_DDFX); } @@ -8921,7 +8644,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c #define COPY_COLORKEY_FX(type) \ do { \ const type *s; \ -@@ -4840,6 +6290,29 @@ +@@ -4842,6 +6289,29 @@ d = (type *)(((BYTE *)d) + dstyinc); \ } \ } while(0) @@ -8951,7 +8674,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c switch (bpp) { -@@ -4858,7 +6331,11 @@ +@@ -4860,7 +6330,11 @@ BYTE *d = dbuf, *dx; for (y = sy = 0; y < dstheight; ++y, sy += yinc) { @@ -8963,7 +8686,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c dx = d; for (x = sx = 0; x < dstwidth; ++x, sx+= xinc) { -@@ -4889,10 +6366,12 @@ +@@ -4891,10 +6365,12 @@ } } @@ -8976,7 +8699,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c error: if (flags && FIXME_ON(d3d_surface)) { -@@ -4900,6 +6379,7 @@ +@@ -4902,6 +6378,7 @@ } release: @@ -8984,7 +8707,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (dst_data) { wined3d_resource_release_map_ptr(&dst_surface->resource, context); -@@ -4918,6 +6398,14 @@ +@@ -4920,6 +6397,14 @@ wined3d_texture_decref(src_texture); if (context) context_release(context); @@ -8999,7 +8722,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return hr; } -@@ -4962,6 +6450,7 @@ +@@ -4964,6 +6449,7 @@ cpu_blit_blit_surface, }; @@ -9007,7 +8730,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c void surface_blt_ugly(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) -@@ -4969,6 +6458,16 @@ +@@ -4971,6 +6457,16 @@ struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; @@ -9024,7 +8747,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c BOOL scale, convert; static const DWORD simple_blit = WINEDDBLT_ASYNC -@@ -4979,6 +6478,106 @@ +@@ -4981,6 +6477,106 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; @@ -9131,7 +8854,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c if (!device->d3d_initialized) { WARN("D3D not initialized, using fallback.\n"); -@@ -5021,8 +6620,13 @@ +@@ -5023,8 +6619,13 @@ } scale = src_surface @@ -9145,7 +8868,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c convert = src_surface && src_surface->resource.format->id != dst_surface->resource.format->id; dst_ds_flags = dst_surface->container->resource.format_flags -@@ -5042,6 +6646,7 @@ +@@ -5044,6 +6645,7 @@ TRACE("Depth fill.\n"); if (!surface_convert_depth_to_float(dst_surface, fx->u5.dwFillDepth, &depth)) @@ -9153,7 +8876,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) -@@ -5052,6 +6657,24 @@ +@@ -5054,6 +6656,24 @@ if (SUCCEEDED(wined3d_surface_depth_blt(src_surface, src_surface->container->resource.draw_binding, src_rect, dst_surface, dst_surface->container->resource.draw_binding, dst_rect))) return; @@ -9178,7 +8901,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } else -@@ -5060,8 +6683,13 @@ +@@ -5062,8 +6682,13 @@ /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ @@ -9192,7 +8915,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); -@@ -5082,8 +6710,13 @@ +@@ -5084,8 +6709,13 @@ palette, fx->u5.dwFillColor, &color)) goto fallback; @@ -9206,7 +8929,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } else { -@@ -5101,8 +6734,13 @@ +@@ -5103,8 +6733,13 @@ color_key = &src_surface->container->async.src_blt_color_key; blit_op = WINED3D_BLIT_OP_COLOR_BLIT_CKEY; } @@ -9220,7 +8943,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c { /* Upload */ if (scale) -@@ -5111,6 +6749,7 @@ +@@ -5113,6 +6748,7 @@ TRACE("Not doing upload because of format conversion.\n"); else { @@ -9228,7 +8951,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c POINT dst_point = {dst_rect->left, dst_rect->top}; if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect))) -@@ -5123,6 +6762,15 @@ +@@ -5125,6 +6761,15 @@ context_release(context); } return; @@ -9244,7 +8967,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } } } -@@ -5146,6 +6794,7 @@ +@@ -5148,6 +6793,7 @@ wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0); dst_swapchain->desc.swap_effect = swap_effect; @@ -9252,7 +8975,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c return; } -@@ -5341,6 +6990,49 @@ +@@ -5353,6 +6999,49 @@ wined3d_surface_location_invalidated, wined3d_surface_load_location, }; @@ -9302,7 +9025,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, const struct wined3d_resource_desc *desc, GLenum target, unsigned int level, unsigned int layer, DWORD flags) -@@ -5402,9 +7094,13 @@ +@@ -5414,9 +7103,13 @@ } surface->container = container; @@ -9316,7 +9039,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c list_init(&surface->renderbuffers); list_init(&surface->overlays); -@@ -5436,9 +7132,14 @@ +@@ -5448,9 +7141,14 @@ if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); @@ -9331,7 +9054,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c } return hr; -@@ -5465,7 +7166,11 @@ +@@ -5477,7 +7175,11 @@ if (FAILED(hr = surface_init(object, container, desc, target, level, layer, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); @@ -9387,6 +9110,42 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c if (rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE) { static unsigned int warned = 0; +diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c +--- a/dlls/wined3d/sampler.c ++++ b/dlls/wined3d/sampler.c +@@ -33,6 +33,7 @@ + return refcount; + } + ++#if defined(STAGING_CSMT) + void wined3d_sampler_destroy(struct wined3d_sampler *sampler) + { + struct wined3d_context *context = context_acquire(sampler->device, NULL); +@@ -54,6 +55,24 @@ + { + struct wined3d_device *device = sampler->device; + wined3d_cs_emit_sampler_destroy(device->cs, sampler); ++#else /* STAGING_CSMT */ ++ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler) ++{ ++ ULONG refcount = InterlockedDecrement(&sampler->refcount); ++ const struct wined3d_gl_info *gl_info; ++ struct wined3d_context *context; ++ ++ TRACE("%p decreasing refcount to %u.\n", sampler, refcount); ++ ++ if (!refcount) ++ { ++ context = context_acquire(sampler->device, NULL); ++ gl_info = context->gl_info; ++ GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); ++ context_release(context); ++ ++ HeapFree(GetProcessHeap(), 0, sampler); ++#endif /* STAGING_CSMT */ + } + + return refcount; diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -9734,7 +9493,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } context_release(context); } -@@ -1072,6 +1240,21 @@ +@@ -1075,6 +1243,21 @@ } base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory; @@ -9756,7 +9515,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); -@@ -1125,7 +1308,11 @@ +@@ -1128,7 +1311,11 @@ checkGLcall("glFlushMappedBufferRange"); } } @@ -9768,7 +9527,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c { for (i = 0; i < buffer->modified_areas; ++i) { -@@ -1136,6 +1323,7 @@ +@@ -1139,6 +1326,7 @@ } GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint)); @@ -9776,7 +9535,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (wined3d_settings.cs_multithreaded) gl_info->gl_ops.gl.p_glFinish(); else if (wined3d_settings.strict_draw_ordering) -@@ -1144,6 +1332,18 @@ +@@ -1147,6 +1335,18 @@ buffer_clear_dirty_areas(buffer); buffer->map_ptr = NULL; @@ -9795,7 +9554,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c } } -@@ -1157,6 +1357,7 @@ +@@ -1160,6 +1360,7 @@ return wined3d_buffer_decref(buffer_from_resource(resource)); } @@ -9803,7 +9562,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c static void wined3d_buffer_location_invalidated(struct wined3d_resource *resource, DWORD location) { ERR("Not yet implemented.\n"); -@@ -1176,6 +1377,13 @@ +@@ -1179,6 +1380,13 @@ buffer_unload, wined3d_buffer_location_invalidated, wined3d_buffer_load_location, @@ -9817,7 +9576,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c }; static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, -@@ -1207,7 +1415,9 @@ +@@ -1210,7 +1418,9 @@ return hr; } buffer->buffer_type_hint = bind_hint; @@ -9827,7 +9586,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c 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); -@@ -1223,6 +1433,7 @@ +@@ -1226,6 +1436,7 @@ dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE]; @@ -9835,7 +9594,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c /* Observations show that draw_strided_slow is faster on dynamic VBs than converting + * drawStridedFast (half-life 2 and others). * -@@ -1230,6 +1441,15 @@ +@@ -1233,6 +1444,15 @@ * show that draw_strided_slow is faster than converting + uploading + drawStridedFast. * Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers. */ @@ -9851,19 +9610,54 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (!gl_info->supported[ARB_VERTEX_BUFFER_OBJECT]) { TRACE("Not creating a vbo because GL_ARB_vertex_buffer is not supported\n"); -@@ -1275,9 +1495,11 @@ +@@ -1250,6 +1470,7 @@ + buffer->flags |= WINED3D_BUFFER_CREATEBO; + } + ++#if defined(STAGING_CSMT) + buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); + if (!buffer->maps) + { +@@ -1260,6 +1481,7 @@ } buffer->maps_size = 1; ++#endif /* STAGING_CSMT */ + if (data) + { + BYTE *ptr; +@@ -1268,7 +1490,9 @@ + if (FAILED(hr)) + { + ERR("Failed to map buffer, hr %#x\n", hr); ++#if defined(STAGING_CSMT) + HeapFree(GetProcessHeap(), 0, buffer->maps); ++#endif /* STAGING_CSMT */ + buffer_unload(&buffer->resource); + resource_cleanup(&buffer->resource); + return hr; +@@ -1279,8 +1503,20 @@ + wined3d_buffer_unmap(buffer); + } + +#if defined(STAGING_CSMT) if (wined3d_settings.cs_multithreaded) buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; - ++#else /* STAGING_CSMT */ ++ buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)); ++ if (!buffer->maps) ++ { ++ ERR("Out of memory\n"); ++ buffer_unload(&buffer->resource); ++ resource_cleanup(&buffer->resource); ++ return E_OUTOFMEMORY; ++ } ++ buffer->maps_size = 1; +#endif /* STAGING_CSMT */ + return WINED3D_OK; } - -@@ -1384,6 +1606,7 @@ +@@ -1388,6 +1624,7 @@ return WINED3D_OK; } @@ -9871,7 +9665,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) { -@@ -1391,3 +1614,4 @@ +@@ -1395,3 +1632,4 @@ buffer->resource.heap_memory = mem; buffer->flags |= WINED3D_BUFFER_DISCARD; }