You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
wined3d-CSMT_Main: Reenable CSMT patchset.
This commit is contained in:
@@ -361,6 +361,7 @@ patch_enable_all ()
|
||||
enable_winecfg_Unmounted_Devices="$1"
|
||||
enable_wined3d_Accounting="$1"
|
||||
enable_wined3d_CSMT_Helper="$1"
|
||||
enable_wined3d_CSMT_Main="$1"
|
||||
enable_wined3d_DXTn="$1"
|
||||
enable_wined3d_Limit_Vram="$1"
|
||||
enable_wined3d_QUERY_Stubs="$1"
|
||||
@@ -1258,6 +1259,9 @@ patch_enable ()
|
||||
wined3d-CSMT_Helper)
|
||||
enable_wined3d_CSMT_Helper="$2"
|
||||
;;
|
||||
wined3d-CSMT_Main)
|
||||
enable_wined3d_CSMT_Main="$2"
|
||||
;;
|
||||
wined3d-DXTn)
|
||||
enable_wined3d_DXTn="$2"
|
||||
;;
|
||||
@@ -1983,6 +1987,13 @@ if test "$enable_wpcap_Dynamic_Linking" -eq 1; then
|
||||
enable_wpcap_Several_Fixes=1
|
||||
fi
|
||||
|
||||
if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
if test "$enable_wined3d_CSMT_Helper" -gt 1; then
|
||||
abort "Patchset wined3d-CSMT_Helper disabled, but wined3d-CSMT_Main depends on that."
|
||||
fi
|
||||
enable_wined3d_CSMT_Helper=1
|
||||
fi
|
||||
|
||||
if test "$enable_wined3d_CSMT_Helper" -eq 1; then
|
||||
if test "$enable_makedep_PARENTSPEC" -gt 1; then
|
||||
abort "Patchset makedep-PARENTSPEC disabled, but wined3d-CSMT_Helper depends on that."
|
||||
@@ -1990,12 +2001,24 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
|
||||
if test "$enable_ntdll_DllRedirects" -gt 1; then
|
||||
abort "Patchset ntdll-DllRedirects disabled, but wined3d-CSMT_Helper depends on that."
|
||||
fi
|
||||
if test "$enable_wined3d_Accounting" -gt 1; then
|
||||
abort "Patchset wined3d-Accounting disabled, but wined3d-CSMT_Helper depends on that."
|
||||
fi
|
||||
if test "$enable_wined3d_DXTn" -gt 1; then
|
||||
abort "Patchset wined3d-DXTn disabled, but wined3d-CSMT_Helper depends on that."
|
||||
fi
|
||||
if test "$enable_wined3d_QUERY_Stubs" -gt 1; then
|
||||
abort "Patchset wined3d-QUERY_Stubs disabled, but wined3d-CSMT_Helper depends on that."
|
||||
fi
|
||||
if test "$enable_wined3d_Silence_FIXMEs" -gt 1; then
|
||||
abort "Patchset wined3d-Silence_FIXMEs disabled, but wined3d-CSMT_Helper depends on that."
|
||||
fi
|
||||
enable_makedep_PARENTSPEC=1
|
||||
enable_ntdll_DllRedirects=1
|
||||
enable_wined3d_Accounting=1
|
||||
enable_wined3d_DXTn=1
|
||||
enable_wined3d_QUERY_Stubs=1
|
||||
enable_wined3d_Silence_FIXMEs=1
|
||||
fi
|
||||
|
||||
if test "$enable_uxtheme_GTK_Theming" -eq 1; then
|
||||
@@ -7212,35 +7235,6 @@ if test "$enable_wined3d_Accounting" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-CSMT_Helper
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc, dlls/wined3d/wined3d_main.c
|
||||
# |
|
||||
if test "$enable_wined3d_CSMT_Helper" -eq 1; then
|
||||
patch_apply wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch
|
||||
patch_apply wined3d-CSMT_Helper/0002-wined3d-Add-warning-that-CSMT-patchset-is-disabled.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Add second dll with STAGING_CSMT definition set.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Add warning that CSMT patchset is disabled.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-Limit_Vram
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/wined3d/directx.c
|
||||
# |
|
||||
if test "$enable_wined3d_Limit_Vram" -eq 1; then
|
||||
patch_apply wined3d-Limit_Vram/0001-wined3d-Limit-the-vram-memory-to-LONG_MAX-only-on-32.patch
|
||||
(
|
||||
echo '+ { "Michael Müller", "wined3d: Limit the vram memory to LONG_MAX only on 32 bit.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-QUERY_Stubs
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@@ -7256,6 +7250,58 @@ if test "$enable_wined3d_QUERY_Stubs" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-Silence_FIXMEs
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/wined3d/resource.c, dlls/wined3d/state.c, dlls/wined3d/surface.c, dlls/wined3d/swapchain.c, dlls/wined3d/texture.c
|
||||
# |
|
||||
if test "$enable_wined3d_Silence_FIXMEs" -eq 1; then
|
||||
patch_apply wined3d-Silence_FIXMEs/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0002-wined3d-Display-FIXME-for-cmp-function-0-only-once.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0003-wined3d-Silence-repeated-resource_check_usage-FIXME.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0004-wined3d-Print-FIXME-only-once-in-surface_cpu_blt.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0005-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0006-wined3d-Silence-extremely-noisy-FIXME-in-wined3d_tex.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0007-wined3d-Display-FIXME-only-once-when-blen-op-is-0.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },';
|
||||
echo '+ { "Christian Costa", "wined3d: Display FIXME for cmp function 0 only once.", 1 },';
|
||||
echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },';
|
||||
echo '+ { "Christian Costa", "wined3d: Print FIXME only once in surface_cpu_blt.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Silence extremely noisy FIXME in wined3d_texture_add_dirty_region.", 1 },';
|
||||
echo '+ { "Christian Costa", "wined3d: Display FIXME only once when blen op is 0.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-CSMT_Helper
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting,
|
||||
# | wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc
|
||||
# |
|
||||
if test "$enable_wined3d_CSMT_Helper" -eq 1; then
|
||||
patch_apply wined3d-CSMT_Helper/0001-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Add second dll with STAGING_CSMT definition set.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-Limit_Vram
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/wined3d/directx.c
|
||||
# |
|
||||
if test "$enable_wined3d_Limit_Vram" -eq 1; then
|
||||
patch_apply wined3d-Limit_Vram/0001-wined3d-Limit-the-vram-memory-to-LONG_MAX-only-on-32.patch
|
||||
(
|
||||
echo '+ { "Michael Müller", "wined3d: Limit the vram memory to LONG_MAX only on 32 bit.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-Revert_PixelFormat
|
||||
# |
|
||||
# | Modified files:
|
||||
@@ -7285,27 +7331,293 @@ if test "$enable_wined3d_Revert_PixelFormat" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-Silence_FIXMEs
|
||||
# Patchset wined3d-CSMT_Main
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-Accounting,
|
||||
# | wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-CSMT_Helper
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#11674] Support for CSMT (command stream) to increase graphic performance
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/wined3d/resource.c, dlls/wined3d/state.c, dlls/wined3d/surface.c, dlls/wined3d/swapchain.c, dlls/wined3d/texture.c
|
||||
# | * 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/drawprim.c, dlls/wined3d/glsl_shader.c,
|
||||
# | dlls/wined3d/query.c, dlls/wined3d/resource.c, dlls/wined3d/sampler.c, dlls/wined3d/shader.c, dlls/wined3d/state.c,
|
||||
# | dlls/wined3d/stateblock.c, dlls/wined3d/surface.c, dlls/wined3d/swapchain.c, dlls/wined3d/texture.c,
|
||||
# | dlls/wined3d/utils.c, dlls/wined3d/vertexdeclaration.c, dlls/wined3d/view.c, dlls/wined3d/volume.c,
|
||||
# | dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h, dlls/winex11.drv/opengl.c
|
||||
# |
|
||||
if test "$enable_wined3d_Silence_FIXMEs" -eq 1; then
|
||||
patch_apply wined3d-Silence_FIXMEs/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0002-wined3d-Display-FIXME-for-cmp-function-0-only-once.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0003-wined3d-Silence-repeated-resource_check_usage-FIXME.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0004-wined3d-Print-FIXME-only-once-in-surface_cpu_blt.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0005-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0006-wined3d-Silence-extremely-noisy-FIXME-in-wined3d_tex.patch
|
||||
patch_apply wined3d-Silence_FIXMEs/0007-wined3d-Display-FIXME-only-once-when-blen-op-is-0.patch
|
||||
if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
patch_apply wined3d-CSMT_Main/0001-wined3d-Make-surface_load_location-return-nothing.patch
|
||||
patch_apply wined3d-CSMT_Main/0002-wined3d-Start-to-move-surface-volume_load_location-i.patch
|
||||
patch_apply wined3d-CSMT_Main/0003-wined3d-Call-texture_load_location-instead-of-surfac.patch
|
||||
patch_apply wined3d-CSMT_Main/0004-wined3d-Share-surface-and-volume-system-memory-loadi.patch
|
||||
patch_apply wined3d-CSMT_Main/0005-wined3d-Discard-the-backbuffer-in-discard-presents.patch
|
||||
patch_apply wined3d-CSMT_Main/0006-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
|
||||
patch_apply wined3d-CSMT_Main/0007-wined3d-Don-t-call-the-public-map-function-in-surfac.patch
|
||||
patch_apply wined3d-CSMT_Main/0008-wined3d-Move-the-framebuffer-into-wined3d_state.patch
|
||||
patch_apply wined3d-CSMT_Main/0009-wined3d-Preload-buffers-if-streamsrc-is-not-dirty.patch
|
||||
patch_apply wined3d-CSMT_Main/0010-wined3d-Hackily-introduce-a-multithreaded-command-st.patch
|
||||
patch_apply wined3d-CSMT_Main/0011-wined3d-Wait-for-resource-updates-to-finish-when-usi.patch
|
||||
patch_apply wined3d-CSMT_Main/0012-wined3d-Wait-for-the-cs-before-destroying-objects.patch
|
||||
patch_apply wined3d-CSMT_Main/0013-wined3d-Wait-for-the-CS-before-destroying-views.patch
|
||||
patch_apply wined3d-CSMT_Main/0014-wined3d-Give-the-cs-its-own-state.patch
|
||||
patch_apply wined3d-CSMT_Main/0015-wined3d-Send-float-constant-updates-through-the-comm.patch
|
||||
patch_apply wined3d-CSMT_Main/0016-wined3d-Request-a-glFinish-before-modifying-resource.patch
|
||||
patch_apply wined3d-CSMT_Main/0017-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch
|
||||
patch_apply wined3d-CSMT_Main/0018-wined3d-Don-t-call-glFinish-after-clears.patch
|
||||
patch_apply wined3d-CSMT_Main/0019-wined3d-Don-t-call-glFinish-after-draws.patch
|
||||
patch_apply wined3d-CSMT_Main/0020-wined3d-Pass-the-depth-stencil-to-swapchain-present.patch
|
||||
patch_apply wined3d-CSMT_Main/0021-wined3d-Keep-track-of-the-onscreen-depth-stencil-in-.patch
|
||||
patch_apply wined3d-CSMT_Main/0022-wined3d-Send-base-vertex-index-updates-through-the-c.patch
|
||||
patch_apply wined3d-CSMT_Main/0023-wined3d-Send-primitive-type-updates-through-the-comm.patch
|
||||
patch_apply wined3d-CSMT_Main/0024-wined3d-Send-bool-constant-updates-through-the-comma.patch
|
||||
patch_apply wined3d-CSMT_Main/0025-wined3d-Send-int-constant-updates-through-the-comman.patch
|
||||
patch_apply wined3d-CSMT_Main/0026-wined3d-Send-light-updates-through-the-command-strea.patch
|
||||
patch_apply wined3d-CSMT_Main/0027-wined3d-Prevent-the-command-stream-from-running-ahea.patch
|
||||
patch_apply wined3d-CSMT_Main/0028-wined3d-Wait-for-the-cs-to-finish-before-destroying-.patch
|
||||
patch_apply wined3d-CSMT_Main/0029-wined3d-Run-the-cs-asynchronously.patch
|
||||
patch_apply wined3d-CSMT_Main/0030-wined3d-Send-blits-through-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0031-wined3d-Hack-to-reject-unsupported-color-fills.patch
|
||||
patch_apply wined3d-CSMT_Main/0032-wined3d-Restore-some-wined3d_device_copy_sub_resourc.patch
|
||||
patch_apply wined3d-CSMT_Main/0033-wined3d-Don-t-force-strict-draw-ordering-for-multith.patch
|
||||
patch_apply wined3d-CSMT_Main/0034-wined3d-Send-render-target-view-clears-through-the-c.patch
|
||||
patch_apply wined3d-CSMT_Main/0035-wined3d-send-texture-maps-through-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0036-wined3d-Get-rid-of-the-end_scene-flush-and-finish.patch
|
||||
patch_apply wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch
|
||||
patch_apply wined3d-CSMT_Main/0038-wined3d-Don-t-preload-buffers-on-unmap.patch
|
||||
patch_apply wined3d-CSMT_Main/0039-wined3d-Don-t-call-glFinish-before-swapping.patch
|
||||
patch_apply wined3d-CSMT_Main/0040-wined3d-wined3d_-_query_issue-never-fails.patch
|
||||
patch_apply wined3d-CSMT_Main/0041-wined3d-Add-query-support-to-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0042-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch
|
||||
patch_apply wined3d-CSMT_Main/0043-wined3d-Poll-queries-automatically-in-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0044-wined3d-Introduce-a-separate-queue-for-priority-comm.patch
|
||||
patch_apply wined3d-CSMT_Main/0045-wined3d-Destroy-queries-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0046-wined3d-Separate-main-and-worker-thread-query-state.patch
|
||||
patch_apply wined3d-CSMT_Main/0047-wined3d-Don-t-poll-queries-that-failed-to-start.patch
|
||||
patch_apply wined3d-CSMT_Main/0048-wined3d-Remove-restated-queries-from-the-poll-list.patch
|
||||
patch_apply wined3d-CSMT_Main/0049-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch
|
||||
patch_apply wined3d-CSMT_Main/0050-wined3d-Put-this-into-the-query-poll-patch.patch
|
||||
patch_apply wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0052-wined3d-Don-t-access-device-state-in-clears.patch
|
||||
patch_apply wined3d-CSMT_Main/0053-wined3d-Avoid-destroying-views-in-color-and-depth-fi.patch
|
||||
patch_apply wined3d-CSMT_Main/0054-wined3d-Avoid-calling-wined3d_surface_blt-from-surfa.patch
|
||||
patch_apply wined3d-CSMT_Main/0055-wined3d-Send-update_texture-calls-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0056-wined3d-Get-rid-of-the-surface_upload_data-glFinish.patch
|
||||
patch_apply wined3d-CSMT_Main/0057-wined3d-Don-t-lock-the-src-volume-in-device_update_v.patch
|
||||
patch_apply wined3d-CSMT_Main/0058-wined3d-Handle-evit_managed_resources-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0059-wined3d-Introduce-resource-fencing.patch
|
||||
patch_apply wined3d-CSMT_Main/0060-wined3d-Fence-update_texture-calls.patch
|
||||
patch_apply wined3d-CSMT_Main/0061-wined3d-Dirtify-resources-on-unmap.patch
|
||||
patch_apply wined3d-CSMT_Main/0062-wined3d-Fence-texture-reads-in-draws.patch
|
||||
patch_apply wined3d-CSMT_Main/0063-wined3d-Fence-render-targets-and-depth-stencils.patch
|
||||
patch_apply wined3d-CSMT_Main/0064-wined3d-Fence-blit-operations.patch
|
||||
patch_apply wined3d-CSMT_Main/0065-wined3d-Fence-color_fill-operations.patch
|
||||
patch_apply wined3d-CSMT_Main/0066-wined3d-Fence-clear-calls.patch
|
||||
patch_apply wined3d-CSMT_Main/0067-wined3d-Fence-present-calls.patch
|
||||
patch_apply wined3d-CSMT_Main/0068-d3d9-tests-Remove-a-TODO-that-has-been-hacked-away.patch
|
||||
patch_apply wined3d-CSMT_Main/0069-wined3d-Make-resource-maps-and-unmaps-a-priority-com.patch
|
||||
patch_apply wined3d-CSMT_Main/0070-wined3d-Send-update_sub_resource-calls-through-the-c.patch
|
||||
patch_apply wined3d-CSMT_Main/0071-wined3d-Dirtify-changed-textures-through-the-command.patch
|
||||
patch_apply wined3d-CSMT_Main/0072-wined3d-Wrap-GL-BOs-in-a-structure.patch
|
||||
patch_apply wined3d-CSMT_Main/0073-wined3d-Separate-resource-map-and-draw-buffers.patch
|
||||
patch_apply wined3d-CSMT_Main/0074-wined3d-Implement-DISCARD-texture-maps-with-PBOs.patch
|
||||
patch_apply wined3d-CSMT_Main/0075-wined3d-Implement-DISCARD-resource-maps-with-heap-me.patch
|
||||
patch_apply wined3d-CSMT_Main/0076-wined3d-Unset-some-objects-in-state_init_default.patch
|
||||
patch_apply wined3d-CSMT_Main/0077-wined3d-Don-t-request-the-frontbuffer-to-create-dumm.patch
|
||||
patch_apply wined3d-CSMT_Main/0078-wined3d-Use-double-buffered-buffers-for-multithreade.patch
|
||||
patch_apply wined3d-CSMT_Main/0079-wined3d-Don-t-synchronize-NOOVERWRITE-buffer-maps.patch
|
||||
patch_apply wined3d-CSMT_Main/0080-wined3d-Separate-buffer-map-write-and-draw-read-memo.patch
|
||||
patch_apply wined3d-CSMT_Main/0081-wined3d-Accelerate-DISCARD-buffer-maps.patch
|
||||
patch_apply wined3d-CSMT_Main/0082-wined3d-Accelerate-READONLY-buffer-maps.patch
|
||||
patch_apply wined3d-CSMT_Main/0083-wined3d-Access-the-buffer-dirty-areas-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0084-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0085-wined3d-Send-buffer-preloads-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0086-wined3d-Use-glBufferSubData-instead-of-glMapBufferRa.patch
|
||||
patch_apply wined3d-CSMT_Main/0087-wined3d-Separate-GL-buffer-discard-control-from-igno.patch
|
||||
patch_apply wined3d-CSMT_Main/0088-wined3d-Create-buffers-before-mapping-them.patch
|
||||
patch_apply wined3d-CSMT_Main/0089-wined3d-Destroy-views-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0090-wined3d-Remove-another-glFinish.patch
|
||||
patch_apply wined3d-CSMT_Main/0091-wined3d-Destroy-vertex-declarations-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0092-wined3d-Destroy-shaders-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0093-wined3d-Create-VBOs-through-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0094-wined3d-Clean-up-resource-data-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0095-wined3d-Clean-up-buffer-resource-data-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0096-Swapchain-waits.patch
|
||||
patch_apply wined3d-CSMT_Main/0097-wined3d-Clean-up-textures-through-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0098-wined3d-Unload-resources-through-the-CS-in-uninit_3d.patch
|
||||
patch_apply wined3d-CSMT_Main/0099-wined3d-Unload-resources-through-the-CS-in-device_re.patch
|
||||
patch_apply wined3d-CSMT_Main/0100-wined3d-Don-t-glFinish-after-a-depth-buffer-blit.patch
|
||||
patch_apply wined3d-CSMT_Main/0101-wined3d-Use-surface_blt_ugly-in-swapchain_gl_present.patch
|
||||
patch_apply wined3d-CSMT_Main/0102-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch
|
||||
patch_apply wined3d-CSMT_Main/0103-wined3d-Use-an-event-to-block-the-worker-thread-when.patch
|
||||
patch_apply wined3d-CSMT_Main/0104-wined3d-Fence-preload-operations.patch
|
||||
patch_apply wined3d-CSMT_Main/0105-wined3d-Set-map_heap_memory-NULL-when-allocating-a-P.patch
|
||||
patch_apply wined3d-CSMT_Main/0106-wined3d-Wait-only-for-the-buffer-to-be-idle.patch
|
||||
patch_apply wined3d-CSMT_Main/0107-wined3d-Add-a-comment-about-worker-thread-lag.patch
|
||||
patch_apply wined3d-CSMT_Main/0108-Winex11-complain-about-glfinish.patch
|
||||
patch_apply wined3d-CSMT_Main/0109-wined3d-Put-GL_APPLE_flush_buffer_range-syncing-back.patch
|
||||
patch_apply wined3d-CSMT_Main/0110-wined3d-Wait-for-the-resource-to-be-idle-when-destro.patch
|
||||
patch_apply wined3d-CSMT_Main/0111-wined3d-Don-t-sync-on-redundant-discard-calls.patch
|
||||
patch_apply wined3d-CSMT_Main/0112-wined3d-Don-t-discard-new-buffers.patch
|
||||
patch_apply wined3d-CSMT_Main/0113-wined3d-Don-t-try-to-sync-VBOs-manually-on-OSX-with-.patch
|
||||
patch_apply wined3d-CSMT_Main/0114-wined3d-Only-discard-buffers-that-are-in-use.patch
|
||||
patch_apply wined3d-CSMT_Main/0115-wined3d-Destroy-samplers-through-the-command-stream.patch
|
||||
patch_apply wined3d-CSMT_Main/0116-wined3d-Destroy-shader-resource-views-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0117-wined3d-Send-getdc-and-releasedc-through-the-command.patch
|
||||
patch_apply wined3d-CSMT_Main/0118-wined3d-Ignore-WINED3D_MAP_NO_DIRTY_UPDATE-in-resour.patch
|
||||
patch_apply wined3d-CSMT_Main/0119-d3d8-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch
|
||||
patch_apply wined3d-CSMT_Main/0120-d3d9-tests-D3DLOCK_NO_DIRTY_UPDATE-on-managed-textur.patch
|
||||
patch_apply wined3d-CSMT_Main/0121-wined3d-Create-dummy-textures-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0122-wined3d-Create-the-initial-context-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0123-wined3d-Recreate-ctx-and-dummy-textures-through-the-.patch
|
||||
patch_apply wined3d-CSMT_Main/0124-wined3d-Call-create_default_sampler-from-create_dumm.patch
|
||||
patch_apply wined3d-CSMT_Main/0125-wined3d-Delete-GL-contexts-through-the-CS-in-reset.patch
|
||||
patch_apply wined3d-CSMT_Main/0126-wined3d-Delete-GL-contexts-through-the-CS-in-uninit_.patch
|
||||
patch_apply wined3d-CSMT_Main/0127-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch
|
||||
patch_apply wined3d-CSMT_Main/0128-wined3d-Do-the-sampler-GL-init-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0129-wined3d-Remove-the-device_reset-CS-sync-fixme.patch
|
||||
patch_apply wined3d-CSMT_Main/0130-wined3d-Create-initial-DCs-through-the-CS.patch
|
||||
patch_apply wined3d-CSMT_Main/0131-wined3d-Assign-a-read-buffer-when-discarding-a-new-t.patch
|
||||
patch_apply wined3d-CSMT_Main/0132-wined3d-Do-not-query-available-GPU-memory-on-main-th.patch
|
||||
patch_apply wined3d-CSMT_Main/9998-wined3d-Enable-CSMT-by-default-print-a-winediag-mess.patch
|
||||
patch_apply wined3d-CSMT_Main/9999-IfDefined.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },';
|
||||
echo '+ { "Christian Costa", "wined3d: Display FIXME for cmp function 0 only once.", 1 },';
|
||||
echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },';
|
||||
echo '+ { "Christian Costa", "wined3d: Print FIXME only once in surface_cpu_blt.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Silence extremely noisy FIXME in wined3d_texture_add_dirty_region.", 1 },';
|
||||
echo '+ { "Christian Costa", "wined3d: Display FIXME only once when blen op is 0.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Make surface_load_location return nothing.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Start to move surface/volume_load_location into the texture.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Call texture_load_location instead of surface_load_location.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Share surface and volume system memory loading code.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Discard the backbuffer in discard presents.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_convert_format.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call the public map function in surface_cpu_blt.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Preload buffers if streamsrc is not dirty.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Hackily introduce a multithreaded command stream.", 1 },';
|
||||
echo '+ { "Henri Verbeet", "wined3d: Wait for resource updates to finish when using the multithreaded command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs before destroying objects.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Wait for the CS before destroying views.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Give the cs its own state.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send float constant updates through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Request a glFinish before modifying resources outside the cs.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Finish the cs before changing the texture lod.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after clears.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish after draws.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Pass the depth stencil to swapchain->present.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Keep track of the onscreen depth stencil in the command stream instead of the device.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send base vertex index updates through the cs.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send primitive type updates through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send bool constant updates through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send int constant updates through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send light updates through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Run the cs asynchronously.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Hack to reject unsupported color fills.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Restore some wined3d_device_copy_sub_resource_region checks.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t force strict draw ordering for multithreaded CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send render target view clears through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send texture maps through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Replace the linked lists with a ringbuffer.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t preload buffers on unmap.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish before swapping.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Wined3d_*_query_issue never fails.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Add query support to the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Check our CS state to find out if a query is done.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Poll queries automatically in the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Introduce a separate queue for priority commands.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Destroy queries through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Separate main and worker thread query state.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t poll queries that failed to start.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Remove restated queries from the poll list.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t reset the query state if it doesn'\''t have a ctx.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Put this into the query poll patch.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send texture preloads through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t access device state in clears.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Avoid destroying views in color and depth fills.", 1 },';
|
||||
echo '+ { "Matteo Bruni", "wined3d: Avoid calling wined3d_surface_blt() from surface_upload_from_surface().", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Get rid of the surface_upload_data glFinish.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t lock the src volume in device_update_volume.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Handle evit_managed_resources through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Introduce resource fencing.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Fence update_texture 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", "d3d9/tests: Remove a TODO that has been hacked away.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Make resource maps and unmaps a priority command.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send update_sub_resource calls through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Dirtify changed textures through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Separate resource map and draw buffers.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD texture maps with PBOs.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Implement DISCARD resource maps with heap memory.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Unset some objects in state_init_default.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: 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", "Swapchain waits.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Clean up textures through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in uninit_3d.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in device_reset.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Don'\''t glFinish after a depth buffer blit.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Use surface_blt_ugly in swapchain_gl_present.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: 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", "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", "Winex11: Complain about glfinish.", 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: Only discard buffers that are in use.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Destroy samplers through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Destroy shader resource views through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Send getdc and releasedc through the command stream.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Ignore WINED3D_MAP_NO_DIRTY_UPDATE in resource_map.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "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: Create dummy textures through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Create the initial context through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Recreate ctx and dummy textures through the CS after resets.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Call create_default_sampler from create_dummy_textures.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in reset.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in uninit_3d.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Do the sampler GL init through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Remove the device_reset CS sync fixme.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Create initial DCs through the CS.", 1 },';
|
||||
echo '+ { "Stefan Dösinger", "wined3d: Assign a read buffer when discarding a new texture.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Do not query available GPU memory on main thread when CSMT is enabled.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "wined3d: Enable CSMT by default, print a winediag message informing about this patchset.", 1 },';
|
||||
echo '+ { "Wine Staging Team", "Autogenerated #ifdef patch for wined3d-CSMT_Main.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
|
@@ -1,28 +0,0 @@
|
||||
From 351506a226133691c2dac3e83e964b304b5ddd90 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 21 Mar 2016 16:23:21 +0100
|
||||
Subject: wined3d: Add warning that CSMT patchset is disabled.
|
||||
|
||||
---
|
||||
dlls/wined3d/wined3d_main.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
|
||||
index fdb260e..d5c307e 100644
|
||||
--- a/dlls/wined3d/wined3d_main.c
|
||||
+++ b/dlls/wined3d/wined3d_main.c
|
||||
@@ -327,6 +327,11 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
|
||||
}
|
||||
}
|
||||
|
||||
+#if defined(STAGING_CSMT)
|
||||
+ FIXME_(winediag)("Please note that the experimental wined3d CSMT patchset has been disabled in this\n");
|
||||
+ FIXME_(winediag)("version of Wine Staging. Check out the release notes for further information.\n");
|
||||
+#endif /* STAGING_CSMT */
|
||||
+
|
||||
if (appkey) RegCloseKey( appkey );
|
||||
if (hkey) RegCloseKey( hkey );
|
||||
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -1,3 +1,6 @@
|
||||
Depends: wined3d-Accounting
|
||||
Depends: wined3d-DXTn
|
||||
Depends: wined3d-QUERY_Stubs
|
||||
Depends: wined3d-Silence_FIXMEs
|
||||
Depends: makedep-PARENTSPEC
|
||||
Depends: ntdll-DllRedirects
|
||||
|
@@ -1,41 +0,0 @@
|
||||
From f4f3123974b03c4c7d671ce36f41bef336b1a8a6 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:15 +0100
|
||||
Subject: Revert "wined3d: Call wined3d_texture_set_dirty() in
|
||||
wined3d_volume_invalidate_location()."
|
||||
|
||||
This reverts commit b23f21a9fb6e09afad6ac3327233130f8be979b2.
|
||||
---
|
||||
dlls/wined3d/volume.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index 457067d..2d88af6 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -109,11 +109,7 @@ void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD locat
|
||||
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location)
|
||||
{
|
||||
TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location));
|
||||
-
|
||||
- if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
- wined3d_texture_set_dirty(volume->container);
|
||||
volume->locations &= ~location;
|
||||
-
|
||||
TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations));
|
||||
}
|
||||
|
||||
@@ -556,7 +552,10 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
|
||||
}
|
||||
|
||||
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
|
||||
+ {
|
||||
+ wined3d_texture_set_dirty(texture);
|
||||
wined3d_volume_invalidate_location(volume, ~volume->resource.map_binding);
|
||||
+ }
|
||||
|
||||
volume->resource.map_count++;
|
||||
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -0,0 +1,100 @@
|
||||
From 5d3739d94ccb7e4a7bfaebf33cdb399a0707f9e7 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 29 Oct 2015 15:41:59 +0100
|
||||
Subject: wined3d: Make surface_load_location return nothing.
|
||||
|
||||
FIXME: I guess Henri disagrees.
|
||||
---
|
||||
dlls/wined3d/surface.c | 12 ++++++------
|
||||
dlls/wined3d/texture.c | 3 ++-
|
||||
dlls/wined3d/wined3d_private.h | 2 +-
|
||||
3 files changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index e0d7c80..3435d17 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -3035,7 +3035,7 @@ static void surface_load_renderbuffer(struct wined3d_surface *surface, struct wi
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */
|
||||
-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)
|
||||
{
|
||||
unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
|
||||
struct wined3d_texture *texture = surface->container;
|
||||
@@ -3053,7 +3053,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
|| (surface->ds_current_size.cx == surface_w && surface->ds_current_size.cy == surface_h)))
|
||||
{
|
||||
TRACE("Location (%#x) is already up to date.\n", location);
|
||||
- return WINED3D_OK;
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (WARN_ON(d3d))
|
||||
@@ -3091,7 +3091,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_co
|
||||
|
||||
FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n",
|
||||
wined3d_debug_location(sub_resource->locations), wined3d_debug_location(location));
|
||||
- return WINED3DERR_INVALIDCALL;
|
||||
+ return;
|
||||
}
|
||||
|
||||
switch (location)
|
||||
@@ -3104,7 +3104,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:
|
||||
@@ -3116,7 +3116,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:
|
||||
@@ -3133,7 +3133,7 @@ done:
|
||||
surface->ds_current_size.cy = surface_h;
|
||||
}
|
||||
|
||||
- return WINED3D_OK;
|
||||
+ return;
|
||||
}
|
||||
|
||||
static HRESULT ffp_blit_alloc(struct wined3d_device *device) { return WINED3D_OK; }
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 3a03bb6..fcea428 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1353,7 +1353,8 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int
|
||||
static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
- return SUCCEEDED(surface_load_location(texture->sub_resources[sub_resource_idx].u.surface, context, location));
|
||||
+ surface_load_location(texture->sub_resources[sub_resource_idx].u.surface, context, location);
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 274f620..d5fa2f0 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2708,7 +2708,7 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru
|
||||
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
|
||||
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
|
||||
struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||
-HRESULT surface_load_location(struct wined3d_surface *surface,
|
||||
+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 wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context,
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1,167 +0,0 @@
|
||||
From 50e69e1a480a8910aa50b5e6201213ef9d35fea5 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:35 +0100
|
||||
Subject: Revert "wined3d: Merge surface_remove_pbo() and
|
||||
wined3d_volume_free_pbo()."
|
||||
|
||||
This reverts commit 5141c082caabd0f18698fe611b57e885adf25fe7.
|
||||
---
|
||||
dlls/wined3d/surface.c | 19 ++++++++++++++++++-
|
||||
dlls/wined3d/texture.c | 27 ---------------------------
|
||||
dlls/wined3d/volume.c | 22 ++++++++++++++++++++++
|
||||
dlls/wined3d/wined3d_private.h | 2 --
|
||||
4 files changed, 40 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 469a493..3cd3782 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -996,6 +996,19 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info)
|
||||
+{
|
||||
+ GLuint *buffer_object;
|
||||
+
|
||||
+ buffer_object = &surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object;
|
||||
+ GL_EXTCALL(glDeleteBuffers(1, buffer_object));
|
||||
+ checkGLcall("glDeleteBuffers(1, buffer_object)");
|
||||
+
|
||||
+ *buffer_object = 0;
|
||||
+ surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER);
|
||||
+}
|
||||
+
|
||||
static ULONG surface_resource_incref(struct wined3d_resource *resource)
|
||||
{
|
||||
struct wined3d_surface *surface = surface_from_resource(resource);
|
||||
@@ -1058,6 +1071,10 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
surface_invalidate_location(surface, ~surface->resource.map_binding);
|
||||
}
|
||||
|
||||
+ /* Destroy PBOs, but load them into real sysmem before */
|
||||
+ if (surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object)
|
||||
+ surface_remove_pbo(surface, gl_info);
|
||||
+
|
||||
/* Destroy fbo render buffers. This is needed for implicit render targets, for
|
||||
* all application-created targets the application has to release the surface
|
||||
* before calling _Reset
|
||||
@@ -3664,7 +3681,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
|
||||
surface_prepare_map_memory(surface);
|
||||
surface_load_location(surface, context, surface->resource.map_binding);
|
||||
- wined3d_texture_remove_buffer_object(texture, surface_get_sub_resource_idx(surface), gl_info);
|
||||
+ surface_remove_pbo(surface, gl_info);
|
||||
}
|
||||
|
||||
surface_get_memory(surface, &data, surface->locations);
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 90a3978..9846f07 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -74,23 +74,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
-/* Context activation is done by the caller. */
|
||||
-void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
|
||||
- unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info)
|
||||
-{
|
||||
- GLuint *buffer_object;
|
||||
-
|
||||
- buffer_object = &texture->sub_resources[sub_resource_idx].buffer_object;
|
||||
- GL_EXTCALL(glDeleteBuffers(1, buffer_object));
|
||||
- checkGLcall("glDeleteBuffers");
|
||||
- texture->texture_ops->texture_sub_resource_invalidate_location(
|
||||
- texture->sub_resources[sub_resource_idx].resource, WINED3D_LOCATION_BUFFER);
|
||||
- *buffer_object = 0;
|
||||
-
|
||||
- TRACE("Deleted buffer object %u for texture %p, sub-resource %u.\n",
|
||||
- *buffer_object, texture, sub_resource_idx);
|
||||
-}
|
||||
-
|
||||
/* A GL context is provided by the caller */
|
||||
static void gltexture_delete(struct wined3d_device *device, const struct wined3d_gl_info *gl_info,
|
||||
struct gl_texture *tex)
|
||||
@@ -996,7 +979,6 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
{
|
||||
struct wined3d_texture *texture = wined3d_texture_from_resource(resource);
|
||||
UINT sub_count = texture->level_count * texture->layer_count;
|
||||
- struct wined3d_context *context = NULL;
|
||||
UINT i;
|
||||
|
||||
TRACE("texture %p.\n", texture);
|
||||
@@ -1006,16 +988,7 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
struct wined3d_resource *sub_resource = texture->sub_resources[i].resource;
|
||||
|
||||
sub_resource->resource_ops->resource_unload(sub_resource);
|
||||
-
|
||||
- if (texture->sub_resources[i].buffer_object)
|
||||
- {
|
||||
- if (!context)
|
||||
- context = context_acquire(texture->resource.device, NULL);
|
||||
- wined3d_texture_remove_buffer_object(texture, i, context->gl_info);
|
||||
- }
|
||||
}
|
||||
- if (context)
|
||||
- context_release(context);
|
||||
|
||||
wined3d_texture_force_reload(texture);
|
||||
wined3d_texture_unload_gl_texture(texture);
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index 2d88af6..fcadd39 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -362,6 +362,19 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *
|
||||
srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
+static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
|
||||
+{
|
||||
+ GLuint *buffer_object = &volume->container->sub_resources[volume->texture_level].buffer_object;
|
||||
+ struct wined3d_context *context = context_acquire(volume->resource.device, NULL);
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
+
|
||||
+ TRACE("Deleting PBO %u belonging to volume %p.\n", *buffer_object, volume);
|
||||
+ GL_EXTCALL(glDeleteBuffers(1, buffer_object));
|
||||
+ checkGLcall("glDeleteBuffers");
|
||||
+ *buffer_object = 0;
|
||||
+ context_release(context);
|
||||
+}
|
||||
+
|
||||
void wined3d_volume_cleanup(struct wined3d_volume *volume)
|
||||
{
|
||||
TRACE("volume %p.\n", volume);
|
||||
@@ -394,6 +407,15 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
+ if (volume->container->sub_resources[volume->texture_level].buffer_object)
|
||||
+ {
|
||||
+ /* Should not happen because only dynamic default pool volumes
|
||||
+ * have a buffer, and those are not evicted by device_evit_managed_resources
|
||||
+ * and must be freed before a non-ex device reset. */
|
||||
+ ERR("Unloading a volume with a buffer\n");
|
||||
+ wined3d_volume_free_pbo(volume);
|
||||
+ }
|
||||
+
|
||||
/* The texture name is managed by the container. */
|
||||
|
||||
resource_unload(resource);
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index da36985..28121b7 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2424,8 +2424,6 @@ void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
|
||||
unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
|
||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
-void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
|
||||
- unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
|
||||
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -0,0 +1,236 @@
|
||||
From e9556c0ee5a1e3ca28cfe317b63affa2ec99141d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 29 Oct 2015 17:33:23 +0100
|
||||
Subject: wined3d: Start to move surface/volume_load_location into the texture.
|
||||
|
||||
FIXME 1: This can be split up into a case by case replace.
|
||||
FIXME 2: This breaks some rtv->resource != buffer checks.
|
||||
|
||||
wined3d_surface_prepare will be moved into the texture a lot later, after
|
||||
moving allocation of all locations (including sysmem) there.
|
||||
---
|
||||
dlls/wined3d/context.c | 5 ++---
|
||||
dlls/wined3d/device.c | 11 ++++++-----
|
||||
dlls/wined3d/drawprim.c | 10 +++++-----
|
||||
dlls/wined3d/swapchain.c | 7 ++++---
|
||||
dlls/wined3d/texture.c | 21 +++++++++++++++------
|
||||
dlls/wined3d/wined3d_private.h | 2 ++
|
||||
6 files changed, 34 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index 114422b..d6a36c9 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -2379,7 +2379,6 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
|
||||
{
|
||||
/* Onscreen surfaces are always in a swapchain */
|
||||
struct wined3d_swapchain *swapchain = context->current_rt.texture->swapchain;
|
||||
- struct wined3d_surface *surface;
|
||||
|
||||
if (context->render_offscreen || !depth_stencil) return;
|
||||
if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->format)) return;
|
||||
@@ -2390,8 +2389,8 @@ static void context_validate_onscreen_formats(struct wined3d_context *context,
|
||||
WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n");
|
||||
|
||||
/* The currently active context is the necessary context to access the swapchain's onscreen buffers */
|
||||
- surface = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_texture_load_location(context->current_rt.texture, context->current_rt.sub_resource_idx,
|
||||
+ context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
swapchain->render_to_fbo = TRUE;
|
||||
swapchain_update_draw_bindings(swapchain);
|
||||
context_set_render_offscreen(context, TRUE);
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 312c8c1..8f5122a 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -324,14 +324,15 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
|
||||
for (i = 0; i < rt_count; ++i)
|
||||
{
|
||||
struct wined3d_rendertarget_view *rtv = fb->render_targets[i];
|
||||
- struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(rtv);
|
||||
|
||||
- if (rt && rtv->format->id != WINED3DFMT_NULL)
|
||||
+ if (rtv && rtv->format->id != WINED3DFMT_NULL)
|
||||
{
|
||||
+ struct wined3d_texture *rt = wined3d_texture_from_resource(fb->render_targets[i]->resource);
|
||||
+
|
||||
if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, rect_count ? clear_rect : NULL))
|
||||
- surface_load_location(rt, context, rtv->resource->draw_binding);
|
||||
+ wined3d_texture_load_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding);
|
||||
else
|
||||
- wined3d_texture_prepare_location(rt->container, rtv->sub_resource_idx,
|
||||
+ wined3d_texture_prepare_location(rt, rtv->sub_resource_idx,
|
||||
context, rtv->resource->draw_binding);
|
||||
}
|
||||
}
|
||||
@@ -4155,7 +4156,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
|
||||
if (!dst_point.x && !dst_point.y && src_rect.right == width && src_rect.bottom == height)
|
||||
wined3d_texture_prepare_texture(texture, context, FALSE);
|
||||
else
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
|
||||
wined3d_surface_upload_data(surface, gl_info, resource->format,
|
||||
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
|
||||
index c086491..78628c5 100644
|
||||
--- a/dlls/wined3d/drawprim.c
|
||||
+++ b/dlls/wined3d/drawprim.c
|
||||
@@ -437,19 +437,19 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
for (i = 0; i < gl_info->limits.buffers; ++i)
|
||||
{
|
||||
struct wined3d_rendertarget_view *rtv = fb->render_targets[i];
|
||||
- struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(rtv);
|
||||
|
||||
- if (target && rtv->format->id != WINED3DFMT_NULL)
|
||||
+ if (rtv && rtv->format->id != WINED3DFMT_NULL)
|
||||
{
|
||||
+ struct wined3d_texture *target = wined3d_texture_from_resource(rtv->resource);
|
||||
if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
|
||||
{
|
||||
- surface_load_location(target, context, rtv->resource->draw_binding);
|
||||
- wined3d_texture_invalidate_location(target->container,
|
||||
+ wined3d_texture_load_location(target, rtv->sub_resource_idx, context, rtv->resource->draw_binding);
|
||||
+ wined3d_texture_invalidate_location(target,
|
||||
rtv->sub_resource_idx, ~rtv->resource->draw_binding);
|
||||
}
|
||||
else
|
||||
{
|
||||
- wined3d_texture_prepare_location(target->container, rtv->sub_resource_idx,
|
||||
+ wined3d_texture_prepare_location(target, rtv->sub_resource_idx,
|
||||
context, rtv->resource->draw_binding);
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index f65a00d..df840f3 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -327,7 +327,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
|
||||
if (texture->resource.multisample_type)
|
||||
{
|
||||
location = WINED3D_LOCATION_RB_RESOLVED;
|
||||
- surface_load_location(back_buffer, context, location);
|
||||
+ wined3d_texture_load_location(texture, 0, context, location);
|
||||
}
|
||||
|
||||
context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, back_buffer, NULL, location);
|
||||
@@ -556,14 +556,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
|
||||
*/
|
||||
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);
|
||||
+ wined3d_texture_load_location(back_buffer->container, 0, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
wined3d_texture_invalidate_location(back_buffer->container, 0, WINED3D_LOCATION_DRAWABLE);
|
||||
swapchain->render_to_fbo = TRUE;
|
||||
swapchain_update_draw_bindings(swapchain);
|
||||
}
|
||||
else
|
||||
{
|
||||
- surface_load_location(back_buffer, context, back_buffer->container->resource.draw_binding);
|
||||
+ wined3d_texture_load_location(swapchain->back_buffers[0], 0, context,
|
||||
+ swapchain->back_buffers[0]->resource.draw_binding);
|
||||
}
|
||||
|
||||
if (swapchain->render_to_fbo)
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 465fb05..619105f 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -317,7 +317,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
for (i = 0; i < sub_count; ++i)
|
||||
{
|
||||
if (texture->sub_resources[i].locations == texture->resource.map_binding
|
||||
- && !texture->texture_ops->texture_load_location(texture, i, context, map_binding))
|
||||
+ && !wined3d_texture_load_location(texture, i, context, map_binding))
|
||||
ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
|
||||
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
|
||||
wined3d_texture_remove_buffer_object(texture, i, context->gl_info);
|
||||
@@ -786,7 +786,7 @@ void wined3d_texture_load(struct wined3d_texture *texture,
|
||||
TRACE("Reloading because of color key value change.\n");
|
||||
for (i = 0; i < sub_count; i++)
|
||||
{
|
||||
- if (!texture->texture_ops->texture_load_location(texture, i, context, texture->resource.map_binding))
|
||||
+ if (!wined3d_texture_load_location(texture, i, context, texture->resource.map_binding))
|
||||
ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
|
||||
else
|
||||
wined3d_texture_invalidate_location(texture, i, ~texture->resource.map_binding);
|
||||
@@ -804,7 +804,7 @@ void wined3d_texture_load(struct wined3d_texture *texture,
|
||||
/* Reload the surfaces if the texture is marked dirty. */
|
||||
for (i = 0; i < sub_count; ++i)
|
||||
{
|
||||
- if (!texture->texture_ops->texture_load_location(texture, i, context,
|
||||
+ if (!wined3d_texture_load_location(texture, i, context,
|
||||
srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB))
|
||||
ERR("Failed to load location (srgb %#x).\n", srgb);
|
||||
}
|
||||
@@ -1285,7 +1285,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
|
||||
|
||||
context = context_acquire(texture->resource.device, NULL);
|
||||
- if (!texture->texture_ops->texture_load_location(texture, sub_resource_idx,
|
||||
+ if (!wined3d_texture_load_location(texture, sub_resource_idx,
|
||||
context, texture->resource.map_binding))
|
||||
{
|
||||
ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
|
||||
@@ -1331,6 +1331,7 @@ static HRESULT wined3d_texture_upload_data(struct wined3d_texture *texture,
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
const struct wined3d_context *context, const struct wined3d_sub_resource_data *data)
|
||||
{
|
||||
@@ -1525,7 +1526,7 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[i];
|
||||
|
||||
if (resource->pool != WINED3D_POOL_DEFAULT
|
||||
- && texture->texture_ops->texture_load_location(texture, i, context, resource->map_binding))
|
||||
+ && wined3d_texture_load_location(texture, i, context, resource->map_binding))
|
||||
{
|
||||
wined3d_texture_invalidate_location(texture, i, ~resource->map_binding);
|
||||
}
|
||||
@@ -1644,7 +1645,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
{
|
||||
if (resource->usage & WINED3DUSAGE_DYNAMIC)
|
||||
WARN_(d3d_perf)("Mapping a dynamic texture without WINED3D_MAP_DISCARD.\n");
|
||||
- ret = texture->texture_ops->texture_load_location(texture,
|
||||
+ ret = wined3d_texture_load_location(texture,
|
||||
sub_resource_idx, context, texture->resource.map_binding);
|
||||
}
|
||||
|
||||
@@ -2004,6 +2005,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
static void texture3d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
const struct wined3d_context *context, const struct wined3d_sub_resource_data *data)
|
||||
{
|
||||
@@ -2633,3 +2635,10 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
+
|
||||
+/* Context activation is done by the caller. Context may be NULL. */
|
||||
+BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_context *context, DWORD location)
|
||||
+{
|
||||
+ return texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
|
||||
+}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 0f2dd36..0f540db 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2580,6 +2580,8 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size
|
||||
const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
+BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
+ struct wined3d_context *context, DWORD location);
|
||||
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
|
||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1,176 +0,0 @@
|
||||
From b7cf2e2b12b808a6f7fc16b4b8b3b0d3f00bdb48 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:36 +0100
|
||||
Subject: Revert "wined3d: Merge surface_prepare_buffer() and
|
||||
wined3d_volume_prepare_pbo()."
|
||||
|
||||
This reverts commit 87143e60ed5708b976754da872f7643ce0982172.
|
||||
---
|
||||
dlls/wined3d/surface.c | 44 ++++++++++++++++++++++++++++++++++--------
|
||||
dlls/wined3d/texture.c | 21 --------------------
|
||||
dlls/wined3d/volume.c | 20 ++++++++++++++++++-
|
||||
dlls/wined3d/wined3d_private.h | 2 --
|
||||
4 files changed, 55 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 3cd3782..208c254 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -489,6 +489,40 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win
|
||||
data->buffer_object = 0;
|
||||
}
|
||||
|
||||
+static void surface_prepare_buffer(struct wined3d_surface *surface)
|
||||
+{
|
||||
+ struct wined3d_context *context;
|
||||
+ GLuint *buffer_object;
|
||||
+ GLenum error;
|
||||
+ const struct wined3d_gl_info *gl_info;
|
||||
+
|
||||
+ buffer_object = &surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object;
|
||||
+ if (*buffer_object)
|
||||
+ return;
|
||||
+
|
||||
+ context = context_acquire(surface->resource.device, NULL);
|
||||
+ gl_info = context->gl_info;
|
||||
+
|
||||
+ GL_EXTCALL(glGenBuffers(1, buffer_object));
|
||||
+ error = gl_info->gl_ops.gl.p_glGetError();
|
||||
+ if (!*buffer_object || error != GL_NO_ERROR)
|
||||
+ ERR("Failed to create a PBO with error %s (%#x).\n", debug_glerror(error), error);
|
||||
+
|
||||
+ TRACE("Binding PBO %u.\n", *buffer_object);
|
||||
+
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, *buffer_object));
|
||||
+ checkGLcall("glBindBuffer");
|
||||
+
|
||||
+ GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4,
|
||||
+ NULL, GL_STREAM_DRAW));
|
||||
+ checkGLcall("glBufferData");
|
||||
+
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
+ checkGLcall("glBindBuffer");
|
||||
+
|
||||
+ context_release(context);
|
||||
+}
|
||||
+
|
||||
static void surface_prepare_system_memory(struct wined3d_surface *surface)
|
||||
{
|
||||
TRACE("surface %p.\n", surface);
|
||||
@@ -507,9 +541,6 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
|
||||
|
||||
void surface_prepare_map_memory(struct wined3d_surface *surface)
|
||||
{
|
||||
- struct wined3d_texture *texture = surface->container;
|
||||
- struct wined3d_context *context;
|
||||
-
|
||||
switch (surface->resource.map_binding)
|
||||
{
|
||||
case WINED3D_LOCATION_SYSMEM:
|
||||
@@ -517,7 +548,7 @@ void surface_prepare_map_memory(struct wined3d_surface *surface)
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_USER_MEMORY:
|
||||
- if (!texture->user_memory)
|
||||
+ if (!surface->container->user_memory)
|
||||
ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->user_memory is NULL.\n");
|
||||
break;
|
||||
|
||||
@@ -527,10 +558,7 @@ void surface_prepare_map_memory(struct wined3d_surface *surface)
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
- context = context_acquire(texture->resource.device, NULL);
|
||||
- wined3d_texture_prepare_buffer_object(texture,
|
||||
- surface_get_sub_resource_idx(surface), context->gl_info);
|
||||
- context_release(context);
|
||||
+ surface_prepare_buffer(surface);
|
||||
break;
|
||||
|
||||
default:
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 9846f07..a8e9194 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -690,27 +690,6 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
return wined3d_surface_update_desc(surface, gl_info);
|
||||
}
|
||||
|
||||
-/* Context activation is done by the caller. */
|
||||
-void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
|
||||
- unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info)
|
||||
-{
|
||||
- GLuint *buffer_object;
|
||||
-
|
||||
- buffer_object = &texture->sub_resources[sub_resource_idx].buffer_object;
|
||||
- if (*buffer_object)
|
||||
- return;
|
||||
-
|
||||
- GL_EXTCALL(glGenBuffers(1, buffer_object));
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, *buffer_object));
|
||||
- GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER,
|
||||
- texture->sub_resources[sub_resource_idx].resource->size, NULL, GL_STREAM_DRAW));
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
- checkGLcall("Create buffer object");
|
||||
-
|
||||
- TRACE("Created buffer object %u for texture %p, sub-resource %u.\n",
|
||||
- *buffer_object, texture, sub_resource_idx);
|
||||
-}
|
||||
-
|
||||
void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
|
||||
{
|
||||
DWORD alloc_flag = srgb ? WINED3D_TEXTURE_SRGB_ALLOCATED : WINED3D_TEXTURE_RGB_ALLOCATED;
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index fcadd39..ef0d69b 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -362,6 +362,24 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *
|
||||
srgb_mode ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct wined3d_context *context)
|
||||
+{
|
||||
+ GLuint *buffer_object = &volume->container->sub_resources[volume->texture_level].buffer_object;
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
+
|
||||
+ if (*buffer_object)
|
||||
+ return;
|
||||
+
|
||||
+ GL_EXTCALL(glGenBuffers(1, buffer_object));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, *buffer_object));
|
||||
+ GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, volume->resource.size, NULL, GL_STREAM_DRAW));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
+ checkGLcall("Create PBO");
|
||||
+
|
||||
+ TRACE("Created PBO %u for volume %p.\n", *buffer_object, volume);
|
||||
+}
|
||||
+
|
||||
static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
|
||||
{
|
||||
GLuint *buffer_object = &volume->container->sub_resources[volume->texture_level].buffer_object;
|
||||
@@ -488,7 +506,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
|
||||
context = context_acquire(device, NULL);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
- wined3d_texture_prepare_buffer_object(texture, volume->texture_level, gl_info);
|
||||
+ wined3d_volume_prepare_pbo(volume, context);
|
||||
if (flags & WINED3D_MAP_DISCARD)
|
||||
wined3d_volume_validate_location(volume, WINED3D_LOCATION_BUFFER);
|
||||
else
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 28121b7..468ff11 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2420,8 +2420,6 @@ struct wined3d_resource *wined3d_texture_get_sub_resource(const struct wined3d_t
|
||||
UINT sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_load(struct wined3d_texture *texture,
|
||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
-void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
|
||||
- unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
|
||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -0,0 +1,230 @@
|
||||
From 130d9dfce6a2aa843885d204471605967c76b164 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Tue, 17 Nov 2015 23:13:29 -0800
|
||||
Subject: wined3d: Call texture_load_location instead of surface_load_location.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 9 ++++++---
|
||||
dlls/wined3d/drawprim.c | 2 +-
|
||||
dlls/wined3d/surface.c | 38 ++++++++++++++++++++++++--------------
|
||||
dlls/wined3d/swapchain.c | 8 ++++----
|
||||
dlls/wined3d/texture.c | 2 +-
|
||||
5 files changed, 36 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index f12cbf4..4be5c0c 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -203,12 +203,15 @@ void device_switch_onscreen_ds(struct wined3d_device *device,
|
||||
{
|
||||
if (device->onscreen_depth_stencil)
|
||||
{
|
||||
- surface_load_location(device->onscreen_depth_stencil, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ struct wined3d_texture *texture = device->onscreen_depth_stencil->container;
|
||||
+ wined3d_texture_load_location(texture,
|
||||
+ surface_get_sub_resource_idx(device->onscreen_depth_stencil),
|
||||
+ context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
|
||||
surface_modify_ds_location(device->onscreen_depth_stencil, WINED3D_LOCATION_TEXTURE_RGB,
|
||||
device->onscreen_depth_stencil->ds_current_size.cx,
|
||||
device->onscreen_depth_stencil->ds_current_size.cy);
|
||||
- wined3d_texture_decref(device->onscreen_depth_stencil->container);
|
||||
+ wined3d_texture_decref(texture);
|
||||
}
|
||||
device->onscreen_depth_stencil = depth_stencil;
|
||||
wined3d_texture_incref(device->onscreen_depth_stencil->container);
|
||||
@@ -283,7 +286,7 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context
|
||||
}
|
||||
|
||||
/* Full load. */
|
||||
- surface_load_location(ds, context, location);
|
||||
+ wined3d_texture_load_location(ds->container, surface_get_sub_resource_idx(ds), context, location);
|
||||
SetRect(out_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 78628c5..83fe4c3 100644
|
||||
--- a/dlls/wined3d/drawprim.c
|
||||
+++ b/dlls/wined3d/drawprim.c
|
||||
@@ -481,7 +481,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
|
||||
IntersectRect(&r, &draw_rect, ¤t_rect);
|
||||
if (!EqualRect(&r, &draw_rect))
|
||||
- surface_load_location(ds, context, location);
|
||||
+ wined3d_texture_load_location(ds->container, surface_get_sub_resource_idx(ds), context, location);
|
||||
else
|
||||
wined3d_texture_prepare_location(ds->container, dsv->sub_resource_idx, context, location);
|
||||
}
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 3435d17..68bf333 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -450,9 +450,11 @@ static void surface_depth_blt_fbo(const struct wined3d_device *device,
|
||||
|
||||
/* Make sure the locations are up-to-date. Loading the destination
|
||||
* surface isn't required if the entire surface is overwritten. */
|
||||
- surface_load_location(src_surface, context, src_location);
|
||||
+ wined3d_texture_load_location(src_surface->container, surface_get_sub_resource_idx(src_surface),
|
||||
+ context, src_location);
|
||||
if (!surface_is_full_rect(dst_surface, dst_rect))
|
||||
- surface_load_location(dst_surface, context, dst_location);
|
||||
+ wined3d_texture_load_location(dst_surface->container, surface_get_sub_resource_idx(dst_surface),
|
||||
+ context, dst_location);
|
||||
else
|
||||
wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location);
|
||||
|
||||
@@ -546,9 +548,11 @@ static void surface_blt_fbo(const struct wined3d_device *device,
|
||||
* surface isn't required if the entire surface is overwritten. (And is
|
||||
* in fact harmful if we're being called by surface_load_location() with
|
||||
* the purpose of loading the destination surface.) */
|
||||
- surface_load_location(src_surface, old_ctx, src_location);
|
||||
+ wined3d_texture_load_location(src_surface->container, surface_get_sub_resource_idx(src_surface),
|
||||
+ old_ctx, src_location);
|
||||
if (!surface_is_full_rect(dst_surface, &dst_rect))
|
||||
- surface_load_location(dst_surface, old_ctx, dst_location);
|
||||
+ wined3d_texture_load_location(dst_surface->container, surface_get_sub_resource_idx(dst_surface),
|
||||
+ old_ctx, dst_location);
|
||||
else
|
||||
wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, old_ctx, dst_location);
|
||||
|
||||
@@ -1192,7 +1196,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
|
||||
if (update_w == dst_w && update_h == dst_h)
|
||||
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
|
||||
else
|
||||
- surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE);
|
||||
|
||||
wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &data,
|
||||
@@ -2298,7 +2302,7 @@ static void surface_blt_to_drawable(const struct wined3d_device *device,
|
||||
gl_info = context->gl_info;
|
||||
|
||||
/* Make sure the surface is up-to-date. This should probably use
|
||||
- * surface_load_location() and worry about the destination surface too,
|
||||
+ * wined3d_texture_load_location() and worry about the destination surface too,
|
||||
* unless we're overwriting it completely. */
|
||||
wined3d_texture_load(src_texture, context, FALSE);
|
||||
|
||||
@@ -2796,7 +2800,8 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
}
|
||||
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_texture_load_location(surface->container, surface_get_sub_resource_idx(surface),
|
||||
+ context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
|
||||
/* Download the surface to system memory. */
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
@@ -2834,7 +2839,8 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
|
||||
}
|
||||
|
||||
surface_get_rect(surface, NULL, &r);
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
+ wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface),
|
||||
+ context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
surface_blt_to_drawable(texture->resource.device, context,
|
||||
WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r);
|
||||
|
||||
@@ -2912,7 +2918,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
{
|
||||
/* Performance warning... */
|
||||
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
|
||||
- surface_load_location(surface, context, texture->resource.map_binding);
|
||||
+ wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface),
|
||||
+ context, texture->resource.map_binding);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2922,7 +2929,8 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
{
|
||||
/* Performance warning... */
|
||||
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
|
||||
- surface_load_location(surface, context, texture->resource.map_binding);
|
||||
+ wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface),
|
||||
+ context, texture->resource.map_binding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2930,7 +2938,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
{
|
||||
WARN("Trying to load a texture from sysmem, but no simple location is valid.\n");
|
||||
/* Lets hope we get it from somewhere... */
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_texture_load_location(texture, surface_get_sub_resource_idx(surface), context, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
wined3d_texture_prepare_texture(texture, context, srgb);
|
||||
@@ -2948,7 +2956,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
{
|
||||
TRACE("Removing the pbo attached to surface %p.\n", surface);
|
||||
|
||||
- surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM);
|
||||
+ wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_SYSMEM);
|
||||
wined3d_texture_set_map_binding(texture, WINED3D_LOCATION_SYSMEM);
|
||||
}
|
||||
|
||||
@@ -3077,7 +3085,8 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
{
|
||||
ERR("Surface %p does not have any up to date location.\n", surface);
|
||||
wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
- return surface_load_location(surface, context, location);
|
||||
+ wined3d_texture_load_location(texture, sub_resource_idx, context, location);
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||
@@ -4231,7 +4240,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
|
||||
if (!wined3d_resource_is_offscreen(&dst_texture->resource))
|
||||
{
|
||||
struct wined3d_context *context = context_acquire(device, dst_surface);
|
||||
- surface_load_location(dst_surface, context, dst_texture->resource.draw_binding);
|
||||
+ wined3d_texture_load_location(dst_texture, surface_get_sub_resource_idx(dst_surface),
|
||||
+ context, dst_texture->resource.draw_binding);
|
||||
context_release(context);
|
||||
}
|
||||
return WINED3D_OK;
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index b9c6055..a02fdf0 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -453,7 +453,7 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
|
||||
sub_resource = &texture->sub_resources[0];
|
||||
|
||||
if (!(sub_resource->locations & supported_locations))
|
||||
- surface_load_location(sub_resource->u.surface, context, texture->resource.draw_binding);
|
||||
+ wined3d_texture_load_location(texture, 0, context, texture->resource.draw_binding);
|
||||
|
||||
texture_prev->texture_rgb = texture->texture_rgb;
|
||||
texture_prev->rb_multisample = texture->rb_multisample;
|
||||
@@ -630,12 +630,12 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
|
||||
|
||||
static void swapchain_gl_frontbuffer_updated(struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
- struct wined3d_surface *surface;
|
||||
+ struct wined3d_texture *texture = swapchain->front_buffer;
|
||||
+ struct wined3d_surface *surface = texture->sub_resources[0].u.surface;
|
||||
struct wined3d_context *context;
|
||||
|
||||
- surface = swapchain->front_buffer->sub_resources[0].u.surface;
|
||||
context = context_acquire(swapchain->device, surface);
|
||||
- surface_load_location(surface, context, surface->container->resource.draw_binding);
|
||||
+ wined3d_texture_load_location(texture, 0, context, texture->resource.draw_binding);
|
||||
context_release(context);
|
||||
SetRectEmpty(&swapchain->front_buffer_update);
|
||||
}
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 30a4581..9780cc5 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -2575,7 +2575,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
|
||||
if (device->d3d_initialized)
|
||||
context = context_acquire(device, NULL);
|
||||
|
||||
- surface_load_location(surface, context, texture->resource.map_binding);
|
||||
+ wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding);
|
||||
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
|
||||
|
||||
if (!surface->dc)
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1,102 +0,0 @@
|
||||
From 9d8d5fb99efea2a4d8628429c811457b1b347647 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:37 +0100
|
||||
Subject: Revert "wined3d: Cleanup sub-resource buffer objects in
|
||||
wined3d_texture_cleanup()."
|
||||
|
||||
This reverts commit 45fa5b6471093db4f97f90b661d1f89d56aa48e7.
|
||||
---
|
||||
dlls/wined3d/surface.c | 11 ++++++++++-
|
||||
dlls/wined3d/texture.c | 27 ---------------------------
|
||||
dlls/wined3d/volume.c | 3 +++
|
||||
3 files changed, 13 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 208c254..994756d 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -48,10 +48,13 @@ static unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *s
|
||||
void wined3d_surface_cleanup(struct wined3d_surface *surface)
|
||||
{
|
||||
struct wined3d_surface *overlay, *cur;
|
||||
+ GLuint buffer_object;
|
||||
|
||||
TRACE("surface %p.\n", surface);
|
||||
|
||||
- if (surface->rb_multisample || surface->rb_resolved || !list_empty(&surface->renderbuffers))
|
||||
+ buffer_object = surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object;
|
||||
+ if (buffer_object || surface->rb_multisample
|
||||
+ || surface->rb_resolved || !list_empty(&surface->renderbuffers))
|
||||
{
|
||||
struct wined3d_renderbuffer_entry *entry, *entry2;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
@@ -61,6 +64,12 @@ void wined3d_surface_cleanup(struct wined3d_surface *surface)
|
||||
context = context_acquire(device, NULL);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
+ if (buffer_object)
|
||||
+ {
|
||||
+ TRACE("Deleting buffer object %u.\n", buffer_object);
|
||||
+ GL_EXTCALL(glDeleteBuffers(1, &buffer_object));
|
||||
+ }
|
||||
+
|
||||
if (surface->rb_multisample)
|
||||
{
|
||||
TRACE("Deleting multisample renderbuffer %u.\n", surface->rb_multisample);
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index a8e9194..cb2b310f 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -108,35 +108,8 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture)
|
||||
|
||||
static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
{
|
||||
- unsigned int sub_count = texture->level_count * texture->layer_count;
|
||||
- struct wined3d_device *device = texture->resource.device;
|
||||
- struct wined3d_context *context = NULL;
|
||||
- const struct wined3d_gl_info *gl_info;
|
||||
- GLuint buffer_object;
|
||||
- unsigned int i;
|
||||
-
|
||||
TRACE("texture %p.\n", texture);
|
||||
|
||||
- for (i = 0; i < sub_count; ++i)
|
||||
- {
|
||||
- if (!(buffer_object = texture->sub_resources[i].buffer_object))
|
||||
- continue;
|
||||
-
|
||||
- TRACE("Deleting buffer object %u.\n", buffer_object);
|
||||
-
|
||||
- /* We may not be able to get a context in wined3d_texture_cleanup() in
|
||||
- * general, but if a buffer object was previously created we can. */
|
||||
- if (!context)
|
||||
- {
|
||||
- context = context_acquire(device, NULL);
|
||||
- gl_info = context->gl_info;
|
||||
- }
|
||||
-
|
||||
- GL_EXTCALL(glDeleteBuffers(1, &buffer_object));
|
||||
- }
|
||||
- if (context)
|
||||
- context_release(context);
|
||||
-
|
||||
texture->texture_ops->texture_cleanup_sub_resources(texture);
|
||||
wined3d_texture_unload_gl_texture(texture);
|
||||
resource_cleanup(&texture->resource);
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index ef0d69b..3782642 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -397,6 +397,9 @@ void wined3d_volume_cleanup(struct wined3d_volume *volume)
|
||||
{
|
||||
TRACE("volume %p.\n", volume);
|
||||
|
||||
+ if (volume->container->sub_resources[volume->texture_level].buffer_object)
|
||||
+ wined3d_volume_free_pbo(volume);
|
||||
+
|
||||
resource_cleanup(&volume->resource);
|
||||
}
|
||||
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -0,0 +1,378 @@
|
||||
From 7bce6d69497a6dcb14bcaf8b02f9b0e68f5cbbd1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 18 Nov 2015 08:31:14 +0000
|
||||
Subject: wined3d: Share surface and volume system memory loading code.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 110 -------------------------------------------
|
||||
dlls/wined3d/texture.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/wined3d/volume.c | 44 -----------------
|
||||
3 files changed, 124 insertions(+), 155 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 68bf333..1189b97 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -2720,67 +2720,6 @@ static void surface_load_ds_location(struct wined3d_surface *surface, struct win
|
||||
}
|
||||
}
|
||||
|
||||
-static DWORD resource_access_from_location(DWORD location)
|
||||
-{
|
||||
- switch (location)
|
||||
- {
|
||||
- case WINED3D_LOCATION_SYSMEM:
|
||||
- case WINED3D_LOCATION_USER_MEMORY:
|
||||
- case WINED3D_LOCATION_BUFFER:
|
||||
- return WINED3D_RESOURCE_ACCESS_CPU;
|
||||
-
|
||||
- case WINED3D_LOCATION_DRAWABLE:
|
||||
- case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
- case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
- case WINED3D_LOCATION_RB_MULTISAMPLE:
|
||||
- case WINED3D_LOCATION_RB_RESOLVED:
|
||||
- return WINED3D_RESOURCE_ACCESS_GPU;
|
||||
-
|
||||
- default:
|
||||
- FIXME("Unhandled location %#x.\n", location);
|
||||
- return 0;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location)
|
||||
-{
|
||||
- unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
|
||||
- struct wined3d_texture *texture = surface->container;
|
||||
- struct wined3d_device *device = texture->resource.device;
|
||||
- struct wined3d_texture_sub_resource *sub_resource;
|
||||
- struct wined3d_context *context;
|
||||
- const struct wined3d_gl_info *gl_info;
|
||||
- struct wined3d_bo_address dst, src;
|
||||
-
|
||||
- sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
- wined3d_texture_get_memory(texture, sub_resource_idx, &dst, location);
|
||||
- wined3d_texture_get_memory(texture, sub_resource_idx, &src, sub_resource->locations);
|
||||
-
|
||||
- if (dst.buffer_object)
|
||||
- {
|
||||
- context = context_acquire(device, NULL);
|
||||
- gl_info = context->gl_info;
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, dst.buffer_object));
|
||||
- GL_EXTCALL(glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, sub_resource->size, src.addr));
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
- checkGLcall("Upload PBO");
|
||||
- context_release(context);
|
||||
- return;
|
||||
- }
|
||||
- if (src.buffer_object)
|
||||
- {
|
||||
- context = context_acquire(device, NULL);
|
||||
- gl_info = context->gl_info;
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, src.buffer_object));
|
||||
- GL_EXTCALL(glGetBufferSubData(GL_PIXEL_PACK_BUFFER, 0, sub_resource->size, dst.addr));
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0));
|
||||
- checkGLcall("Download PBO");
|
||||
- context_release(context);
|
||||
- return;
|
||||
- }
|
||||
- memcpy(dst.addr, src.addr, sub_resource->size);
|
||||
-}
|
||||
-
|
||||
/* Context activation is done by the caller. */
|
||||
static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
struct wined3d_context *context, DWORD dst_location)
|
||||
@@ -2793,12 +2732,6 @@ static void surface_load_sysmem(struct wined3d_surface *surface,
|
||||
wined3d_texture_prepare_location(texture, sub_resource_idx, context, dst_location);
|
||||
|
||||
sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
- if (sub_resource->locations & surface_simple_locations)
|
||||
- {
|
||||
- surface_copy_simple_location(surface, dst_location);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
|
||||
wined3d_texture_load_location(surface->container, surface_get_sub_resource_idx(surface),
|
||||
context, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
@@ -3048,46 +2981,11 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
|
||||
struct wined3d_texture *texture = surface->container;
|
||||
struct wined3d_texture_sub_resource *sub_resource;
|
||||
- unsigned int surface_w, surface_h;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
|
||||
|
||||
- surface_w = wined3d_texture_get_level_width(texture, surface->texture_level);
|
||||
- surface_h = wined3d_texture_get_level_height(texture, surface->texture_level);
|
||||
-
|
||||
sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
- if (sub_resource->locations & location && (!(texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||
- || (surface->ds_current_size.cx == surface_w && surface->ds_current_size.cy == surface_h)))
|
||||
- {
|
||||
- TRACE("Location (%#x) is already up to date.\n", location);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (WARN_ON(d3d))
|
||||
- {
|
||||
- DWORD required_access = resource_access_from_location(location);
|
||||
- if ((texture->resource.access_flags & required_access) != required_access)
|
||||
- WARN("Operation requires %#x access, but surface only has %#x.\n",
|
||||
- required_access, texture->resource.access_flags);
|
||||
- }
|
||||
-
|
||||
- if (sub_resource->locations & WINED3D_LOCATION_DISCARDED)
|
||||
- {
|
||||
- TRACE("Surface previously discarded, nothing to do.\n");
|
||||
- wined3d_texture_prepare_location(texture, sub_resource_idx, context, location);
|
||||
- wined3d_texture_validate_location(texture, sub_resource_idx, location);
|
||||
- wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
- goto done;
|
||||
- }
|
||||
-
|
||||
- if (!sub_resource->locations)
|
||||
- {
|
||||
- ERR("Surface %p does not have any up to date location.\n", surface);
|
||||
- wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
- wined3d_texture_load_location(texture, sub_resource_idx, context, location);
|
||||
- return;
|
||||
- }
|
||||
|
||||
if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||
{
|
||||
@@ -3134,14 +3032,6 @@ void surface_load_location(struct wined3d_surface *surface, struct wined3d_conte
|
||||
}
|
||||
|
||||
done:
|
||||
- wined3d_texture_validate_location(texture, sub_resource_idx, location);
|
||||
-
|
||||
- if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||
- {
|
||||
- surface->ds_current_size.cx = surface_w;
|
||||
- surface->ds_current_size.cy = surface_h;
|
||||
- }
|
||||
-
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 9780cc5..708470e 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -2636,9 +2636,132 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+static BOOL wined3d_texture_copy_sysmem_location(struct wined3d_texture *texture,
|
||||
+ unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
|
||||
+{
|
||||
+ struct wined3d_device *device = texture->resource.device;
|
||||
+ const struct wined3d_gl_info *gl_info;
|
||||
+ struct wined3d_bo_address dst, src;
|
||||
+ UINT size = texture->sub_resources[sub_resource_idx].size;
|
||||
+
|
||||
+ wined3d_texture_prepare_location(texture, sub_resource_idx, context, location);
|
||||
+
|
||||
+ wined3d_texture_get_memory(texture, sub_resource_idx, &dst, location);
|
||||
+ wined3d_texture_get_memory(texture, sub_resource_idx, &src,
|
||||
+ texture->sub_resources[sub_resource_idx].locations);
|
||||
+
|
||||
+ if (dst.buffer_object)
|
||||
+ {
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ gl_info = context->gl_info;
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, dst.buffer_object));
|
||||
+ GL_EXTCALL(glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, size, src.addr));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
+ checkGLcall("Upload PBO");
|
||||
+ context_release(context);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ if (src.buffer_object)
|
||||
+ {
|
||||
+ context = context_acquire(device, NULL);
|
||||
+ gl_info = context->gl_info;
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, src.buffer_object));
|
||||
+ GL_EXTCALL(glGetBufferSubData(GL_PIXEL_PACK_BUFFER, 0, size, dst.addr));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0));
|
||||
+ checkGLcall("Download PBO");
|
||||
+ context_release(context);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ memcpy(dst.addr, src.addr, size);
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static DWORD resource_access_from_location(DWORD location)
|
||||
+{
|
||||
+ switch (location)
|
||||
+ {
|
||||
+ case WINED3D_LOCATION_SYSMEM:
|
||||
+ case WINED3D_LOCATION_USER_MEMORY:
|
||||
+ case WINED3D_LOCATION_BUFFER:
|
||||
+ return WINED3D_RESOURCE_ACCESS_CPU;
|
||||
+
|
||||
+ case WINED3D_LOCATION_DRAWABLE:
|
||||
+ case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
+ case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
+ case WINED3D_LOCATION_RB_MULTISAMPLE:
|
||||
+ case WINED3D_LOCATION_RB_RESOLVED:
|
||||
+ return WINED3D_RESOURCE_ACCESS_GPU;
|
||||
+
|
||||
+ default:
|
||||
+ FIXME("Unhandled location %#x.\n", location);
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Context activation is done by the caller. Context may be NULL. */
|
||||
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
- return texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
|
||||
+ BOOL ret;
|
||||
+ DWORD current = texture->sub_resources[sub_resource_idx].locations;
|
||||
+ struct wined3d_surface *surface = texture->sub_resources[sub_resource_idx].u.surface;
|
||||
+ unsigned int sub_resource_w, sub_resource_h;
|
||||
+
|
||||
+ TRACE("Texture %p, sub_resource %u, location %s.\n", texture, sub_resource_idx,
|
||||
+ wined3d_debug_location(location));
|
||||
+
|
||||
+ sub_resource_w = wined3d_texture_get_level_width(texture, sub_resource_idx % texture->level_count);
|
||||
+ sub_resource_h = wined3d_texture_get_level_height(texture, sub_resource_idx % texture->level_count);
|
||||
+
|
||||
+ if ((current & location) && (!(surface && (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL))
|
||||
+ || (surface->ds_current_size.cx == sub_resource_w
|
||||
+ && surface->ds_current_size.cy == sub_resource_h)))
|
||||
+ {
|
||||
+ TRACE("Location (%#x) is already up to date.\n", location);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ if (WARN_ON(d3d))
|
||||
+ {
|
||||
+ DWORD required_access = resource_access_from_location(location);
|
||||
+ if ((texture->resource.access_flags & required_access) != required_access)
|
||||
+ WARN("Operation requires %#x access, but texture only has %#x.\n",
|
||||
+ required_access, texture->resource.access_flags);
|
||||
+ }
|
||||
+
|
||||
+ if (!current)
|
||||
+ {
|
||||
+ ERR("Texture %p, sub resource %u does not have any up to date location.\n", texture, sub_resource_idx);
|
||||
+ wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
+ wined3d_texture_load_location(texture, sub_resource_idx, context, location);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ if (texture->sub_resources[sub_resource_idx].locations & WINED3D_LOCATION_DISCARDED)
|
||||
+ {
|
||||
+ wined3d_texture_prepare_location(texture, sub_resource_idx, context, location);
|
||||
+ ret = TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ static const DWORD sysmem_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY
|
||||
+ | WINED3D_LOCATION_BUFFER;
|
||||
+
|
||||
+ if ((location & sysmem_locations) && (current & sysmem_locations))
|
||||
+ ret = wined3d_texture_copy_sysmem_location(texture, sub_resource_idx, context, location);
|
||||
+ else
|
||||
+ ret = texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
|
||||
+ }
|
||||
+
|
||||
+ if (ret)
|
||||
+ {
|
||||
+ wined3d_texture_validate_location(texture, sub_resource_idx, location);
|
||||
+
|
||||
+ if (surface && texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||
+ {
|
||||
+ surface->ds_current_size.cx = sub_resource_w;
|
||||
+ surface->ds_current_size.cy = sub_resource_h;
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
}
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index f59f963..dda5f98 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -119,27 +119,6 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume,
|
||||
|
||||
}
|
||||
|
||||
-static DWORD volume_access_from_location(DWORD location)
|
||||
-{
|
||||
- switch (location)
|
||||
- {
|
||||
- case WINED3D_LOCATION_DISCARDED:
|
||||
- return 0;
|
||||
-
|
||||
- case WINED3D_LOCATION_SYSMEM:
|
||||
- return WINED3D_RESOURCE_ACCESS_CPU;
|
||||
-
|
||||
- case WINED3D_LOCATION_BUFFER:
|
||||
- case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
- case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
- return WINED3D_RESOURCE_ACCESS_GPU;
|
||||
-
|
||||
- default:
|
||||
- FIXME("Unhandled location %#x.\n", location);
|
||||
- return 0;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume,
|
||||
struct wined3d_context *context, BOOL dest_is_srgb)
|
||||
@@ -170,7 +149,6 @@ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume,
|
||||
BOOL wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
- DWORD required_access = volume_access_from_location(location);
|
||||
unsigned int sub_resource_idx = volume->texture_level;
|
||||
struct wined3d_texture *texture = volume->container;
|
||||
struct wined3d_texture_sub_resource *sub_resource;
|
||||
@@ -179,30 +157,9 @@ BOOL wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location),
|
||||
wined3d_debug_location(sub_resource->locations));
|
||||
|
||||
- if ((sub_resource->locations & location) == location)
|
||||
- {
|
||||
- TRACE("Location(s) already up to date.\n");
|
||||
- return TRUE;
|
||||
- }
|
||||
-
|
||||
- if ((texture->resource.access_flags & required_access) != required_access)
|
||||
- {
|
||||
- ERR("Operation requires %#x access, but volume only has %#x.\n",
|
||||
- required_access, texture->resource.access_flags);
|
||||
- return FALSE;
|
||||
- }
|
||||
-
|
||||
if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, location))
|
||||
return FALSE;
|
||||
|
||||
- if (sub_resource->locations & WINED3D_LOCATION_DISCARDED)
|
||||
- {
|
||||
- TRACE("Volume previously discarded, nothing to do.\n");
|
||||
- wined3d_texture_validate_location(texture, sub_resource_idx, location);
|
||||
- wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
- goto done;
|
||||
- }
|
||||
-
|
||||
switch (location)
|
||||
{
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
@@ -285,7 +242,6 @@ BOOL wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
-done:
|
||||
wined3d_texture_validate_location(texture, sub_resource_idx, location);
|
||||
|
||||
return TRUE;
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1,422 +0,0 @@
|
||||
From 0a30deac1b8dc66d9877369442f4cbc7fbde21cb Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:39 +0100
|
||||
Subject: Revert "wined3d: Store surface/volume buffer objects in the
|
||||
sub-resource structure."
|
||||
|
||||
This reverts commit fbe27375370c426c781ba50841ef93ea6ff44502.
|
||||
---
|
||||
dlls/wined3d/surface.c | 52 ++++++++++++---------------------
|
||||
dlls/wined3d/texture.c | 4 +--
|
||||
dlls/wined3d/volume.c | 65 +++++++++++++++++-------------------------
|
||||
dlls/wined3d/wined3d_private.h | 6 ++--
|
||||
4 files changed, 51 insertions(+), 76 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 994756d..303bdc7 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -40,20 +40,13 @@ static const DWORD surface_simple_locations =
|
||||
WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY
|
||||
| WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER;
|
||||
|
||||
-static unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *surface)
|
||||
-{
|
||||
- return surface->texture_layer * surface->container->level_count + surface->texture_level;
|
||||
-}
|
||||
-
|
||||
void wined3d_surface_cleanup(struct wined3d_surface *surface)
|
||||
{
|
||||
struct wined3d_surface *overlay, *cur;
|
||||
- GLuint buffer_object;
|
||||
|
||||
TRACE("surface %p.\n", surface);
|
||||
|
||||
- buffer_object = surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object;
|
||||
- if (buffer_object || surface->rb_multisample
|
||||
+ if (surface->pbo || surface->rb_multisample
|
||||
|| surface->rb_resolved || !list_empty(&surface->renderbuffers))
|
||||
{
|
||||
struct wined3d_renderbuffer_entry *entry, *entry2;
|
||||
@@ -64,10 +57,10 @@ void wined3d_surface_cleanup(struct wined3d_surface *surface)
|
||||
context = context_acquire(device, NULL);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
- if (buffer_object)
|
||||
+ if (surface->pbo)
|
||||
{
|
||||
- TRACE("Deleting buffer object %u.\n", buffer_object);
|
||||
- GL_EXTCALL(glDeleteBuffers(1, &buffer_object));
|
||||
+ TRACE("Deleting PBO %u.\n", surface->pbo);
|
||||
+ GL_EXTCALL(glDeleteBuffers(1, &surface->pbo));
|
||||
}
|
||||
|
||||
if (surface->rb_multisample)
|
||||
@@ -471,7 +464,7 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win
|
||||
if (location & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
data->addr = NULL;
|
||||
- data->buffer_object = surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object;
|
||||
+ data->buffer_object = surface->pbo;
|
||||
return;
|
||||
}
|
||||
if (location & WINED3D_LOCATION_USER_MEMORY)
|
||||
@@ -501,25 +494,23 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win
|
||||
static void surface_prepare_buffer(struct wined3d_surface *surface)
|
||||
{
|
||||
struct wined3d_context *context;
|
||||
- GLuint *buffer_object;
|
||||
GLenum error;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
|
||||
- buffer_object = &surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object;
|
||||
- if (*buffer_object)
|
||||
+ if (surface->pbo)
|
||||
return;
|
||||
|
||||
context = context_acquire(surface->resource.device, NULL);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
- GL_EXTCALL(glGenBuffers(1, buffer_object));
|
||||
+ GL_EXTCALL(glGenBuffers(1, &surface->pbo));
|
||||
error = gl_info->gl_ops.gl.p_glGetError();
|
||||
- if (!*buffer_object || error != GL_NO_ERROR)
|
||||
+ if (!surface->pbo || error != GL_NO_ERROR)
|
||||
ERR("Failed to create a PBO with error %s (%#x).\n", debug_glerror(error), error);
|
||||
|
||||
- TRACE("Binding PBO %u.\n", *buffer_object);
|
||||
+ TRACE("Binding PBO %u.\n", surface->pbo);
|
||||
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, *buffer_object));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo));
|
||||
checkGLcall("glBindBuffer");
|
||||
|
||||
GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, surface->resource.size + 4,
|
||||
@@ -1036,13 +1027,10 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW
|
||||
/* Context activation is done by the caller. */
|
||||
static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info)
|
||||
{
|
||||
- GLuint *buffer_object;
|
||||
+ GL_EXTCALL(glDeleteBuffers(1, &surface->pbo));
|
||||
+ checkGLcall("glDeleteBuffers(1, &surface->pbo)");
|
||||
|
||||
- buffer_object = &surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object;
|
||||
- GL_EXTCALL(glDeleteBuffers(1, buffer_object));
|
||||
- checkGLcall("glDeleteBuffers(1, buffer_object)");
|
||||
-
|
||||
- *buffer_object = 0;
|
||||
+ surface->pbo = 0;
|
||||
surface_invalidate_location(surface, WINED3D_LOCATION_BUFFER);
|
||||
}
|
||||
|
||||
@@ -1109,7 +1097,7 @@ static void surface_unload(struct wined3d_resource *resource)
|
||||
}
|
||||
|
||||
/* Destroy PBOs, but load them into real sysmem before */
|
||||
- if (surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object)
|
||||
+ if (surface->pbo)
|
||||
surface_remove_pbo(surface, gl_info);
|
||||
|
||||
/* Destroy fbo render buffers. This is needed for implicit render targets, for
|
||||
@@ -2179,9 +2167,9 @@ do { \
|
||||
HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
|
||||
{
|
||||
struct wined3d_device *device = surface->resource.device;
|
||||
- struct wined3d_texture *texture = surface->container;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
+ struct wined3d_texture *texture;
|
||||
|
||||
TRACE("surface %p.\n", surface);
|
||||
|
||||
@@ -2203,8 +2191,7 @@ HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
|
||||
context = context_acquire(device, NULL);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER,
|
||||
- texture->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo));
|
||||
GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER));
|
||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
checkGLcall("glUnmapBuffer");
|
||||
@@ -2218,6 +2205,7 @@ HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
|
||||
|
||||
if (!(surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)))
|
||||
{
|
||||
+ texture = surface->container;
|
||||
if (texture->swapchain && texture->swapchain->front_buffer == texture)
|
||||
texture->swapchain->swapchain_ops->swapchain_frontbuffer_updated(texture->swapchain);
|
||||
else if (texture->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
|
||||
@@ -2319,8 +2307,7 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_
|
||||
context = context_acquire(device, NULL);
|
||||
gl_info = context->gl_info;
|
||||
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER,
|
||||
- texture->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, surface->pbo));
|
||||
base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE));
|
||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
checkGLcall("map PBO");
|
||||
@@ -3706,8 +3693,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
|
||||
/* Don't use PBOs for converted surfaces. During PBO conversion we look at
|
||||
* WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is
|
||||
* getting called. */
|
||||
- if ((format.convert || conversion)
|
||||
- && texture->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object)
|
||||
+ if ((format.convert || conversion) && surface->pbo)
|
||||
{
|
||||
TRACE("Removing the pbo attached to surface %p.\n", surface);
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index cb2b310f..01f54a9 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1770,8 +1770,8 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY
|
||||
- || texture->flags & WINED3D_TEXTURE_PIN_SYSMEM
|
||||
- || texture->sub_resources[sub_resource_idx].buffer_object))
|
||||
+ || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM
|
||||
+ || surface->pbo))
|
||||
surface->resource.map_binding = WINED3D_LOCATION_DIB;
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
|
||||
index 3782642..4b726d7 100644
|
||||
--- a/dlls/wined3d/volume.c
|
||||
+++ b/dlls/wined3d/volume.c
|
||||
@@ -214,7 +214,6 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
DWORD required_access = volume_access_from_location(location);
|
||||
- struct wined3d_texture *texture = volume->container;
|
||||
|
||||
TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location),
|
||||
wined3d_debug_location(volume->locations));
|
||||
@@ -237,9 +236,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
case WINED3D_LOCATION_TEXTURE_SRGB:
|
||||
if ((location == WINED3D_LOCATION_TEXTURE_RGB
|
||||
- && !(texture->flags & WINED3D_TEXTURE_RGB_ALLOCATED))
|
||||
+ && !(volume->container->flags & WINED3D_TEXTURE_RGB_ALLOCATED))
|
||||
|| (location == WINED3D_LOCATION_TEXTURE_SRGB
|
||||
- && !(texture->flags & WINED3D_TEXTURE_SRGB_ALLOCATED)))
|
||||
+ && !(volume->container->flags & WINED3D_TEXTURE_SRGB_ALLOCATED)))
|
||||
ERR("Trying to load (s)RGB texture without prior allocation.\n");
|
||||
|
||||
if (volume->locations & WINED3D_LOCATION_DISCARDED)
|
||||
@@ -250,18 +249,14 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
else if (volume->locations & WINED3D_LOCATION_SYSMEM)
|
||||
{
|
||||
struct wined3d_const_bo_address data = {0, volume->resource.heap_memory};
|
||||
- wined3d_texture_bind_and_dirtify(texture, context,
|
||||
+ wined3d_texture_bind_and_dirtify(volume->container, context,
|
||||
location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_volume_upload_data(volume, context, &data);
|
||||
}
|
||||
else if (volume->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
- struct wined3d_const_bo_address data =
|
||||
- {
|
||||
- texture->sub_resources[volume->texture_level].buffer_object,
|
||||
- NULL
|
||||
- };
|
||||
- wined3d_texture_bind_and_dirtify(texture, context,
|
||||
+ struct wined3d_const_bo_address data = {volume->pbo, NULL};
|
||||
+ wined3d_texture_bind_and_dirtify(volume->container, context,
|
||||
location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_volume_upload_data(volume, context, &data);
|
||||
}
|
||||
@@ -299,9 +294,9 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
struct wined3d_bo_address data = {0, volume->resource.heap_memory};
|
||||
|
||||
if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
- wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
+ wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
|
||||
else
|
||||
- wined3d_texture_bind_and_dirtify(texture, context, TRUE);
|
||||
+ wined3d_texture_bind_and_dirtify(volume->container, context, TRUE);
|
||||
|
||||
volume->download_count++;
|
||||
wined3d_volume_download_data(volume, context, &data);
|
||||
@@ -316,7 +311,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
break;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
- if (!texture->sub_resources[volume->texture_level].buffer_object)
|
||||
+ if (!volume->pbo)
|
||||
ERR("Trying to load WINED3D_LOCATION_BUFFER without setting it up first.\n");
|
||||
|
||||
if (volume->locations & WINED3D_LOCATION_DISCARDED)
|
||||
@@ -326,16 +321,12 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
|
||||
}
|
||||
else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
- struct wined3d_bo_address data =
|
||||
- {
|
||||
- texture->sub_resources[volume->texture_level].buffer_object,
|
||||
- NULL
|
||||
- };
|
||||
+ struct wined3d_bo_address data = {volume->pbo, NULL};
|
||||
|
||||
if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
- wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
+ wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
|
||||
else
|
||||
- wined3d_texture_bind_and_dirtify(texture, context, TRUE);
|
||||
+ wined3d_texture_bind_and_dirtify(volume->container, context, TRUE);
|
||||
|
||||
wined3d_volume_download_data(volume, context, &data);
|
||||
}
|
||||
@@ -365,31 +356,29 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct wined3d_context *context)
|
||||
{
|
||||
- GLuint *buffer_object = &volume->container->sub_resources[volume->texture_level].buffer_object;
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
- if (*buffer_object)
|
||||
+ if (volume->pbo)
|
||||
return;
|
||||
|
||||
- GL_EXTCALL(glGenBuffers(1, buffer_object));
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, *buffer_object));
|
||||
+ GL_EXTCALL(glGenBuffers(1, &volume->pbo));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo));
|
||||
GL_EXTCALL(glBufferData(GL_PIXEL_UNPACK_BUFFER, volume->resource.size, NULL, GL_STREAM_DRAW));
|
||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
checkGLcall("Create PBO");
|
||||
|
||||
- TRACE("Created PBO %u for volume %p.\n", *buffer_object, volume);
|
||||
+ TRACE("Created PBO %u for volume %p.\n", volume->pbo, volume);
|
||||
}
|
||||
|
||||
static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
|
||||
{
|
||||
- GLuint *buffer_object = &volume->container->sub_resources[volume->texture_level].buffer_object;
|
||||
struct wined3d_context *context = context_acquire(volume->resource.device, NULL);
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
- TRACE("Deleting PBO %u belonging to volume %p.\n", *buffer_object, volume);
|
||||
- GL_EXTCALL(glDeleteBuffers(1, buffer_object));
|
||||
+ TRACE("Deleting PBO %u belonging to volume %p.\n", volume->pbo, volume);
|
||||
+ GL_EXTCALL(glDeleteBuffers(1, &volume->pbo));
|
||||
checkGLcall("glDeleteBuffers");
|
||||
- *buffer_object = 0;
|
||||
+ volume->pbo = 0;
|
||||
context_release(context);
|
||||
}
|
||||
|
||||
@@ -397,7 +386,7 @@ void wined3d_volume_cleanup(struct wined3d_volume *volume)
|
||||
{
|
||||
TRACE("volume %p.\n", volume);
|
||||
|
||||
- if (volume->container->sub_resources[volume->texture_level].buffer_object)
|
||||
+ if (volume->pbo)
|
||||
wined3d_volume_free_pbo(volume);
|
||||
|
||||
resource_cleanup(&volume->resource);
|
||||
@@ -428,7 +417,7 @@ static void volume_unload(struct wined3d_resource *resource)
|
||||
wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
- if (volume->container->sub_resources[volume->texture_level].buffer_object)
|
||||
+ if (volume->pbo)
|
||||
{
|
||||
/* Should not happen because only dynamic default pool volumes
|
||||
* have a buffer, and those are not evicted by device_evit_managed_resources
|
||||
@@ -468,12 +457,11 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
|
||||
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
|
||||
{
|
||||
struct wined3d_device *device = volume->resource.device;
|
||||
- struct wined3d_texture *texture = volume->container;
|
||||
struct wined3d_context *context;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
BYTE *base_memory;
|
||||
const struct wined3d_format *format = volume->resource.format;
|
||||
- const unsigned int fmt_flags = texture->resource.format_flags;
|
||||
+ const unsigned int fmt_flags = volume->container->resource.format_flags;
|
||||
|
||||
TRACE("volume %p, map_desc %p, box %s, flags %#x.\n",
|
||||
volume, map_desc, debug_box(box), flags);
|
||||
@@ -495,7 +483,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box
|
||||
- && !wined3d_texture_check_block_align(texture, volume->texture_level, box))
|
||||
+ && !wined3d_texture_check_block_align(volume->container, volume->texture_level, box))
|
||||
{
|
||||
WARN("Map box %s is misaligned for %ux%u blocks.\n",
|
||||
debug_box(box), format->block_width, format->block_height);
|
||||
@@ -515,7 +503,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
|
||||
else
|
||||
wined3d_volume_load_location(volume, context, WINED3D_LOCATION_BUFFER);
|
||||
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->sub_resources[volume->texture_level].buffer_object));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo));
|
||||
|
||||
if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
|
||||
{
|
||||
@@ -566,7 +554,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
|
||||
}
|
||||
else
|
||||
{
|
||||
- wined3d_texture_get_pitch(texture, volume->texture_level,
|
||||
+ wined3d_texture_get_pitch(volume->container, volume->texture_level,
|
||||
&map_desc->row_pitch, &map_desc->slice_pitch);
|
||||
}
|
||||
|
||||
@@ -596,7 +584,7 @@ HRESULT wined3d_volume_map(struct wined3d_volume *volume,
|
||||
|
||||
if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY)))
|
||||
{
|
||||
- wined3d_texture_set_dirty(texture);
|
||||
+ wined3d_texture_set_dirty(volume->container);
|
||||
wined3d_volume_invalidate_location(volume, ~volume->resource.map_binding);
|
||||
}
|
||||
|
||||
@@ -624,8 +612,7 @@ HRESULT wined3d_volume_unmap(struct wined3d_volume *volume)
|
||||
struct wined3d_context *context = context_acquire(device, NULL);
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
|
||||
- GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER,
|
||||
- volume->container->sub_resources[volume->texture_level].buffer_object));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, volume->pbo));
|
||||
GL_EXTCALL(glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER));
|
||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||
checkGLcall("Unmap PBO");
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 468ff11..1774039 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2391,8 +2391,6 @@ struct wined3d_texture
|
||||
struct wined3d_surface *surface;
|
||||
struct wined3d_volume *volume;
|
||||
} u;
|
||||
-
|
||||
- GLuint buffer_object;
|
||||
} sub_resources[1];
|
||||
};
|
||||
|
||||
@@ -2447,6 +2445,7 @@ struct wined3d_volume
|
||||
DWORD locations;
|
||||
GLint texture_level;
|
||||
DWORD download_count;
|
||||
+ GLuint pbo;
|
||||
};
|
||||
|
||||
static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
|
||||
@@ -2522,6 +2521,9 @@ struct wined3d_surface
|
||||
|
||||
UINT pow2Width;
|
||||
UINT pow2Height;
|
||||
+
|
||||
+ /* PBO */
|
||||
+ GLuint pbo;
|
||||
GLuint rb_multisample;
|
||||
GLuint rb_resolved;
|
||||
GLenum texture_target;
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -0,0 +1,34 @@
|
||||
From 25903b870407e8368508fd002f15c509fdd9a66b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 19 Sep 2013 13:09:58 +0200
|
||||
Subject: wined3d: Discard the backbuffer in discard presents.
|
||||
|
||||
---
|
||||
dlls/wined3d/swapchain.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index a02fdf0..9a36e38 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -608,6 +608,17 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
|
||||
* up to date and hope WGL flipped front and back buffers and read this data into
|
||||
* the FBO. Don't bother about this for now. */
|
||||
|
||||
+ switch (swapchain->desc.swap_effect)
|
||||
+ {
|
||||
+ case WINED3D_SWAP_EFFECT_DISCARD:
|
||||
+ wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1],
|
||||
+ 0, WINED3D_LOCATION_DISCARDED);
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
if (fb->depth_stencil)
|
||||
{
|
||||
struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(fb->depth_stencil);
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1,27 +0,0 @@
|
||||
From 0b0c0691884fbf0335df4d89bf94774205622da4 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:40 +0100
|
||||
Subject: Revert "wined3d: Avoid volume_from_resource() in
|
||||
texture3d_prepare_texture()."
|
||||
|
||||
This reverts commit 09c862b6a23c35c2157842f1f7a1fa9a8d17da1d.
|
||||
---
|
||||
dlls/wined3d/texture.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 01f54a9..af1c1de 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -1207,7 +1207,7 @@ static void texture3d_prepare_texture(struct wined3d_texture *texture, struct wi
|
||||
|
||||
for (i = 0; i < sub_count; ++i)
|
||||
{
|
||||
- struct wined3d_volume *volume = texture->sub_resources[i].u.volume;
|
||||
+ struct wined3d_volume *volume = volume_from_resource(texture->sub_resources[i].resource);
|
||||
|
||||
GL_EXTCALL(glTexImage3D(GL_TEXTURE_3D, volume->texture_level,
|
||||
srgb ? format->glGammaInternal : format->glInternal,
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -0,0 +1,137 @@
|
||||
From 1752f853d8b96b779acbd0b62273e75d7b647732 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Mon, 23 Sep 2013 23:58:41 +0200
|
||||
Subject: wined3d: Don't call the public map function in
|
||||
surface_convert_format.
|
||||
|
||||
TODO: Creating a helper surface and releasing it won't work with the CS.
|
||||
surface_cpu_blt will be called via the CS, so it can't call external
|
||||
methods that enqueue commands in the stream.
|
||||
---
|
||||
dlls/wined3d/surface.c | 78 ++++++++++++++++++++++++++++++++++----------------
|
||||
1 file changed, 53 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 1189b97..d5e9f36 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -1548,11 +1548,14 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr
|
||||
{
|
||||
unsigned int texture_level = sub_resource_idx % src_texture->level_count;
|
||||
const struct wined3d_format *src_format = src_texture->resource.format;
|
||||
- struct wined3d_device *device = src_texture->resource.device;
|
||||
- const struct d3dfmt_converter_desc *conv = NULL;
|
||||
+ void *dst_data = NULL, *src_data = NULL;
|
||||
+ UINT src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
|
||||
+ const struct d3dfmt_converter_desc *conv;
|
||||
struct wined3d_texture *dst_texture;
|
||||
struct wined3d_resource_desc desc;
|
||||
- struct wined3d_map_desc src_map;
|
||||
+ struct wined3d_context *context = NULL;
|
||||
+ struct wined3d_device *device = src_texture->resource.device;
|
||||
+ struct wined3d_bo_address src_bo_addr;
|
||||
|
||||
if (!(conv = find_converter(src_format->id, dst_format->id)) && (!device->d3d_initialized
|
||||
|| !is_identity_fixup(src_format->color_fixup) || src_format->convert
|
||||
@@ -1582,34 +1585,45 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- memset(&src_map, 0, sizeof(src_map));
|
||||
- if (FAILED(wined3d_resource_map(&src_texture->resource, sub_resource_idx,
|
||||
- &src_map, NULL, WINED3D_MAP_READONLY)))
|
||||
- {
|
||||
- ERR("Failed to map the source texture.\n");
|
||||
- wined3d_texture_decref(dst_texture);
|
||||
- return NULL;
|
||||
- }
|
||||
+ wined3d_texture_get_pitch(src_texture, sub_resource_idx & src_texture->level_count,
|
||||
+ &src_row_pitch, &src_slice_pitch);
|
||||
+ wined3d_texture_get_pitch(dst_texture, 0, &dst_row_pitch, &dst_slice_pitch);
|
||||
+
|
||||
+ if (device->d3d_initialized)
|
||||
+ context = context_acquire(device, NULL);
|
||||
+
|
||||
+ wined3d_texture_load_location(src_texture, sub_resource_idx, context,
|
||||
+ src_texture->resource.map_binding);
|
||||
+ wined3d_texture_get_memory(src_texture, sub_resource_idx, &src_bo_addr,
|
||||
+ src_texture->resource.map_binding);
|
||||
+ src_data = wined3d_texture_map_bo_address(&src_bo_addr,
|
||||
+ src_texture->sub_resources[sub_resource_idx].size,
|
||||
+ context->gl_info, GL_PIXEL_UNPACK_BUFFER, WINED3D_MAP_READONLY);
|
||||
+ if (!src_data)
|
||||
+ goto error;
|
||||
+
|
||||
if (conv)
|
||||
{
|
||||
- struct wined3d_map_desc dst_map;
|
||||
+ struct wined3d_bo_address dst_bo_addr;
|
||||
|
||||
- memset(&dst_map, 0, sizeof(dst_map));
|
||||
- if (FAILED(wined3d_resource_map(&dst_texture->resource, 0, &dst_map, NULL, 0)))
|
||||
- {
|
||||
- ERR("Failed to map the destination texture.\n");
|
||||
- wined3d_resource_unmap(&src_texture->resource, sub_resource_idx);
|
||||
- wined3d_texture_decref(dst_texture);
|
||||
- return NULL;
|
||||
- }
|
||||
+ wined3d_texture_prepare_location(dst_texture, 0, context, dst_texture->resource.map_binding);
|
||||
+ wined3d_texture_get_memory(dst_texture, 0, &dst_bo_addr,
|
||||
+ dst_texture->resource.map_binding);
|
||||
+ dst_data = wined3d_texture_map_bo_address(&dst_bo_addr,
|
||||
+ dst_texture->sub_resources[0].size,
|
||||
+ context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
+ if (!dst_data)
|
||||
+ goto error;
|
||||
|
||||
- conv->convert(src_map.data, dst_map.data, src_map.row_pitch, dst_map.row_pitch, desc.width, desc.height);
|
||||
+ conv->convert(src_data, dst_data, src_row_pitch, dst_row_pitch, desc.width, desc.height);
|
||||
|
||||
- wined3d_resource_unmap(&dst_texture->resource, 0);
|
||||
+ wined3d_texture_unmap_bo_address(&dst_bo_addr, context->gl_info, GL_PIXEL_UNPACK_BUFFER);
|
||||
}
|
||||
else
|
||||
{
|
||||
- struct wined3d_bo_address data = {0, src_map.data};
|
||||
+ /* FIXME: This seems weird, considering that we got a wined3d_bo_address from the source
|
||||
+ * surface above. Though not sure if the upload_data would work properly with a PBO src. */
|
||||
+ struct wined3d_bo_address data = {0, src_data};
|
||||
RECT src_rect = {0, 0, desc.width, desc.height};
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
@@ -1622,16 +1636,30 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr
|
||||
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
|
||||
wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE);
|
||||
wined3d_surface_upload_data(dst_texture->sub_resources[0].u.surface, gl_info, src_format,
|
||||
- &src_rect, src_map.row_pitch, &dst_point, FALSE, wined3d_const_bo_address(&data));
|
||||
+ &src_rect, src_row_pitch, &dst_point, FALSE, wined3d_const_bo_address(&data));
|
||||
|
||||
context_release(context);
|
||||
|
||||
wined3d_texture_validate_location(dst_texture, 0, WINED3D_LOCATION_TEXTURE_RGB);
|
||||
wined3d_texture_invalidate_location(dst_texture, 0, ~WINED3D_LOCATION_TEXTURE_RGB);
|
||||
}
|
||||
- wined3d_resource_unmap(&src_texture->resource, sub_resource_idx);
|
||||
+ wined3d_texture_unmap_bo_address(&src_bo_addr, context->gl_info, GL_PIXEL_UNPACK_BUFFER);
|
||||
+
|
||||
+ if (context)
|
||||
+ context_release(context);
|
||||
|
||||
return dst_texture;
|
||||
+
|
||||
+error:
|
||||
+ ERR("Surface conversion failed.\n");
|
||||
+
|
||||
+ if (src_data)
|
||||
+ wined3d_texture_unmap_bo_address(&src_bo_addr, context->gl_info, GL_PIXEL_UNPACK_BUFFER);
|
||||
+ if (dst_texture)
|
||||
+ wined3d_texture_decref(dst_texture);
|
||||
+ if (context)
|
||||
+ context_release(context);
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
static HRESULT _Blt_ColorFill(BYTE *buf, unsigned int width, unsigned int height,
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1,27 +0,0 @@
|
||||
From a3ec578ff5afb88dddec526bb21981343f7429ea Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:41 +0100
|
||||
Subject: Revert "wined3d: Avoid surface_from_resource() in
|
||||
swapchain_gl_frontbuffer_updated()."
|
||||
|
||||
This reverts commit c059191e0fe795e4643e56bb2ab806c9ce994055.
|
||||
---
|
||||
dlls/wined3d/swapchain.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index 299a47a..9b8d04c 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -652,7 +652,7 @@ static void swapchain_gl_frontbuffer_updated(struct wined3d_swapchain *swapchain
|
||||
struct wined3d_surface *surface;
|
||||
struct wined3d_context *context;
|
||||
|
||||
- surface = swapchain->front_buffer->sub_resources[0].u.surface;
|
||||
+ surface = surface_from_resource(swapchain->front_buffer->sub_resources[0].resource);
|
||||
context = context_acquire(swapchain->device, surface);
|
||||
surface_load_location(surface, context, surface->container->resource.draw_binding);
|
||||
context_release(context);
|
||||
--
|
||||
2.7.1
|
||||
|
@@ -0,0 +1,135 @@
|
||||
From 317bc57491a7d82cc7274c31371bae4d49001e01 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
|
||||
Date: Sun, 3 Apr 2016 14:45:06 +0100
|
||||
Subject: wined3d: Don't call the public map function in surface_cpu_blt.
|
||||
|
||||
---
|
||||
dlls/wined3d/surface.c | 67 +++++++++++++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 56 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index d5e9f36..4746c5a 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -3392,16 +3392,33 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
|
||||
const BYTE *sbuf;
|
||||
BYTE *dbuf;
|
||||
int x, y;
|
||||
+ struct wined3d_device *device = dst_texture->resource.device;
|
||||
+ struct wined3d_context *context = NULL;
|
||||
+ struct wined3d_bo_address src_bo_addr, dst_bo_addr;
|
||||
|
||||
TRACE("dst_texture %p, dst_sub_resource_idx %u, dst_box %s, src_texture %p, "
|
||||
"src_sub_resource_idx %u, src_box %s, flags %#x, fx %p, filter %s.\n",
|
||||
dst_texture, dst_sub_resource_idx, debug_box(dst_box), src_texture,
|
||||
src_sub_resource_idx, debug_box(src_box), flags, fx, debug_d3dtexturefiltertype(filter));
|
||||
|
||||
+ if (device->d3d_initialized)
|
||||
+ context = context_acquire(device, NULL);
|
||||
+
|
||||
+ wined3d_texture_load_location(dst_texture, dst_sub_resource_idx,
|
||||
+ context, dst_texture->resource.map_binding);
|
||||
+
|
||||
if (src_texture == dst_texture && src_sub_resource_idx == dst_sub_resource_idx)
|
||||
{
|
||||
same_sub_resource = TRUE;
|
||||
- wined3d_resource_map(&dst_texture->resource, dst_sub_resource_idx, &dst_map, NULL, 0);
|
||||
+
|
||||
+ wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_bo_addr,
|
||||
+ dst_texture->resource.map_binding);
|
||||
+ dst_map.data = wined3d_texture_map_bo_address(&dst_bo_addr,
|
||||
+ dst_texture->sub_resources[dst_sub_resource_idx].size,
|
||||
+ context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
+ wined3d_texture_get_pitch(dst_texture, dst_sub_resource_idx % dst_texture->level_count,
|
||||
+ &dst_map.row_pitch, &dst_map.slice_pitch);
|
||||
+
|
||||
src_map = dst_map;
|
||||
src_format = dst_texture->resource.format;
|
||||
dst_format = src_format;
|
||||
@@ -3426,7 +3443,16 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
|
||||
src_texture = converted_texture;
|
||||
src_sub_resource_idx = 0;
|
||||
}
|
||||
- wined3d_resource_map(&src_texture->resource, src_sub_resource_idx, &src_map, NULL, WINED3D_MAP_READONLY);
|
||||
+ wined3d_texture_load_location(src_texture, src_sub_resource_idx,
|
||||
+ context, src_texture->resource.map_binding);
|
||||
+ wined3d_texture_get_pitch(src_texture, src_sub_resource_idx % src_texture->level_count,
|
||||
+ &src_map.row_pitch, &src_map.slice_pitch);
|
||||
+ wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &src_bo_addr,
|
||||
+ src_texture->resource.map_binding);
|
||||
+ src_map.data = wined3d_texture_map_bo_address(&src_bo_addr,
|
||||
+ src_texture->sub_resources[src_sub_resource_idx].size,
|
||||
+ context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
+
|
||||
src_format = src_texture->resource.format;
|
||||
src_fmt_flags = src_texture->resource.format_flags;
|
||||
}
|
||||
@@ -3436,7 +3462,13 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
|
||||
src_fmt_flags = dst_fmt_flags;
|
||||
}
|
||||
|
||||
- wined3d_resource_map(&dst_texture->resource, dst_sub_resource_idx, &dst_map, dst_box, 0);
|
||||
+ wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_bo_addr,
|
||||
+ dst_texture->resource.map_binding);
|
||||
+ dst_map.data = wined3d_texture_map_bo_address(&dst_bo_addr,
|
||||
+ dst_texture->sub_resources[dst_sub_resource_idx].size,
|
||||
+ context->gl_info, GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
+ wined3d_texture_get_pitch(dst_texture, dst_sub_resource_idx % dst_texture->level_count,
|
||||
+ &dst_map.row_pitch, &dst_map.slice_pitch);
|
||||
}
|
||||
|
||||
bpp = dst_format->byte_count;
|
||||
@@ -3450,12 +3482,9 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
|
||||
sbase = (BYTE *)src_map.data
|
||||
+ ((src_box->top / src_format->block_height) * src_map.row_pitch)
|
||||
+ ((src_box->left / src_format->block_width) * src_format->block_byte_count);
|
||||
- if (same_sub_resource)
|
||||
- dbuf = (BYTE *)dst_map.data
|
||||
- + ((dst_box->top / dst_format->block_height) * dst_map.row_pitch)
|
||||
- + ((dst_box->left / dst_format->block_width) * dst_format->block_byte_count);
|
||||
- else
|
||||
- dbuf = dst_map.data;
|
||||
+ dbuf = (BYTE *)dst_map.data
|
||||
+ + ((dst_box->top / dst_format->block_height) * dst_map.row_pitch)
|
||||
+ + ((dst_box->left / dst_format->block_width) * dst_format->block_byte_count);
|
||||
|
||||
if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS)
|
||||
{
|
||||
@@ -3847,16 +3876,32 @@ do { \
|
||||
}
|
||||
}
|
||||
|
||||
+ wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx,
|
||||
+ ~dst_texture->resource.map_binding);
|
||||
+
|
||||
error:
|
||||
if (flags)
|
||||
FIXME(" Unsupported flags %#x.\n", flags);
|
||||
|
||||
release:
|
||||
- wined3d_resource_unmap(&dst_texture->resource, dst_sub_resource_idx);
|
||||
+ wined3d_texture_unmap_bo_address(&dst_bo_addr, context->gl_info, GL_PIXEL_UNPACK_BUFFER);
|
||||
+
|
||||
+ if (dst_texture->swapchain
|
||||
+ && dst_texture == dst_texture->swapchain->front_buffer)
|
||||
+ {
|
||||
+ RECT *r = &dst_texture->swapchain->front_buffer_update;
|
||||
+
|
||||
+ SetRect(r, dst_box->left, dst_box->top, dst_box->right, dst_box->bottom);
|
||||
+ if (!(dst_texture->sub_resources[dst_sub_resource_idx].locations
|
||||
+ & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB)))
|
||||
+ dst_texture->swapchain->swapchain_ops->swapchain_frontbuffer_updated(dst_texture->swapchain);
|
||||
+ }
|
||||
if (src_texture && !same_sub_resource)
|
||||
- wined3d_resource_unmap(&src_texture->resource, src_sub_resource_idx);
|
||||
+ wined3d_texture_unmap_bo_address(&src_bo_addr, context->gl_info, GL_PIXEL_UNPACK_BUFFER);
|
||||
if (converted_texture)
|
||||
wined3d_texture_decref(converted_texture);
|
||||
+ if (context)
|
||||
+ context_release(context);
|
||||
|
||||
return hr;
|
||||
}
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1,27 +0,0 @@
|
||||
From 22489d4035d07941ef326dc05ac4fda8fee8b985 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:43 +0100
|
||||
Subject: Revert "wined3d: Avoid surface_from_resource() in
|
||||
texture2d_prepare_texture()."
|
||||
|
||||
This reverts commit b309b831deb81f47b22f0c25a5fc0a1db6759d6d.
|
||||
---
|
||||
dlls/wined3d/texture.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index af1c1de..651318c 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -868,7 +868,7 @@ static void texture2d_prepare_texture(struct wined3d_texture *texture, struct wi
|
||||
|
||||
for (i = 0; i < sub_count; ++i)
|
||||
{
|
||||
- struct wined3d_surface *surface = texture->sub_resources[i].u.surface;
|
||||
+ struct wined3d_surface *surface = surface_from_resource(texture->sub_resources[i].resource);
|
||||
GLsizei height = surface->pow2Height;
|
||||
GLsizei width = surface->pow2Width;
|
||||
|
||||
--
|
||||
2.7.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
||||
From a88ae9c0bcb8ba8eb4fd9892a6928f38c9add605 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 6 Mar 2016 22:08:44 +0100
|
||||
Subject: Revert "wined3d: Avoid surface_from_resource() in
|
||||
wined3d_texture_update_desc()."
|
||||
|
||||
This reverts commit aad8f74cc8b6cf382026bbaf2f929d240f2d326f.
|
||||
---
|
||||
dlls/wined3d/texture.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 651318c..a664155 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -631,7 +631,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
- surface = texture->sub_resources[0].u.surface;
|
||||
+ surface = surface_from_resource(texture->sub_resources[0].resource);
|
||||
if (surface->resource.map_count || (surface->flags & SFLAG_DCINUSE))
|
||||
{
|
||||
WARN("Surface is mapped or the DC is in use.\n");
|
||||
--
|
||||
2.7.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user