wined3d-CSMT_Main: Reenable patchset.

For now, various conflicting changes have just been reverted.
This commit is contained in:
Sebastian Lackner 2016-02-21 23:51:33 +01:00
parent b765f1e594
commit 932dd8fbbc
176 changed files with 2271 additions and 1524 deletions

View File

@ -333,6 +333,7 @@ patch_enable_all ()
enable_winecfg_Unmounted_Devices="$1"
enable_wined3d_Accounting="$1"
enable_wined3d_CSMT_Helper="$1"
enable_wined3d_CSMT_Main="$1"
enable_wined3d_DXTn="$1"
enable_wined3d_Geforce_425M="$1"
enable_wined3d_MESA_GPU_Info="$1"
@ -1143,6 +1144,9 @@ patch_enable ()
wined3d-CSMT_Helper)
enable_wined3d_CSMT_Helper="$2"
;;
wined3d-CSMT_Main)
enable_wined3d_CSMT_Main="$2"
;;
wined3d-DXTn)
enable_wined3d_DXTn="$2"
;;
@ -1879,6 +1883,13 @@ if test "$enable_wpcap_Dynamic_Linking" -eq 1; then
enable_wpcap_Several_Fixes=1
fi
if test "$enable_wined3d_CSMT_Main" -eq 1; then
if test "$enable_wined3d_CSMT_Helper" -gt 1; then
abort "Patchset wined3d-CSMT_Helper disabled, but wined3d-CSMT_Main depends on that."
fi
enable_wined3d_CSMT_Helper=1
fi
if test "$enable_wined3d_MESA_GPU_Info" -eq 1; then
if test "$enable_wined3d_Accounting" -gt 1; then
abort "Patchset wined3d-Accounting disabled, but wined3d-MESA_GPU_Info depends on that."
@ -6719,6 +6730,377 @@ if test "$enable_wined3d_Silence_FIXMEs" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-CSMT_Main
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d-
# | resource_map, wined3d-CSMT_Helper
# |
# | This patchset fixes the following Wine bugs:
# | * [#11674] Support for CSMT (command stream) to increase graphic performance
# |
# | 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/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-Revert-wined3d-Introduce-wined3d_texture_check_block.patch
patch_apply wined3d-CSMT_Main/0002-Revert-wined3d-Introduce-wined3d_texture_get_pitch.patch
patch_apply wined3d-CSMT_Main/0003-Revert-wined3d-Use-wined3d_format_calculate_pitch-in.patch
patch_apply wined3d-CSMT_Main/0004-Revert-wined3d-Handle-slice-pitch-and-alignment-as-w.patch
patch_apply wined3d-CSMT_Main/0005-Revert-wined3d-Store-custom-pitches-in-the-texture-i.patch
patch_apply wined3d-CSMT_Main/0006-Revert-wined3d-Store-the-user_memory-pointer-in-the-.patch
patch_apply wined3d-CSMT_Main/0007-wined3d-Merge-get_pitch-functions.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-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-Don-t-call-the-public-map-function-in-surfac.patch
patch_apply wined3d-CSMT_Main/0041-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
patch_apply wined3d-CSMT_Main/0042-wined3d-Move-the-framebuffer-into-wined3d_state.patch
patch_apply wined3d-CSMT_Main/0043-wined3d-Get-rid-of-state-access-in-shader_generate_g.patch
patch_apply wined3d-CSMT_Main/0044-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch
patch_apply wined3d-CSMT_Main/0045-wined3d-Hackily-introduce-a-multithreaded-command-st.patch
patch_apply wined3d-CSMT_Main/0046-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch
patch_apply wined3d-CSMT_Main/0047-wined3d-Don-t-store-pointers-in-struct-wined3d_cs_pr.patch
patch_apply wined3d-CSMT_Main/0048-wined3d-Don-t-put-rectangle-pointers-into-wined3d_cs.patch
patch_apply wined3d-CSMT_Main/0049-wined3d-Store-the-color-in-clear-ops-instead-of-a-po.patch
patch_apply wined3d-CSMT_Main/0050-wined3d-Pass-the-state-to-draw_primitive.patch
patch_apply wined3d-CSMT_Main/0051-wined3d-Wait-for-the-cs-before-destroying-objects.patch
patch_apply wined3d-CSMT_Main/0052-wined3d-Give-the-cs-its-own-state.patch
patch_apply wined3d-CSMT_Main/0053-wined3d-Send-float-constant-updates-through-the-comm.patch
patch_apply wined3d-CSMT_Main/0054-wined3d-Request-a-glFinish-before-modifying-resource.patch
patch_apply wined3d-CSMT_Main/0055-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch
patch_apply wined3d-CSMT_Main/0056-wined3d-Don-t-call-glFinish-after-clears.patch
patch_apply wined3d-CSMT_Main/0057-wined3d-Don-t-call-glFinish-after-draws.patch
patch_apply wined3d-CSMT_Main/0058-wined3d-Shadow-device-offscreenBuffer-in-the-context.patch
patch_apply wined3d-CSMT_Main/0059-wined3d-Don-t-access-the-stateblock-in-find_draw_buf.patch
patch_apply wined3d-CSMT_Main/0060-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch
patch_apply wined3d-CSMT_Main/0061-wined3d-Don-t-store-viewport-pointers-in-the-command.patch
patch_apply wined3d-CSMT_Main/0062-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch
patch_apply wined3d-CSMT_Main/0063-wined3d-Send-base-vertex-index-updates-through-the-c.patch
patch_apply wined3d-CSMT_Main/0064-wined3d-Send-primitive-type-updates-through-the-comm.patch
patch_apply wined3d-CSMT_Main/0065-wined3d-Send-bool-constant-updates-through-the-comma.patch
patch_apply wined3d-CSMT_Main/0066-wined3d-Send-int-constant-updates-through-the-comman.patch
patch_apply wined3d-CSMT_Main/0067-wined3d-Send-light-updates-through-the-command-strea.patch
patch_apply wined3d-CSMT_Main/0068-wined3d-Prevent-the-command-stream-from-running-ahea.patch
patch_apply wined3d-CSMT_Main/0069-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch
patch_apply wined3d-CSMT_Main/0070-wined3d-Run-the-cs-asynchronously.patch
patch_apply wined3d-CSMT_Main/0071-wined3d-Send-blits-through-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0072-wined3d-Get-rid-of-WINED3D_BUFFER_FLUSH.patch
patch_apply wined3d-CSMT_Main/0073-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch
patch_apply wined3d-CSMT_Main/0074-wined3d-Send-render-target-view-clears-through-the-c.patch
patch_apply wined3d-CSMT_Main/0075-wined3d-Wait-for-the-CS-in-GetDC.patch
patch_apply wined3d-CSMT_Main/0076-wined3d-send-resource-maps-through-the-command-strea.patch
patch_apply wined3d-CSMT_Main/0077-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch
patch_apply wined3d-CSMT_Main/0078-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch
patch_apply wined3d-CSMT_Main/0079-wined3d-Don-t-preload-buffers-on-unmap.patch
patch_apply wined3d-CSMT_Main/0080-wined3d-Don-t-call-glFinish-before-swapping.patch
patch_apply wined3d-CSMT_Main/0081-wined3d-wined3d_-_query_issue-never-fails.patch
patch_apply wined3d-CSMT_Main/0082-wined3d-Add-query-support-to-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0083-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch
patch_apply wined3d-CSMT_Main/0084-wined3d-Poll-queries-automatically-in-the-CS.patch
patch_apply wined3d-CSMT_Main/0085-wined3d-Introduce-a-separate-queue-for-priority-comm.patch
patch_apply wined3d-CSMT_Main/0086-wined3d-Destroy-queries-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0087-wined3d-Separate-main-and-worker-thread-query-state.patch
patch_apply wined3d-CSMT_Main/0088-wined3d-Don-t-poll-queries-that-failed-to-start.patch
patch_apply wined3d-CSMT_Main/0089-wined3d-Remove-restated-queries-from-the-poll-list.patch
patch_apply wined3d-CSMT_Main/0090-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch
patch_apply wined3d-CSMT_Main/0091-wined3d-Put-this-into-the-query-poll-patch.patch
patch_apply wined3d-CSMT_Main/0092-wined3d-Send-texture-preloads-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0093-wined3d-Send-update_texture-calls-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0094-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch
patch_apply wined3d-CSMT_Main/0095-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch
patch_apply wined3d-CSMT_Main/0096-wined3d-Handle-evit_managed_resources-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0097-wined3d-Introduce-resource-fencing.patch
patch_apply wined3d-CSMT_Main/0098-wined3d-Fence-update_texture-and-update_surface-call.patch
patch_apply wined3d-CSMT_Main/0099-wined3d-Dirtify-resources-on-unmap.patch
patch_apply wined3d-CSMT_Main/0100-wined3d-Fence-texture-reads-in-draws.patch
patch_apply wined3d-CSMT_Main/0101-wined3d-Fence-render-targets-and-depth-stencils.patch
patch_apply wined3d-CSMT_Main/0102-wined3d-Fence-blit-operations.patch
patch_apply wined3d-CSMT_Main/0103-wined3d-Fence-color_fill-operations.patch
patch_apply wined3d-CSMT_Main/0104-wined3d-Fence-clear-calls.patch
patch_apply wined3d-CSMT_Main/0105-wined3d-Fence-present-calls.patch
patch_apply wined3d-CSMT_Main/0106-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch
patch_apply wined3d-CSMT_Main/0107-wined3d-Dirtify-changed-textures-through-the-command.patch
patch_apply wined3d-CSMT_Main/0108-wined3d-Wrap-GL-BOs-in-a-structure.patch
patch_apply wined3d-CSMT_Main/0109-wined3d-Separate-resource-map-and-draw-buffers.patch
patch_apply wined3d-CSMT_Main/0110-wined3d-Implement-DISCARD-resource-maps-with-buffers.patch
patch_apply wined3d-CSMT_Main/0111-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch
patch_apply wined3d-CSMT_Main/0112-wined3d-Unset-some-objects-in-state_init_default.patch
patch_apply wined3d-CSMT_Main/0113-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch
patch_apply wined3d-CSMT_Main/0114-wined3d-Use-double-buffered-buffers-for-multithreade.patch
patch_apply wined3d-CSMT_Main/0115-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch
patch_apply wined3d-CSMT_Main/0116-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch
patch_apply wined3d-CSMT_Main/0117-wined3d-Accelerate-DISCARD-buffer-maps.patch
patch_apply wined3d-CSMT_Main/0118-wined3d-Accelerate-READONLY-buffer-maps.patch
patch_apply wined3d-CSMT_Main/0119-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0120-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch
patch_apply wined3d-CSMT_Main/0121-wined3d-Send-buffer-preloads-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0122-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch
patch_apply wined3d-CSMT_Main/0123-wined3d-Separate-GL-buffer-discard-control-from-igno.patch
patch_apply wined3d-CSMT_Main/0124-wined3d-Create-buffers-before-mapping-them.patch
patch_apply wined3d-CSMT_Main/0125-wined3d-Destroy-views-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0126-wined3d-Remove-another-glFinish.patch
patch_apply wined3d-CSMT_Main/0127-wined3d-Destroy-vertex-declarations-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0128-wined3d-Destroy-shaders-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0129-wined3d-Create-VBOs-through-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0130-wined3d-Clean-up-resource-data-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0131-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0132-wined3d-Clean-up-volume-resource-data-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0133-wined3d-Clean-up-surfaces-through-the-cs.patch
patch_apply wined3d-CSMT_Main/0134-wined3d-Clean-up-texture-resources-through-the-cs.patch
patch_apply wined3d-CSMT_Main/0135-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch
patch_apply wined3d-CSMT_Main/0136-wined3d-Unload-resources-through-the-CS-in-device_re.patch
patch_apply wined3d-CSMT_Main/0137-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch
patch_apply wined3d-CSMT_Main/0138-wined3d-Remove-software-cursor-support.patch
patch_apply wined3d-CSMT_Main/0139-wined3d-Create-dummy-textures-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0140-wined3d-Create-the-initial-context-through-the-CS.patch
patch_apply wined3d-CSMT_Main/0141-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch
patch_apply wined3d-CSMT_Main/0142-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch
patch_apply wined3d-CSMT_Main/0143-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch
patch_apply wined3d-CSMT_Main/0144-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch
patch_apply wined3d-CSMT_Main/0145-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch
patch_apply wined3d-CSMT_Main/0146-wined3d-Use-an-event-to-block-the-worker-thread-when.patch
patch_apply wined3d-CSMT_Main/0147-wined3d-Fence-preload-operations.patch
patch_apply wined3d-CSMT_Main/0148-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch
patch_apply wined3d-CSMT_Main/0149-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch
patch_apply wined3d-CSMT_Main/0150-wined3d-Completely-reset-the-state-on-reset.patch
patch_apply wined3d-CSMT_Main/0151-wined3d-Send-getdc-and-releasedc-through-the-command.patch
patch_apply wined3d-CSMT_Main/0152-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch
patch_apply wined3d-CSMT_Main/0153-wined3d-Wait-only-for-the-buffer-to-be-idle.patch
patch_apply wined3d-CSMT_Main/0154-wined3d-Add-a-comment-about-worker-thread-lag.patch
patch_apply wined3d-CSMT_Main/0155-wined3d-Remove-the-texture-destroy-glFinish.patch
patch_apply wined3d-CSMT_Main/0156-wined3d-Move-FBO-destruction-into-the-worker-thread.patch
patch_apply wined3d-CSMT_Main/0157-wined3d-Don-t-incref-decref-textures-in-color-depth-.patch
patch_apply wined3d-CSMT_Main/0158-Winex11-complain-about-glfinish.patch
patch_apply wined3d-CSMT_Main/0159-wined3d-Make-sure-the-new-window-is-set-up-before-se.patch
patch_apply wined3d-CSMT_Main/0160-wined3d-Remove-the-device_reset-CS-sync-fixme.patch
patch_apply wined3d-CSMT_Main/0161-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch
patch_apply wined3d-CSMT_Main/0162-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch
patch_apply wined3d-CSMT_Main/0163-wined3d-Don-t-sync-on-redundant-discard-calls.patch
patch_apply wined3d-CSMT_Main/0164-wined3d-Don-t-discard-new-buffers.patch
patch_apply wined3d-CSMT_Main/0165-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch
patch_apply wined3d-CSMT_Main/0166-wined3d-Render-target-lock-hack.patch
patch_apply wined3d-CSMT_Main/0167-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch
patch_apply wined3d-CSMT_Main/0168-wined3d-Only-discard-buffers-that-are-in-use.patch
patch_apply wined3d-CSMT_Main/0169-wined3d-Destroy-samplers-through-the-command-stream.patch
patch_apply wined3d-CSMT_Main/0170-wined3d-Hack-to-reject-unsupported-color-fills.patch
patch_apply wined3d-CSMT_Main/0171-wined3d-Alloc-the-buffer-map-array-before-mapping-th.patch
patch_apply wined3d-CSMT_Main/0172-wined3d-Send-update_sub_resource-calls-through-the-c.patch
patch_apply wined3d-CSMT_Main/9998-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch
patch_apply wined3d-CSMT_Main/9999-IfDefined.patch
(
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_texture_check_block_align().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_texture_get_pitch().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use wined3d_format_calculate_pitch() in surface_download_data().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Handle slice pitch and alignment as well in wined3d_format_calculate_pitch().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Store custom pitches in the texture instead of the surface.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Store the \"user_memory\" pointer in the texture instead of the surface.\".", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Merge get_pitch functions.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Pass a context to surface_load_location.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Make surface_load_location return nothing.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Store volume locations in the resource.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move validate_location to resource.c.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move surface locations into the resource.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove surface_validate_location.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move invalidate_location to resource.c.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Invalidate containers via callback.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove surface_invalidate_location.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move bitmap_data and user_memory into the resource.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move load_location into the resource.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Replace surface_load_location with resource_load_location.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Introduce helper functions for mapping volumes.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move volume PBO infrastructure into the resource.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove surface->pbo.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use resource buffer mapping facilities in surfaces.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move buffer creation into the resource.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Handle WINED3D_LOCATION_DISCARDED in surface_load_texture.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Handle LOCATION_DISCARDED in surface_load_drawable.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Handle WINED3D_LOCATION_DISCARDED for sysmem loads.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Discard implicit surfaces on unload.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t try to flip sysmem copies in swapchain_present.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Discard the backbuffer in discard presents.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Introduce a function to retrieve resource memory.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Make surface_ops->unmap specific for front buffers.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move check_block_align to resource.c.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Replace surface alloc functions with resource ones.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t delete the buffer in surface_cleanup.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use resource facilities to destroy PBOs.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move simple location copying to the resource.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move most of volume_map to resource.c.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use resource_map for surface_map.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_convert_format.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_cpu_blt.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Get rid of state access in shader_generate_glsl_declarations.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Preload buffers if streamsrc is not dirty.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Hackily introduce a multithreaded command stream.", 1 },';
echo '+ { "Henri Verbeet", "wined3d: Wait for resource updates to finish when using the multithreaded command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t store pointers in struct wined3d_cs_present.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t put rectangle pointers into wined3d_cs_clear.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Store the color in clear ops instead of a pointer.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Pass the state to draw_primitive.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs before destroying objects.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Give the cs its own state.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send float constant updates through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Request a glFinish before modifying resources outside the cs.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Finish the cs before changing the texture lod.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after clears.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after draws.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Shadow device->offscreenBuffer in the context.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t access the stateblock in find_draw_buffers_mask.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Pass the depth stencil to swapchain->present.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t store viewport pointers in the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Keep track of the onscreen depth stencil in the command stream instead of the device.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send base vertex index updates through the cs.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send primitive type updates through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send bool constant updates through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send int constant updates through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send light updates through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Run the cs asynchronously.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Get rid of WINED3D_BUFFER_FLUSH.", 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 },';
echo '+ { "Stefan Dösinger", "wined3d: Send resource maps through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Replace the linked lists with a ringbuffer.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t preload buffers on unmap.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish before swapping.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Wined3d_*_query_issue never fails.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Add query support to the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Check our CS state to find out if a query is done.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Poll queries automatically in the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Introduce a separate queue for priority commands.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Destroy queries through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Separate main and worker thread query state.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t poll queries that failed to start.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove restated queries from the poll list.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t reset the query state if it doesn'\''t have a ctx.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Put this into the query poll patch.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send texture preloads through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Get rid of the surface_upload_data glFinish.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t lock the src volume in device_update_volume.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Handle evit_managed_resources through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Introduce resource fencing.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence update_texture and update_surface calls.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Dirtify resources on unmap.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence texture reads in draws.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence render targets and depth stencils.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence blit operations.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence color_fill operations.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence clear calls.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence present calls.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Make resource maps and unmaps a priority command.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Dirtify changed textures through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Separate resource map and draw buffers.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD resource maps with buffers.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD resource maps with heap memory.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Unset some objects in state_init_default.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t request the frontbuffer to create dummy textures.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use double-buffered buffers for multithreaded CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t synchronize NOOVERWRITE buffer maps.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Separate buffer map write and draw read memory pointers.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Accelerate DISCARD buffer maps.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Accelerate READONLY buffer maps.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Access the buffer dirty areas through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Ignore buffer->resource.map_count in the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send buffer preloads through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use glBufferSubData instead of glMapBufferRange.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Separate GL buffer discard control from ignoring MAP_DISCARD.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Create buffers before mapping them.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Destroy views through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove another glFinish.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Destroy vertex declarations through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Destroy shaders through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Create VBOs through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Clean up resource data through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Clean up buffer resource data through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Clean up volume resource data through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Clean up surfaces through the cs.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Clean up texture resources through the cs.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in uninit_3d.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in device_reset.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t glFinish after a depth buffer blit.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove software cursor support.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Create dummy textures through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Create the initial context through the CS.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Recreate ctx and dummy textures through the CS after resets.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in reset.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in uninit_3d.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Invoke surface_unload through the CS in wined3d_surface_update_desc.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Use an event to block the worker thread when it is idle.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Fence preload operations.", 1 },';
echo '+ { "Stefan Dösinger", "d3d8/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is temporarily broken.", 1 },';
echo '+ { "Stefan Dösinger", "d3d9/tests: D3DLOCK_NO_DIRTY_UPDATE on managed textures is temporarily broken.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Completely reset the state on reset.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Send getdc and releasedc through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Set map_heap_memory = NULL when allocating a PBO.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Wait only for the buffer to be idle.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Add a comment about worker thread lag.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove the texture destroy glFinish.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Move FBO destruction into the worker thread.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t incref / decref textures in color / depth fill blits.", 1 },';
echo '+ { "Stefan Dösinger", "Winex11: Complain about glfinish.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Make sure the new window is set up before setting up a context.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Remove the device_reset CS sync fixme.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Put GL_APPLE_flush_buffer_range syncing back in place.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Wait for the resource to be idle when destroying user memory surfaces.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t sync on redundant discard calls.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t discard new buffers.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t try to sync VBOs manually on OSX with CSMT.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: 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 '+ { "Stefan Dösinger", "wined3d: Send update_sub_resource calls through the command stream.", 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"
fi
# Patchset winedevice-Fix_Relocation
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,171 @@
From c007a75501e40d839902fbc8bbfb4ef291f07bb2 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 21 Feb 2016 23:30:15 +0100
Subject: Revert "wined3d: Introduce wined3d_texture_check_block_align()."
This reverts commit 58719f60d5dca15f0f0de625bc307e04b01fc6d9.
---
dlls/wined3d/surface.c | 31 +++++++++++++++++++++++++++++--
dlls/wined3d/texture.c | 29 -----------------------------
dlls/wined3d/volume.c | 31 +++++++++++++++++++++++++++++--
dlls/wined3d/wined3d_private.h | 2 --
4 files changed, 58 insertions(+), 35 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7858d15..c1d7b18 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1538,11 +1538,38 @@ void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct w
}
}
+static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box)
+{
+ UINT width_mask, height_mask;
+
+ if (!box->left && !box->top
+ && box->right == surface->resource.width
+ && box->bottom == surface->resource.height)
+ return TRUE;
+
+ if ((box->left >= box->right)
+ || (box->top >= box->bottom)
+ || (box->right > surface->resource.width)
+ || (box->bottom > surface->resource.height))
+ return FALSE;
+
+ /* This assumes power of two block sizes, but NPOT block sizes would be
+ * silly anyway. */
+ width_mask = surface->resource.format->block_width - 1;
+ height_mask = surface->resource.format->block_height - 1;
+
+ if (!(box->left & width_mask) && !(box->top & height_mask)
+ && !(box->right & width_mask) && !(box->bottom & height_mask))
+ return TRUE;
+
+ return FALSE;
+}
+
static BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect)
{
struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1};
- return wined3d_texture_check_block_align(surface->container, surface->texture_level, &box);
+ return surface_check_block_align(surface, &box);
}
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
@@ -2274,7 +2301,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
}
if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box
- && !wined3d_texture_check_block_align(surface->container, surface->texture_level, box))
+ && !surface_check_block_align(surface, box))
{
WARN("Map box %s is misaligned for %ux%u blocks.\n",
debug_box(box), format->block_width, format->block_height);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 804856b..7a24ff0 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1201,35 +1201,6 @@ static const struct wined3d_texture_ops texture3d_ops =
texture3d_prepare_texture,
};
-BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
- unsigned int level, const struct wined3d_box *box)
-{
- const struct wined3d_format *format = texture->resource.format;
- unsigned int height = max(1, texture->resource.height >> level);
- unsigned int width = max(1, texture->resource.width >> level);
- unsigned int width_mask, height_mask;
-
- if ((box->left >= box->right)
- || (box->top >= box->bottom)
- || (box->right > width)
- || (box->bottom > height))
- return FALSE;
-
- /* This assumes power of two block sizes, but NPOT block sizes would be
- * silly anyway.
- *
- * This also assumes that the format's block depth is 1. */
- width_mask = format->block_width - 1;
- height_mask = format->block_height - 1;
-
- if ((box->left & width_mask) || (box->top & height_mask)
- || (box->right & width_mask && box->right != width)
- || (box->bottom & height_mask && box->bottom != height))
- return FALSE;
-
- return TRUE;
-}
-
static HRESULT texture3d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 6f5de73..75585d8 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -433,6 +433,34 @@ static void volume_unload(struct wined3d_resource *resource)
resource_unload(resource);
}
+static BOOL volume_check_block_align(const struct wined3d_volume *volume,
+ const struct wined3d_box *box)
+{
+ UINT width_mask, height_mask;
+ const struct wined3d_format *format = volume->resource.format;
+
+ if (!box)
+ return TRUE;
+
+ /* This assumes power of two block sizes, but NPOT block sizes would be
+ * silly anyway.
+ *
+ * This also assumes that the format's block depth is 1. */
+ width_mask = format->block_width - 1;
+ height_mask = format->block_height - 1;
+
+ if (box->left & width_mask)
+ return FALSE;
+ if (box->top & height_mask)
+ return FALSE;
+ if (box->right & width_mask && box->right != volume->resource.width)
+ return FALSE;
+ if (box->bottom & height_mask && box->bottom != volume->resource.height)
+ return FALSE;
+
+ return TRUE;
+}
+
static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *volume,
const struct wined3d_box *box)
{
@@ -484,8 +512,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
WARN("Map box is invalid.\n");
return WINED3DERR_INVALIDCALL;
}
- if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box
- && !wined3d_texture_check_block_align(volume->container, volume->texture_level, box))
+ if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !volume_check_block_align(volume, box))
{
WARN("Map box %s is misaligned for %ux%u blocks.\n",
debug_box(box), format->block_width, format->block_height);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index a20bc65..a243727 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2405,8 +2405,6 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
-BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
- unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
void wined3d_texture_force_reload(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_load(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
--
2.7.1

View File

@ -0,0 +1,76 @@
From fde2bdfb77c46121de1617f90fbb20662d208edd Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 21 Feb 2016 23:34:22 +0100
Subject: Revert "wined3d: Introduce wined3d_texture_get_pitch()."
This partially reverts commit 65c04ce0409d870bc42ef466027120388abdb83c.
---
dlls/wined3d/surface.c | 11 ++++++++++-
dlls/wined3d/texture.c | 9 ++-------
dlls/wined3d/wined3d_private.h | 1 -
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 62a1a3c..dad5c22 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1909,7 +1909,16 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
surface->resource.format = texture_resource->format;
surface->resource.multisample_type = texture_resource->multisample_type;
surface->resource.multisample_quality = texture_resource->multisample_quality;
- surface->resource.size = surface->container->slice_pitch;
+ if (surface->container->row_pitch)
+ {
+ surface->resource.size = height * surface->container->row_pitch;
+ }
+ else
+ {
+ /* User memory surfaces don't have the regular surface alignment. */
+ wined3d_format_calculate_pitch(texture_resource->format, 1, width, height,
+ &surface->container->row_pitch, &surface->resource.size);
+ }
/* The format might be changed to a format that needs conversion.
* If the surface didn't use PBOs previously but could now, don't
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index b4f679c..487b2ef 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -502,7 +502,7 @@ void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture,
if (texture->row_pitch)
{
*row_pitch = texture->row_pitch;
- *slice_pitch = texture->slice_pitch;
+ *slice_pitch = *row_pitch * height;
return;
}
@@ -656,12 +656,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
texture->resource.height = height;
texture->user_memory = mem;
- if ((texture->row_pitch = pitch))
- texture->slice_pitch = height * pitch;
- else
- /* User memory surfaces don't have the regular surface alignment. */
- wined3d_format_calculate_pitch(format, 1, width, height,
- &texture->row_pitch, &texture->slice_pitch);
+ texture->row_pitch = pitch;
texture->flags &= ~WINED3D_TEXTURE_COND_NP2_EMULATED;
if (((width & (width - 1)) || (height & (height - 1))) && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0ef64c1..3433ae1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2367,7 +2367,6 @@ struct wined3d_texture
void *user_memory;
unsigned int row_pitch;
- unsigned int slice_pitch;
/* May only be accessed from the command stream worker thread. */
struct wined3d_texture_async
--
2.7.1

View File

@ -0,0 +1,55 @@
From 979c38f3099fa1d537710254c6f2961e6de7d6d9 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 21 Feb 2016 23:34:31 +0100
Subject: Revert "wined3d: Use wined3d_format_calculate_pitch() in
surface_download_data()."
This reverts commit a95524b8f3abfaa28fc21055d95d4a087a9b6d69.
---
dlls/wined3d/surface.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 93bf718..59c6e5c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1325,17 +1325,18 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
else
{
unsigned int dst_row_pitch, dst_slice_pitch;
- unsigned int src_row_pitch, src_slice_pitch;
+ unsigned int src_pitch;
GLenum gl_format = format->glFormat;
GLenum gl_type = format->glType;
void *mem;
if (surface->container->flags & WINED3D_TEXTURE_COND_NP2_EMULATED)
{
+ unsigned char alignment = surface->resource.device->surface_alignment;
+ src_pitch = format->byte_count * surface->pow2Width;
wined3d_texture_get_pitch(surface->container, surface->texture_level, &dst_row_pitch, &dst_slice_pitch);
- wined3d_format_calculate_pitch(format, surface->resource.device->surface_alignment,
- surface->pow2Width, surface->pow2Height, &src_row_pitch, &src_slice_pitch);
- mem = HeapAlloc(GetProcessHeap(), 0, src_slice_pitch);
+ src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1);
+ mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height);
}
else
{
@@ -1420,11 +1421,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
* won't be released, and doesn't have to be re-read. */
src_data = mem;
dst_data = data.addr;
- TRACE("Repacking the surface data from pitch %u to pitch %u.\n", src_row_pitch, dst_row_pitch);
+ TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_row_pitch);
for (y = 0; y < surface->resource.height; ++y)
{
memcpy(dst_data, src_data, dst_row_pitch);
- src_data += src_row_pitch;
+ src_data += src_pitch;
dst_data += dst_row_pitch;
}
--
2.7.1

View File

@ -1,377 +0,0 @@
From 0121313746277d4ade36ddf19f616fbbb481304e 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.
---
dlls/wined3d/resource.c | 31 +++++++++++++++++
dlls/wined3d/surface.c | 75 +++++++++++++++++++-----------------------
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/volume.c | 28 ++--------------
dlls/wined3d/wined3d_private.h | 5 +--
5 files changed, 70 insertions(+), 71 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 44cdb43..ed598cc 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -440,3 +440,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
else
resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
}
+
+void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+ UINT *slice_pitch)
+{
+ unsigned int alignment;
+ const struct wined3d_format *format = resource->format;
+
+ if (resource->custom_row_pitch)
+ {
+ *row_pitch = resource->custom_row_pitch;
+ *slice_pitch = resource->custom_slice_pitch;
+ return;
+ }
+
+ alignment = resource->device->surface_alignment;
+ *row_pitch = wined3d_format_calculate_pitch(resource->format, resource->width);
+ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
+ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS)
+ {
+ /* Since compressed formats are block based, pitch means the amount of
+ * bytes to the next row of block rather than the next row of pixels. */
+ UINT slice_block_count = (resource->height + format->block_height - 1) / format->block_height;
+ *slice_pitch = *row_pitch * slice_block_count;
+ }
+ else
+ {
+ *slice_pitch = *row_pitch * resource->height;
+ }
+
+ 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 65cb3b7..293b78d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -364,6 +364,7 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
BITMAPINFO *b_info;
int extraline = 0;
DWORD *masks;
+ UINT row_pitch, slice_pitch;
TRACE("surface %p.\n", surface);
@@ -409,10 +410,11 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
/* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */
- b_info->bmiHeader.biWidth = wined3d_surface_get_pitch(surface) / format->byte_count;
+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch);
+ b_info->bmiHeader.biWidth = row_pitch / format->byte_count;
b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline;
b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline)
- * wined3d_surface_get_pitch(surface);
+ * row_pitch;
b_info->bmiHeader.biPlanes = 1;
b_info->bmiHeader.biBitCount = format->byte_count * 8;
@@ -1332,14 +1334,14 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
void *mem;
GLenum gl_format = format->glFormat;
GLenum gl_type = format->glType;
- int src_pitch = 0;
- int dst_pitch = 0;
+ UINT src_pitch = 0;
+ UINT dst_row_pitch, dst_slice_pitch;
if (surface->flags & SFLAG_NONPOW2)
{
unsigned char alignment = surface->resource.device->surface_alignment;
src_pitch = format->byte_count * surface->pow2Width;
- dst_pitch = wined3d_surface_get_pitch(surface);
+ wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch);
src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1);
mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height);
}
@@ -1426,12 +1428,12 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
* won't be released, and doesn't have to be re-read. */
src_data = mem;
dst_data = data.addr;
- TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_pitch);
+ TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_row_pitch);
for (y = 0; y < surface->resource.height; ++y)
{
- memcpy(dst_data, src_data, dst_pitch);
+ memcpy(dst_data, src_data, dst_row_pitch);
src_data += src_pitch;
- dst_data += dst_pitch;
+ dst_data += dst_row_pitch;
}
HeapFree(GetProcessHeap(), 0, mem);
@@ -1599,7 +1601,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
UINT update_w, update_h;
UINT dst_w, dst_h;
RECT r, dst_rect;
- UINT src_pitch;
+ UINT src_row_pitch, src_slice_pitch;
POINT p;
TRACE("dst_surface %p, dst_point %s, src_surface %p, src_rect %s.\n",
@@ -1687,10 +1689,10 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
surface_get_memory(src_surface, &data, src_surface->locations);
- src_pitch = wined3d_surface_get_pitch(src_surface);
+ 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,
- src_pitch, dst_point, FALSE, wined3d_const_bo_address(&data));
+ src_row_pitch, dst_point, FALSE, wined3d_const_bo_address(&data));
context_release(context);
@@ -1892,21 +1894,10 @@ void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface)
DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
{
- unsigned int alignment;
- DWORD pitch;
-
- TRACE("surface %p.\n", surface);
-
- if (surface->pitch)
- return surface->pitch;
-
- alignment = surface->resource.device->surface_alignment;
- pitch = wined3d_format_calculate_pitch(surface->resource.format, surface->resource.width);
- pitch = (pitch + alignment - 1) & ~(alignment - 1);
-
- 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 wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -1959,20 +1950,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
- surface->pitch = pitch;
+ surface->resource.custom_row_pitch = pitch;
+ surface->resource.custom_slice_pitch = pitch * surface->resource.height;
surface->resource.format = texture_resource->format;
surface->resource.multisample_type = texture_resource->multisample_type;
surface->resource.multisample_quality = texture_resource->multisample_quality;
- if (surface->pitch)
+ if (surface->resource.custom_row_pitch)
{
- surface->resource.size = height * surface->pitch;
+ surface->resource.size = height * surface->resource.custom_row_pitch;
}
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->pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
+ surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
}
/* The format might be changed to a format that needs conversion.
@@ -2594,7 +2586,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
map_desc->row_pitch = surface->resource.width * format->byte_count;
else
- map_desc->row_pitch = wined3d_surface_get_pitch(surface);
+ wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
map_desc->slice_pitch = surface->resource.height * map_desc->row_pitch;
if (!box)
@@ -2645,6 +2637,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
int i;
BOOL srcIsUpsideDown;
struct wined3d_bo_address data;
+ DWORD slice_pitch, pitch;
surface_get_memory(surface, &data, dst_location);
@@ -2686,8 +2679,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
}
/* 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, &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,
@@ -2704,8 +2697,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
{
/* glReadPixels returns the image upside down, and there is no way to prevent this.
* Flip the lines in software. */
- UINT pitch = wined3d_surface_get_pitch(surface);
-
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -3859,7 +3850,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
struct wined3d_device *device = surface->resource.device;
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
- UINT width, src_pitch, dst_pitch;
+ UINT width, src_row_pitch, src_slice_pitch, dst_pitch;
struct wined3d_bo_address data;
struct wined3d_format format;
POINT dst_point = {0, 0};
@@ -3944,7 +3935,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_bind_and_dirtify(texture, context, srgb);
width = surface->resource.width;
- src_pitch = wined3d_surface_get_pitch(surface);
+ wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch);
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -3982,9 +3973,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
- format.convert(data.addr, mem, src_pitch, src_pitch * height,
+ format.convert(data.addr, mem, src_row_pitch, src_row_pitch * height,
dst_pitch, dst_pitch * height, width, height, 1);
- src_pitch = dst_pitch;
+ src_row_pitch = dst_pitch;
data.addr = mem;
}
else if (conversion)
@@ -4004,14 +3995,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
- conversion->convert(data.addr, src_pitch, mem, dst_pitch,
+ conversion->convert(data.addr, src_row_pitch, mem, dst_pitch,
width, height, palette, &texture->async.gl_color_key);
- src_pitch = dst_pitch;
+ src_row_pitch = dst_pitch;
data.addr = mem;
}
wined3d_surface_upload_data(surface, gl_info, &format, &src_rect,
- src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
+ src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
HeapFree(GetProcessHeap(), 0, mem);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 0c48c91..8646e82 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1141,7 +1141,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;
- wined3d_volume_get_pitch(volume, &row_pitch, &slice_pitch);
+ wined3d_resource_get_pitch(sub_resource, &row_pitch, &slice_pitch);
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);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 3ac7f98..9235f3f 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -40,30 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume)
return TRUE;
}
-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch)
-{
- const struct wined3d_format *format = volume->resource.format;
-
- if (volume->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
- {
- /* Since compressed formats are block based, pitch means the amount of
- * bytes to the next row of block rather than the next row of pixels. */
- UINT row_block_count = (volume->resource.width + format->block_width - 1) / format->block_width;
- UINT slice_block_count = (volume->resource.height + format->block_height - 1) / format->block_height;
- *row_pitch = row_block_count * format->block_byte_count;
- *slice_pitch = *row_pitch * slice_block_count;
- }
- else
- {
- unsigned char alignment = volume->resource.device->surface_alignment;
- *row_pitch = format->byte_count * volume->resource.width; /* Bytes / row */
- *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
- *slice_pitch = *row_pitch * volume->resource.height;
- }
-
- TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
-}
-
/* This call just uploads data, the caller is responsible for binding the
* correct texture. */
/* Context activation is done by the caller. */
@@ -95,7 +71,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
dst_row_pitch = width * format->conv_byte_count;
dst_slice_pitch = dst_row_pitch * height;
- wined3d_volume_get_pitch(volume, &src_row_pitch, &src_slice_pitch);
+ wined3d_resource_get_pitch(&volume->resource, &src_row_pitch, &src_slice_pitch);
converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth);
format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch,
@@ -607,7 +583,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
}
else
{
- wined3d_volume_get_pitch(volume, &map_desc->row_pitch, &map_desc->slice_pitch);
+ wined3d_resource_get_pitch(&volume->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
}
if (!box)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8b2cdb2..a0b7681 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2276,6 +2276,7 @@ struct wined3d_resource
UINT size;
DWORD priority;
void *heap_memory;
+ UINT custom_row_pitch, custom_slice_pitch;
struct list resource_list_entry;
void *parent;
@@ -2303,6 +2304,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;
@@ -2438,7 +2441,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;
-void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch, UINT *slice_pitch) DECLSPEC_HIDDEN;
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;
@@ -2491,7 +2493,6 @@ struct wined3d_surface
DWORD flags;
- UINT pitch;
UINT pow2Width;
UINT pow2Height;
--
2.7.0

View File

@ -0,0 +1,250 @@
From d26ecafd4c77d62749ea0fe0e7cb4a4cfbad2845 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 21 Feb 2016 23:34:42 +0100
Subject: Revert "wined3d: Handle slice pitch and alignment as well in
wined3d_format_calculate_pitch()."
This reverts commit a0beaa4006b0261587204fdecc08ba0bd941567d.
---
dlls/wined3d/directx.c | 6 +-----
dlls/wined3d/surface.c | 29 +++++++++++++------------
dlls/wined3d/texture.c | 25 +++++++++++++++++++--
dlls/wined3d/utils.c | 49 +++++++++++++++++++++---------------------
dlls/wined3d/wined3d_private.h | 3 +--
5 files changed, 64 insertions(+), 48 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 5f995ce..329da15 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4756,7 +4756,6 @@ UINT CDECL wined3d_calculate_format_pitch(const struct wined3d *wined3d, UINT ad
enum wined3d_format_id format_id, UINT width)
{
const struct wined3d_gl_info *gl_info;
- unsigned int row_pitch, slice_pitch;
TRACE("wined3d %p, adapter_idx %u, format_id %s, width %u.\n",
wined3d, adapter_idx, debug_d3dformat(format_id), width);
@@ -4765,10 +4764,7 @@ UINT CDECL wined3d_calculate_format_pitch(const struct wined3d *wined3d, UINT ad
return ~0u;
gl_info = &wined3d->adapters[adapter_idx].gl_info;
- wined3d_format_calculate_pitch(wined3d_get_format(gl_info, format_id),
- 1, width, 1, &row_pitch, &slice_pitch);
-
- return row_pitch;
+ return wined3d_format_calculate_pitch(wined3d_get_format(gl_info, format_id), width);
}
HRESULT CDECL wined3d_check_device_format_conversion(const struct wined3d *wined3d, UINT adapter_idx,
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 4d11787..5182b29 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1917,8 +1917,9 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
else
{
/* User memory surfaces don't have the regular surface alignment. */
- wined3d_format_calculate_pitch(texture_resource->format, 1, width, height,
- &surface->container->row_pitch, &surface->resource.size);
+ surface->resource.size = wined3d_format_calculate_size(texture_resource->format,
+ 1, width, height, 1);
+ surface->container->row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
}
/* The format might be changed to a format that needs conversion.
@@ -3806,7 +3807,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
static HRESULT surface_load_texture(struct wined3d_surface *surface,
struct wined3d_context *context, BOOL srgb)
{
- unsigned int width, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
+ unsigned int width, src_row_pitch, src_slice_pitch, dst_pitch;
const RECT src_rect = {0, 0, surface->resource.width, surface->resource.height};
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_device *device = surface->resource.device;
@@ -3926,17 +3927,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
UINT height = surface->resource.height;
format.byte_count = format.conv_byte_count;
- wined3d_format_calculate_pitch(&format, 1, width, height, &dst_row_pitch, &dst_slice_pitch);
+ dst_pitch = wined3d_format_calculate_pitch(&format, width);
- if (!(mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch)))
+ if (!(mem = HeapAlloc(GetProcessHeap(), 0, dst_pitch * height)))
{
- ERR("Out of memory (%u).\n", dst_slice_pitch);
+ ERR("Out of memory (%u).\n", dst_pitch * height);
context_release(context);
return E_OUTOFMEMORY;
}
format.convert(data.addr, mem, src_row_pitch, src_slice_pitch,
- dst_row_pitch, dst_slice_pitch, width, height, 1);
- src_row_pitch = dst_row_pitch;
+ dst_pitch, dst_pitch * height, width, height, 1);
+ src_row_pitch = dst_pitch;
data.addr = mem;
}
else if (conversion)
@@ -3945,20 +3946,20 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
struct wined3d_palette *palette = NULL;
UINT height = surface->resource.height;
- wined3d_format_calculate_pitch(&format, device->surface_alignment,
- width, height, &dst_row_pitch, &dst_slice_pitch);
+ dst_pitch = wined3d_format_calculate_pitch(&format, width);
+ dst_pitch = (dst_pitch + device->surface_alignment - 1) & ~(device->surface_alignment - 1);
- if (!(mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch)))
+ if (!(mem = HeapAlloc(GetProcessHeap(), 0, dst_pitch * height)))
{
- ERR("Out of memory (%u).\n", dst_slice_pitch);
+ ERR("Out of memory (%u).\n", dst_pitch * height);
context_release(context);
return E_OUTOFMEMORY;
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
- conversion->convert(data.addr, src_row_pitch, mem, dst_row_pitch,
+ conversion->convert(data.addr, src_row_pitch, mem, dst_pitch,
width, height, palette, &texture->async.gl_color_key);
- src_row_pitch = dst_row_pitch;
+ src_row_pitch = dst_pitch;
data.addr = mem;
}
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 487b2ef..8fe6251 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -496,6 +496,8 @@ void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture,
unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch)
{
const struct wined3d_resource *resource = &texture->resource;
+ const struct wined3d_format *format = resource->format;
+ unsigned int alignment = resource->device->surface_alignment;
unsigned int width = max(1, texture->resource.width >> level);
unsigned int height = max(1, texture->resource.height >> level);
@@ -506,8 +508,27 @@ void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture,
return;
}
- wined3d_format_calculate_pitch(resource->format, resource->device->surface_alignment,
- width, height, row_pitch, slice_pitch);
+ if (resource->format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS)
+ {
+ unsigned int row_block_count = (width + format->block_width - 1) / format->block_width;
+ unsigned int slice_block_count = (height + format->block_height - 1) / format->block_height;
+ *row_pitch = row_block_count * format->block_byte_count;
+ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
+ *slice_pitch = *row_pitch * slice_block_count;
+ }
+ else
+ {
+ *row_pitch = format->byte_count * width; /* Bytes / row */
+ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
+ *slice_pitch = *row_pitch * height;
+ }
+
+ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_HEIGHT_SCALE)
+ {
+ /* The D3D format requirements make sure that the resulting format is an integer again */
+ *slice_pitch *= format->height_scale.numerator;
+ *slice_pitch /= format->height_scale.denominator;
+ }
}
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index b52b967..81fb262 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3199,47 +3199,46 @@ const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl
return &gl_info->formats[idx];
}
-void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigned int alignment,
- unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch)
+UINT wined3d_format_calculate_pitch(const struct wined3d_format *format, UINT width)
{
/* For block based formats, pitch means the amount of bytes to the next
* row of blocks rather than the next row of pixels. */
if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS)
+ return format->block_byte_count * ((width + format->block_width - 1) / format->block_width);
+
+ return format->byte_count * width;
+}
+
+UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT alignment,
+ UINT width, UINT height, UINT depth)
+{
+ UINT pitch = wined3d_format_calculate_pitch(format, width);
+ UINT size;
+
+ if (format->id == WINED3DFMT_UNKNOWN)
+ {
+ size = 0;
+ }
+ else if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS)
{
- unsigned int row_block_count = (width + format->block_width - 1) / format->block_width;
- unsigned int slice_block_count = (height + format->block_height - 1) / format->block_height;
- *row_pitch = row_block_count * format->block_byte_count;
- *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
- *slice_pitch = *row_pitch * slice_block_count;
+ UINT row_count = (height + format->block_height - 1) / format->block_height;
+ size = row_count * ((pitch + alignment - 1) & ~(alignment - 1));
}
else
{
- *row_pitch = format->byte_count * width; /* Bytes / row */
- *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
- *slice_pitch = *row_pitch * height;
+ size = height * ((pitch + alignment - 1) & ~(alignment - 1));
}
if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_HEIGHT_SCALE)
{
/* The D3D format requirements make sure that the resulting format is an integer again */
- *slice_pitch *= format->height_scale.numerator;
- *slice_pitch /= format->height_scale.denominator;
+ size *= format->height_scale.numerator;
+ size /= format->height_scale.denominator;
}
- TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
-}
-
-UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT alignment,
- UINT width, UINT height, UINT depth)
-{
- unsigned int row_pitch, slice_pitch;
+ size *= depth;
- if (format->id == WINED3DFMT_UNKNOWN)
- return 0;
-
- wined3d_format_calculate_pitch(format, alignment, width, height, &row_pitch, &slice_pitch);
-
- return slice_pitch * depth;
+ return size;
}
/*****************************************************************************
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3433ae1..712267c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3347,8 +3347,7 @@ struct wined3d_format
const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl_info,
enum wined3d_format_id format_id) DECLSPEC_HIDDEN;
-void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigned int alignment,
- unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch) DECLSPEC_HIDDEN;
+UINT wined3d_format_calculate_pitch(const struct wined3d_format *format, UINT width) DECLSPEC_HIDDEN;
UINT wined3d_format_calculate_size(const struct wined3d_format *format,
UINT alignment, UINT width, UINT height, UINT depth) DECLSPEC_HIDDEN;
DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface,
--
2.7.1

View File

@ -1,33 +1,22 @@
From c40334a562447ca292f9699a1d3b2b725a78c844 Mon Sep 17 00:00:00 2001
From ced9d2e5e64407781a03c6e3e619fc36ecee4d45 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 10 Feb 2016 02:05:11 +0100
Subject: Revert "wined3d: Store custom pitches in the texture instead of the
surface."
This reverts commit 195d16c8267fcd5085048b3513571e2fee0eb548.
This partially reverts commit 195d16c8267fcd5085048b3513571e2fee0eb548.
---
dlls/wined3d/surface.c | 14 ++++++++------
dlls/wined3d/texture.c | 3 +--
dlls/wined3d/wined3d_private.h | 4 ++--
3 files changed, 11 insertions(+), 10 deletions(-)
dlls/wined3d/surface.c | 10 ++++++----
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/wined3d_private.h | 3 ++-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 665af4a..65e07c5 100644
index 5182b29..0a8509c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1897,8 +1897,8 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
TRACE("surface %p.\n", surface);
- if (surface->container->row_pitch)
- return surface->container->row_pitch;
+ if (surface->pitch)
+ return surface->pitch;
alignment = surface->resource.device->surface_alignment;
pitch = wined3d_format_calculate_pitch(surface->resource.format, surface->resource.width);
@@ -1909,7 +1909,8 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
return pitch;
@@ -1863,7 +1863,8 @@ static inline unsigned short float_32_to_16(const float *in)
return ret;
}
-HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info)
@ -36,7 +25,7 @@ index 665af4a..65e07c5 100644
{
struct wined3d_resource *texture_resource = &surface->container->resource;
unsigned int width, height;
@@ -1958,19 +1959,20 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
@@ -1907,19 +1908,20 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
@ -61,14 +50,12 @@ index 665af4a..65e07c5 100644
/* The format might be changed to a format that needs conversion.
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 0a084de..4ded4ca 100644
index 8fe6251..f0ed152 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -645,9 +645,8 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
texture->resource.height = height;
texture->user_memory = mem;
- texture->row_pitch = pitch;
@@ -684,7 +684,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
&& !gl_info->supported[ARB_TEXTURE_RECTANGLE] && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT])
texture->flags |= WINED3D_TEXTURE_COND_NP2_EMULATED;
- return wined3d_surface_update_desc(surface, gl_info);
+ return wined3d_surface_update_desc(surface, gl_info, pitch);
@ -76,18 +63,10 @@ index 0a084de..4ded4ca 100644
void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3fadff6..2ff3b99 100644
index 712267c..1cf309c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2365,7 +2365,6 @@ struct wined3d_texture
GLenum target;
void *user_memory;
- unsigned int row_pitch;
/* May only be accessed from the command stream worker thread. */
struct wined3d_texture_async
@@ -2493,6 +2492,7 @@ struct wined3d_surface
@@ -2498,6 +2498,7 @@ struct wined3d_surface
DWORD flags;
@ -95,7 +74,7 @@ index 3fadff6..2ff3b99 100644
UINT pow2Width;
UINT pow2Height;
@@ -2570,7 +2570,7 @@ void surface_set_texture_target(struct wined3d_surface *surface, GLenum target,
@@ -2575,7 +2576,7 @@ void surface_set_texture_target(struct wined3d_surface *surface, GLenum target,
void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@ -105,5 +84,5 @@ index 3fadff6..2ff3b99 100644
struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN;
void surface_validate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;
--
2.7.0
2.7.1

View File

@ -1,4 +1,4 @@
From 351ce90ef3980bf24e295982bc4046708255ad1e Mon Sep 17 00:00:00 2001
From adf0f2d92cb2c1711518bf519c1c96fb64ceef5a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 10 Feb 2016 02:05:20 +0100
Subject: Revert "wined3d: Store the "user_memory" pointer in the texture
@ -7,12 +7,12 @@ Subject: Revert "wined3d: Store the "user_memory" pointer in the texture
This reverts commit 77088e3faaded7f583903102240b9a2879a42fe8.
---
dlls/wined3d/surface.c | 10 +++++-----
dlls/wined3d/texture.c | 4 +---
dlls/wined3d/wined3d_private.h | 5 ++---
3 files changed, 8 insertions(+), 11 deletions(-)
dlls/wined3d/texture.c | 3 +--
dlls/wined3d/wined3d_private.h | 4 ++--
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 65e07c5..65cb3b7 100644
index cdbb2be..0be82ff 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -488,7 +488,7 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win
@ -33,7 +33,7 @@ index 65e07c5..65cb3b7 100644
ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->user_memory is NULL.\n");
break;
@@ -1910,7 +1910,7 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
@@ -1897,7 +1897,7 @@ DWORD wined3d_surface_get_pitch(const struct wined3d_surface *surface)
}
HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@ -42,16 +42,16 @@ index 65e07c5..65cb3b7 100644
{
struct wined3d_resource *texture_resource = &surface->container->resource;
unsigned int width, height;
@@ -1954,7 +1954,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
else
surface->flags &= ~SFLAG_NONPOW2;
@@ -1936,7 +1936,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->pow2Height <<= 1;
}
- if (surface->container->user_memory)
+ if ((surface->user_memory = mem))
{
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
@@ -2567,7 +2567,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
@@ -2549,7 +2549,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
break;
case WINED3D_LOCATION_USER_MEMORY:
@ -61,34 +61,39 @@ index 65e07c5..65cb3b7 100644
case WINED3D_LOCATION_DIB:
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 4ded4ca..0c48c91 100644
index e1786c9..ea04663 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -644,9 +644,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -685,7 +685,6 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
texture->resource.width = width;
texture->resource.height = height;
- texture->user_memory = mem;
-
texture->row_pitch = pitch;
texture->flags &= ~WINED3D_TEXTURE_COND_NP2_EMULATED;
@@ -693,7 +692,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
&& !gl_info->supported[ARB_TEXTURE_RECTANGLE] && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT])
texture->flags |= WINED3D_TEXTURE_COND_NP2_EMULATED;
- return wined3d_surface_update_desc(surface, gl_info, pitch);
+ return wined3d_surface_update_desc(surface, gl_info, mem, pitch);
}
void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2ff3b99..8b2cdb2 100644
index c486c92..a7ba298 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2364,8 +2364,6 @@ struct wined3d_texture
@@ -2366,7 +2366,6 @@ struct wined3d_texture
DWORD flags;
GLenum target;
- void *user_memory;
-
unsigned int row_pitch;
/* May only be accessed from the command stream worker thread. */
struct wined3d_texture_async
{
@@ -2488,6 +2486,7 @@ struct wined3d_surface
@@ -2491,6 +2490,7 @@ struct wined3d_surface
struct wined3d_resource resource;
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
@ -96,7 +101,7 @@ index 2ff3b99..8b2cdb2 100644
DWORD locations;
DWORD flags;
@@ -2570,7 +2569,7 @@ void surface_set_texture_target(struct wined3d_surface *surface, GLenum target,
@@ -2574,7 +2574,7 @@ void surface_set_texture_target(struct wined3d_surface *surface, GLenum target,
void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@ -106,5 +111,5 @@ index 2ff3b99..8b2cdb2 100644
struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN;
void surface_validate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;
--
2.7.0
2.7.1

View File

@ -0,0 +1,195 @@
From 2d4d9e65962f93d9aabea0aa891cc95fa1b8ccdc 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.
---
dlls/wined3d/resource.c | 31 +++++++++++++++++++++++++++++++
dlls/wined3d/surface.c | 22 +++++++++++-----------
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/volume.c | 2 +-
dlls/wined3d/wined3d_private.h | 4 +++-
5 files changed, 47 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 44cdb43..ed598cc 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -440,3 +440,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
else
resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
}
+
+void wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+ UINT *slice_pitch)
+{
+ unsigned int alignment;
+ const struct wined3d_format *format = resource->format;
+
+ if (resource->custom_row_pitch)
+ {
+ *row_pitch = resource->custom_row_pitch;
+ *slice_pitch = resource->custom_slice_pitch;
+ return;
+ }
+
+ alignment = resource->device->surface_alignment;
+ *row_pitch = wined3d_format_calculate_pitch(resource->format, resource->width);
+ *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
+ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS)
+ {
+ /* Since compressed formats are block based, pitch means the amount of
+ * bytes to the next row of block rather than the next row of pixels. */
+ UINT slice_block_count = (resource->height + format->block_height - 1) / format->block_height;
+ *slice_pitch = *row_pitch * slice_block_count;
+ }
+ else
+ {
+ *slice_pitch = *row_pitch * resource->height;
+ }
+
+ 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 aff6162..418efa3 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -395,7 +395,7 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
return E_OUTOFMEMORY;
b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- wined3d_texture_get_pitch(surface->container, surface->texture_level, &row_pitch, &slice_pitch);
+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch);
b_info->bmiHeader.biWidth = row_pitch / format->byte_count;
b_info->bmiHeader.biHeight = 0 - surface->resource.height;
b_info->bmiHeader.biSizeImage = slice_pitch;
@@ -1319,7 +1319,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
{
unsigned char alignment = surface->resource.device->surface_alignment;
src_pitch = format->byte_count * surface->pow2Width;
- wined3d_texture_get_pitch(surface->container, surface->texture_level, &dst_row_pitch, &dst_slice_pitch);
+ wined3d_resource_get_pitch(&surface->resource, &dst_row_pitch, &dst_slice_pitch);
src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1);
mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * surface->pow2Height);
}
@@ -1667,7 +1667,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE);
surface_get_memory(src_surface, &data, src_surface->locations);
- wined3d_texture_get_pitch(src_surface->container, src_surface->texture_level, &src_row_pitch, &src_slice_pitch);
+ 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,
src_row_pitch, dst_point, FALSE, wined3d_const_bo_address(&data));
@@ -1908,20 +1908,21 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
}
- surface->pitch = pitch;
+ surface->resource.custom_row_pitch = pitch;
+ surface->resource.custom_slice_pitch = pitch * surface->resource.height;
surface->resource.format = texture_resource->format;
surface->resource.multisample_type = texture_resource->multisample_type;
surface->resource.multisample_quality = texture_resource->multisample_quality;
- if (surface->pitch)
+ if (surface->resource.custom_row_pitch)
{
- surface->resource.size = height * surface->pitch;
+ surface->resource.size = height * surface->resource.custom_row_pitch;
}
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->pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
+ surface->resource.custom_row_pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
}
/* The format might be changed to a format that needs conversion.
@@ -2547,8 +2548,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
}
else
{
- wined3d_texture_get_pitch(surface->container, surface->texture_level,
- &map_desc->row_pitch, &map_desc->slice_pitch);
+ wined3d_resource_get_pitch(&surface->resource, &map_desc->row_pitch, &map_desc->slice_pitch);
}
if (!box)
@@ -2640,7 +2640,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
checkGLcall("glBindBuffer");
}
- wined3d_texture_get_pitch(surface->container, surface->texture_level, &row_pitch, &slice_pitch);
+ wined3d_resource_get_pitch(&surface->resource, &row_pitch, &slice_pitch);
/* Setup pixel store pack state -- to glReadPixels into the correct place */
gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count);
@@ -3897,7 +3897,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_prepare_texture(texture, context, srgb);
wined3d_texture_bind_and_dirtify(texture, context, srgb);
- wined3d_texture_get_pitch(texture, surface->texture_level, &src_row_pitch, &src_slice_pitch);
+ wined3d_resource_get_pitch(&surface->resource, &src_row_pitch, &src_slice_pitch);
width = surface->resource.width;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index a443b5d..cb7ae9c 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1180,7 +1180,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;
- wined3d_texture_get_pitch(volume->container, volume->texture_level, &row_pitch, &slice_pitch);
+ wined3d_resource_get_pitch(sub_resource, &row_pitch, &slice_pitch);
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);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 75585d8..d97db80 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -71,7 +71,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
dst_row_pitch = width * format->conv_byte_count;
dst_slice_pitch = dst_row_pitch * height;
- wined3d_texture_get_pitch(volume->container, volume->texture_level, &src_row_pitch, &src_slice_pitch);
+ wined3d_resource_get_pitch(&volume->resource, &src_row_pitch, &src_slice_pitch);
converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth);
format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 1dc499e..90a489e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2277,6 +2277,7 @@ struct wined3d_resource
UINT size;
DWORD priority;
void *heap_memory;
+ UINT custom_row_pitch, custom_slice_pitch;
struct list resource_list_entry;
void *parent;
@@ -2304,6 +2305,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;
@@ -2498,7 +2501,6 @@ struct wined3d_surface
DWORD flags;
- UINT pitch;
UINT pow2Width;
UINT pow2Height;
--
2.7.1

View File

@ -1,4 +1,4 @@
From 00f61862ec59e32534adfabc359009143a9b9651 Mon Sep 17 00:00:00 2001
From 5b4915863af63b0df11c80611d327820f63f5d0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 16 Jan 2014 22:04:55 +0100
Subject: wined3d: Move bitmap_data and user_memory into the resource.
@ -11,7 +11,7 @@ I may want to change this to keep this in the surface. Not sure yet.
3 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ad9310a..65eefa9 100644
index 79be75f..ad15f4a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -88,7 +88,7 @@ static void surface_cleanup(struct wined3d_surface *surface)
@ -23,7 +23,7 @@ index ad9310a..65eefa9 100644
}
if (surface->overlay_dest)
@@ -456,7 +456,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@@ -456,7 +456,7 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
TRACE("Creating a DIB section with size %dx%dx%d, size=%d.\n",
b_info->bmiHeader.biWidth, b_info->bmiHeader.biHeight,
b_info->bmiHeader.biBitCount, b_info->bmiHeader.biSizeImage);
@ -32,7 +32,7 @@ index ad9310a..65eefa9 100644
if (!surface->dib.DIBsection)
{
@@ -465,7 +465,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
@@ -465,7 +465,7 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
return HRESULT_FROM_WIN32(GetLastError());
}
@ -75,7 +75,7 @@ index ad9310a..65eefa9 100644
break;
case WINED3D_LOCATION_BUFFER:
@@ -2100,7 +2100,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
@@ -1914,7 +1914,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
{
DeleteDC(surface->hDC);
DeleteObject(surface->dib.DIBsection);
@ -84,16 +84,16 @@ index ad9310a..65eefa9 100644
surface->flags &= ~SFLAG_DIBSECTION;
create_dib = TRUE;
}
@@ -2132,7 +2132,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
else
surface->flags &= ~SFLAG_NONPOW2;
@@ -1941,7 +1941,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
surface->pow2Height <<= 1;
}
- if ((surface->user_memory = mem))
+ if ((surface->resource.user_memory = mem))
{
surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY;
valid_location = WINED3D_LOCATION_USER_MEMORY;
@@ -2750,11 +2750,11 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
@@ -2555,11 +2555,11 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
break;
case WINED3D_LOCATION_USER_MEMORY:
@ -108,10 +108,10 @@ index ad9310a..65eefa9 100644
case WINED3D_LOCATION_BUFFER:
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 4f6be9e..d0b8cf0 100644
index 41cd400..3ca22cf 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -666,9 +666,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC
@@ -680,9 +680,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC
{
void *tmp;
@ -125,10 +125,10 @@ index 4f6be9e..d0b8cf0 100644
if (front->resource.heap_memory)
ERR("GDI Surface %p has heap memory allocated.\n", front);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9d2e40a..3776439 100644
index e7c872d..861057d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2164,7 +2164,7 @@ struct wined3d_resource
@@ -2277,7 +2277,7 @@ struct wined3d_resource
UINT depth;
UINT size;
DWORD priority;
@ -137,7 +137,7 @@ index 9d2e40a..3776439 100644
UINT custom_row_pitch, custom_slice_pitch;
struct list resource_list_entry;
DWORD locations;
@@ -2343,7 +2343,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
@@ -2459,7 +2459,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
struct wined3d_surface_dib
{
HBITMAP DIBsection;
@ -145,7 +145,7 @@ index 9d2e40a..3776439 100644
UINT bitmap_size;
};
@@ -2377,7 +2376,6 @@ struct wined3d_surface
@@ -2493,7 +2492,6 @@ struct wined3d_surface
struct wined3d_resource resource;
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
@ -154,5 +154,5 @@ index 9d2e40a..3776439 100644
DWORD flags;
--
2.5.1
2.7.1

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