wined3d-CSMT_Helper: Move 'Merge get_pitch' patch into CSMT_Main.

This commit is contained in:
Sebastian Lackner 2015-07-29 03:58:55 +02:00
parent c258f95d4b
commit 025e40edcc
179 changed files with 1139 additions and 987 deletions

View File

@ -4906,15 +4906,11 @@ fi
# Patchset wined3d-CSMT_Helper
# |
# | Modified files:
# | * configure.ac, dlls/ddraw/surface.c, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc,
# | dlls/wined3d/resource.c, dlls/wined3d/surface.c, dlls/wined3d/texture.c, dlls/wined3d/volume.c,
# | dlls/wined3d/wined3d.spec, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h
# | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc
# |
if test "$enable_wined3d_CSMT_Helper" -eq 1; then
patch_apply wined3d-CSMT_Helper/0001-wined3d-Merge-get_pitch-functions.patch
patch_apply wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch
patch_apply wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch
(
echo '+ { "Stefan Dösinger", "wined3d: Merge get_pitch functions.", 1 },';
echo '+ { "Sebastian Lackner", "wined3d: Add second dll with STAGING_CSMT definition set.", 1 },';
) >> "$patchlist"
fi
@ -5044,182 +5040,184 @@ fi
# | 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-Pass-a-context-to-surface_load_sysmem.patch
patch_apply wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-read_from_framebuffer.patch
patch_apply wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch
patch_apply wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_blt_fbo.patch
patch_apply wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_multisample_resolv.patch
patch_apply wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_load_texture.patch
patch_apply wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_location.patch
patch_apply wined3d-CSMT_Main/0008-wined3d-Make-surface_load_location-return-nothing.patch
patch_apply wined3d-CSMT_Main/0009-wined3d-Store-volume-locations-in-the-resource.patch
patch_apply wined3d-CSMT_Main/0010-wined3d-Move-validate_location-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0011-wined3d-Move-surface-locations-into-the-resource.patch
patch_apply wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch
patch_apply wined3d-CSMT_Main/0013-wined3d-Move-invalidate_location-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0014-wined3d-Invalidate-containers-via-callback.patch
patch_apply wined3d-CSMT_Main/0015-wined3d-Remove-surface_invalidate_location.patch
patch_apply wined3d-CSMT_Main/0016-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch
patch_apply wined3d-CSMT_Main/0017-wined3d-Move-load_location-into-the-resource.patch
patch_apply wined3d-CSMT_Main/0018-wined3d-Replace-surface_load_location-with-resource_.patch
patch_apply wined3d-CSMT_Main/0019-wined3d-Introduce-helper-functions-for-mapping-volum.patch
patch_apply wined3d-CSMT_Main/0020-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch
patch_apply wined3d-CSMT_Main/0021-wined3d-Remove-surface-pbo.patch
patch_apply wined3d-CSMT_Main/0022-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch
patch_apply wined3d-CSMT_Main/0023-wined3d-Move-buffer-creation-into-the-resource.patch
patch_apply wined3d-CSMT_Main/0024-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch
patch_apply wined3d-CSMT_Main/0025-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch
patch_apply wined3d-CSMT_Main/0026-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch
patch_apply wined3d-CSMT_Main/0027-wined3d-Discard-implicit-surfaces-on-unload.patch
patch_apply wined3d-CSMT_Main/0028-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch
patch_apply wined3d-CSMT_Main/0029-wined3d-Discard-the-backbuffer-in-discard-presents.patch
patch_apply wined3d-CSMT_Main/0030-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch
patch_apply wined3d-CSMT_Main/0031-wined3d-Introduce-a-function-to-retrieve-resource-me.patch
patch_apply wined3d-CSMT_Main/0032-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch
patch_apply wined3d-CSMT_Main/0033-wined3d-Move-check_block_align-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0034-wined3d-Replace-surface-alloc-functions-with-resourc.patch
patch_apply wined3d-CSMT_Main/0035-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch
patch_apply wined3d-CSMT_Main/0036-wined3d-Use-resource-facilities-to-destroy-PBOs.patch
patch_apply wined3d-CSMT_Main/0037-wined3d-Move-simple-location-copying-to-the-resource.patch
patch_apply wined3d-CSMT_Main/0038-wined3d-Move-most-of-volume_map-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0039-wined3d-Use-resource_map-for-surface_map.patch
patch_apply wined3d-CSMT_Main/0040-wined3d-Use-client-storage-with-DIB-sections.patch
patch_apply wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
patch_apply wined3d-CSMT_Main/0001-wined3d-Merge-get_pitch-functions.patch
patch_apply wined3d-CSMT_Main/0002-wined3d-Pass-a-context-to-surface_load_sysmem.patch
patch_apply wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-read_from_framebuffer.patch
patch_apply wined3d-CSMT_Main/0004-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch
patch_apply wined3d-CSMT_Main/0005-wined3d-Pass-a-context-to-surface_blt_fbo.patch
patch_apply wined3d-CSMT_Main/0006-wined3d-Pass-a-context-to-surface_multisample_resolv.patch
patch_apply wined3d-CSMT_Main/0007-wined3d-Pass-a-context-to-surface_load_texture.patch
patch_apply wined3d-CSMT_Main/0008-wined3d-Pass-a-context-to-surface_load_location.patch
patch_apply wined3d-CSMT_Main/0009-wined3d-Make-surface_load_location-return-nothing.patch
patch_apply wined3d-CSMT_Main/0010-wined3d-Store-volume-locations-in-the-resource.patch
patch_apply wined3d-CSMT_Main/0011-wined3d-Move-validate_location-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0012-wined3d-Move-surface-locations-into-the-resource.patch
patch_apply wined3d-CSMT_Main/0013-wined3d-Remove-surface_validate_location.patch
patch_apply wined3d-CSMT_Main/0014-wined3d-Move-invalidate_location-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0015-wined3d-Invalidate-containers-via-callback.patch
patch_apply wined3d-CSMT_Main/0016-wined3d-Remove-surface_invalidate_location.patch
patch_apply wined3d-CSMT_Main/0017-wined3d-Move-bitmap_data-and-user_memory-into-the-re.patch
patch_apply wined3d-CSMT_Main/0018-wined3d-Move-load_location-into-the-resource.patch
patch_apply wined3d-CSMT_Main/0019-wined3d-Replace-surface_load_location-with-resource_.patch
patch_apply wined3d-CSMT_Main/0020-wined3d-Introduce-helper-functions-for-mapping-volum.patch
patch_apply wined3d-CSMT_Main/0021-wined3d-Move-volume-PBO-infrastructure-into-the-reso.patch
patch_apply wined3d-CSMT_Main/0022-wined3d-Remove-surface-pbo.patch
patch_apply wined3d-CSMT_Main/0023-wined3d-Use-resource-buffer-mapping-facilities-in-su.patch
patch_apply wined3d-CSMT_Main/0024-wined3d-Move-buffer-creation-into-the-resource.patch
patch_apply wined3d-CSMT_Main/0025-wined3d-Handle-WINED3D_LOCATION_DISCARDED-in-surface.patch
patch_apply wined3d-CSMT_Main/0026-wined3d-Handle-LOCATION_DISCARDED-in-surface_load_dr.patch
patch_apply wined3d-CSMT_Main/0027-wined3d-Handle-WINED3D_LOCATION_DISCARDED-for-sysmem.patch
patch_apply wined3d-CSMT_Main/0028-wined3d-Discard-implicit-surfaces-on-unload.patch
patch_apply wined3d-CSMT_Main/0029-wined3d-Don-t-try-to-flip-sysmem-copies-in-swapchain.patch
patch_apply wined3d-CSMT_Main/0030-wined3d-Discard-the-backbuffer-in-discard-presents.patch
patch_apply wined3d-CSMT_Main/0031-wined3d-Allocate-sysmem-for-client-storage-if-it-doe.patch
patch_apply wined3d-CSMT_Main/0032-wined3d-Introduce-a-function-to-retrieve-resource-me.patch
patch_apply wined3d-CSMT_Main/0033-wined3d-Make-surface_ops-unmap-specific-for-front-bu.patch
patch_apply wined3d-CSMT_Main/0034-wined3d-Move-check_block_align-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0035-wined3d-Replace-surface-alloc-functions-with-resourc.patch
patch_apply wined3d-CSMT_Main/0036-wined3d-Don-t-delete-the-buffer-in-surface_cleanup.patch
patch_apply wined3d-CSMT_Main/0037-wined3d-Use-resource-facilities-to-destroy-PBOs.patch
patch_apply wined3d-CSMT_Main/0038-wined3d-Move-simple-location-copying-to-the-resource.patch
patch_apply wined3d-CSMT_Main/0039-wined3d-Move-most-of-volume_map-to-resource.c.patch
patch_apply wined3d-CSMT_Main/0040-wined3d-Use-resource_map-for-surface_map.patch
patch_apply wined3d-CSMT_Main/0041-wined3d-Use-client-storage-with-DIB-sections.patch
patch_apply wined3d-CSMT_Main/0042-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
patch_apply wined3d-CSMT_Main/0043-wined3d-Move-the-framebuffer-into-wined3d_state.patch
patch_apply wined3d-CSMT_Main/0044-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch
patch_apply wined3d-CSMT_Main/0045-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch
patch_apply wined3d-CSMT_Main/0046-wined3d-Hackily-introduce-a-multithreaded-command-st.patch
patch_apply wined3d-CSMT_Main/0047-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch
patch_apply wined3d-CSMT_Main/0048-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch
patch_apply wined3d-CSMT_Main/0049-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch
patch_apply wined3d-CSMT_Main/0050-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch
patch_apply wined3d-CSMT_Main/0051-wined3d-Pass-the-state-to-draw_primitive.patch
patch_apply wined3d-CSMT_Main/0052-wined3d-Wait-for-the-cs-before-destroying-objects.patch
patch_apply wined3d-CSMT_Main/0053-wined3d-Give-the-cs-its-own-state.patch
patch_apply wined3d-CSMT_Main/0054-wined3d-Send-float-constant-updates-through-the-comm.patch
patch_apply wined3d-CSMT_Main/0055-wined3d-Request-a-glFinish-before-modifying-resource.patch
patch_apply wined3d-CSMT_Main/0056-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch
patch_apply wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-clears.patch
patch_apply wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-draws.patch
patch_apply wined3d-CSMT_Main/0059-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch
patch_apply wined3d-CSMT_Main/0060-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch
patch_apply wined3d-CSMT_Main/0061-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch
patch_apply wined3d-CSMT_Main/0062-wined3d-Don-t-store-viewport-pointers-in-the-command.patch
patch_apply wined3d-CSMT_Main/0063-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch
patch_apply wined3d-CSMT_Main/0064-wined3d-Send-base-vertex-index-updates-through-the-c.patch
patch_apply wined3d-CSMT_Main/0065-wined3d-Send-primitive-type-updates-through-the-comm.patch
patch_apply wined3d-CSMT_Main/0066-wined3d-Send-bool-constant-updates-through-the-comma.patch
patch_apply wined3d-CSMT_Main/0067-wined3d-Send-int-constant-updates-through-the-comman.patch
patch_apply wined3d-CSMT_Main/0068-wined3d-Send-light-updates-through-the-command-strea.patch
patch_apply wined3d-CSMT_Main/0069-wined3d-Prevent-the-command-stream-from-running-ahea.patch
patch_apply wined3d-CSMT_Main/0070-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch
patch_apply wined3d-CSMT_Main/0071-wined3d-Run-the-cs-asynchronously.patch
patch_apply wined3d-CSMT_Main/0072-wined3d-Send-blits-through-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0073-wined3d-Put-update_surface-checks-back-in-place.patch
patch_apply wined3d-CSMT_Main/0074-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch
patch_apply wined3d-CSMT_Main/0075-wined3d-Add-cs-waiting-debug-code.patch
patch_apply wined3d-CSMT_Main/0076-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch
patch_apply wined3d-CSMT_Main/0077-wined3d-Send-render-target-view-clears-through-the-c.patch
patch_apply wined3d-CSMT_Main/0078-wined3d-Wait-for-the-CS-in-GetDC.patch
patch_apply wined3d-CSMT_Main/0079-wined3d-send-resource-maps-through-the-command-strea.patch
patch_apply wined3d-CSMT_Main/0080-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch
patch_apply wined3d-CSMT_Main/0081-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch
patch_apply wined3d-CSMT_Main/0082-wined3d-Don-t-preload-buffers-on-unmap.patch
patch_apply wined3d-CSMT_Main/0083-wined3d-Don-t-call-glFinish-before-swapping.patch
patch_apply wined3d-CSMT_Main/0084-wined3d-wined3d_-_query_issue-never-fails.patch
patch_apply wined3d-CSMT_Main/0085-wined3d-Add-query-support-to-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0086-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch
patch_apply wined3d-CSMT_Main/0087-wined3d-Poll-queries-automatically-in-the-CS.patch
patch_apply wined3d-CSMT_Main/0088-wined3d-Introduce-a-separate-queue-for-priority-comm.patch
patch_apply wined3d-CSMT_Main/0089-wined3d-Destroy-queries-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0090-wined3d-Separate-main-and-worker-thread-query-state.patch
patch_apply wined3d-CSMT_Main/0091-wined3d-Don-t-poll-queries-that-failed-to-start.patch
patch_apply wined3d-CSMT_Main/0092-wined3d-Remove-restated-queries-from-the-poll-list.patch
patch_apply wined3d-CSMT_Main/0093-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch
patch_apply wined3d-CSMT_Main/0094-wined3d-Put-this-into-the-query-poll-patch.patch
patch_apply wined3d-CSMT_Main/0095-wined3d-Send-update_surface-commands-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0096-wined3d-Send-texture-preloads-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0097-wined3d-Send-surface-preloads-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0098-wined3d-Send-update_texture-calls-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0099-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch
patch_apply wined3d-CSMT_Main/0100-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch
patch_apply wined3d-CSMT_Main/0101-wined3d-Handle-evit_managed_resources-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0102-wined3d-Send-flips-through-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0103-wined3d-Introduce-resource-fencing.patch
patch_apply wined3d-CSMT_Main/0104-wined3d-Fence-update_texture-and-update_surface-call.patch
patch_apply wined3d-CSMT_Main/0105-wined3d-Dirtify-resources-on-unmap.patch
patch_apply wined3d-CSMT_Main/0106-wined3d-Fence-texture-reads-in-draws.patch
patch_apply wined3d-CSMT_Main/0107-wined3d-Fence-render-targets-and-depth-stencils.patch
patch_apply wined3d-CSMT_Main/0108-wined3d-Fence-blit-operations.patch
patch_apply wined3d-CSMT_Main/0109-wined3d-Fence-color_fill-operations.patch
patch_apply wined3d-CSMT_Main/0110-wined3d-Fence-clear-calls.patch
patch_apply wined3d-CSMT_Main/0111-wined3d-Fence-present-calls.patch
patch_apply wined3d-CSMT_Main/0112-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch
patch_apply wined3d-CSMT_Main/0113-wined3d-Dirtify-changed-textures-through-the-command.patch
patch_apply wined3d-CSMT_Main/0114-wined3d-Wrap-GL-BOs-in-a-structure.patch
patch_apply wined3d-CSMT_Main/0115-wined3d-Separate-resource-map-and-draw-buffers.patch
patch_apply wined3d-CSMT_Main/0116-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch
patch_apply wined3d-CSMT_Main/0117-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch
patch_apply wined3d-CSMT_Main/0118-wined3d-Unset-some-objects-in-state_init_default.patch
patch_apply wined3d-CSMT_Main/0119-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch
patch_apply wined3d-CSMT_Main/0120-wined3d-Use-double-buffered-buffers-for-multithreade.patch
patch_apply wined3d-CSMT_Main/0121-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch
patch_apply wined3d-CSMT_Main/0122-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch
patch_apply wined3d-CSMT_Main/0123-wined3d-Accelerate-DISCARD-buffer-maps.patch
patch_apply wined3d-CSMT_Main/0124-wined3d-Accelerate-READONLY-buffer-maps.patch
patch_apply wined3d-CSMT_Main/0125-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0126-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch
patch_apply wined3d-CSMT_Main/0127-wined3d-Send-buffer-preloads-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0128-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch
patch_apply wined3d-CSMT_Main/0129-wined3d-Separate-GL-buffer-discard-control-from-igno.patch
patch_apply wined3d-CSMT_Main/0130-wined3d-Create-buffers-before-mapping-them.patch
patch_apply wined3d-CSMT_Main/0131-wined3d-Destroy-views-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0132-wined3d-Remove-another-glFinish.patch
patch_apply wined3d-CSMT_Main/0133-wined3d-Destroy-vertex-declarations-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0134-wined3d-Destroy-shaders-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0135-wined3d-Create-VBOs-through-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0136-wined3d-Clean-up-resource-data-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0137-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0138-wined3d-Clean-up-volume-resource-data-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0139-wined3d-Clean-up-surfaces-through-the-cs.patch
patch_apply wined3d-CSMT_Main/0140-wined3d-Clean-up-texture-resources-through-the-cs.patch
patch_apply wined3d-CSMT_Main/0141-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch
patch_apply wined3d-CSMT_Main/0142-wined3d-Unload-resources-through-the-CS-in-device_re.patch
patch_apply wined3d-CSMT_Main/0143-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch
patch_apply wined3d-CSMT_Main/0144-wined3d-Remove-software-cursor-support.patch
patch_apply wined3d-CSMT_Main/0145-wined3d-Create-dummy-textures-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0146-wined3d-Create-the-initial-context-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0147-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch
patch_apply wined3d-CSMT_Main/0148-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch
patch_apply wined3d-CSMT_Main/0149-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch
patch_apply wined3d-CSMT_Main/0150-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch
patch_apply wined3d-CSMT_Main/0151-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch
patch_apply wined3d-CSMT_Main/0152-wined3d-Use-an-event-to-block-the-worker-thread-when.patch
patch_apply wined3d-CSMT_Main/0153-wined3d-Fence-preload-operations.patch
patch_apply wined3d-CSMT_Main/0154-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch
patch_apply wined3d-CSMT_Main/0155-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch
patch_apply wined3d-CSMT_Main/0156-wined3d-Completely-reset-the-state-on-reset.patch
patch_apply wined3d-CSMT_Main/0157-wined3d-Send-getdc-and-releasedc-through-the-command.patch
patch_apply wined3d-CSMT_Main/0158-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch
patch_apply wined3d-CSMT_Main/0159-wined3d-Wait-only-for-the-buffer-to-be-idle.patch
patch_apply wined3d-CSMT_Main/0160-wined3d-Add-a-comment-about-worker-thread-lag.patch
patch_apply wined3d-CSMT_Main/0161-wined3d-Remove-the-texture-destroy-glFinish.patch
patch_apply wined3d-CSMT_Main/0162-wined3d-Move-FBO-destruction-into-the-worker-thread.patch
patch_apply wined3d-CSMT_Main/0163-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch
patch_apply wined3d-CSMT_Main/0164-Winex11-complain-about-glfinish.patch
patch_apply wined3d-CSMT_Main/0165-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch
patch_apply wined3d-CSMT_Main/0166-wined3d-Remove-the-device_reset-CS-sync-fixme.patch
patch_apply wined3d-CSMT_Main/0167-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch
patch_apply wined3d-CSMT_Main/0168-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch
patch_apply wined3d-CSMT_Main/0169-wined3d-Don-t-sync-on-redundant-discard-calls.patch
patch_apply wined3d-CSMT_Main/0170-wined3d-Don-t-discard-new-buffers.patch
patch_apply wined3d-CSMT_Main/0171-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch
patch_apply wined3d-CSMT_Main/0172-wined3d-Render-target-lock-hack.patch
patch_apply wined3d-CSMT_Main/0173-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch
patch_apply wined3d-CSMT_Main/0174-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch
patch_apply wined3d-CSMT_Main/0043-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
patch_apply wined3d-CSMT_Main/0044-wined3d-Move-the-framebuffer-into-wined3d_state.patch
patch_apply wined3d-CSMT_Main/0045-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch
patch_apply wined3d-CSMT_Main/0046-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch
patch_apply wined3d-CSMT_Main/0047-wined3d-Hackily-introduce-a-multithreaded-command-st.patch
patch_apply wined3d-CSMT_Main/0048-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch
patch_apply wined3d-CSMT_Main/0049-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch
patch_apply wined3d-CSMT_Main/0050-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch
patch_apply wined3d-CSMT_Main/0051-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch
patch_apply wined3d-CSMT_Main/0052-wined3d-Pass-the-state-to-draw_primitive.patch
patch_apply wined3d-CSMT_Main/0053-wined3d-Wait-for-the-cs-before-destroying-objects.patch
patch_apply wined3d-CSMT_Main/0054-wined3d-Give-the-cs-its-own-state.patch
patch_apply wined3d-CSMT_Main/0055-wined3d-Send-float-constant-updates-through-the-comm.patch
patch_apply wined3d-CSMT_Main/0056-wined3d-Request-a-glFinish-before-modifying-resource.patch
patch_apply wined3d-CSMT_Main/0057-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch
patch_apply wined3d-CSMT_Main/0058-wined3d-Don-t-call-glFinish-after-clears.patch
patch_apply wined3d-CSMT_Main/0059-wined3d-Don-t-call-glFinish-after-draws.patch
patch_apply wined3d-CSMT_Main/0060-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch
patch_apply wined3d-CSMT_Main/0061-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch
patch_apply wined3d-CSMT_Main/0062-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch
patch_apply wined3d-CSMT_Main/0063-wined3d-Don-t-store-viewport-pointers-in-the-command.patch
patch_apply wined3d-CSMT_Main/0064-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch
patch_apply wined3d-CSMT_Main/0065-wined3d-Send-base-vertex-index-updates-through-the-c.patch
patch_apply wined3d-CSMT_Main/0066-wined3d-Send-primitive-type-updates-through-the-comm.patch
patch_apply wined3d-CSMT_Main/0067-wined3d-Send-bool-constant-updates-through-the-comma.patch
patch_apply wined3d-CSMT_Main/0068-wined3d-Send-int-constant-updates-through-the-comman.patch
patch_apply wined3d-CSMT_Main/0069-wined3d-Send-light-updates-through-the-command-strea.patch
patch_apply wined3d-CSMT_Main/0070-wined3d-Prevent-the-command-stream-from-running-ahea.patch
patch_apply wined3d-CSMT_Main/0071-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch
patch_apply wined3d-CSMT_Main/0072-wined3d-Run-the-cs-asynchronously.patch
patch_apply wined3d-CSMT_Main/0073-wined3d-Send-blits-through-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0074-wined3d-Put-update_surface-checks-back-in-place.patch
patch_apply wined3d-CSMT_Main/0075-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch
patch_apply wined3d-CSMT_Main/0076-wined3d-Add-cs-waiting-debug-code.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-Enable-CSMT-by-default-print-a-winediag-mess.patch
patch_apply wined3d-CSMT_Main/9999-IfDefined.patch
(
echo '+ { "Stefan Dösinger", "wined3d: Merge get_pitch functions.", 2 },';
echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_sysmem.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Pass a context to read_from_framebuffer.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_drawable and surface_blt_to_drawable.", 1 },';

View File

@ -94,7 +94,7 @@ index 0000000..0439375
+#include "config.h" /* Needed to get PACKAGE_VERSION */
+
+#define WINE_FILEDESCRIPTION_STR "Wine D3D"
+#define WINE_FILENAME_STR "wined3d.dll"
+#define WINE_FILENAME_STR "wined3d-csmt.dll"
+#define WINE_FILEVERSION_STR PACKAGE_VERSION
+#define WINE_PRODUCTVERSION_STR PACKAGE_VERSION
+#define WINE_PRODUCTNAME_STR "Wine D3D"

View File

@ -1,72 +1,26 @@
From e34f6f432826634f80cefdc9311c5472eae80dad Mon Sep 17 00:00:00 2001
From fb1391dc1f2274d4336846720bb9869a3b751b0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 19 Sep 2013 14:22:24 +0200
Subject: wined3d: Merge get_pitch functions.
Subject: wined3d: Merge get_pitch functions. (v2)
---
dlls/ddraw/surface.c | 12 +++++--
dlls/wined3d/resource.c | 31 ++++++++++++++++
dlls/wined3d/surface.c | 81 ++++++++++++++++++------------------------
dlls/wined3d/surface.c | 81 ++++++++++++++++++++----------------------
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/volume.c | 28 ++-------------
dlls/wined3d/wined3d.spec | 2 +-
dlls/wined3d/wined3d_private.h | 3 +-
include/wine/wined3d.h | 3 +-
8 files changed, 81 insertions(+), 81 deletions(-)
dlls/wined3d/wined3d_private.h | 5 +--
5 files changed, 75 insertions(+), 72 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index f716cfc..da64d97 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -6212,6 +6212,10 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru
DDSURFACEDESC2 *desc = &surface->surface_desc;
struct wined3d_resource_desc wined3d_desc;
unsigned int version = texture->version;
+ UINT row_pitch, slice_pitch;
+ struct wined3d_resource *resource = wined3d_surface_get_resource(wined3d_surface);
+
+ wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch);
surface->IDirectDrawSurface7_iface.lpVtbl = &ddraw_surface7_vtbl;
surface->IDirectDrawSurface4_iface.lpVtbl = &ddraw_surface4_vtbl;
@@ -6242,7 +6246,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru
}
*desc = texture->surface_desc;
- wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &wined3d_desc);
+ wined3d_resource_get_desc(resource, &wined3d_desc);
desc->dwWidth = wined3d_desc.width;
desc->dwHeight = wined3d_desc.height;
surface->first_attached = surface;
@@ -6252,14 +6256,16 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru
if (desc->dwFlags & DDSD_LPSURFACE)
desc->u1.dwLinearSize = ~0u;
else
- desc->u1.dwLinearSize = wined3d_surface_get_pitch(wined3d_surface) * ((desc->dwHeight + 3) / 4);
+ {
+ desc->u1.dwLinearSize = row_pitch * ((desc->dwHeight + 3) / 4);
+ }
desc->dwFlags |= DDSD_LINEARSIZE;
desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_PITCH);
}
else
{
if (!(desc->dwFlags & DDSD_LPSURFACE))
- desc->u1.lPitch = wined3d_surface_get_pitch(wined3d_surface);
+ desc->u1.lPitch = row_pitch;
desc->dwFlags |= DDSD_PITCH;
desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_LINEARSIZE);
}
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index e9e586f..648882e 100644
index 1891165..0968cd2 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -405,3 +405,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
@@ -414,3 +414,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
else
resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
}
+
+void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+ UINT *slice_pitch)
+{
+ unsigned int alignment;
@ -97,7 +51,7 @@ index e9e586f..648882e 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 1ea8e61..5460f79 100644
index 3b033db..bb2278d 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)
@ -178,12 +132,10 @@ index 1ea8e61..5460f79 100644
context_release(context);
@@ -1931,25 +1933,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
return WINED3D_OK;
}
@@ -1933,21 +1935,10 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
-DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
-{
DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
{
- unsigned int alignment;
- DWORD pitch;
-
@ -199,12 +151,14 @@ index 1ea8e61..5460f79 100644
- TRACE("Returning %u.\n", pitch);
-
- return pitch;
-}
-
+ UINT row_pitch, slice_pitch;
+ const struct wined3d_resource *resource = &surface->resource;
+ wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch);
+ return row_pitch;
}
HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y)
{
LONG w, h;
@@ -2130,20 +2113,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -2109,20 +2100,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
@ -232,7 +186,7 @@ index 1ea8e61..5460f79 100644
}
/* The format might be changed to a format that needs conversion.
@@ -2763,7 +2747,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2742,7 +2734,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
@ -241,7 +195,7 @@ index 1ea8e61..5460f79 100644
map_desc->slice_pitch = 0;
if (!rect)
@@ -2890,6 +2874,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2869,6 +2861,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
int i;
BOOL srcIsUpsideDown;
struct wined3d_bo_address data;
@ -249,7 +203,7 @@ index 1ea8e61..5460f79 100644
surface_get_memory(surface, &data, dst_location);
@@ -2926,8 +2911,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2905,8 +2898,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
}
/* Setup pixel store pack state -- to glReadPixels into the correct place */
@ -260,7 +214,7 @@ index 1ea8e61..5460f79 100644
checkGLcall("glPixelStorei");
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
@@ -2944,7 +2929,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
@@ -2923,7 +2916,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. */
@ -271,7 +225,7 @@ index 1ea8e61..5460f79 100644
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -4125,7 +4112,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4107,7 +4102,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;
@ -280,7 +234,7 @@ index 1ea8e61..5460f79 100644
struct wined3d_bo_address data;
struct wined3d_format format;
POINT dst_point = {0, 0};
@@ -4213,7 +4200,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4195,7 +4190,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_bind_and_dirtify(texture, context, srgb);
width = surface->resource.width;
@ -289,7 +243,7 @@ index 1ea8e61..5460f79 100644
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -4251,9 +4238,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4233,9 +4228,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
@ -301,7 +255,7 @@ index 1ea8e61..5460f79 100644
data.addr = mem;
}
else if (conversion)
@@ -4273,14 +4260,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4255,14 +4250,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
@ -385,31 +339,11 @@ index 424938a..b672d4a 100644
}
if (!box)
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index bc1129f..fcabd53 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -182,6 +182,7 @@
@ cdecl wined3d_resource_get_desc(ptr ptr)
@ cdecl wined3d_resource_get_parent(ptr)
+@ cdecl wined3d_resource_get_pitch(ptr ptr ptr)
@ cdecl wined3d_resource_get_priority(ptr)
@ cdecl wined3d_resource_set_parent(ptr ptr)
@ cdecl wined3d_resource_set_priority(ptr long)
@@ -227,7 +228,6 @@
@ cdecl wined3d_surface_get_flip_status(ptr long)
@ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr)
@ cdecl wined3d_surface_get_parent(ptr)
-@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_get_render_target_data(ptr ptr)
@ cdecl wined3d_surface_get_resource(ptr)
@ cdecl wined3d_surface_getdc(ptr ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0f181f3..9e6cb5e 100644
index 5786db0..7f989dc 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2136,6 +2136,7 @@ struct wined3d_resource
@@ -2162,6 +2162,7 @@ struct wined3d_resource
UINT size;
DWORD priority;
void *heap_memory;
@ -417,7 +351,16 @@ index 0f181f3..9e6cb5e 100644
struct list resource_list_entry;
void *parent;
@@ -2300,7 +2301,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume) DECLSPEC_HIDDEN
@@ -2189,6 +2190,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;
+void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+ UINT *slice_pitch) DECLSPEC_HIDDEN;
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
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;
@ -425,7 +368,7 @@ index 0f181f3..9e6cb5e 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;
@@ -2350,7 +2350,6 @@ struct wined3d_surface
@@ -2376,7 +2378,6 @@ struct wined3d_surface
DWORD flags;
@ -433,27 +376,6 @@ index 0f181f3..9e6cb5e 100644
UINT pow2Width;
UINT pow2Height;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index a1803bb..fc91d02 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2427,6 +2427,8 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv
void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
struct wined3d_resource_desc *desc);
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
+void __cdecl wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+ UINT *slice_pitch);
DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource);
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent);
DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority);
@@ -2485,7 +2487,6 @@ HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *sur
HRESULT __cdecl wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags);
HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y);
void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
-DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_get_render_target_data(struct wined3d_surface *surface,
struct wined3d_surface *render_target);
struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
--
2.4.2
2.4.5

View File

@ -1,4 +1,4 @@
From 680c99d5fb4ab94a37f934c66bf9c22a326b0dd2 Mon Sep 17 00:00:00 2001
From 0dd2ded31943d0729f811330cc2afa0d3b050dc8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 3 Oct 2013 12:47:01 +0200
Subject: wined3d: Move load_location into the resource.
@ -16,7 +16,7 @@ and downloading from textures will be delegated to surfaces / volumes.
6 files changed, 91 insertions(+), 36 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 5931232..2386410 100644
index 727e8be..3470a89 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1128,12 +1128,20 @@ static void wined3d_buffer_location_invalidated(struct wined3d_resource *resourc
@ -41,10 +41,10 @@ index 5931232..2386410 100644
static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device,
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index a63eab8..7f283f5 100644
index 35a1a14..39df397 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -378,3 +378,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
@@ -461,3 +461,53 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
resource->resource_ops->resource_location_invalidated(resource, location);
}
@ -99,10 +99,10 @@ index a63eab8..7f283f5 100644
+ resource->resource_ops->resource_load_location(resource, context, location);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b9d8968..5f6a0c2 100644
index a59e401..9e46545 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1281,12 +1281,20 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
@@ -1227,12 +1227,20 @@ static void wined3d_surface_location_invalidated(struct wined3d_resource *resour
wined3d_texture_set_dirty(surface->container);
}
@ -123,7 +123,7 @@ index b9d8968..5f6a0c2 100644
};
static const struct wined3d_surface_ops surface_ops =
@@ -4195,7 +4203,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
@@ -4062,7 +4070,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
@ -132,7 +132,7 @@ index b9d8968..5f6a0c2 100644
{
switch (location)
{
@@ -4535,7 +4543,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
@@ -4394,7 +4402,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
if (WARN_ON(d3d_surface))
{
@ -142,10 +142,10 @@ index b9d8968..5f6a0c2 100644
WARN("Operation requires %#x access, but surface only has %#x.\n",
required_access, surface->resource.access_flags);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 6d82ce6..fc0f6d6 100644
index fe7936d..89f94f3 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1039,12 +1039,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r
@@ -950,12 +950,20 @@ static void wined3d_texture_load_location_invalidated(struct wined3d_resource *r
ERR("Should not be called on textures.\n");
}
@ -167,7 +167,7 @@ index 6d82ce6..fc0f6d6 100644
static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc,
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 6b685bd..e2c9d4a 100644
index 94eb77e..f82347d 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -137,27 +137,6 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
@ -224,7 +224,7 @@ index 6b685bd..e2c9d4a 100644
if ((volume->resource.access_flags & required_access) != required_access)
{
ERR("Operation requires %#x access, but volume only has %#x.\n",
@@ -333,7 +308,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
@@ -337,7 +312,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode)
{
wined3d_texture_prepare_texture(volume->container, context, srgb_mode);
@ -233,7 +233,7 @@ index 6b685bd..e2c9d4a 100644
srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB);
}
@@ -392,7 +367,7 @@ static void volume_unload(struct wined3d_resource *resource)
@@ -396,7 +371,7 @@ static void volume_unload(struct wined3d_resource *resource)
if (volume_prepare_system_memory(volume))
{
context = context_acquire(device, NULL);
@ -242,7 +242,7 @@ index 6b685bd..e2c9d4a 100644
context_release(context);
wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM);
}
@@ -547,7 +522,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -552,7 +527,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
if (flags & WINED3D_MAP_DISCARD)
wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER);
else
@ -251,7 +251,7 @@ index 6b685bd..e2c9d4a 100644
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo));
@@ -585,7 +560,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -590,7 +565,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
{
context = context_acquire(device, NULL);
@ -260,7 +260,7 @@ index 6b685bd..e2c9d4a 100644
context_release(context);
}
base_memory = volume->resource.heap_memory;
@@ -700,6 +675,7 @@ static const struct wined3d_resource_ops volume_resource_ops =
@@ -705,6 +680,7 @@ static const struct wined3d_resource_ops volume_resource_ops =
volume_resource_decref,
volume_unload,
wined3d_volume_location_invalidated,
@ -269,10 +269,10 @@ index 6b685bd..e2c9d4a 100644
static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b533108..4db209a 100644
index 936950f..e1e490e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2069,6 +2069,8 @@ struct wined3d_resource_ops
@@ -2138,6 +2138,8 @@ struct wined3d_resource_ops
ULONG (*resource_decref)(struct wined3d_resource *resource);
void (*resource_unload)(struct wined3d_resource *resource);
void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location);
@ -281,13 +281,15 @@ index b533108..4db209a 100644
};
struct wined3d_resource
@@ -2119,15 +2121,18 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
@@ -2190,17 +2192,20 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
void *parent, const struct wined3d_parent_ops *parent_ops,
const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN;
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
+DWORD wined3d_resource_access_from_location(DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
UINT *slice_pitch) DECLSPEC_HIDDEN;
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
@ -302,5 +304,5 @@ index b533108..4db209a 100644
/* Tests show that the start address of resources is 32 byte aligned */
#define RESOURCE_ALIGNMENT 16
--
2.2.1
2.4.5

View File

@ -1,4 +1,4 @@
From 4dedb87fa2626251d0c7c0d5f861f8665bfa289b Mon Sep 17 00:00:00 2001
From 441b1121637291e4f7e87640911111c8f6398c4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 16 Jan 2014 22:07:17 +0100
Subject: wined3d: Move volume PBO infrastructure into the resource.
@ -10,10 +10,10 @@ Subject: wined3d: Move volume PBO infrastructure into the resource.
3 files changed, 82 insertions(+), 79 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 61a829d..1fb2370 100644
index 39df397..5f0a98e 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -301,7 +301,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags)
@@ -373,7 +373,7 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags)
return ret;
}
@ -22,7 +22,7 @@ index 61a829d..1fb2370 100644
{
if (d3d_flags & WINED3D_MAP_READONLY)
return GL_READ_ONLY_ARB;
@@ -437,3 +437,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource,
@@ -511,3 +511,65 @@ void wined3d_resource_load_location(struct wined3d_resource *resource,
resource->resource_ops->resource_load_location(resource, context, location);
}
@ -89,7 +89,7 @@ index 61a829d..1fb2370 100644
+ }
+}
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 99caab8..5fe223b 100644
index 17502ee..de96508 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,
@ -217,7 +217,7 @@ index 99caab8..5fe223b 100644
HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
@@ -586,7 +548,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
@@ -587,7 +549,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
else
wined3d_resource_load_location(&volume->resource, context, volume->resource.map_binding);
@ -226,7 +226,7 @@ index 99caab8..5fe223b 100644
context_release(context);
TRACE("Base memory pointer %p.\n", base_memory);
@@ -645,30 +607,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
@@ -646,30 +608,6 @@ struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resour
return volume_from_resource(resource);
}
@ -257,7 +257,7 @@ index 99caab8..5fe223b 100644
HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
{
struct wined3d_device *device = volume->resource.device;
@@ -682,7 +620,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
@@ -683,7 +621,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
}
context = context_acquire(device, NULL);
@ -267,10 +267,10 @@ index 99caab8..5fe223b 100644
volume->resource.map_count--;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b8dbde3..460e861 100644
index 53fd864..c8c44d3 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2125,6 +2125,7 @@ struct wined3d_resource
@@ -2166,6 +2166,7 @@ struct wined3d_resource
DWORD priority;
void *heap_memory, *user_memory, *bitmap_data;
UINT custom_row_pitch, custom_slice_pitch;
@ -278,12 +278,14 @@ index b8dbde3..460e861 100644
struct list resource_list_entry;
DWORD locations;
@@ -2154,12 +2155,15 @@ void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
@@ -2195,14 +2196,17 @@ 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;
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;
void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
UINT *slice_pitch) DECLSPEC_HIDDEN;
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
-GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
@ -295,7 +297,7 @@ index b8dbde3..460e861 100644
DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
@@ -2283,7 +2287,6 @@ struct wined3d_volume
@@ -2326,7 +2330,6 @@ struct wined3d_volume
DWORD flags;
GLint texture_level;
DWORD download_count;
@ -304,5 +306,5 @@ index b8dbde3..460e861 100644
static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
--
2.3.5
2.4.5

View File

@ -1,4 +1,4 @@
From 240ba2fd70e0e8ed91785aca4e4bce8044d9f129 Mon Sep 17 00:00:00 2001
From ddfa60053cfc7b215fdf041cd0e0b8401bb1a86b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 16 Sep 2013 22:44:33 +0200
Subject: wined3d: Introduce a function to retrieve resource memory.
@ -10,10 +10,10 @@ Subject: wined3d: Introduce a function to retrieve resource memory.
3 files changed, 38 insertions(+), 39 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 3308c82..7c915bd 100644
index b756bf1..40267e7 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -497,6 +497,36 @@ DWORD wined3d_resource_access_from_location(DWORD location)
@@ -506,6 +506,36 @@ DWORD wined3d_resource_access_from_location(DWORD location)
}
}
@ -51,7 +51,7 @@ index 3308c82..7c915bd 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 7e2e6c4..3e9a8ef 100644
index cf21b54..a6b98f1 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,7 +112,7 @@ index 7e2e6c4..3e9a8ef 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,
@@ -2878,7 +2845,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
@@ -2865,7 +2832,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
struct wined3d_bo_address data;
UINT row_pitch, slice_pitch;
@ -121,7 +121,7 @@ index 7e2e6c4..3e9a8ef 100644
/* Context_release does not restore the original context in case of
* nested context_acquire calls. Only read_from_framebuffer and
@@ -4017,8 +3984,8 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
@@ -4007,8 +3974,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 7e2e6c4..3e9a8ef 100644
if (dst.buffer_object)
{
@@ -4230,7 +4197,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
@@ -4220,7 +4187,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
@ -142,18 +142,18 @@ index 7e2e6c4..3e9a8ef 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 f3e8f2a..f8733ad 100644
index f28994d..a640145 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2172,6 +2172,8 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPE
@@ -2198,6 +2198,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;
+void wined3d_resource_get_memory(const struct wined3d_resource *resource,
+ DWORD location, struct wined3d_bo_address *data) DECLSPEC_HIDDEN;
void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
UINT *slice_pitch) DECLSPEC_HIDDEN;
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
--
2.4.2
2.4.5

View File

@ -1,101 +0,0 @@
From 89a2597787017d7bc966c2a146fa4c4fc59e9ebb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 23 Sep 2013 23:58:41 +0200
Subject: wined3d: Don't call the public map function in
surface_convert_format.
TODO: Creating a helper surface and releasing it won't work with the CS.
surface_cpu_blt will be called via the CS, so it can't call external
methods that enqueue commands in the stream.
---
dlls/wined3d/surface.c | 57 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 38 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 303a0dc..045ede5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2253,11 +2253,14 @@ static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_fo
static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt)
{
- struct wined3d_map_desc src_map, dst_map;
+ 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;
struct wined3d_texture *ret = NULL;
struct wined3d_resource_desc desc;
struct wined3d_surface *dst;
+ struct wined3d_context *context = NULL;
+ struct wined3d_device *device = source->resource.device;
conv = find_converter(source->resource.format->id, to_fmt);
if (!conv)
@@ -2281,30 +2284,46 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *so
}
dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0));
- memset(&src_map, 0, sizeof(src_map));
- memset(&dst_map, 0, sizeof(dst_map));
+ wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch);
+ wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch);
- if (FAILED(wined3d_surface_map(source, &src_map, NULL, WINED3D_MAP_READONLY)))
- {
- ERR("Failed to lock the source surface.\n");
- wined3d_texture_decref(ret);
- return NULL;
- }
- if (FAILED(wined3d_surface_map(dst, &dst_map, NULL, 0)))
- {
- ERR("Failed to lock the destination surface.\n");
- wined3d_surface_unmap(source);
- wined3d_texture_decref(ret);
- return NULL;
- }
+ if (device->d3d_initialized)
+ context = context_acquire(device, NULL);
+
+ wined3d_resource_load_location(&source->resource, context, source->resource.map_binding);
+ src_data = wined3d_resource_get_map_ptr(&source->resource, context, WINED3D_MAP_READONLY);
+ if (!src_data)
+ goto error;
- conv->convert(src_map.data, dst_map.data, src_map.row_pitch, dst_map.row_pitch,
+ if (!wined3d_resource_prepare_map_memory(&dst->resource, context))
+ goto error;
+ dst_data = wined3d_resource_get_map_ptr(&dst->resource, context, 0);
+ if (!dst_data)
+ goto error;
+
+ conv->convert(src_data, dst_data, src_row_pitch, dst_row_pitch,
source->resource.width, source->resource.height);
- wined3d_surface_unmap(dst);
- wined3d_surface_unmap(source);
+ wined3d_resource_release_map_ptr(&dst->resource, context);
+ wined3d_resource_release_map_ptr(&source->resource, context);
+
+ if (context)
+ context_release(context);
return ret;
+
+error:
+ ERR("Surface conversion failed.\n");
+
+ if (src_data)
+ wined3d_resource_release_map_ptr(&source->resource, context);
+ if (dst_data)
+ wined3d_resource_release_map_ptr(&ret->resource, context);
+ if (ret)
+ wined3d_texture_decref(ret);
+ if (context)
+ context_release(context);
+ return NULL;
}
static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height,
--
2.1.3

View File

@ -1,277 +1,101 @@
From 9d0010d5add477e39747ac3e458d16b5b1fa101f Mon Sep 17 00:00:00 2001
From 89a2597787017d7bc966c2a146fa4c4fc59e9ebb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 24 Sep 2013 00:31:39 +0200
Subject: wined3d: Don't call the public map function in surface_cpu_blt.
Date: Mon, 23 Sep 2013 23:58:41 +0200
Subject: wined3d: Don't call the public map function in
surface_convert_format.
TODO: Creating a helper surface and releasing it won't work with the CS.
surface_cpu_blt will be called via the CS, so it can't call external
methods that enqueue commands in the stream.
---
dlls/wined3d/surface.c | 107 +++++++++++++++++++++++++++++++++----------------
1 file changed, 72 insertions(+), 35 deletions(-)
dlls/wined3d/surface.c | 57 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 38 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ff83f29..df8aea6 100644
index 303a0dc..045ede5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4428,21 +4428,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
const struct wined3d_format *src_format, *dst_format;
unsigned int src_fmt_flags, dst_fmt_flags;
struct wined3d_texture *src_texture = NULL;
- struct wined3d_map_desc dst_map, src_map;
+ void *src_data = NULL, *dst_data = NULL;
@@ -2253,11 +2253,14 @@ static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_fo
static struct wined3d_texture *surface_convert_format(struct wined3d_surface *source, enum wined3d_format_id to_fmt)
{
- struct wined3d_map_desc src_map, dst_map;
+ void *dst_data = NULL, *src_data = NULL;
+ UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
const BYTE *sbase = NULL;
HRESULT hr = WINED3D_OK;
const BYTE *sbuf;
BYTE *dbuf;
int x, y;
+ struct wined3d_device *device = dst_surface->resource.device;
const struct d3dfmt_converter_desc *conv;
struct wined3d_texture *ret = NULL;
struct wined3d_resource_desc desc;
struct wined3d_surface *dst;
+ struct wined3d_context *context = NULL;
+ struct wined3d_device *device = source->resource.device;
TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect),
flags, fx, debug_d3dtexturefiltertype(filter));
conv = find_converter(source->resource.format->id, to_fmt);
if (!conv)
@@ -2281,30 +2284,46 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_surface *so
}
dst = surface_from_resource(wined3d_texture_get_sub_resource(ret, 0));
- memset(&src_map, 0, sizeof(src_map));
- memset(&dst_map, 0, sizeof(dst_map));
+ wined3d_resource_get_pitch(&source->resource, &src_row_pitch, &src_slice_pitch);
+ wined3d_resource_get_pitch(&ret->resource, &dst_row_pitch, &dst_slice_pitch);
- if (FAILED(wined3d_surface_map(source, &src_map, NULL, WINED3D_MAP_READONLY)))
- {
- ERR("Failed to lock the source surface.\n");
- wined3d_texture_decref(ret);
- return NULL;
- }
- if (FAILED(wined3d_surface_map(dst, &dst_map, NULL, 0)))
- {
- ERR("Failed to lock the destination surface.\n");
- wined3d_surface_unmap(source);
- wined3d_texture_decref(ret);
- return NULL;
- }
+ if (device->d3d_initialized)
+ context = context_acquire(device, NULL);
+
+ if (!wined3d_resource_prepare_map_memory(&dst_surface->resource, context))
+ {
+ hr = E_OUTOFMEMORY;
+ wined3d_resource_load_location(&source->resource, context, source->resource.map_binding);
+ src_data = wined3d_resource_get_map_ptr(&source->resource, context, WINED3D_MAP_READONLY);
+ if (!src_data)
+ goto error;
- conv->convert(src_map.data, dst_map.data, src_map.row_pitch, dst_map.row_pitch,
+ if (!wined3d_resource_prepare_map_memory(&dst->resource, context))
+ goto error;
+ dst_data = wined3d_resource_get_map_ptr(&dst->resource, context, 0);
+ if (!dst_data)
+ goto error;
+ }
+ wined3d_resource_load_location(&dst_surface->resource, context, dst_surface->resource.map_binding);
+
if (src_surface == dst_surface)
{
- wined3d_surface_map(dst_surface, &dst_map, NULL, 0);
- src_map = dst_map;
+ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0);
+ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
+ src_data = dst_data;
+ src_row_pitch = dst_row_pitch;
src_format = dst_surface->resource.format;
dst_format = src_format;
dst_fmt_flags = dst_surface->container->resource.format_flags;
@@ -4454,6 +4469,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
dst_fmt_flags = dst_surface->container->resource.format_flags;
if (src_surface)
{
+ if (!wined3d_resource_prepare_map_memory(&src_surface->resource, context))
+ {
+ hr = E_OUTOFMEMORY;
+ goto error;
+ }
+ conv->convert(src_data, dst_data, src_row_pitch, dst_row_pitch,
source->resource.width, source->resource.height);
- wined3d_surface_unmap(dst);
- wined3d_surface_unmap(source);
+ wined3d_resource_release_map_ptr(&dst->resource, context);
+ wined3d_resource_release_map_ptr(&source->resource, context);
+
if (dst_surface->resource.format->id != src_surface->resource.format->id)
{
if (!(src_texture = surface_convert_format(src_surface, dst_format->id)))
@@ -4464,7 +4485,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
}
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0));
}
- wined3d_surface_map(src_surface, &src_map, NULL, WINED3D_MAP_READONLY);
+ wined3d_resource_load_location(&src_surface->resource, context, src_surface->resource.map_binding);
+ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
+ src_data = wined3d_resource_get_map_ptr(&src_surface->resource, context, 0);
src_format = src_surface->resource.format;
src_fmt_flags = src_surface->container->resource.format_flags;
}
@@ -4474,7 +4497,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
src_fmt_flags = dst_fmt_flags;
}
- wined3d_surface_map(dst_surface, &dst_map, dst_rect, 0);
+ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
+ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0);
}
bpp = dst_surface->resource.format->byte_count;
@@ -4485,15 +4509,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
width = (dst_rect->right - dst_rect->left) * bpp;
if (src_surface)
- sbase = (BYTE *)src_map.data
- + ((src_rect->top / src_format->block_height) * src_map.row_pitch)
+ sbase = (BYTE *)src_data
+ + ((src_rect->top / src_format->block_height) * src_row_pitch)
+ ((src_rect->left / src_format->block_width) * src_format->block_byte_count);
- if (src_surface != dst_surface)
- dbuf = dst_map.data;
- else
- dbuf = (BYTE *)dst_map.data
- + ((dst_rect->top / dst_format->block_height) * dst_map.row_pitch)
- + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count);
+ dbuf = (BYTE *)dst_data
+ + ((dst_rect->top / dst_format->block_height) * dst_row_pitch)
+ + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count);
if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS)
{
@@ -4528,7 +4549,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
}
hr = surface_cpu_blt_compressed(sbase, dbuf,
- src_map.row_pitch, dst_map.row_pitch, dstwidth, dstheight,
+ src_row_pitch, dst_row_pitch, dstwidth, dstheight,
src_format, flags, fx);
goto release;
}
@@ -4536,7 +4557,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
/* First, all the 'source-less' blits */
if (flags & WINEDDBLT_COLORFILL)
{
- hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_map.row_pitch, fx->u5.dwFillColor);
+ hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_row_pitch, fx->u5.dwFillColor);
flags &= ~WINEDDBLT_COLORFILL;
}
@@ -4585,19 +4606,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
for (y = 0; y < dstheight; ++y)
{
memcpy(dbuf, sbuf, width);
- sbuf += src_map.row_pitch;
- dbuf += dst_map.row_pitch;
+ sbuf += src_row_pitch;
+ dbuf += dst_row_pitch;
}
}
else if (dst_rect->top > src_rect->top)
{
/* Copy from bottom upwards. */
- sbuf += src_map.row_pitch * dstheight;
- dbuf += dst_map.row_pitch * dstheight;
+ sbuf += src_row_pitch * dstheight;
+ dbuf += dst_row_pitch * dstheight;
for (y = 0; y < dstheight; ++y)
{
- sbuf -= src_map.row_pitch;
- dbuf -= dst_map.row_pitch;
+ sbuf -= src_row_pitch;
+ dbuf -= dst_row_pitch;
memcpy(dbuf, sbuf, width);
}
}
@@ -4607,8 +4628,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
for (y = 0; y < dstheight; ++y)
{
memmove(dbuf, sbuf, width);
- sbuf += src_map.row_pitch;
- dbuf += dst_map.row_pitch;
+ sbuf += src_row_pitch;
+ dbuf += dst_row_pitch;
}
}
}
@@ -4617,9 +4638,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
/* Stretching in y direction only. */
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
- sbuf = sbase + (sy >> 16) * src_map.row_pitch;
+ sbuf = sbase + (sy >> 16) * src_row_pitch;
memcpy(dbuf, sbuf, width);
- dbuf += dst_map.row_pitch;
+ dbuf += dst_row_pitch;
}
}
}
@@ -4629,13 +4650,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
int last_sy = -1;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
- sbuf = sbase + (sy >> 16) * src_map.row_pitch;
+ sbuf = sbase + (sy >> 16) * src_row_pitch;
if ((sy >> 16) == (last_sy >> 16))
{
/* This source row is the same as last source row -
* Copy the already stretched row. */
- memcpy(dbuf, dbuf - dst_map.row_pitch, width);
+ memcpy(dbuf, dbuf - dst_row_pitch, width);
}
else
{
@@ -4682,14 +4703,14 @@ do { \
}
#undef STRETCH_ROW
}
- dbuf += dst_map.row_pitch;
+ dbuf += dst_row_pitch;
last_sy = sy;
}
}
}
else
{
- LONG dstyinc = dst_map.row_pitch, dstxinc = bpp;
+ LONG dstyinc = dst_row_pitch, dstxinc = bpp;
DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff;
DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff;
if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE))
@@ -4739,7 +4760,7 @@ do { \
LONG tmpxy;
dTopLeft = dbuf;
dTopRight = dbuf + ((dstwidth - 1) * bpp);
- dBottomLeft = dTopLeft + ((dstheight - 1) * dst_map.row_pitch);
+ dBottomLeft = dTopLeft + ((dstheight - 1) * dst_row_pitch);
dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp);
if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY)
@@ -4822,7 +4843,7 @@ do { \
type *d = (type *)dbuf, *dx, tmp; \
for (y = sy = 0; y < dstheight; ++y, sy += yinc) \
{ \
- s = (const type *)(sbase + (sy >> 16) * src_map.row_pitch); \
+ s = (const type *)(sbase + (sy >> 16) * src_row_pitch); \
dx = d; \
for (x = sx = 0; x < dstwidth; ++x, sx += xinc) \
{ \
@@ -4855,7 +4876,7 @@ do { \
BYTE *d = dbuf, *dx;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
- sbuf = sbase + (sy >> 16) * src_map.row_pitch;
+ sbuf = sbase + (sy >> 16) * src_row_pitch;
dx = d;
for (x = sx = 0; x < dstwidth; ++x, sx+= xinc)
{
@@ -4886,6 +4907,10 @@ do { \
}
}
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->resource.map_binding);
+ if (dst_surface->container)
+ wined3d_texture_set_dirty(dst_surface->container);
+
error:
if (flags && FIXME_ON(d3d_surface))
{
@@ -4893,12 +4918,24 @@ error:
}
release:
- wined3d_surface_unmap(dst_surface);
- if (src_surface && src_surface != dst_surface)
- wined3d_surface_unmap(src_surface);
+ if (dst_data)
+ {
+ wined3d_resource_release_map_ptr(&dst_surface->resource, context);
+
+ if (dst_surface->container->swapchain
+ && dst_surface->container == dst_surface->container->swapchain->front_buffer)
+ {
+ dst_surface->lockedRect = *dst_rect;
+ dst_surface->surface_ops->surface_frontbuffer_updated(dst_surface);
+ }
+ }
+ if (src_surface && src_surface != dst_surface && src_data)
+ wined3d_resource_release_map_ptr(&src_surface->resource, context);
/* Release the converted surface, if any. */
if (src_texture)
wined3d_texture_decref(src_texture);
+ if (context)
+ context_release(context);
return hr;
return ret;
+
+error:
+ ERR("Surface conversion failed.\n");
+
+ if (src_data)
+ wined3d_resource_release_map_ptr(&source->resource, context);
+ if (dst_data)
+ wined3d_resource_release_map_ptr(&ret->resource, context);
+ if (ret)
+ wined3d_texture_decref(ret);
+ if (context)
+ context_release(context);
+ return NULL;
}
static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height,
--
2.4.2
2.1.3

View File

@ -0,0 +1,277 @@
From 9d0010d5add477e39747ac3e458d16b5b1fa101f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 24 Sep 2013 00:31:39 +0200
Subject: wined3d: Don't call the public map function in surface_cpu_blt.
---
dlls/wined3d/surface.c | 107 +++++++++++++++++++++++++++++++++----------------
1 file changed, 72 insertions(+), 35 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ff83f29..df8aea6 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4428,21 +4428,36 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
const struct wined3d_format *src_format, *dst_format;
unsigned int src_fmt_flags, dst_fmt_flags;
struct wined3d_texture *src_texture = NULL;
- struct wined3d_map_desc dst_map, src_map;
+ void *src_data = NULL, *dst_data = NULL;
+ UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
const BYTE *sbase = NULL;
HRESULT hr = WINED3D_OK;
const BYTE *sbuf;
BYTE *dbuf;
int x, y;
+ struct wined3d_device *device = dst_surface->resource.device;
+ struct wined3d_context *context = NULL;
TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect),
flags, fx, debug_d3dtexturefiltertype(filter));
+ if (device->d3d_initialized)
+ context = context_acquire(device, NULL);
+
+ if (!wined3d_resource_prepare_map_memory(&dst_surface->resource, context))
+ {
+ hr = E_OUTOFMEMORY;
+ goto error;
+ }
+ wined3d_resource_load_location(&dst_surface->resource, context, dst_surface->resource.map_binding);
+
if (src_surface == dst_surface)
{
- wined3d_surface_map(dst_surface, &dst_map, NULL, 0);
- src_map = dst_map;
+ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0);
+ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
+ src_data = dst_data;
+ src_row_pitch = dst_row_pitch;
src_format = dst_surface->resource.format;
dst_format = src_format;
dst_fmt_flags = dst_surface->container->resource.format_flags;
@@ -4454,6 +4469,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
dst_fmt_flags = dst_surface->container->resource.format_flags;
if (src_surface)
{
+ if (!wined3d_resource_prepare_map_memory(&src_surface->resource, context))
+ {
+ hr = E_OUTOFMEMORY;
+ goto error;
+ }
+
if (dst_surface->resource.format->id != src_surface->resource.format->id)
{
if (!(src_texture = surface_convert_format(src_surface, dst_format->id)))
@@ -4464,7 +4485,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
}
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, 0));
}
- wined3d_surface_map(src_surface, &src_map, NULL, WINED3D_MAP_READONLY);
+ wined3d_resource_load_location(&src_surface->resource, context, src_surface->resource.map_binding);
+ wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
+ src_data = wined3d_resource_get_map_ptr(&src_surface->resource, context, 0);
src_format = src_surface->resource.format;
src_fmt_flags = src_surface->container->resource.format_flags;
}
@@ -4474,7 +4497,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
src_fmt_flags = dst_fmt_flags;
}
- wined3d_surface_map(dst_surface, &dst_map, dst_rect, 0);
+ wined3d_resource_get_pitch(&dst_surface->resource, &dst_row_pitch, &dst_slice_pitch);
+ dst_data = wined3d_resource_get_map_ptr(&dst_surface->resource, context, 0);
}
bpp = dst_surface->resource.format->byte_count;
@@ -4485,15 +4509,12 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
width = (dst_rect->right - dst_rect->left) * bpp;
if (src_surface)
- sbase = (BYTE *)src_map.data
- + ((src_rect->top / src_format->block_height) * src_map.row_pitch)
+ sbase = (BYTE *)src_data
+ + ((src_rect->top / src_format->block_height) * src_row_pitch)
+ ((src_rect->left / src_format->block_width) * src_format->block_byte_count);
- if (src_surface != dst_surface)
- dbuf = dst_map.data;
- else
- dbuf = (BYTE *)dst_map.data
- + ((dst_rect->top / dst_format->block_height) * dst_map.row_pitch)
- + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count);
+ dbuf = (BYTE *)dst_data
+ + ((dst_rect->top / dst_format->block_height) * dst_row_pitch)
+ + ((dst_rect->left / dst_format->block_width) * dst_format->block_byte_count);
if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS)
{
@@ -4528,7 +4549,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
}
hr = surface_cpu_blt_compressed(sbase, dbuf,
- src_map.row_pitch, dst_map.row_pitch, dstwidth, dstheight,
+ src_row_pitch, dst_row_pitch, dstwidth, dstheight,
src_format, flags, fx);
goto release;
}
@@ -4536,7 +4557,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
/* First, all the 'source-less' blits */
if (flags & WINEDDBLT_COLORFILL)
{
- hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_map.row_pitch, fx->u5.dwFillColor);
+ hr = _Blt_ColorFill(dbuf, dstwidth, dstheight, bpp, dst_row_pitch, fx->u5.dwFillColor);
flags &= ~WINEDDBLT_COLORFILL;
}
@@ -4585,19 +4606,19 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
for (y = 0; y < dstheight; ++y)
{
memcpy(dbuf, sbuf, width);
- sbuf += src_map.row_pitch;
- dbuf += dst_map.row_pitch;
+ sbuf += src_row_pitch;
+ dbuf += dst_row_pitch;
}
}
else if (dst_rect->top > src_rect->top)
{
/* Copy from bottom upwards. */
- sbuf += src_map.row_pitch * dstheight;
- dbuf += dst_map.row_pitch * dstheight;
+ sbuf += src_row_pitch * dstheight;
+ dbuf += dst_row_pitch * dstheight;
for (y = 0; y < dstheight; ++y)
{
- sbuf -= src_map.row_pitch;
- dbuf -= dst_map.row_pitch;
+ sbuf -= src_row_pitch;
+ dbuf -= dst_row_pitch;
memcpy(dbuf, sbuf, width);
}
}
@@ -4607,8 +4628,8 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
for (y = 0; y < dstheight; ++y)
{
memmove(dbuf, sbuf, width);
- sbuf += src_map.row_pitch;
- dbuf += dst_map.row_pitch;
+ sbuf += src_row_pitch;
+ dbuf += dst_row_pitch;
}
}
}
@@ -4617,9 +4638,9 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
/* Stretching in y direction only. */
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
- sbuf = sbase + (sy >> 16) * src_map.row_pitch;
+ sbuf = sbase + (sy >> 16) * src_row_pitch;
memcpy(dbuf, sbuf, width);
- dbuf += dst_map.row_pitch;
+ dbuf += dst_row_pitch;
}
}
}
@@ -4629,13 +4650,13 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
int last_sy = -1;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
- sbuf = sbase + (sy >> 16) * src_map.row_pitch;
+ sbuf = sbase + (sy >> 16) * src_row_pitch;
if ((sy >> 16) == (last_sy >> 16))
{
/* This source row is the same as last source row -
* Copy the already stretched row. */
- memcpy(dbuf, dbuf - dst_map.row_pitch, width);
+ memcpy(dbuf, dbuf - dst_row_pitch, width);
}
else
{
@@ -4682,14 +4703,14 @@ do { \
}
#undef STRETCH_ROW
}
- dbuf += dst_map.row_pitch;
+ dbuf += dst_row_pitch;
last_sy = sy;
}
}
}
else
{
- LONG dstyinc = dst_map.row_pitch, dstxinc = bpp;
+ LONG dstyinc = dst_row_pitch, dstxinc = bpp;
DWORD keylow = 0xffffffff, keyhigh = 0, keymask = 0xffffffff;
DWORD destkeylow = 0x0, destkeyhigh = 0xffffffff, destkeymask = 0xffffffff;
if (flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYDEST | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_KEYDESTOVERRIDE))
@@ -4739,7 +4760,7 @@ do { \
LONG tmpxy;
dTopLeft = dbuf;
dTopRight = dbuf + ((dstwidth - 1) * bpp);
- dBottomLeft = dTopLeft + ((dstheight - 1) * dst_map.row_pitch);
+ dBottomLeft = dTopLeft + ((dstheight - 1) * dst_row_pitch);
dBottomRight = dBottomLeft + ((dstwidth - 1) * bpp);
if (fx->dwDDFX & WINEDDBLTFX_ARITHSTRETCHY)
@@ -4822,7 +4843,7 @@ do { \
type *d = (type *)dbuf, *dx, tmp; \
for (y = sy = 0; y < dstheight; ++y, sy += yinc) \
{ \
- s = (const type *)(sbase + (sy >> 16) * src_map.row_pitch); \
+ s = (const type *)(sbase + (sy >> 16) * src_row_pitch); \
dx = d; \
for (x = sx = 0; x < dstwidth; ++x, sx += xinc) \
{ \
@@ -4855,7 +4876,7 @@ do { \
BYTE *d = dbuf, *dx;
for (y = sy = 0; y < dstheight; ++y, sy += yinc)
{
- sbuf = sbase + (sy >> 16) * src_map.row_pitch;
+ sbuf = sbase + (sy >> 16) * src_row_pitch;
dx = d;
for (x = sx = 0; x < dstwidth; ++x, sx+= xinc)
{
@@ -4886,6 +4907,10 @@ do { \
}
}
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->resource.map_binding);
+ if (dst_surface->container)
+ wined3d_texture_set_dirty(dst_surface->container);
+
error:
if (flags && FIXME_ON(d3d_surface))
{
@@ -4893,12 +4918,24 @@ error:
}
release:
- wined3d_surface_unmap(dst_surface);
- if (src_surface && src_surface != dst_surface)
- wined3d_surface_unmap(src_surface);
+ if (dst_data)
+ {
+ wined3d_resource_release_map_ptr(&dst_surface->resource, context);
+
+ if (dst_surface->container->swapchain
+ && dst_surface->container == dst_surface->container->swapchain->front_buffer)
+ {
+ dst_surface->lockedRect = *dst_rect;
+ dst_surface->surface_ops->surface_frontbuffer_updated(dst_surface);
+ }
+ }
+ if (src_surface && src_surface != dst_surface && src_data)
+ wined3d_resource_release_map_ptr(&src_surface->resource, context);
/* Release the converted surface, if any. */
if (src_texture)
wined3d_texture_decref(src_texture);
+ if (context)
+ context_release(context);
return hr;
}
--
2.4.2

Some files were not shown because too many files have changed in this diff Show More