wined3d-CSMT_Helper: Reenable patchset.

This commit is contained in:
Sebastian Lackner 2016-11-15 22:25:07 +01:00
parent 93ef3b46c8
commit dcc28e042c
136 changed files with 1610 additions and 267 deletions

View File

@ -370,6 +370,7 @@ patch_enable_all ()
enable_wined3d_1DTextures="$1"
enable_wined3d_Accounting="$1"
enable_wined3d_CSMT_Helper="$1"
enable_wined3d_CSMT_Main="$1"
enable_wined3d_DXTn="$1"
enable_wined3d_GTX_560M="$1"
enable_wined3d_Limit_Vram="$1"
@ -1295,6 +1296,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"
;;
@ -2018,6 +2022,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."
@ -7707,6 +7718,163 @@ if test "$enable_wined3d_check_format_support" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-CSMT_Main
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-Attach_Process_DLLs, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects,
# | wined3d-1DTextures, wined3d-Accounting, wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Revert_Pixel_Center_Offset, 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/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/view.c,
# | dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h, include/wine/wined3d.h
# |
if test "$enable_wined3d_CSMT_Main" -eq 1; then
patch_apply wined3d-CSMT_Main/9999-IfDefined.patch
(
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Return location from wined3d_buffer_get_memory().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use unsynchronized buffer updates only if there has been at least one buffer map.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Avoid unsynchronized buffer update when reloading whole buffer.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_rendertarget_view_get_drawable_size() as replacement for surface_get_drawable_size().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Move surface_get_drawable_size() to view.c file.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Mark buffers as used in wined3d_buffer_copy().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use wined3d_vec4 in fixup_transformed_pos().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Invalidate STATE_CONSTANT_BUFFER(*) device state in buffer_destroy_buffer_object() when needed.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Fix style issues in delete_gl_buffer().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Pass context to delete_gl_buffer().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Invalidate device state based on buffer bind flags when buffer is deleted.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Compute \"buffer_type_hint\" from buffer bind flags.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Use buffer_bind() in buffer_conversion_upload().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Fix index offset for immediate mode draws.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce buffer_conversion_upload() helper function.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Replace wined3d_buffer_load_sysmem() calls with wined3d_buffer_load_location().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Prefer current locations to WINED3D_LOCATION_SYSMEM in wined3d_buffer_copy().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_get_memory().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Implement wined3d_buffer_prepare_location() for WINED3D_LOCATION_BUFFER.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Move buffer_get_memory() under wined3d_buffer_load_sysmem().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Do not assume that WINED3D_LOCATION_SYSMEM is always valid for double buffered buffers.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_load_location().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Introduce wined3d_buffer_prepapre_location().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Explicitly track locations for buffers.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Clean up buffer_internal_preload().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Let buffer_direct_upload() invalidate STATE_INDEXBUFFER if needed.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Sanitise resource map flags in wined3d_resource_map().\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send resource unmaps through the command stream.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send resource maps through the command stream.\".", 1 },';
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Send shader constant updates through the command stream.\".", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Make surface_load_location return nothing.", 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: 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: 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: 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: 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: Put this into the query poll patch.", 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: Fence update_texture calls.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Dirtify resources on unmap.", 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: 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: 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: 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: Remove another glFinish.", 1 },';
echo '+ { "Stefan Dösinger", "wined3d: Create VBOs through the command stream.", 1 },';
echo '+ { "Stefan Dösinger", "Swapchain waits.", 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: Use an event to block the worker thread when it is idle.", 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: Put GL_APPLE_flush_buffer_range syncing back in place.", 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: 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", "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: 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 '+ { "Nils Kuhnhenn", "wined3d: Fix incorrect return value in wined3d_cs_exec_set_light.", 1 },';
echo '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },';
echo '+ { "Sebastian Lackner", "wined3d: Do not signal CS event when we manage to unset waiting_for_event quickly enough.", 1 },';
echo '+ { "Sebastian Lackner", "wined3d: Enable CSMT by default, print a winediag message informing about this patchset.", 1 },';
) >> "$patchlist"
fi
# Patchset winedevice-Fix_Relocation
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,79 @@
From 103b66b00488084c7245407a61b2bb09d2c0cfdc Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:07:19 +0100
Subject: Revert "wined3d: Return location from wined3d_buffer_get_memory()."
This reverts commit e2733ed7fbcc9ca205e5e9b7507f301021b742cc.
---
dlls/wined3d/buffer.c | 10 +++++-----
dlls/wined3d/wined3d_private.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 58c273c..6b59965 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -631,7 +631,7 @@ BYTE *wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_c
return buffer->resource.heap_memory;
}
-DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
+void wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
struct wined3d_bo_address *data, DWORD locations)
{
TRACE("buffer %p, data %p, locations %s.\n",
@@ -641,19 +641,18 @@ DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
{
data->buffer_object = buffer->buffer_object;
data->addr = NULL;
- return WINED3D_LOCATION_BUFFER;
+ return;
}
if (locations & WINED3D_LOCATION_SYSMEM)
{
data->buffer_object = 0;
data->addr = buffer->resource.heap_memory;
- return WINED3D_LOCATION_SYSMEM;
+ return;
}
ERR("Unexpected locations %s.\n", wined3d_debug_location(locations));
data->buffer_object = 0;
data->addr = NULL;
- return 0;
}
static void buffer_unload(struct wined3d_resource *resource)
@@ -1275,7 +1274,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
context = context_acquire(device, NULL);
gl_info = context->gl_info;
- dst_location = wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations);
+ wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations);
wined3d_buffer_get_memory(src_buffer, &src, src_buffer->locations);
if (dst.buffer_object && src.buffer_object)
@@ -1327,6 +1326,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
memcpy(dst.addr + dst_offset, src.addr + src_offset, size);
}
+ dst_location = dst.buffer_object ? WINED3D_LOCATION_BUFFER : WINED3D_LOCATION_SYSMEM;
wined3d_buffer_invalidate_range(dst_buffer, ~dst_location, dst_offset, size);
context_release(context);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6e742f6..503f7f2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3179,7 +3179,7 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc
}
void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
-DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
+void wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN;
void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD location) DECLSPEC_HIDDEN;
void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context,
--
2.9.0

View File

@ -0,0 +1,80 @@
From 2accc03254f24b7fb290d99d0bec7a689386c9e1 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:07:28 +0100
Subject: Revert "wined3d: Use unsynchronized buffer updates only if there has
been at least one buffer map."
This reverts commit 085ae6ed08710fedfdcd1febe580d04baeebd596.
---
dlls/wined3d/buffer.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6b59965..f686855 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -34,8 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */
#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */
#define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */
-#define WINED3D_BUFFER_MAP 0x20 /* There has been at least one map since the last preload. */
-#define WINED3D_BUFFER_APPLESYNC 0x40 /* Using sync as in GL_APPLE_flush_buffer_range. */
+#define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */
#define VB_MAXDECLCHANGES 100 /* After that number of decl changes we stop converting */
#define VB_RESETDECLCHANGE 1000 /* Reset the decl changecount after that number of draws */
@@ -819,7 +818,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con
mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT;
if (flags & WINED3D_BUFFER_DISCARD)
mapflags |= GL_MAP_INVALIDATE_BUFFER_BIT;
- else if (flags & WINED3D_BUFFER_MAP && !(flags & WINED3D_BUFFER_SYNC))
+ else if (!(flags & WINED3D_BUFFER_SYNC))
mapflags |= GL_MAP_UNSYNCHRONIZED_BIT;
map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0,
This->resource.size, mapflags));
@@ -832,7 +831,7 @@ static void buffer_direct_upload(struct wined3d_buffer *This, struct wined3d_con
DWORD syncflags = 0;
if (flags & WINED3D_BUFFER_DISCARD)
syncflags |= WINED3D_MAP_DISCARD;
- else if (flags & WINED3D_BUFFER_MAP && !(flags & WINED3D_BUFFER_SYNC))
+ else if (!(flags & WINED3D_BUFFER_SYNC))
syncflags |= WINED3D_MAP_NOOVERWRITE;
buffer_sync_apple(This, syncflags, gl_info);
}
@@ -930,14 +929,14 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined
void buffer_mark_used(struct wined3d_buffer *buffer)
{
- buffer->flags &= ~(WINED3D_BUFFER_MAP | WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD);
+ buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD);
}
/* Context activation is done by the caller. */
void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context,
const struct wined3d_state *state)
{
- DWORD flags = buffer->flags & (WINED3D_BUFFER_MAP | WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD);
+ DWORD flags = buffer->flags & (WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD);
const struct wined3d_gl_info *gl_info = context->gl_info;
BOOL decl_changed = FALSE;
@@ -1012,7 +1011,7 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *
/* Avoid unfenced updates, we might overwrite more areas of the buffer than the application
* cleared for unsynchronized updates.
*/
- flags = 0;
+ flags = WINED3D_BUFFER_SYNC;
}
else
{
@@ -1172,7 +1171,6 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI
}
}
- buffer->flags |= WINED3D_BUFFER_MAP;
if (flags & WINED3D_MAP_DISCARD)
buffer->flags |= WINED3D_BUFFER_DISCARD;
else if (!(flags & WINED3D_MAP_NOOVERWRITE))
--
2.9.0

View File

@ -0,0 +1,30 @@
From 289f21e74582e376903f3f987b839f2b66fe29af Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:07:39 +0100
Subject: Revert "wined3d: Avoid unsynchronized buffer update when reloading
whole buffer."
This reverts commit c259854a0afc5e4fb8644af7c5c979f312f954f3.
---
dlls/wined3d/buffer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index f686855..564b1fc 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1009,9 +1009,9 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *
buffer_invalidate_bo_range(buffer, 0, 0);
/* Avoid unfenced updates, we might overwrite more areas of the buffer than the application
- * cleared for unsynchronized updates.
+ * cleared for unsynchronized updates
*/
- flags = WINED3D_BUFFER_SYNC;
+ flags = 0;
}
else
{
--
2.9.0

View File

@ -0,0 +1,124 @@
From 2bd4f2e4ad2310471f7c3cd85f59f261314cd6c4 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:07:56 +0100
Subject: Revert "wined3d: Introduce
wined3d_rendertarget_view_get_drawable_size() as replacement for
surface_get_drawable_size()."
This reverts commit 5cdb8f2486cf00a61c1aac20daef8c7cac0d8312.
---
dlls/wined3d/device.c | 5 ++---
dlls/wined3d/state.c | 6 +++---
dlls/wined3d/view.c | 17 +++--------------
dlls/wined3d/wined3d_private.h | 5 ++---
4 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d7349fcf..a611531 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -291,8 +291,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
UINT rect_count, const RECT *clear_rect, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color,
float depth, DWORD stencil)
{
- struct wined3d_rendertarget_view *rtv = rt_count ? fb->render_targets[0] : NULL;
- struct wined3d_surface *target = rtv ? wined3d_rendertarget_view_get_surface(rtv) : NULL;
+ struct wined3d_surface *target = rt_count ? wined3d_rendertarget_view_get_surface(fb->render_targets[0]) : NULL;
struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL;
const struct wined3d_state *state = &device->state;
@@ -340,7 +339,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
if (target)
{
render_offscreen = context->render_offscreen;
- wined3d_rendertarget_view_get_drawable_size(rtv, context, &drawable_width, &drawable_height);
+ surface_get_drawable_size(target, context, &drawable_width, &drawable_height);
}
else
{
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index cd3763c..9e36bcd 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4624,7 +4624,7 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine
if (vp.height > target->height)
vp.height = target->height;
- wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height);
+ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height);
}
else if (depth_stencil)
{
@@ -4668,7 +4668,7 @@ static void viewport_miscpart_cc(struct wined3d_context *context,
if (vp.height > target->height)
vp.height = target->height;
- wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height);
+ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height);
}
else if (depth_stencil)
{
@@ -4853,7 +4853,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
UINT height;
UINT width;
- wined3d_rendertarget_view_get_drawable_size(target, context, &width, &height);
+ surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height);
gl_info->gl_ops.gl.p_glScissor(r->left, height - r->bottom, r->right - r->left, r->bottom - r->top);
}
checkGLcall("glScissor");
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index a67c506..1f819e6 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -94,21 +94,10 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str
return view->resource;
}
-void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view,
- const struct wined3d_context *context, unsigned int *width, unsigned int *height)
+void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
+ unsigned int *width, unsigned int *height)
{
- const struct wined3d_texture *texture;
-
- if (view->resource->type != WINED3D_RTYPE_TEXTURE_2D)
- {
- FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(view->resource->type));
- *width = 0;
- *height = 0;
- return;
- }
-
- texture = texture_from_resource(view->resource);
- if (texture->swapchain)
+ if (surface->container->swapchain)
{
/* The drawable size of an onscreen drawable is the surface size.
* (Actually: The window size, but the surface is created in window
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 503f7f2..19b650e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2908,6 +2908,8 @@ HRESULT surface_color_fill(struct wined3d_surface *s,
const RECT *rect, const struct wined3d_color *color) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_create_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_surface_destroy_dc(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
+void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
+ unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct wined3d_context *context) DECLSPEC_HIDDEN;
HRESULT surface_load_location(struct wined3d_surface *surface,
@@ -3224,9 +3226,6 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface(
return texture->sub_resources[view->sub_resource_idx].u.surface;
}
-void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view,
- const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
-
struct wined3d_shader_resource_view
{
LONG refcount;
--
2.9.0

View File

@ -0,0 +1,102 @@
From 1a411d1906c961dc1d754181823b2ce92301937a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:08:06 +0100
Subject: Revert "wined3d: Move surface_get_drawable_size() to view.c file."
This reverts commit 4beb9e5922301b76c16f6ea885bc1cb604f9eb91.
---
dlls/wined3d/surface.c | 33 +++++++++++++++++++++++++++++++++
dlls/wined3d/view.c | 33 ---------------------------------
2 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index bba855a..1c211ed 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -36,6 +36,39 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
static const DWORD surface_simple_locations = WINED3D_LOCATION_SYSMEM
| WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_BUFFER;
+void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
+ unsigned int *width, unsigned int *height)
+{
+ if (surface->container->swapchain)
+ {
+ /* The drawable size of an onscreen drawable is the surface size.
+ * (Actually: The window size, but the surface is created in window
+ * size.) */
+ *width = context->current_rt.texture->resource.width;
+ *height = context->current_rt.texture->resource.height;
+ }
+ else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER)
+ {
+ const struct wined3d_swapchain *swapchain = context->swapchain;
+
+ /* The drawable size of a backbuffer / aux buffer offscreen target is
+ * the size of the current context's drawable, which is the size of
+ * the back buffer of the swapchain the active context belongs to. */
+ *width = swapchain->desc.backbuffer_width;
+ *height = swapchain->desc.backbuffer_height;
+ }
+ else
+ {
+ struct wined3d_surface *rt;
+
+ /* The drawable size of an FBO target is the OpenGL texture size,
+ * which is the power of two size. */
+ rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
+ *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level);
+ *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level);
+ }
+}
+
struct blt_info
{
GLenum binding;
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 1f819e6..7f07d57 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -94,39 +94,6 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str
return view->resource;
}
-void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context,
- unsigned int *width, unsigned int *height)
-{
- if (surface->container->swapchain)
- {
- /* The drawable size of an onscreen drawable is the surface size.
- * (Actually: The window size, but the surface is created in window
- * size.) */
- *width = context->current_rt.texture->resource.width;
- *height = context->current_rt.texture->resource.height;
- }
- else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER)
- {
- const struct wined3d_swapchain *swapchain = context->swapchain;
-
- /* The drawable size of a backbuffer / aux buffer offscreen target is
- * the size of the current context's drawable, which is the size of
- * the back buffer of the swapchain the active context belongs to. */
- *width = swapchain->desc.backbuffer_width;
- *height = swapchain->desc.backbuffer_height;
- }
- else
- {
- struct wined3d_surface *rt;
-
- /* The drawable size of an FBO target is the OpenGL texture size,
- * which is the power of two size. */
- rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
- *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level);
- *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level);
- }
-}
-
static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view,
const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource,
void *parent, const struct wined3d_parent_ops *parent_ops)
--
2.9.0

View File

@ -0,0 +1,27 @@
From b80300afc09521dddf8d025ba5df8243bd044681 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:08:32 +0100
Subject: Revert "wined3d: Mark buffers as used in wined3d_buffer_copy()."
This reverts commit 20b989ef86de7e36b7ec9feee49b0bfa9f284b43.
---
dlls/wined3d/buffer.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 564b1fc..202ce32 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1264,9 +1264,6 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
DWORD dst_location;
HRESULT hr;
- buffer_mark_used(dst_buffer);
- buffer_mark_used(src_buffer);
-
device = dst_buffer->resource.device;
context = context_acquire(device, NULL);
--
2.9.0

View File

@ -0,0 +1,54 @@
From 01e29442c38eff41c69cc4b99d91d8eee5bcb5ef Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:09:25 +0100
Subject: Revert "wined3d: Use wined3d_vec4 in fixup_transformed_pos()."
This reverts commit 07cfeac3dd7ca41d9d9fde3a490425451c4b26b7.
---
dlls/wined3d/buffer.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 202ce32..aed9e26 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -509,19 +509,19 @@ static inline unsigned int fixup_d3dcolor(DWORD *dst_color)
return sizeof(*dst_color);
}
-static inline unsigned int fixup_transformed_pos(struct wined3d_vec4 *p)
+static inline unsigned int fixup_transformed_pos(float *p)
{
/* rhw conversion like in position_float4(). */
- if (p->w != 1.0f && p->w != 0.0f)
+ if (p[3] != 1.0f && p[3] != 0.0f)
{
- float w = 1.0f / p->w;
- p->x *= w;
- p->y *= w;
- p->z *= w;
- p->w = w;
+ float w = 1.0f / p[3];
+ p[0] *= w;
+ p[1] *= w;
+ p[2] *= w;
+ p[3] = w;
}
- return sizeof(*p);
+ return 4 * sizeof(*p);
}
ULONG CDECL wined3d_buffer_incref(struct wined3d_buffer *buffer)
@@ -909,7 +909,7 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined
j += fixup_d3dcolor((DWORD *) (data + i * buffer->stride + j));
break;
case CONV_POSITIONT:
- j += fixup_transformed_pos((struct wined3d_vec4 *) (data + i * buffer->stride + j));
+ j += fixup_transformed_pos((float *) (data + i * buffer->stride + j));
break;
default:
FIXME("Unimplemented conversion %d in shifted conversion.\n", buffer->conversion_map[j]);
--
2.9.0

View File

@ -0,0 +1,34 @@
From 753504b584ef9c248fe9165cd07ec89b8ab401c2 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:09:45 +0100
Subject: Revert "wined3d: Invalidate STATE_CONSTANT_BUFFER(*) device state in
buffer_destroy_buffer_object() when needed."
This reverts commit de19ba7c23b3fd3c80ce7221bdb3ce138b3d4400.
---
dlls/wined3d/buffer.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index aed9e26..6e6d189 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -162,15 +162,6 @@ static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const st
device_invalidate_state(resource->device, STATE_STREAMSRC);
if (buffer->bind_flags & WINED3D_BIND_INDEX_BUFFER)
device_invalidate_state(resource->device, STATE_INDEXBUFFER);
- if (buffer->bind_flags & WINED3D_BIND_CONSTANT_BUFFER)
- {
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_HULL));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_DOMAIN));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GEOMETRY));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_PIXEL));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_COMPUTE));
- }
}
if (buffer->query)
--
2.9.0

View File

@ -0,0 +1,92 @@
From 7c6279ec1995b6987669524f9c03aac4423394d0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:09:53 +0100
Subject: Revert "wined3d: Fix style issues in delete_gl_buffer()."
This reverts commit 01b8bea329a34d946aa2efbeabae9ad00a5e9868.
---
dlls/wined3d/buffer.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6e6d189..a3d7dfd 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -139,17 +139,16 @@ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *c
}
/* Context activation is done by the caller. */
-static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const struct wined3d_context *context)
+static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
- struct wined3d_resource *resource = &buffer->resource;
+ struct wined3d_resource *resource = &This->resource;
- if (!buffer->buffer_object)
- return;
+ if(!This->buffer_object) return;
- GL_EXTCALL(glDeleteBuffers(1, &buffer->buffer_object));
+ GL_EXTCALL(glDeleteBuffers(1, &This->buffer_object));
checkGLcall("glDeleteBuffers");
- buffer->buffer_object = 0;
+ This->buffer_object = 0;
/* The stream source state handler might have read the memory of the
* vertex buffer already and got the memory in the vbo which is not
@@ -158,18 +157,18 @@ static void buffer_destroy_buffer_object(struct wined3d_buffer *buffer, const st
* rarely. */
if (resource->bind_count)
{
- if (buffer->bind_flags & WINED3D_BIND_VERTEX_BUFFER)
+ if (This->bind_flags & WINED3D_BIND_VERTEX_BUFFER)
device_invalidate_state(resource->device, STATE_STREAMSRC);
- if (buffer->bind_flags & WINED3D_BIND_INDEX_BUFFER)
+ if (This->bind_flags & WINED3D_BIND_INDEX_BUFFER)
device_invalidate_state(resource->device, STATE_INDEXBUFFER);
}
- if (buffer->query)
+ if(This->query)
{
- wined3d_event_query_destroy(buffer->query);
- buffer->query = NULL;
+ wined3d_event_query_destroy(This->query);
+ This->query = NULL;
}
- buffer->flags &= ~WINED3D_BUFFER_APPLESYNC;
+ This->flags &= ~WINED3D_BUFFER_APPLESYNC;
}
/* Context activation is done by the caller. */
@@ -258,7 +257,7 @@ fail:
/* Clean up all BO init, but continue because we can work without a BO :-) */
ERR("Failed to create a buffer object. Continuing, but performance issues may occur.\n");
buffer->flags &= ~WINED3D_BUFFER_USE_BO;
- buffer_destroy_buffer_object(buffer, context);
+ delete_gl_buffer(buffer, context);
buffer_clear_dirty_areas(buffer);
return FALSE;
}
@@ -664,7 +663,7 @@ static void buffer_unload(struct wined3d_resource *resource)
buffer->flags &= ~WINED3D_BUFFER_DOUBLEBUFFER;
wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER);
- buffer_destroy_buffer_object(buffer, context);
+ delete_gl_buffer(buffer, context);
buffer_clear_dirty_areas(buffer);
context_release(context);
@@ -693,7 +692,7 @@ static void wined3d_buffer_destroy_object(void *object)
if (buffer->buffer_object)
{
context = context_acquire(buffer->resource.device, NULL);
- buffer_destroy_buffer_object(buffer, context);
+ delete_gl_buffer(buffer, context);
context_release(context);
HeapFree(GetProcessHeap(), 0, buffer->conversion_map);
--
2.9.0

View File

@ -0,0 +1,57 @@
From d826efd7c8bce9cc50f79ab5589455d8e7882561 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:10:01 +0100
Subject: Revert "wined3d: Pass context to delete_gl_buffer()."
This reverts commit 20eb55fdefa9f0b7a0864dce3b4a12b132dba651.
---
dlls/wined3d/buffer.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index a3d7dfd..43b3366 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -138,10 +138,9 @@ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *c
GL_EXTCALL(glBindBuffer(buffer->buffer_type_hint, buffer->buffer_object));
}
-/* Context activation is done by the caller. */
-static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_context *context)
+/* Context activation is done by the caller */
+static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info)
{
- const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_resource *resource = &This->resource;
if(!This->buffer_object) return;
@@ -257,7 +256,7 @@ fail:
/* Clean up all BO init, but continue because we can work without a BO :-) */
ERR("Failed to create a buffer object. Continuing, but performance issues may occur.\n");
buffer->flags &= ~WINED3D_BUFFER_USE_BO;
- delete_gl_buffer(buffer, context);
+ delete_gl_buffer(buffer, gl_info);
buffer_clear_dirty_areas(buffer);
return FALSE;
}
@@ -663,7 +662,7 @@ static void buffer_unload(struct wined3d_resource *resource)
buffer->flags &= ~WINED3D_BUFFER_DOUBLEBUFFER;
wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER);
- delete_gl_buffer(buffer, context);
+ delete_gl_buffer(buffer, context->gl_info);
buffer_clear_dirty_areas(buffer);
context_release(context);
@@ -692,7 +691,7 @@ static void wined3d_buffer_destroy_object(void *object)
if (buffer->buffer_object)
{
context = context_acquire(buffer->resource.device, NULL);
- delete_gl_buffer(buffer, context);
+ delete_gl_buffer(buffer, context->gl_info);
context_release(context);
HeapFree(GetProcessHeap(), 0, buffer->conversion_map);
--
2.9.0

View File

@ -0,0 +1,99 @@
From 9d42f1e7b7426a61c7e7b1c355c5563ffbdc8c59 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:10:09 +0100
Subject: Revert "wined3d: Invalidate device state based on buffer bind flags
when buffer is deleted."
This reverts commit cc35b6c8b3896a2020dc45db3aab61673f7c7268.
---
dlls/wined3d/buffer.c | 32 +++++++++++++++-----------------
dlls/wined3d/wined3d_private.h | 1 -
2 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 43b3366..a30e467 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -141,27 +141,12 @@ static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *c
/* Context activation is done by the caller */
static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info)
{
- struct wined3d_resource *resource = &This->resource;
-
if(!This->buffer_object) return;
GL_EXTCALL(glDeleteBuffers(1, &This->buffer_object));
checkGLcall("glDeleteBuffers");
This->buffer_object = 0;
- /* The stream source state handler might have read the memory of the
- * vertex buffer already and got the memory in the vbo which is not
- * valid any longer. Dirtify the stream source to force a reload. This
- * happens only once per changed vertexbuffer and should occur rather
- * rarely. */
- if (resource->bind_count)
- {
- if (This->bind_flags & WINED3D_BIND_VERTEX_BUFFER)
- device_invalidate_state(resource->device, STATE_STREAMSRC);
- if (This->bind_flags & WINED3D_BIND_INDEX_BUFFER)
- device_invalidate_state(resource->device, STATE_INDEXBUFFER);
- }
-
if(This->query)
{
wined3d_event_query_destroy(This->query);
@@ -652,9 +637,10 @@ static void buffer_unload(struct wined3d_resource *resource)
if (buffer->buffer_object)
{
+ struct wined3d_device *device = resource->device;
struct wined3d_context *context;
- context = context_acquire(resource->device, NULL);
+ context = context_acquire(device, NULL);
/* Download the buffer, but don't permanently enable double buffering. */
wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_SYSMEM);
@@ -672,6 +658,19 @@ static void buffer_unload(struct wined3d_resource *resource)
buffer->stride = 0;
buffer->conversion_stride = 0;
buffer->flags &= ~WINED3D_BUFFER_HASDESC;
+
+ /* The stream source state handler might have read the memory of the
+ * vertex buffer already and got the memory in the vbo which is not
+ * valid any longer. Dirtify the stream source to force a reload. This
+ * happens only once per changed vertexbuffer and should occur rather
+ * rarely. */
+ if (resource->bind_count)
+ {
+ device_invalidate_state(device, STATE_STREAMSRC);
+
+ if (buffer->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER)
+ device_invalidate_state(device, STATE_INDEXBUFFER);
+ }
}
resource_unload(resource);
@@ -1454,7 +1453,6 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
return hr;
}
buffer->buffer_type_hint = buffer_type_hint_from_bind_flags(bind_flags);
- buffer->bind_flags = bind_flags;
buffer->locations = WINED3D_LOCATION_SYSMEM;
TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n",
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 19b650e..c56558d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3158,7 +3158,6 @@ struct wined3d_buffer
GLuint buffer_object;
GLenum buffer_object_usage;
GLenum buffer_type_hint;
- unsigned int bind_flags;
DWORD flags;
void *map_ptr;
--
2.9.0

View File

@ -0,0 +1,112 @@
From 280cb6e8d37df26215688bfe2ec13ad76faff8d4 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 15 Nov 2016 22:13:29 +0100
Subject: Revert "wined3d: Compute "buffer_type_hint" from buffer bind flags."
This reverts commit e3c692151f9199d7e37b2c788daa629d0c2c1b3b.
---
dlls/wined3d/buffer.c | 31 ++++++++-----------------------
include/wine/wined3d.h | 9 ---------
2 files changed, 8 insertions(+), 32 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index a30e467..5cecce5 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1410,28 +1410,14 @@ static const struct wined3d_resource_ops buffer_resource_ops =
buffer_resource_sub_resource_unmap,
};
-static GLenum buffer_type_hint_from_bind_flags(unsigned int bind_flags)
-{
- if (bind_flags == WINED3D_BIND_INDEX_BUFFER)
- return GL_ELEMENT_ARRAY_BUFFER;
-
- if (bind_flags & WINED3D_BIND_CONSTANT_BUFFER)
- return GL_UNIFORM_BUFFER;
-
- if (bind_flags & ~(WINED3D_BIND_VERTEX_BUFFER | WINED3D_BIND_INDEX_BUFFER))
- FIXME("Unhandled bind flags %#x.\n", bind_flags);
-
- return GL_ARRAY_BUFFER;
-}
-
static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device,
- UINT size, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, unsigned int bind_flags,
+ UINT size, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, GLenum bind_hint,
const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
- BOOL dynamic_buffer_ok;
HRESULT hr;
+ BOOL dynamic_buffer_ok;
if (!size)
{
@@ -1452,12 +1438,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
WARN("Failed to initialize resource, hr %#x.\n", hr);
return hr;
}
- buffer->buffer_type_hint = buffer_type_hint_from_bind_flags(bind_flags);
+ buffer->buffer_type_hint = bind_hint;
buffer->locations = WINED3D_LOCATION_SYSMEM;
- TRACE("buffer %p, size %#x, usage %#x, format %s, memory @ %p.\n",
- buffer, buffer->resource.size, buffer->resource.usage,
- debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory);
+ TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage,
+ debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer);
if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING || pool == WINED3D_POOL_MANAGED)
{
@@ -1524,7 +1509,7 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct
FIXME("Ignoring access flags (pool).\n");
hr = buffer_init(object, device, desc->byte_width, desc->usage, WINED3DFMT_UNKNOWN,
- WINED3D_POOL_MANAGED, desc->bind_flags, data, parent, parent_ops);
+ WINED3D_POOL_MANAGED, GL_ARRAY_BUFFER_ARB, data, parent, parent_ops);
if (FAILED(hr))
{
WARN("Failed to initialize buffer, hr %#x.\n", hr);
@@ -1566,7 +1551,7 @@ HRESULT CDECL wined3d_buffer_create_vb(struct wined3d_device *device, UINT size,
}
hr = buffer_init(object, device, size, usage, WINED3DFMT_UNKNOWN,
- pool, WINED3D_BIND_VERTEX_BUFFER, NULL, parent, parent_ops);
+ pool, GL_ARRAY_BUFFER_ARB, NULL, parent, parent_ops);
if (FAILED(hr))
{
WARN("Failed to initialize buffer, hr %#x.\n", hr);
@@ -1597,7 +1582,7 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size,
}
hr = buffer_init(object, device, size, usage | WINED3DUSAGE_STATICDECL,
- WINED3DFMT_UNKNOWN, pool, WINED3D_BIND_INDEX_BUFFER, NULL,
+ WINED3DFMT_UNKNOWN, pool, GL_ELEMENT_ARRAY_BUFFER_ARB, NULL,
parent, parent_ops);
if (FAILED(hr))
{
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index c7ecef1..8cbb76c 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -833,15 +833,6 @@ enum wined3d_display_rotation
#define WINED3DDP_MAXTEXCOORD 8
-#define WINED3D_BIND_VERTEX_BUFFER 0x00000001
-#define WINED3D_BIND_INDEX_BUFFER 0x00000002
-#define WINED3D_BIND_CONSTANT_BUFFER 0x00000004
-#define WINED3D_BIND_SHADER_RESOURCE 0x00000008
-#define WINED3D_BIND_STREAM_OUTPUT 0x00000010
-#define WINED3D_BIND_RENDER_TARGET 0x00000020
-#define WINED3D_BIND_DEPTH_STENCIL 0x00000040
-#define WINED3D_BIND_UNORDERED_ACCESS 0x00000080
-
#define WINED3DUSAGE_RENDERTARGET 0x00000001
#define WINED3DUSAGE_DEPTHSTENCIL 0x00000002
#define WINED3DUSAGE_WRITEONLY 0x00000008
--
2.9.0

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