Added patches for CSMT support (not enabled yet).

This commit is contained in:
Sebastian Lackner 2014-12-14 20:24:48 +01:00
parent 152e0e26a9
commit 5c6cef5ac8
181 changed files with 34347 additions and 1 deletions

View File

@ -37,7 +37,7 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
===================================
**Bugfixes and features included in the next upcoming release [13]:**
**Bugfixes and features included in the next upcoming release [14]:**
* Add support for GetPropValue to PulseAudio backend
* Fix condition mask handling in RtlVerifyVersionInfo ([Wine Bug #36143](https://bugs.winehq.org/show_bug.cgi?id=36143))
@ -48,6 +48,7 @@ Included bug fixes and improvements
* Provide named entry point shell32.SHILCreateFromPath for vista apps ([Wine Bug #37265](https://bugs.winehq.org/show_bug.cgi?id=37265))
* Reallocate buffer when adding records to AVI files ([Wine Bug #5137](https://bugs.winehq.org/show_bug.cgi?id=5137))
* Set last error when GetRawInputDeviceList fails ([Wine Bug #37667](https://bugs.winehq.org/show_bug.cgi?id=37667))
* Support for CSMT (command stream) to increase graphic performance ([Wine Bug #11674](https://bugs.winehq.org/show_bug.cgi?id=11674))
* Support for StrCatChainW
* Support for combase HSTRING objects
* Support for loader dll redirections

View File

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

View File

@ -0,0 +1,406 @@
From e40fbe3feb09e745a7cb95413b23f3087a2859af 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/ddraw/surface.c | 12 ++++++--
dlls/wined3d/resource.c | 31 +++++++++++++++++++
dlls/wined3d/surface.c | 70 +++++++++++++++++-------------------------
dlls/wined3d/volume.c | 29 ++---------------
dlls/wined3d/wined3d.spec | 2 +-
dlls/wined3d/wined3d_private.h | 2 +-
include/wine/wined3d.h | 3 +-
7 files changed, 74 insertions(+), 75 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index a4184b8..a0d7f2d 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -6158,6 +6158,10 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru
DDSURFACEDESC2 *desc = &surface->surface_desc;
struct wined3d_resource_desc wined3d_desc;
unsigned int version = texture->version;
+ UINT row_pitch, slice_pitch;
+ struct wined3d_resource *resource = wined3d_surface_get_resource(wined3d_surface);
+
+ wined3d_resource_get_pitch(resource, &row_pitch, &slice_pitch);
surface->IDirectDrawSurface7_iface.lpVtbl = &ddraw_surface7_vtbl;
surface->IDirectDrawSurface4_iface.lpVtbl = &ddraw_surface4_vtbl;
@@ -6188,7 +6192,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru
}
*desc = texture->surface_desc;
- wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &wined3d_desc);
+ wined3d_resource_get_desc(resource, &wined3d_desc);
desc->dwWidth = wined3d_desc.width;
desc->dwHeight = wined3d_desc.height;
surface->first_attached = surface;
@@ -6198,14 +6202,16 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru
if (desc->dwFlags & DDSD_LPSURFACE)
desc->u1.dwLinearSize = ~0u;
else
- desc->u1.dwLinearSize = wined3d_surface_get_pitch(wined3d_surface) * ((desc->dwHeight + 3) / 4);
+ {
+ desc->u1.dwLinearSize = row_pitch * ((desc->dwHeight + 3) / 4);
+ }
desc->dwFlags |= DDSD_LINEARSIZE;
desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_PITCH);
}
else
{
if (!(desc->dwFlags & DDSD_LPSURFACE))
- desc->u1.lPitch = wined3d_surface_get_pitch(wined3d_surface);
+ desc->u1.lPitch = row_pitch;
desc->dwFlags |= DDSD_PITCH;
desc->dwFlags &= ~(DDSD_LPSURFACE | DDSD_LINEARSIZE);
}
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 0ab55dc..8032a4c 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -331,3 +331,34 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
else
resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
}
+
+void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+ 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 & 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 092cbe6..d9b1846 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -364,6 +364,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
BITMAPINFO *b_info;
int extraline = 0;
DWORD *masks;
+ UINT row_pitch, slice_pitch;
TRACE("surface %p.\n", surface);
@@ -409,10 +410,11 @@ static 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;
@@ -1359,14 +1361,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);
}
@@ -1453,12 +1455,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);
@@ -1612,7 +1614,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",
@@ -1698,9 +1700,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
wined3d_texture_bind(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);
- surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_pitch, dst_point, FALSE, &data);
+ surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_row_pitch, dst_point, FALSE, &data);
context_invalidate_active_texture(context);
@@ -2008,25 +2010,6 @@ HRESULT CDECL wined3d_surface_restore(struct wined3d_surface *surface)
return WINED3D_OK;
}
-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;
-}
-
HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y)
{
LONG w, h;
@@ -2207,12 +2190,13 @@ 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)
- surface->resource.size = height * surface->pitch;
+ if (surface->resource.custom_row_pitch)
+ surface->resource.size = height * surface->resource.custom_row_pitch;
else
surface->resource.size = wined3d_format_calculate_size(texture_resource->format,
texture_resource->device->surface_alignment, width, height, 1);
@@ -2680,7 +2664,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if (format->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 = 0;
if (!rect)
@@ -2860,7 +2844,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
{
/* glReadPixels returns the image upside down, and there is no way to prevent this.
* Flip the lines in software. */
- UINT pitch = wined3d_surface_get_pitch(surface);
+ UINT pitch, slice_pitch;
+
+ wined3d_resource_get_pitch(&surface->resource, &pitch, &slice_pitch);
if (!(row = HeapAlloc(GetProcessHeap(), 0, pitch)))
goto error;
@@ -4092,7 +4078,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
struct wined3d_context *context;
- 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};
@@ -4187,7 +4173,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
else surface->flags &= ~SFLAG_GLCKEY;
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)))
@@ -4226,9 +4212,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)
@@ -4248,13 +4234,13 @@ 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->src_blt_color_key);
- src_pitch = dst_pitch;
+ src_row_pitch = dst_pitch;
data.addr = mem;
}
- surface_upload_data(surface, gl_info, &format, &src_rect, src_pitch, &dst_point, srgb, &data);
+ surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, &data);
context_release(context);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 58d7321..af99825 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -40,31 +40,6 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume)
return TRUE;
}
-static 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 (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);
-}
-
/* Context activation is done by the caller. */
void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context,
const struct wined3d_bo_address *data)
@@ -95,7 +70,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
dst_row_pitch = (dst_row_pitch + alignment - 1) & ~(alignment - 1);
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);
mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth);
format->convert(data->addr, mem, src_row_pitch, src_slice_pitch,
@@ -638,7 +613,7 @@ HRESULT CDECL 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.spec b/dlls/wined3d/wined3d.spec
index 7a77003..95885c7 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -181,6 +181,7 @@
@ cdecl wined3d_resource_get_desc(ptr ptr)
@ cdecl wined3d_resource_get_parent(ptr)
+@ cdecl wined3d_resource_get_pitch(ptr ptr ptr)
@ cdecl wined3d_resource_get_priority(ptr)
@ cdecl wined3d_resource_set_parent(ptr ptr)
@ cdecl wined3d_resource_set_priority(ptr long)
@@ -226,7 +227,6 @@
@ cdecl wined3d_surface_get_flip_status(ptr long)
@ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr)
@ cdecl wined3d_surface_get_parent(ptr)
-@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_get_render_target_data(ptr ptr)
@ cdecl wined3d_surface_get_resource(ptr)
@ cdecl wined3d_surface_getdc(ptr ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7935a5d..abd8d2b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2080,6 +2080,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;
@@ -2298,7 +2299,6 @@ struct wined3d_surface
DWORD flags;
- UINT pitch;
UINT pow2Width;
UINT pow2Height;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 0cf26e1..3d24b98 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2411,6 +2411,8 @@ static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_priv
void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
struct wined3d_resource_desc *desc);
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
+void __cdecl wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
+ UINT *slice_pitch);
DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource);
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent);
DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority);
@@ -2468,7 +2470,6 @@ HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *sur
HRESULT __cdecl wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags);
HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y);
void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
-DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_get_render_target_data(struct wined3d_surface *surface,
struct wined3d_surface *render_target);
struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
--
2.1.3

View File

View File

@ -0,0 +1,79 @@
From d802d551603f20fde872cf45d43064426bea4434 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:10:18 +0100
Subject: wined3d: Pass a context to surface_load_sysmem.
---
dlls/wined3d/surface.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index d9b1846..3877139 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4010,9 +4010,12 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
memcpy(dst.addr, src.addr, size);
}
+/* Context activation is done by the caller. */
static void surface_load_sysmem(struct wined3d_surface *surface,
- const struct wined3d_gl_info *gl_info, DWORD dst_location)
+ struct wined3d_context *context, DWORD dst_location)
{
+ const struct wined3d_gl_info *gl_info = context->gl_info;
+
if (surface->locations & surface_simple_locations)
{
surface_copy_simple_location(surface, dst_location);
@@ -4025,18 +4028,10 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
/* Download the surface to system memory. */
if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
- struct wined3d_device *device = surface->resource.device;
- struct wined3d_context *context;
-
- /* TODO: Use already acquired context when possible. */
- context = context_acquire(device, NULL);
-
wined3d_texture_bind_and_dirtify(surface->container, context,
!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB));
surface_download_data(surface, gl_info, dst_location);
- context_release(context);
-
return;
}
@@ -4266,6 +4261,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
struct wined3d_device *device = surface->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
HRESULT hr;
+ struct wined3d_context *context = NULL;
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4274,7 +4270,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
if (location == WINED3D_LOCATION_TEXTURE_RGB
&& surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
{
- struct wined3d_context *context = context_acquire(device, NULL);
+ context = context_acquire(device, NULL);
surface_load_ds_location(surface, context, location);
context_release(context);
return WINED3D_OK;
@@ -4320,7 +4316,11 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
case WINED3D_LOCATION_USER_MEMORY:
case WINED3D_LOCATION_SYSMEM:
case WINED3D_LOCATION_BUFFER:
- surface_load_sysmem(surface, gl_info, location);
+ if (device->d3d_initialized)
+ context = context_acquire(device, NULL);
+ surface_load_sysmem(surface, context, location);
+ if (context)
+ context_release(context);
break;
case WINED3D_LOCATION_DRAWABLE:
--
2.1.3

View File

@ -0,0 +1,81 @@
From e29e2b0ccda7ed5e930eb18b3c73204150a68123 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:16:40 +0100
Subject: wined3d: Pass a context to read_from_framebuffer.
In the average case the function will not be able to reuse it, because
it requires a specific context to access the WGL framebuffer. It will
restore the original context afterwards to hide the context change from
load_location / preload callers. This is related to bug 34574.
---
dlls/wined3d/surface.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 3877139..ef6a233 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2781,11 +2781,13 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
return WINED3D_OK;
}
-static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_location)
+static void read_from_framebuffer(struct wined3d_surface *surface,
+ struct wined3d_context *old_ctx, DWORD dst_location)
{
struct wined3d_device *device = surface->resource.device;
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
+ struct wined3d_surface *restore_rt;
BYTE *mem;
BYTE *row, *top, *bottom;
int i;
@@ -2794,7 +2796,21 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
surface_get_memory(surface, &data, dst_location);
- context = context_acquire(device, surface);
+ /* Context_release does not restore the original context in case of
+ * nested context_acquire calls. Only read_from_framebuffer and
+ * surface_blt_to_drawable use nested context_acquire calls. Manually
+ * restore the original context at the end of the function if needed. */
+ if (old_ctx->current_rt == surface)
+ {
+ restore_rt = NULL;
+ context = old_ctx;
+ }
+ else
+ {
+ restore_rt = old_ctx->current_rt;
+ context = context_acquire(device, surface);
+ }
+
context_apply_blit_state(context, device);
gl_info = context->gl_info;
@@ -2882,7 +2898,12 @@ error:
checkGLcall("glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)");
}
- context_release(context);
+ if (restore_rt)
+ {
+ context_release(context);
+ context = context_acquire(device, restore_rt);
+ context_release(context);
+ }
}
/* Read the framebuffer contents into a texture. Note that this function
@@ -4037,7 +4058,7 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
if (surface->locations & WINED3D_LOCATION_DRAWABLE)
{
- read_from_framebuffer(surface, dst_location);
+ read_from_framebuffer(surface, context, dst_location);
return;
}
--
2.1.3

View File

@ -0,0 +1,121 @@
From da5210457d0a852e97fd20fed4b33030585b0549 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:34:26 +0100
Subject: wined3d: Pass a context to surface_load_drawable and
surface_blt_to_drawable.
---
dlls/wined3d/surface.c | 40 ++++++++++++++++++++++++++++++++++------
1 file changed, 34 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ef6a233..7a32f7f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3452,19 +3452,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW
rect->bottom = drawable_height - rect->bottom;
}
+/* Context activation is done by the caller. */
static void surface_blt_to_drawable(const struct wined3d_device *device,
+ struct wined3d_context *old_ctx,
enum wined3d_texture_filter_type filter, BOOL alpha_test,
struct wined3d_surface *src_surface, const RECT *src_rect_in,
struct wined3d_surface *dst_surface, const RECT *dst_rect_in)
{
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
+ struct wined3d_surface *restore_rt;
RECT src_rect, dst_rect;
src_rect = *src_rect_in;
dst_rect = *dst_rect_in;
- context = context_acquire(device, dst_surface);
+ /* Context_release does not restore the original context in case of
+ * nested context_acquire calls. Only read_from_framebuffer and
+ * surface_blt_to_drawable use nested context_acquire calls. Manually
+ * restore the original context at the end of the function if needed. */
+ if (old_ctx->current_rt == dst_surface)
+ {
+ restore_rt = NULL;
+ context = old_ctx;
+ }
+ else
+ {
+ restore_rt = old_ctx->current_rt;
+ context = context_acquire(device, dst_surface);
+ }
gl_info = context->gl_info;
/* Make sure the surface is up-to-date. This should probably use
@@ -3517,7 +3533,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
&& dst_surface->container->swapchain->front_buffer == dst_surface->container))
gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
- context_release(context);
+ if (restore_rt)
+ {
+ context_release(context);
+ context = context_acquire(device, restore_rt);
+ context_release(context);
+ }
}
HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color)
@@ -3668,6 +3689,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
/* Blit from offscreen surface to render target */
struct wined3d_color_key old_blt_key = src_surface->container->src_blt_color_key;
DWORD old_color_key_flags = src_surface->container->color_key_flags;
+ struct wined3d_context *context;
TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface);
@@ -3701,9 +3723,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, NULL);
}
- surface_blt_to_drawable(device, filter,
+ context = context_acquire(device, dst_surface);
+ surface_blt_to_drawable(device, context, filter,
flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE | WINEDDBLT_ALPHATEST),
src_surface, src_rect, dst_surface, dst_rect);
+ context_release(context);
/* Restore the color key parameters */
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT,
@@ -4066,8 +4090,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
surface, wined3d_debug_location(surface->locations));
}
+/* Context activation is done by the caller. */
static HRESULT surface_load_drawable(struct wined3d_surface *surface,
- const struct wined3d_gl_info *gl_info)
+ struct wined3d_context *context)
{
RECT r;
@@ -4080,7 +4105,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
surface_get_rect(surface, NULL, &r);
surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB);
- surface_blt_to_drawable(surface->resource.device,
+ surface_blt_to_drawable(surface->resource.device, context,
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
return WINED3D_OK;
@@ -4345,7 +4370,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
break;
case WINED3D_LOCATION_DRAWABLE:
- if (FAILED(hr = surface_load_drawable(surface, gl_info)))
+ context = context_acquire(device, NULL);
+ hr = surface_load_drawable(surface, context);
+ context_release(context);
+ if (FAILED(hr))
return hr;
break;
--
2.1.3

View File

@ -0,0 +1,140 @@
From 61070d97c76557046a90cac37fbdf9c5f033adb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:49:38 +0100
Subject: wined3d: Pass a context to surface_blt_fbo.
---
dlls/wined3d/surface.c | 53 +++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 42 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7a32f7f..a2f8112 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -860,13 +860,15 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
}
/* Blit between surface locations. Onscreen on different swapchains is not supported.
- * Depth / stencil is not supported. */
-static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_texture_filter_type filter,
+ * Depth / stencil is not supported. Context activation is done by the caller. */
+static void surface_blt_fbo(const struct wined3d_device *device,
+ struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter,
struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in,
struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in)
{
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
+ struct wined3d_surface *required_rt, *restore_rt;
RECT src_rect, dst_rect;
GLenum gl_filter;
GLenum buffer;
@@ -909,9 +911,20 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
if (!surface_is_full_rect(dst_surface, &dst_rect))
surface_load_location(dst_surface, dst_location);
- if (src_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, src_surface);
- else if (dst_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, dst_surface);
- else context = context_acquire(device, NULL);
+ if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface;
+ else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface;
+ else required_rt = NULL;
+
+ if (required_rt && required_rt != old_ctx->current_rt)
+ {
+ restore_rt = context->current_rt;
+ context = context_acquire(device, required_rt);
+ }
+ else
+ {
+ restore_rt = NULL;
+ context = old_ctx;
+ }
if (!context->valid)
{
@@ -974,7 +987,12 @@ static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_te
&& dst_surface->container->swapchain->front_buffer == dst_surface->container))
gl_info->gl_ops.gl.p_glFlush();
- context_release(context);
+ if (restore_rt)
+ {
+ context_release(context);
+ context = context_acquire(device, restore_rt);
+ context_release(context);
+ }
}
static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op,
@@ -4140,13 +4158,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
{
+ context = context_acquire(device, NULL);
+
if (srgb)
- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB,
+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB,
&src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect);
else
- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB,
+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB,
&src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect);
+ context_release(context);
+
return WINED3D_OK;
}
@@ -4161,8 +4183,10 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
- surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, src_location,
+ context = context_acquire(device, NULL);
+ surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location,
&rect, surface, dst_location, &rect);
+ context_release(context);
return WINED3D_OK;
}
@@ -4292,14 +4316,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
static void surface_multisample_resolve(struct wined3d_surface *surface)
{
+ struct wined3d_context *context;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
- surface_blt_fbo(surface->resource.device, WINED3D_TEXF_POINT,
+ context = context_acquire(surface->resource.device, NULL);
+ surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT,
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
+ context_release(context);
}
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -5474,11 +5501,15 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
&src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format,
&dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format))
{
+ struct wined3d_context *context;
TRACE("Using FBO blit.\n");
- surface_blt_fbo(device, filter,
+ context = context_acquire(device, NULL);
+ surface_blt_fbo(device, context, filter,
src_surface, src_surface->container->resource.draw_binding, &src_rect,
dst_surface, dst_surface->container->resource.draw_binding, &dst_rect);
+ context_release(context);
+
surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
--
2.1.3

View File

@ -0,0 +1,49 @@
From f3cecdde174e3fc350ca4a35771183695b6777de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:50:47 +0100
Subject: wined3d: Pass a context to surface_multisample_resolve.
---
dlls/wined3d/surface.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a2f8112..ee6cfdd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4314,19 +4314,17 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
-static void surface_multisample_resolve(struct wined3d_surface *surface)
+/* Context activation is done by the caller. */
+static void surface_multisample_resolve(struct wined3d_surface *surface, struct wined3d_context *context)
{
- struct wined3d_context *context;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
- context = context_acquire(surface->resource.device, NULL);
surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT,
surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect);
- context_release(context);
}
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
@@ -4405,7 +4403,9 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
break;
case WINED3D_LOCATION_RB_RESOLVED:
- surface_multisample_resolve(surface);
+ context = context_acquire(device, NULL);
+ surface_multisample_resolve(surface, context);
+ context_release(context);
break;
case WINED3D_LOCATION_TEXTURE_RGB:
--
2.1.3

View File

@ -0,0 +1,100 @@
From c47fbee59422dcccdf545d9ca1a37eba75e7ef92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 19:52:56 +0100
Subject: wined3d: Pass a context to surface_load_texture.
---
dlls/wined3d/surface.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ee6cfdd..b37dca9 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4130,13 +4130,13 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
}
static HRESULT surface_load_texture(struct wined3d_surface *surface,
- const struct wined3d_gl_info *gl_info, BOOL srgb)
+ struct wined3d_context *context, BOOL srgb)
{
+ const struct wined3d_gl_info *gl_info = context->gl_info;
RECT src_rect = {0, 0, surface->resource.width, surface->resource.height};
struct wined3d_device *device = surface->resource.device;
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
- struct wined3d_context *context;
UINT width, src_row_pitch, src_slice_pitch, dst_pitch;
struct wined3d_bo_address data;
struct wined3d_format format;
@@ -4158,8 +4158,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
{
- context = context_acquire(device, NULL);
-
if (srgb)
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB,
&src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect);
@@ -4167,8 +4165,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB,
&src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect);
- context_release(context);
-
return WINED3D_OK;
}
@@ -4183,10 +4179,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
- context = context_acquire(device, NULL);
surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location,
&rect, surface, dst_location, &rect);
- context_release(context);
return WINED3D_OK;
}
@@ -4224,9 +4218,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_load_location(surface, WINED3D_LOCATION_SYSMEM);
}
- /* TODO: Use already acquired context when possible. */
- context = context_acquire(device, NULL);
-
wined3d_texture_prepare_texture(texture, context, srgb);
wined3d_texture_bind_and_dirtify(texture, context, srgb);
@@ -4307,8 +4298,6 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_upload_data(surface, gl_info, &format, &src_rect, src_row_pitch, &dst_point, srgb, &data);
- context_release(context);
-
HeapFree(GetProcessHeap(), 0, mem);
return WINED3D_OK;
@@ -4330,7 +4319,6 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
{
struct wined3d_device *device = surface->resource.device;
- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
HRESULT hr;
struct wined3d_context *context = NULL;
@@ -4410,7 +4398,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
case WINED3D_LOCATION_TEXTURE_RGB:
case WINED3D_LOCATION_TEXTURE_SRGB:
- if (FAILED(hr = surface_load_texture(surface, gl_info, location == WINED3D_LOCATION_TEXTURE_SRGB)))
+ context = context_acquire(device, NULL);
+ hr = surface_load_texture(surface, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
+ context_release(context);
+ if (FAILED(hr))
return hr;
break;
--
2.1.3

View File

@ -0,0 +1,106 @@
From 7059ae36100e7efafcbcefcf582c34c0ce99e435 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 20:25:01 +0100
Subject: wined3d: Make surface_load_location return nothing.
---
dlls/wined3d/surface.c | 18 +++++++++---------
dlls/wined3d/wined3d_private.h | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 66956df..8a14169 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4353,7 +4353,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
}
/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
-HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
+void surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location)
{
HRESULT hr;
@@ -4365,26 +4365,26 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
&& surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
{
surface_load_ds_location(surface, context, location);
- return WINED3D_OK;
+ return;
}
else if (location & surface->locations
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
{
/* Already up to date, nothing to do. */
- return WINED3D_OK;
+ return;
}
else
{
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
wined3d_debug_location(surface->locations), wined3d_debug_location(location));
- return WINED3DERR_INVALIDCALL;
+ return;
}
}
if (surface->locations & location)
{
TRACE("Location already up to date.\n");
- return WINED3D_OK;
+ return;
}
if (WARN_ON(d3d_surface))
@@ -4399,7 +4399,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
{
ERR("Surface %p does not have any up to date location.\n", surface);
surface->flags |= SFLAG_LOST;
- return WINED3DERR_DEVICELOST;
+ return;
}
switch (location)
@@ -4413,7 +4413,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
case WINED3D_LOCATION_DRAWABLE:
if (FAILED(hr = surface_load_drawable(surface, context)))
- return hr;
+ return;
break;
case WINED3D_LOCATION_RB_RESOLVED:
@@ -4424,7 +4424,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
case WINED3D_LOCATION_TEXTURE_SRGB:
if (FAILED(hr = surface_load_texture(surface, context,
location == WINED3D_LOCATION_TEXTURE_SRGB)))
- return hr;
+ return;
break;
default:
@@ -4437,7 +4437,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM))
surface_evict_sysmem(surface);
- return WINED3D_OK;
+ return;
}
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7115eca..f24808b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2354,7 +2354,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN;
-HRESULT surface_load_location(struct wined3d_surface *surface,
+void surface_load_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void surface_prepare_rb(struct wined3d_surface *surface,
--
2.1.3

View File

@ -0,0 +1,203 @@
From 98ce21ea2f7c29d885b7dcf5b36819f8d977c5a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 3 Oct 2013 12:31:24 +0200
Subject: wined3d: Store volume locations in the resource.
---
dlls/wined3d/volume.c | 46 +++++++++++++++++++++---------------------
dlls/wined3d/wined3d_private.h | 5 +++--
2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index af99825..ea56b38 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -101,15 +101,15 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location)
{
TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location));
- volume->locations |= location;
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations));
+ volume->resource.locations |= location;
+ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
}
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location)
{
TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location));
- volume->locations &= ~location;
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations));
+ volume->resource.locations &= ~location;
+ TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
}
/* Context activation is done by the caller. */
@@ -217,9 +217,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
DWORD required_access = volume_access_from_location(location);
TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location),
- wined3d_debug_location(volume->locations));
+ wined3d_debug_location(volume->resource.locations));
- if ((volume->locations & location) == location)
+ if ((volume->resource.locations & location) == location)
{
TRACE("Location(s) already up to date.\n");
return;
@@ -242,32 +242,32 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
&& !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED)))
ERR("Trying to load (s)RGB texture without prior allocation.\n");
- if (volume->locations & WINED3D_LOCATION_DISCARDED)
+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Volume previously discarded, nothing to do.\n");
wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
}
- else if (volume->locations & WINED3D_LOCATION_SYSMEM)
+ else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM)
{
struct wined3d_bo_address data = {0, volume->resource.heap_memory};
wined3d_volume_upload_data(volume, context, &data);
}
- else if (volume->locations & WINED3D_LOCATION_BUFFER)
+ else if (volume->resource.locations & WINED3D_LOCATION_BUFFER)
{
struct wined3d_bo_address data = {volume->pbo, NULL};
wined3d_volume_upload_data(volume, context, &data);
}
- else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
+ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
{
wined3d_volume_srgb_transfer(volume, context, TRUE);
}
- else if (volume->locations & WINED3D_LOCATION_TEXTURE_SRGB)
+ else if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_SRGB)
{
wined3d_volume_srgb_transfer(volume, context, FALSE);
}
else
{
- FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->locations));
+ FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations));
return;
}
wined3d_volume_validate_location(volume, location);
@@ -281,16 +281,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
if (!volume->resource.heap_memory)
ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n");
- if (volume->locations & WINED3D_LOCATION_DISCARDED)
+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Volume previously discarded, nothing to do.\n");
wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
}
- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
+ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
struct wined3d_bo_address data = {0, volume->resource.heap_memory};
- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
+ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
else
wined3d_texture_bind_and_dirtify(volume->container, context, TRUE);
@@ -301,7 +301,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
else
{
FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n",
- wined3d_debug_location(volume->locations));
+ wined3d_debug_location(volume->resource.locations));
return;
}
wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
@@ -311,16 +311,16 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
if (!volume->pbo)
ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n");
- if (volume->locations & WINED3D_LOCATION_DISCARDED)
+ if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Volume previously discarded, nothing to do.\n");
wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
}
- else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
+ else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
struct wined3d_bo_address data = {volume->pbo, NULL};
- if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
+ if (volume->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
else
wined3d_texture_bind_and_dirtify(volume->container, context, TRUE);
@@ -330,7 +330,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
else
{
FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n",
- wined3d_debug_location(volume->locations));
+ wined3d_debug_location(volume->resource.locations));
return;
}
wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER);
@@ -338,7 +338,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
default:
FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location),
- wined3d_debug_location(volume->locations));
+ wined3d_debug_location(volume->resource.locations));
}
}
@@ -595,7 +595,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
{
wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
}
- else if (!(volume->locations & WINED3D_LOCATION_SYSMEM))
+ else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
{
context = context_acquire(device, NULL);
wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM);
@@ -743,7 +743,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture
}
volume->texture_level = level;
- volume->locations = WINED3D_LOCATION_DISCARDED;
+ volume->resource.locations = WINED3D_LOCATION_DISCARDED;
if (desc->pool == WINED3D_POOL_DEFAULT && desc->usage & WINED3DUSAGE_DYNAMIC
&& gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f24808b..57a048f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -5,7 +5,7 @@
* Copyright 2002-2003 Raphael Junqueira
* Copyright 2002-2003, 2004 Jason Edmeades
* Copyright 2005 Oliver Stieber
- * Copyright 2006-2011, 2013 Stefan Dösinger for CodeWeavers
+ * Copyright 2006-2011, 2013-2014 Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -2082,6 +2082,7 @@ struct wined3d_resource
void *heap_memory;
UINT custom_row_pitch, custom_slice_pitch;
struct list resource_list_entry;
+ DWORD locations;
void *parent;
const struct wined3d_parent_ops *parent_ops;
@@ -2236,7 +2237,7 @@ struct wined3d_volume
struct wined3d_resource resource;
struct wined3d_texture *container;
- DWORD flags, locations;
+ DWORD flags;
GLint texture_level;
DWORD download_count;
GLuint pbo;
--
2.1.3

View File

@ -0,0 +1,116 @@
From 8b7f33e2323fa2acac3722c3a8a753b7a8f11db2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 3 Oct 2013 12:34:13 +0200
Subject: wined3d: Move validate_location to resource.c.
---
dlls/wined3d/resource.c | 7 +++++++
dlls/wined3d/volume.c | 19 ++++++-------------
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 8032a4c..bac15c0 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -332,6 +332,13 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
}
+void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location)
+{
+ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location));
+ resource->locations |= location;
+ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
+}
+
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
UINT *slice_pitch)
{
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index ea56b38..6bc2724 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -98,13 +98,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
HeapFree(GetProcessHeap(), 0, mem);
}
-static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location)
-{
- TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location));
- volume->resource.locations |= location;
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
-}
-
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location)
{
TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location));
@@ -270,7 +263,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->resource.locations));
return;
}
- wined3d_volume_validate_location(volume, location);
+ wined3d_resource_validate_location(&volume->resource, location);
if (wined3d_volume_can_evict(volume))
wined3d_volume_evict_sysmem(volume);
@@ -304,7 +297,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
wined3d_debug_location(volume->resource.locations));
return;
}
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
break;
case WINED3D_LOCATION_BUFFER:
@@ -333,7 +326,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
wined3d_debug_location(volume->resource.locations));
return;
}
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER);
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER);
break;
default:
@@ -412,7 +405,7 @@ static void volume_unload(struct wined3d_resource *resource)
else
{
ERR("Out of memory when unloading volume %p.\n", volume);
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_DISCARDED);
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED);
}
@@ -558,7 +551,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
wined3d_volume_prepare_pbo(volume, context);
if (flags & WINED3D_MAP_DISCARD)
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER);
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_BUFFER);
else
wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER);
@@ -593,7 +586,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
if (flags & WINED3D_MAP_DISCARD)
{
- wined3d_volume_validate_location(volume, WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
}
else if (!(volume->resource.locations & WINED3D_LOCATION_SYSMEM))
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 57a048f..0c698b6 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2114,6 +2114,7 @@ GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
+void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
/* Tests show that the start address of resources is 32 byte aligned */
#define RESOURCE_ALIGNMENT 16
--
2.1.3

View File

@ -0,0 +1,457 @@
From 298ba6d476f8f76000f879b2ca61ff1fd0e810ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 21 Jan 2014 12:22:30 +0100
Subject: wined3d: Move surface locations into the resource.
---
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/device.c | 4 +-
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 99 ++++++++++++++++++++-------------------
dlls/wined3d/swapchain.c | 4 +-
dlls/wined3d/wined3d_private.h | 1 -
6 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index bc66c4a..c1b3b6d 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7649,7 +7649,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
/* Now load the surface */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
- && (src_surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE))
+ && (src_surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE))
== WINED3D_LOCATION_DRAWABLE
&& !wined3d_resource_is_offscreen(&src_surface->container->resource))
{
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0b4c6f9..01ccd9d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -236,7 +236,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
{
RECT current_rect, r;
- if (ds->locations & WINED3D_LOCATION_DISCARDED)
+ if (ds->resource.locations & WINED3D_LOCATION_DISCARDED)
{
/* Depth buffer was discarded, make it entirely current in its new location since
* there is no other place where we would get data anyway. */
@@ -244,7 +244,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
return;
}
- if (ds->locations & location)
+ if (ds->resource.locations & location)
SetRect(&current_rect, 0, 0,
ds->ds_current_size.cx,
ds->ds_current_size.cy);
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 2d39a83..7034b25 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -648,7 +648,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if (!context->render_offscreen && ds != device->onscreen_depth_stencil)
device_switch_onscreen_ds(device, context, ds);
- if (ds->locations & location)
+ if (ds->resource.locations & location)
SetRect(&current_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy);
else
SetRectEmpty(&current_rect);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8a14169..c44179f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -556,7 +556,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
if (!wined3d_resource_allocate_sysmem(&surface->resource))
ERR("Failed to allocate system memory.\n");
- if (surface->locations & WINED3D_LOCATION_SYSMEM)
+ if (surface->resource.locations & WINED3D_LOCATION_SYSMEM)
ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n");
}
@@ -706,7 +706,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
}
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
- surface->locations = WINED3D_LOCATION_DISCARDED;
+ surface->resource.locations = WINED3D_LOCATION_DISCARDED;
if (surface_use_pbo(surface))
surface->resource.map_binding = WINED3D_LOCATION_BUFFER;
@@ -746,7 +746,7 @@ static void surface_unmap(struct wined3d_surface *surface)
ERR("Unexpected map binding %s.\n", wined3d_debug_location(surface->resource.map_binding));
}
- if (surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))
+ if (surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))
{
TRACE("Not dirtified, nothing to do.\n");
return;
@@ -1726,7 +1726,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_bind(dst_surface->container, context, FALSE);
- surface_get_memory(src_surface, &data, src_surface->locations);
+ surface_get_memory(src_surface, &data, src_surface->resource.locations);
wined3d_resource_get_pitch(&src_surface->resource, &src_row_pitch, &src_slice_pitch);
surface_upload_data(dst_surface, gl_info, src_format, src_rect, src_row_pitch, dst_point, FALSE, &data);
@@ -1872,7 +1872,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
if (ck_changed)
wined3d_texture_force_reload(surface->container);
}
- else if (!(surface->locations & location))
+ else if (!(surface->resource.locations & location))
{
TRACE("Reloading because surface is dirty.\n");
}
@@ -2186,7 +2186,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
create_dib = TRUE;
}
- surface->locations = 0;
+ surface->resource.locations = 0;
wined3d_resource_free_sysmem(&surface->resource);
width = texture_resource->width;
@@ -3088,9 +3088,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
back->flags = front->flags;
front->flags = tmp_flags;
- tmp_flags = back->locations;
- back->locations = front->locations;
- front->locations = tmp_flags;
+ tmp_flags = back->resource.locations;
+ back->resource.locations = front->resource.locations;
+ front->resource.locations = tmp_flags;
}
}
@@ -3269,7 +3269,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
- src_surface->locations &= ~WINED3D_LOCATION_TEXTURE_RGB;
+ src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB;
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3863,13 +3863,14 @@ void surface_modify_ds_location(struct wined3d_surface *surface,
{
TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h);
- if (((surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB))
- || (!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB)))
+ if (((surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB))
+ || (!(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB)
+ && (location & WINED3D_LOCATION_TEXTURE_RGB)))
wined3d_texture_set_dirty(surface->container);
surface->ds_current_size.cx = w;
surface->ds_current_size.cy = h;
- surface->locations = location;
+ surface->resource.locations = location;
}
/* Context activation is done by the caller. */
@@ -3884,7 +3885,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
- if (!(surface->locations & location))
+ if (!(surface->resource.locations & location))
{
w = surface->ds_current_size.cx;
h = surface->ds_current_size.cy;
@@ -3910,7 +3911,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
return;
}
- if (surface->locations & WINED3D_LOCATION_DISCARDED)
+ if (surface->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Surface was discarded, no need copy data.\n");
switch (location)
@@ -3927,17 +3928,17 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
default:
FIXME("Unhandled location %#x\n", location);
}
- surface->locations &= ~WINED3D_LOCATION_DISCARDED;
- surface->locations |= location;
+ surface->resource.locations &= ~WINED3D_LOCATION_DISCARDED;
+ surface->resource.locations |= location;
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
}
- if (!surface->locations)
+ if (!surface->resource.locations)
{
FIXME("No up to date depth stencil location.\n");
- surface->locations |= location;
+ surface->resource.locations |= location;
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
return;
@@ -4026,7 +4027,7 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
ERR("Invalid location (%#x) specified.\n", location);
}
- surface->locations |= location;
+ surface->resource.locations |= location;
surface->ds_current_size.cx = surface->resource.width;
surface->ds_current_size.cy = surface->resource.height;
}
@@ -4035,7 +4036,7 @@ void surface_validate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
- surface->locations |= location;
+ surface->resource.locations |= location;
}
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
@@ -4044,9 +4045,9 @@ void surface_invalidate_location(struct wined3d_surface *surface, DWORD location
if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
wined3d_texture_set_dirty(surface->container);
- surface->locations &= ~location;
+ surface->resource.locations &= ~location;
- if (!surface->locations)
+ if (!surface->resource.locations)
ERR("Surface %p does not have any up to date location.\n", surface);
}
@@ -4082,7 +4083,7 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD
UINT size = surface->resource.size;
surface_get_memory(surface, &dst, location);
- surface_get_memory(surface, &src, surface->locations);
+ surface_get_memory(surface, &src, surface->resource.locations);
if (dst.buffer_object)
{
@@ -4115,33 +4116,33 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
{
const struct wined3d_gl_info *gl_info = context->gl_info;
- if (surface->locations & surface_simple_locations)
+ if (surface->resource.locations & surface_simple_locations)
{
surface_copy_simple_location(surface, dst_location);
return;
}
- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
+ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
/* Download the surface to system memory. */
- if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
+ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
wined3d_texture_bind_and_dirtify(surface->container, context,
- !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB));
+ !(surface->resource.locations & WINED3D_LOCATION_TEXTURE_RGB));
surface_download_data(surface, gl_info, dst_location);
return;
}
- if (surface->locations & WINED3D_LOCATION_DRAWABLE)
+ if (surface->resource.locations & WINED3D_LOCATION_DRAWABLE)
{
read_from_framebuffer(surface, context, dst_location);
return;
}
FIXME("Can't load surface %p with location flags %s into sysmem.\n",
- surface, wined3d_debug_location(surface->locations));
+ surface, wined3d_debug_location(surface->resource.locations));
}
/* Context activation is done by the caller. */
@@ -4181,14 +4182,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& wined3d_resource_is_offscreen(&texture->resource)
- && (surface->locations & WINED3D_LOCATION_DRAWABLE))
+ && (surface->resource.locations & WINED3D_LOCATION_DRAWABLE))
{
surface_load_fb_texture(surface, srgb);
return WINED3D_OK;
}
- if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
+ if (surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
&& (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
@@ -4204,13 +4205,13 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
return WINED3D_OK;
}
- if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)
+ if (surface->resource.locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)
&& (!srgb || (surface->resource.format->flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB))
&& fbo_blit_supported(gl_info, WINED3D_BLIT_OP_COLOR_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format))
{
- DWORD src_location = surface->locations & WINED3D_LOCATION_RB_RESOLVED ?
+ DWORD src_location = surface->resource.locations & WINED3D_LOCATION_RB_RESOLVED ?
WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE;
DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB;
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
@@ -4225,7 +4226,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
if (srgb)
{
- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding))
+ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding))
== WINED3D_LOCATION_TEXTURE_RGB)
{
/* Performance warning... */
@@ -4236,7 +4237,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
else
{
- if ((surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding))
+ if ((surface->resource.locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding))
== WINED3D_LOCATION_TEXTURE_SRGB)
{
/* Performance warning... */
@@ -4246,7 +4247,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
}
- if (!(surface->locations & surface_simple_locations))
+ if (!(surface->resource.locations & surface_simple_locations))
{
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
/* Lets hope we get it from somewhere... */
@@ -4288,7 +4289,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_remove_pbo(surface, gl_info);
}
- surface_get_memory(surface, &data, surface->locations);
+ surface_get_memory(surface, &data, surface->resource.locations);
if (format.convert)
{
/* This code is entered for texture formats which need a fixup. */
@@ -4344,7 +4345,7 @@ static void surface_multisample_resolve(struct wined3d_surface *surface, struct
{
RECT rect = {0, 0, surface->resource.width, surface->resource.height};
- if (!(surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE))
+ if (!(surface->resource.locations & WINED3D_LOCATION_RB_MULTISAMPLE))
ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n",
surface);
@@ -4362,12 +4363,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
{
if (location == WINED3D_LOCATION_TEXTURE_RGB
- && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
+ && surface->resource.locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED))
{
surface_load_ds_location(surface, context, location);
return;
}
- else if (location & surface->locations
+ else if (location & surface->resource.locations
&& surface->container->resource.draw_binding != WINED3D_LOCATION_DRAWABLE)
{
/* Already up to date, nothing to do. */
@@ -4376,12 +4377,12 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
else
{
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
- wined3d_debug_location(surface->locations), wined3d_debug_location(location));
+ wined3d_debug_location(surface->resource.locations), wined3d_debug_location(location));
return;
}
}
- if (surface->locations & location)
+ if (surface->resource.locations & location)
{
TRACE("Location already up to date.\n");
return;
@@ -4395,7 +4396,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
required_access, surface->resource.access_flags);
}
- if (!surface->locations)
+ if (!surface->resource.locations)
{
ERR("Surface %p does not have any up to date location.\n", surface);
surface->flags |= SFLAG_LOST;
@@ -4434,7 +4435,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
surface_validate_location(surface, location);
- if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM))
+ if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM))
surface_evict_sysmem(surface);
return;
@@ -5439,8 +5440,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
{
/* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */
- if ((dst_surface->locations & dst_surface->resource.map_binding)
- && (!src_surface || (src_surface->locations & src_surface->resource.map_binding)))
+ if ((dst_surface->resource.locations & dst_surface->resource.map_binding)
+ && (!src_surface || (src_surface->resource.locations & src_surface->resource.map_binding)))
{
if (scale)
TRACE("Not doing sysmem blit because of scaling.\n");
@@ -5467,8 +5468,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
TRACE("Color blit.\n");
/* Upload */
- if ((src_surface->locations & WINED3D_LOCATION_SYSMEM)
- && !(dst_surface->locations & WINED3D_LOCATION_SYSMEM))
+ if ((src_surface->resource.locations & WINED3D_LOCATION_SYSMEM)
+ && !(dst_surface->resource.locations & WINED3D_LOCATION_SYSMEM))
{
if (scale)
TRACE("Not doing upload because of scaling.\n");
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index d742b11..601d3ad 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -555,8 +555,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0));
- if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM)
- || (back_buffer->locations & WINED3D_LOCATION_SYSMEM)))
+ if (!swapchain->render_to_fbo && ((front->resource.locations & WINED3D_LOCATION_SYSMEM)
+ || (back_buffer->resource.locations & WINED3D_LOCATION_SYSMEM)))
{
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0c698b6..4011833 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2297,7 +2297,6 @@ struct wined3d_surface
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
void *user_memory;
- DWORD locations;
DWORD flags;
--
2.1.3

View File

@ -0,0 +1,217 @@
From a15ccac8ee6ece2955548900f4e7b4a993a498b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 4 Jan 2014 00:53:47 +0100
Subject: wined3d: Remove surface_validate_location.
---
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/device.c | 2 +-
dlls/wined3d/surface.c | 29 +++++++++++------------------
dlls/wined3d/swapchain.c | 12 ++++++------
dlls/wined3d/wined3d_private.h | 1 -
5 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index c1b3b6d..08f92cb 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7686,7 +7686,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
context_release(context);
- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 01ccd9d..e10ea1c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -392,7 +392,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if (rt)
{
- surface_validate_location(rt, rt->container->resource.draw_binding);
+ wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding);
surface_invalidate_location(rt, ~rt->container->resource.draw_binding);
}
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c44179f..b56796e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1224,7 +1224,7 @@ static void surface_unload(struct wined3d_resource *resource)
* and all flags get lost */
surface_prepare_system_memory(surface);
memset(surface->resource.heap_memory, 0, surface->resource.size);
- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM);
/* We also get here when the ddraw swapchain is destroyed, for example
@@ -1735,7 +1735,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
context_release(context);
- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
return WINED3D_OK;
@@ -2253,7 +2253,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
valid_location = WINED3D_LOCATION_SYSMEM;
}
- surface_validate_location(surface, valid_location);
+ wined3d_resource_validate_location(&surface->resource, valid_location);
return WINED3D_OK;
}
@@ -2645,7 +2645,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
{
TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n",
wined3d_debug_location(surface->resource.map_binding));
- surface_validate_location(surface, surface->resource.map_binding);
+ wined3d_resource_validate_location(&surface->resource, surface->resource.map_binding);
}
else
{
@@ -3200,7 +3200,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
}
@@ -3474,7 +3474,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
- surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
}
@@ -3787,7 +3787,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT,
(old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL);
- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
@@ -4032,13 +4032,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
-void surface_validate_location(struct wined3d_surface *surface, DWORD location)
-{
- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
-
- surface->resource.locations |= location;
-}
-
void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
{
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
@@ -4433,7 +4426,7 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
break;
}
- surface_validate_location(surface, location);
+ wined3d_resource_validate_location(&surface->resource, location);
if (location != WINED3D_LOCATION_SYSMEM && (surface->resource.locations & WINED3D_LOCATION_SYSMEM))
surface_evict_sysmem(surface);
@@ -5528,7 +5521,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
dst_surface, dst_surface->container->resource.draw_binding, &dst_rect);
context_release(context);
- surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
+ wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
@@ -5625,7 +5618,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
}
surface->container = container;
- surface_validate_location(surface, WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
list_init(&surface->renderbuffers);
list_init(&surface->overlays);
@@ -5657,7 +5650,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
if (surface->resource.map_binding == WINED3D_LOCATION_DIB)
{
wined3d_resource_free_sysmem(&surface->resource);
- surface_validate_location(surface, WINED3D_LOCATION_DIB);
+ wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB);
surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM);
}
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 601d3ad..bdb4b67 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -569,19 +569,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
/* Tell the front buffer surface that is has been modified. However,
* the other locations were preserved during that, so keep the flags.
* This serves to update the emulated overlay, if any. */
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
}
else
{
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
- surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
}
}
else
{
- surface_validate_location(front, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
@@ -590,7 +590,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
*/
if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
{
- surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding);
+ wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
}
}
@@ -865,7 +865,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
wined3d_texture_set_swapchain(swapchain->front_buffer, swapchain);
if (!(device->wined3d->flags & WINED3D_NO3D))
{
- surface_validate_location(front_buffer, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE);
surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4011833..5ca3ab8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2368,7 +2368,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
const struct wined3d_gl_info *gl_info, void *mem, unsigned int pitch) DECLSPEC_HIDDEN;
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN;
-void surface_validate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
--
2.1.3

View File

@ -0,0 +1,161 @@
From c7669f4cc8e98c81027cd1c2392d3435ec534206 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 3 Oct 2013 12:36:46 +0200
Subject: wined3d: Move invalidate_location to resource.c.
---
dlls/wined3d/device.c | 2 +-
dlls/wined3d/resource.c | 7 +++++++
dlls/wined3d/texture.c | 4 +---
dlls/wined3d/volume.c | 21 +++++++--------------
dlls/wined3d/wined3d_private.h | 2 +-
5 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index e10ea1c..600afed 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3487,7 +3487,7 @@ static HRESULT device_update_volume(struct wined3d_device *device,
data.buffer_object = 0;
data.addr = src.data;
wined3d_volume_upload_data(dst_volume, context, &data);
- wined3d_volume_invalidate_location(dst_volume, ~WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_resource_invalidate_location(&dst_volume->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
context_release(context);
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index bac15c0..1ec27d3 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -339,6 +339,13 @@ void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD
TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
}
+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location)
+{
+ TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location));
+ resource->locations &= ~location;
+ TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
+}
+
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
UINT *slice_pitch)
{
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index c173518..f003fa2 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1286,9 +1286,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource
static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location)
{
- struct wined3d_volume *volume = volume_from_resource(sub_resource);
-
- wined3d_volume_invalidate_location(volume, location);
+ wined3d_resource_invalidate_location(sub_resource, location);
}
static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 6bc2724..3b742d2 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -98,13 +98,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
HeapFree(GetProcessHeap(), 0, mem);
}
-void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location)
-{
- TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location));
- volume->resource.locations &= ~location;
- TRACE("new location flags are %s.\n", wined3d_debug_location(volume->resource.locations));
-}
-
/* Context activation is done by the caller. */
static void wined3d_volume_download_data(struct wined3d_volume *volume,
const struct wined3d_context *context, const struct wined3d_bo_address *data)
@@ -140,7 +133,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume,
static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
{
wined3d_resource_free_sysmem(&volume->resource);
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_SYSMEM);
}
static DWORD volume_access_from_location(DWORD location)
@@ -238,7 +231,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Volume previously discarded, nothing to do.\n");
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
}
else if (volume->resource.locations & WINED3D_LOCATION_SYSMEM)
{
@@ -277,7 +270,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Volume previously discarded, nothing to do.\n");
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
}
else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
@@ -307,7 +300,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
if (volume->resource.locations & WINED3D_LOCATION_DISCARDED)
{
TRACE("Volume previously discarded, nothing to do.\n");
- wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED);
+ wined3d_resource_invalidate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
}
else if (volume->resource.locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
@@ -400,13 +393,13 @@ static void volume_unload(struct wined3d_resource *resource)
context = context_acquire(device, NULL);
wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM);
context_release(context);
- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_SYSMEM);
}
else
{
ERR("Out of memory when unloading volume %p.\n", volume);
wined3d_resource_validate_location(&volume->resource, WINED3D_LOCATION_DISCARDED);
- wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED);
+ wined3d_resource_invalidate_location(&volume->resource, ~WINED3D_LOCATION_DISCARDED);
}
if (volume->pbo)
@@ -640,7 +633,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
{
wined3d_texture_set_dirty(volume->container);
- wined3d_volume_invalidate_location(volume, ~volume->resource.map_binding);
+ wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding);
}
volume->resource.map_count++;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5ca3ab8..fd28fa5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2115,6 +2115,7 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_H
DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_resource_validate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
+void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWORD location) DECLSPEC_HIDDEN;
/* Tests show that the start address of resources is 32 byte aligned */
#define RESOURCE_ALIGNMENT 16
@@ -2255,7 +2256,6 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi
void wined3d_volume_destroy(struct wined3d_volume *volume) 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;
void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context,
const struct wined3d_bo_address *data) DECLSPEC_HIDDEN;
--
2.1.3

View File

@ -0,0 +1,144 @@
From 39c0dd79f403ac4aac1cf660e207b0ed2703e81b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 17 Nov 2013 18:44:48 +0100
Subject: wined3d: Invalidate containers via callback.
---
dlls/wined3d/buffer.c | 6 ++++++
dlls/wined3d/resource.c | 2 ++
dlls/wined3d/surface.c | 6 ++++++
dlls/wined3d/texture.c | 6 ++++++
dlls/wined3d/volume.c | 12 +++++++++---
dlls/wined3d/wined3d_private.h | 1 +
6 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 989026f..d9bc820 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1123,11 +1123,17 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource)
return wined3d_buffer_decref(buffer_from_resource(resource));
}
+static void wined3d_buffer_location_invalidated(struct wined3d_resource *resource, DWORD location)
+{
+ ERR("Not yet implemented.\n");
+}
+
static const struct wined3d_resource_ops buffer_resource_ops =
{
buffer_resource_incref,
buffer_resource_decref,
buffer_unload,
+ wined3d_buffer_location_invalidated,
};
static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device,
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 1ec27d3..9d2db2b 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -344,6 +344,8 @@ void wined3d_resource_invalidate_location(struct wined3d_resource *resource, DWO
TRACE("Resource %p, setting %s.\n", resource, wined3d_debug_location(location));
resource->locations &= ~location;
TRACE("new location flags are %s.\n", wined3d_debug_location(resource->locations));
+
+ resource->resource_ops->resource_location_invalidated(resource, location);
}
void CDECL wined3d_resource_get_pitch(const struct wined3d_resource *resource, UINT *row_pitch,
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b56796e..6c2698a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1273,11 +1273,17 @@ static void surface_unload(struct wined3d_resource *resource)
resource_unload(resource);
}
+static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location)
+{
+ ERR("Not yet implemented.\n");
+}
+
static const struct wined3d_resource_ops surface_resource_ops =
{
surface_resource_incref,
surface_resource_decref,
surface_unload,
+ wined3d_surface_location_invalidated,
};
static const struct wined3d_surface_ops surface_ops =
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index f003fa2..c42e475 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -986,11 +986,17 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
wined3d_texture_unload_gl_texture(texture);
}
+static void wined3d_texture_load_location_invalidated(struct wined3d_resource *resource, DWORD location)
+{
+ ERR("Should not be called on textures.\n");
+}
+
static const struct wined3d_resource_ops texture_resource_ops =
{
texture_resource_incref,
texture_resource_decref,
wined3d_texture_unload,
+ wined3d_texture_load_location_invalidated,
};
static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc,
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 3b742d2..6921b87 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -631,10 +631,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
- {
- wined3d_texture_set_dirty(volume->container);
wined3d_resource_invalidate_location(&volume->resource, ~volume->resource.map_binding);
- }
volume->resource.map_count++;
@@ -688,11 +685,20 @@ static ULONG volume_resource_decref(struct wined3d_resource *resource)
return wined3d_volume_decref(volume_from_resource(resource));
}
+static void wined3d_volume_location_invalidated(struct wined3d_resource *resource, DWORD location)
+{
+ struct wined3d_volume *volume = volume_from_resource(resource);
+
+ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
+ wined3d_texture_set_dirty(volume->container);
+}
+
static const struct wined3d_resource_ops volume_resource_ops =
{
volume_resource_incref,
volume_resource_decref,
volume_unload,
+ wined3d_volume_location_invalidated,
};
static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index fd28fa5..60d1b56 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2057,6 +2057,7 @@ struct wined3d_resource_ops
ULONG (*resource_incref)(struct wined3d_resource *resource);
ULONG (*resource_decref)(struct wined3d_resource *resource);
void (*resource_unload)(struct wined3d_resource *resource);
+ void (*resource_location_invalidated)(struct wined3d_resource *resource, DWORD location);
};
struct wined3d_resource
--
2.1.3

View File

@ -0,0 +1,327 @@
From 421ef7716a0748076fd14bb607849f81ab149679 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 4 Jan 2014 01:02:15 +0100
Subject: wined3d: Remove surface_invalidate_location.
---
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/context.c | 2 +-
dlls/wined3d/device.c | 2 +-
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 47 ++++++++++++++++-----------------------
dlls/wined3d/swapchain.c | 12 +++++-----
dlls/wined3d/texture.c | 6 ++---
dlls/wined3d/wined3d_private.h | 1 -
8 files changed, 31 insertions(+), 43 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 08f92cb..f612099 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7687,7 +7687,7 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
}
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 1f34992..61c074f 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3085,7 +3085,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
if (texture->texture_srgb.name)
wined3d_texture_load(texture, context, TRUE);
wined3d_texture_load(texture, context, FALSE);
- surface_invalidate_location(context->current_rt, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&context->current_rt->resource, WINED3D_LOCATION_DRAWABLE);
}
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 600afed..70a30f0 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -393,7 +393,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if (rt)
{
wined3d_resource_validate_location(&rt->resource, rt->container->resource.draw_binding);
- surface_invalidate_location(rt, ~rt->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&rt->resource, ~rt->container->resource.draw_binding);
}
}
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 7034b25..eef7e2c 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -626,7 +626,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if (target)
{
surface_load_location(target, context, target->container->resource.draw_binding);
- surface_invalidate_location(target, ~target->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&target->resource, ~target->container->resource.draw_binding);
}
}
}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6c2698a..ef52ed0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -599,7 +599,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
return;
wined3d_resource_free_sysmem(&surface->resource);
- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
}
static void surface_release_client_storage(struct wined3d_surface *surface)
@@ -1185,7 +1185,7 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
checkGLcall("glDeleteBuffersARB(1, &surface->pbo)");
surface->pbo = 0;
- surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER);
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_BUFFER);
}
static ULONG surface_resource_incref(struct wined3d_resource *resource)
@@ -1225,7 +1225,7 @@ static void surface_unload(struct wined3d_resource *resource)
surface_prepare_system_memory(surface);
memset(surface->resource.heap_memory, 0, surface->resource.size);
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
- surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_SYSMEM);
/* We also get here when the ddraw swapchain is destroyed, for example
* for a mode switch. In this case this surface won't necessarily be
@@ -1237,7 +1237,7 @@ static void surface_unload(struct wined3d_resource *resource)
{
surface_prepare_map_memory(surface);
surface_load_location(surface, context, surface->resource.map_binding);
- surface_invalidate_location(surface, ~surface->resource.map_binding);
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
}
/* Destroy PBOs, but load them into real sysmem before */
@@ -1275,7 +1275,10 @@ static void surface_unload(struct wined3d_resource *resource)
static void wined3d_surface_location_invalidated(struct wined3d_resource *resource, DWORD location)
{
- ERR("Not yet implemented.\n");
+ struct wined3d_surface *surface = surface_from_resource(resource);
+
+ if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
+ wined3d_texture_set_dirty(surface->container);
}
static const struct wined3d_resource_ops surface_resource_ops =
@@ -1742,7 +1745,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
return WINED3D_OK;
}
@@ -1873,7 +1876,7 @@ void surface_load(struct wined3d_surface *surface, struct wined3d_context *conte
surface_prepare_map_memory(surface);
surface_load_location(surface, context, surface->resource.map_binding);
- surface_invalidate_location(surface, ~surface->resource.map_binding);
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
/* Switching color keying on / off may change the internal format. */
if (ck_changed)
wined3d_texture_force_reload(surface->container);
@@ -2668,7 +2671,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
- surface_invalidate_location(surface, ~surface->resource.map_binding);
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
switch (surface->resource.map_binding)
{
@@ -2784,7 +2787,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
}
surface_load_location(surface, context, WINED3D_LOCATION_DIB);
- surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB);
+ wined3d_resource_invalidate_location(&surface->resource, ~WINED3D_LOCATION_DIB);
if (context)
context_release(context);
@@ -2833,7 +2836,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
context = context_acquire(device, NULL);
surface_load_location(surface, context, surface->resource.map_binding);
- surface_invalidate_location(surface, WINED3D_LOCATION_DIB);
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_DIB);
if (context)
context_release(context);
}
@@ -3207,7 +3210,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
}
/* Uses the hardware to stretch and flip the image */
@@ -3275,7 +3278,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
- src_surface->resource.locations &= ~WINED3D_LOCATION_TEXTURE_RGB;
+ wined3d_resource_invalidate_location(&src_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3481,7 +3484,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
/* The texture is now most up to date - If the surface is a render target
* and has a drawable, this path is never entered. */
wined3d_resource_validate_location(&dst_surface->resource, WINED3D_LOCATION_TEXTURE_RGB);
- surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB);
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~WINED3D_LOCATION_TEXTURE_RGB);
}
/* Front buffer coordinates are always full screen coordinates, but our GL
@@ -3794,7 +3797,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
(old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
}
@@ -4038,18 +4041,6 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
surface->ds_current_size.cy = surface->resource.height;
}
-void surface_invalidate_location(struct wined3d_surface *surface, DWORD location)
-{
- TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
-
- if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
- wined3d_texture_set_dirty(surface->container);
- surface->resource.locations &= ~location;
-
- if (!surface->resource.locations)
- ERR("Surface %p does not have any up to date location.\n", surface);
-}
-
static DWORD resource_access_from_location(DWORD location)
{
switch (location)
@@ -5528,7 +5519,7 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
context_release(context);
wined3d_resource_validate_location(&dst_surface->resource, dst_surface->container->resource.draw_binding);
- surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&dst_surface->resource, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
}
@@ -5657,7 +5648,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
{
wined3d_resource_free_sysmem(&surface->resource);
wined3d_resource_validate_location(&surface->resource, WINED3D_LOCATION_DIB);
- surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM);
+ wined3d_resource_invalidate_location(&surface->resource, WINED3D_LOCATION_SYSMEM);
}
return hr;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index bdb4b67..e64715e 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -512,7 +512,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB);
- surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
swapchain->render_to_fbo = TRUE;
swapchain_update_draw_bindings(swapchain);
}
@@ -574,15 +574,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
else
{
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
wined3d_resource_validate_location(&back_buffer->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&back_buffer->resource, ~WINED3D_LOCATION_DRAWABLE);
}
}
else
{
wined3d_resource_validate_location(&front->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&front->resource, ~WINED3D_LOCATION_DRAWABLE);
/* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM
* and INTEXTURE copies can keep their old content if they have any defined content.
* If the swapeffect is COPY, the content remains the same. If it is FLIP however,
@@ -591,7 +591,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
{
wined3d_resource_validate_location(&back_buffer->resource, back_buffer->container->resource.draw_binding);
- surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding);
+ wined3d_resource_invalidate_location(&back_buffer->resource, ~back_buffer->container->resource.draw_binding);
}
}
@@ -866,7 +866,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
if (!(device->wined3d->flags & WINED3D_NO3D))
{
wined3d_resource_validate_location(&front_buffer->resource, WINED3D_LOCATION_DRAWABLE);
- surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE);
+ wined3d_resource_invalidate_location(&front_buffer->resource, ~WINED3D_LOCATION_DRAWABLE);
}
/* MSDN says we're only allowed a single fullscreen swapchain per device,
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index c42e475..941d935 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -832,7 +832,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
context = context_acquire(surface->resource.device, NULL);
surface_load_location(surface, context, surface->resource.map_binding);
context_release(context);
- surface_invalidate_location(surface, ~surface->resource.map_binding);
+ wined3d_resource_invalidate_location(&surface->resource, ~surface->resource.map_binding);
}
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
@@ -844,9 +844,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location)
{
- struct wined3d_surface *surface = surface_from_resource(sub_resource);
-
- surface_invalidate_location(surface, location);
+ wined3d_resource_invalidate_location(sub_resource, location);
}
/* Context activation is done by the caller. */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 60d1b56..640aa95 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2351,7 +2351,6 @@ HRESULT surface_color_fill(struct wined3d_surface *s,
GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
-void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN;
void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void surface_load_ds_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
--
2.1.3

View File

@ -0,0 +1,171 @@
From 2341723442d5ab7fb42bb82d066b306cc458813d 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.
I may want to change this to keep this in the surface. Not sure yet.
---
dlls/wined3d/surface.c | 32 ++++++++++++++++----------------
dlls/wined3d/swapchain.c | 6 +++---
dlls/wined3d/wined3d_private.h | 4 +---
3 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ef52ed0..c689880 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -88,7 +88,7 @@ static void surface_cleanup(struct wined3d_surface *surface)
{
DeleteDC(surface->hDC);
DeleteObject(surface->dib.DIBsection);
- surface->dib.bitmap_data = NULL;
+ surface->resource.bitmap_data = NULL;
}
if (surface->overlay_dest)
@@ -456,7 +456,7 @@ static 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);
- surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->dib.bitmap_data, 0, 0);
+ surface->dib.DIBsection = CreateDIBSection(0, b_info, DIB_RGB_COLORS, &surface->resource.bitmap_data, 0, 0);
if (!surface->dib.DIBsection)
{
@@ -465,7 +465,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
return HRESULT_FROM_WIN32(GetLastError());
}
- TRACE("DIBSection at %p.\n", surface->dib.bitmap_data);
+ TRACE("DIBSection at %p.\n", surface->resource.bitmap_data);
surface->dib.bitmap_size = b_info->bmiHeader.biSizeImage;
HeapFree(GetProcessHeap(), 0, b_info);
@@ -490,13 +490,13 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win
}
if (location & WINED3D_LOCATION_USER_MEMORY)
{
- data->addr = surface->user_memory;
+ data->addr = surface->resource.user_memory;
data->buffer_object = 0;
return;
}
if (location & WINED3D_LOCATION_DIB)
{
- data->addr = surface->dib.bitmap_data;
+ data->addr = surface->resource.bitmap_data;
data->buffer_object = 0;
return;
}
@@ -569,13 +569,13 @@ void surface_prepare_map_memory(struct wined3d_surface *surface)
break;
case WINED3D_LOCATION_USER_MEMORY:
- if (!surface->user_memory)
- ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->user_memory is NULL.\n");
+ if (!surface->resource.user_memory)
+ ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->resource.user_memory is NULL.\n");
break;
case WINED3D_LOCATION_DIB:
- if (!surface->dib.bitmap_data)
- ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->dib.bitmap_data is NULL.\n");
+ if (!surface->resource.bitmap_data)
+ ERR("Map binding is set to WINED3D_LOCATION_DIB but surface->resource.bitmap_data is NULL.\n");
break;
case WINED3D_LOCATION_BUFFER:
@@ -2190,7 +2190,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
{
DeleteDC(surface->hDC);
DeleteObject(surface->dib.DIBsection);
- surface->dib.bitmap_data = NULL;
+ surface->resource.bitmap_data = NULL;
surface->flags &= ~SFLAG_DIBSECTION;
create_dib = TRUE;
}
@@ -2222,7 +2222,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
else
surface->flags &= ~SFLAG_NONPOW2;
- 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;
@@ -2680,11 +2680,11 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
break;
case WINED3D_LOCATION_USER_MEMORY:
- base_memory = surface->user_memory;
+ base_memory = surface->resource.user_memory;
break;
case WINED3D_LOCATION_DIB:
- base_memory = surface->dib.bitmap_data;
+ base_memory = surface->resource.bitmap_data;
break;
case WINED3D_LOCATION_BUFFER:
@@ -3052,9 +3052,9 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back)
{
void* tmp;
- tmp = front->dib.bitmap_data;
- front->dib.bitmap_data = back->dib.bitmap_data;
- back->dib.bitmap_data = tmp;
+ tmp = front->resource.bitmap_data;
+ front->resource.bitmap_data = back->resource.bitmap_data;
+ back->resource.bitmap_data = tmp;
tmp = front->resource.heap_memory;
front->resource.heap_memory = back->resource.heap_memory;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index e64715e..17f1afe 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -695,9 +695,9 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain, const REC
{
void *tmp;
- tmp = front->dib.bitmap_data;
- front->dib.bitmap_data = back->dib.bitmap_data;
- back->dib.bitmap_data = tmp;
+ tmp = front->resource.bitmap_data;
+ front->resource.bitmap_data = back->resource.bitmap_data;
+ back->resource.bitmap_data = tmp;
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 640aa95..52280a7 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2080,7 +2080,7 @@ struct wined3d_resource
UINT depth;
UINT size;
DWORD priority;
- void *heap_memory;
+ void *heap_memory, *user_memory, *bitmap_data;
UINT custom_row_pitch, custom_slice_pitch;
struct list resource_list_entry;
DWORD locations;
@@ -2263,7 +2263,6 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
struct wined3d_surface_dib
{
HBITMAP DIBsection;
- void *bitmap_data;
UINT bitmap_size;
};
@@ -2297,7 +2296,6 @@ struct wined3d_surface
struct wined3d_resource resource;
const struct wined3d_surface_ops *surface_ops;
struct wined3d_texture *container;
- void *user_memory;
DWORD flags;
--
2.1.3

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