mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
wined3d-CSMT_Main: Reenable patchset.
This commit is contained in:
parent
06886567bc
commit
74528271f3
@ -405,6 +405,7 @@ patch_enable_all ()
|
||||
enable_wined3d_Accounting="$1"
|
||||
enable_wined3d_Blend_Factor="$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"
|
||||
@ -1429,6 +1430,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"
|
||||
;;
|
||||
@ -1959,6 +1963,13 @@ if test "$enable_winex11_WM_WINDOWPOSCHANGING" -eq 1; then
|
||||
enable_winex11__NET_ACTIVE_WINDOW=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_d3d11_Deferred_Context" -gt 1; then
|
||||
abort "Patchset d3d11-Deferred_Context disabled, but wined3d-CSMT_Helper depends on that."
|
||||
@ -8446,6 +8457,80 @@ 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:
|
||||
# | * d3d11-Deferred_Context, 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/d3d10core/tests/device.c, dlls/d3d11/tests/d3d11.c, dlls/d3d9/tests/visual.c, dlls/wined3d/arb_program_shader.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
|
||||
# |
|
||||
if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
patch_apply wined3d-CSMT_Main/9999-IfDefined.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "wined3d: Replace surface_load_location with texture_load_location.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Hackily introduce a multithreaded command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send push_constants through the CS.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Give the cs its own state.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send primitive type updates through the command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send light updates through the command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Pass the depth stencil to swapchain->present.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send render target view clears through the command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send update_sub_resource calls through the command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in uninit_3d.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Unload resources through the CS in device_reset.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send getdc and releasedc through the command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Create dummy textures through the CS.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Create the initial context through the CS.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Recreate ctx and dummy textures through the CS after resets.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Call create_default_sampler from create_dummy_textures.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Do the sampler GL init through the CS.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Create initial DCs through the CS.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Do not query available GPU memory on main thread when CSMT is enabled.", 1 },';
|
||||
printf '%s\n' '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send buffer update subresource requests through CS.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send buffer copy requests through CS.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send create_buffer_texture / create_texture_view through the CS.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Don'\''t access device state in clears.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in reset.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Delete GL contexts through the CS in uninit_3d.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Add swapchain waits.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Avoid destroying views in color and depth fills.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Run the cs asynchronously.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "wined3d: Map vertex buffers through cs.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "wined3d: Optimize cs queue empty check.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Introduce a separate priority queue.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Use priority queue for maps/unmaps.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Do not allow to disable CSMT.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Use priority queue for query polls.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish before swapping.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Use an event to block the worker thread when it is idle.", 1 },';
|
||||
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Unset some objects in state_init_default.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Use priority queue for get_dc / release_dc.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Simplify the fence handling.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Do not immediately submit stateblock updates.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Get rid of TLS for command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Clean up cs lists on shutdown.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset winedbg-Process_Arguments
|
||||
# |
|
||||
# | Modified files:
|
||||
|
@ -1,79 +0,0 @@
|
||||
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
|
||||
|
@ -0,0 +1,26 @@
|
||||
From d08d8a1233fd4d1fcb269b6e364c2122183fdd3f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 5 Feb 2017 16:34:41 +0100
|
||||
Subject: wined3d: Replace surface_load_location with texture_load_location.
|
||||
|
||||
---
|
||||
dlls/wined3d/device.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 74a4b09ab1a..4d0f6f2c4be 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -286,7 +286,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
|
||||
{
|
||||
DWORD location = render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
|
||||
|
||||
- surface_load_location(depth_stencil, context, location);
|
||||
+ wined3d_texture_load_location(depth_stencil->container, dsv->sub_resource_idx,
|
||||
+ context, location);
|
||||
}
|
||||
|
||||
if (!context_apply_clear_state(context, state, rt_count, fb))
|
||||
--
|
||||
2.11.0
|
||||
|
@ -1,80 +0,0 @@
|
||||
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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,30 +0,0 @@
|
||||
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
|
||||
|
@ -0,0 +1,293 @@
|
||||
From 29cdf26fd35b1d309b9326c2eb8641ed5564e85b Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 6 Feb 2017 05:50:11 +0100
|
||||
Subject: wined3d: Send push_constants through the CS.
|
||||
|
||||
---
|
||||
dlls/wined3d/cs.c | 119 +++++++++++++++++++++++++----------------
|
||||
dlls/wined3d/device.c | 12 ++---
|
||||
dlls/wined3d/wined3d_private.h | 12 ++---
|
||||
3 files changed, 83 insertions(+), 60 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index c0d8a5f2fd5..b832b7e0733 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -75,6 +75,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_MAP,
|
||||
WINED3D_CS_OP_UNMAP,
|
||||
WINED3D_CS_OP_GLFINISH,
|
||||
+ WINED3D_CS_OP_PUSH_CONSTANTS,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -366,6 +367,15 @@ struct wined3d_cs_finish
|
||||
enum wined3d_cs_op opcode;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_push_constants
|
||||
+{
|
||||
+ enum wined3d_cs_op opcode;
|
||||
+ enum wined3d_push_constants p;
|
||||
+ unsigned int start_idx;
|
||||
+ unsigned int count;
|
||||
+ BYTE constants[1];
|
||||
+};
|
||||
+
|
||||
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
|
||||
|
||||
@@ -1742,6 +1752,67 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
|
||||
cs->ops->submit(cs);
|
||||
}
|
||||
|
||||
+static const struct
|
||||
+{
|
||||
+ size_t offset;
|
||||
+ size_t size;
|
||||
+ DWORD mask;
|
||||
+}
|
||||
+push_constant_info[] =
|
||||
+{
|
||||
+ /* WINED3D_PUSH_CONSTANTS_VS_F */
|
||||
+ {FIELD_OFFSET(struct wined3d_state, vs_consts_f), sizeof(struct wined3d_vec4), WINED3D_SHADER_CONST_VS_F},
|
||||
+ /* WINED3D_PUSH_CONSTANTS_PS_F */
|
||||
+ {FIELD_OFFSET(struct wined3d_state, ps_consts_f), sizeof(struct wined3d_vec4), WINED3D_SHADER_CONST_PS_F},
|
||||
+ /* WINED3D_PUSH_CONSTANTS_VS_I */
|
||||
+ {FIELD_OFFSET(struct wined3d_state, vs_consts_i), sizeof(struct wined3d_ivec4), WINED3D_SHADER_CONST_VS_I},
|
||||
+ /* WINED3D_PUSH_CONSTANTS_PS_I */
|
||||
+ {FIELD_OFFSET(struct wined3d_state, ps_consts_i), sizeof(struct wined3d_ivec4), WINED3D_SHADER_CONST_PS_I},
|
||||
+ /* WINED3D_PUSH_CONSTANTS_VS_B */
|
||||
+ {FIELD_OFFSET(struct wined3d_state, vs_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_VS_B},
|
||||
+ /* WINED3D_PUSH_CONSTANTS_PS_B */
|
||||
+ {FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B},
|
||||
+};
|
||||
+
|
||||
+static UINT wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *data)
|
||||
+{
|
||||
+ const struct wined3d_cs_push_constants *op = data;
|
||||
+ size_t size = FIELD_OFFSET(struct wined3d_cs_push_constants, constants[op->count * push_constant_info[op->p].size]);
|
||||
+ struct wined3d_device *device = cs->device;
|
||||
+ unsigned int context_count;
|
||||
+ unsigned int i;
|
||||
+ size_t offset;
|
||||
+
|
||||
+ if (op->p == WINED3D_PUSH_CONSTANTS_VS_F)
|
||||
+ device->shader_backend->shader_update_float_vertex_constants(device, op->start_idx, op->count);
|
||||
+ else if (op->p == WINED3D_PUSH_CONSTANTS_PS_F)
|
||||
+ device->shader_backend->shader_update_float_pixel_constants(device, op->start_idx, op->count);
|
||||
+
|
||||
+ offset = push_constant_info[op->p].offset + op->start_idx * push_constant_info[op->p].size;
|
||||
+ memcpy((BYTE *)&cs->state + offset, op->constants, op->count * push_constant_info[op->p].size);
|
||||
+ for (i = 0, context_count = device->context_count; i < context_count; ++i)
|
||||
+ {
|
||||
+ device->contexts[i]->constant_update_mask |= push_constant_info[op->p].mask;
|
||||
+ }
|
||||
+
|
||||
+ return size;
|
||||
+}
|
||||
+
|
||||
+void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
|
||||
+ unsigned int start_idx, unsigned int count, const void *constants)
|
||||
+{
|
||||
+ struct wined3d_cs_push_constants *op;
|
||||
+
|
||||
+ op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size]));
|
||||
+ op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS;
|
||||
+ op->p = p;
|
||||
+ op->start_idx = start_idx;
|
||||
+ op->count = count;
|
||||
+ memcpy(op->constants, constants, count * push_constant_info[p].size);
|
||||
+
|
||||
+ cs->ops->submit(cs);
|
||||
+}
|
||||
+
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
|
||||
@@ -1782,6 +1853,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map,
|
||||
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
|
||||
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
|
||||
+ /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
|
||||
};
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
@@ -1808,55 +1880,11 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs)
|
||||
wined3d_cs_op_handlers[opcode](cs, cs->data);
|
||||
}
|
||||
|
||||
-static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
|
||||
- unsigned int start_idx, unsigned int count, const void *constants)
|
||||
-{
|
||||
- struct wined3d_device *device = cs->device;
|
||||
- unsigned int context_count;
|
||||
- unsigned int i;
|
||||
- size_t offset;
|
||||
-
|
||||
- static const struct
|
||||
- {
|
||||
- size_t offset;
|
||||
- size_t size;
|
||||
- DWORD mask;
|
||||
- }
|
||||
- push_constant_info[] =
|
||||
- {
|
||||
- /* WINED3D_PUSH_CONSTANTS_VS_F */
|
||||
- {FIELD_OFFSET(struct wined3d_state, vs_consts_f), sizeof(struct wined3d_vec4), WINED3D_SHADER_CONST_VS_F},
|
||||
- /* WINED3D_PUSH_CONSTANTS_PS_F */
|
||||
- {FIELD_OFFSET(struct wined3d_state, ps_consts_f), sizeof(struct wined3d_vec4), WINED3D_SHADER_CONST_PS_F},
|
||||
- /* WINED3D_PUSH_CONSTANTS_VS_I */
|
||||
- {FIELD_OFFSET(struct wined3d_state, vs_consts_i), sizeof(struct wined3d_ivec4), WINED3D_SHADER_CONST_VS_I},
|
||||
- /* WINED3D_PUSH_CONSTANTS_PS_I */
|
||||
- {FIELD_OFFSET(struct wined3d_state, ps_consts_i), sizeof(struct wined3d_ivec4), WINED3D_SHADER_CONST_PS_I},
|
||||
- /* WINED3D_PUSH_CONSTANTS_VS_B */
|
||||
- {FIELD_OFFSET(struct wined3d_state, vs_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_VS_B},
|
||||
- /* WINED3D_PUSH_CONSTANTS_PS_B */
|
||||
- {FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B},
|
||||
- };
|
||||
-
|
||||
- if (p == WINED3D_PUSH_CONSTANTS_VS_F)
|
||||
- device->shader_backend->shader_update_float_vertex_constants(device, start_idx, count);
|
||||
- else if (p == WINED3D_PUSH_CONSTANTS_PS_F)
|
||||
- device->shader_backend->shader_update_float_pixel_constants(device, start_idx, count);
|
||||
-
|
||||
- offset = push_constant_info[p].offset + start_idx * push_constant_info[p].size;
|
||||
- memcpy((BYTE *)&cs->state + offset, constants, count * push_constant_info[p].size);
|
||||
- for (i = 0, context_count = device->context_count; i < context_count; ++i)
|
||||
- {
|
||||
- device->contexts[i]->constant_update_mask |= push_constant_info[p].mask;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static const struct wined3d_cs_ops wined3d_cs_st_ops =
|
||||
{
|
||||
wined3d_cs_st_require_space,
|
||||
wined3d_cs_st_submit,
|
||||
wined3d_cs_st_submit,
|
||||
- wined3d_cs_st_push_constants,
|
||||
};
|
||||
|
||||
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
|
||||
@@ -1864,6 +1892,8 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
|
||||
struct wined3d_cs_block *block = wined3d_cs_get_thread_block(cs);
|
||||
void *data;
|
||||
|
||||
+ assert(size <= sizeof(block->data));
|
||||
+
|
||||
if (!block || block->pos + size > sizeof(block->data))
|
||||
{
|
||||
if (block)
|
||||
@@ -1906,7 +1936,6 @@ static const struct wined3d_cs_ops wined3d_cs_mt_ops =
|
||||
wined3d_cs_mt_require_space,
|
||||
wined3d_cs_mt_submit_and_wait, /* FIXME */
|
||||
wined3d_cs_mt_submit_and_wait,
|
||||
- wined3d_cs_st_push_constants, /* FIXME */
|
||||
};
|
||||
|
||||
/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 4d0f6f2c4be..831f36c9870 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -2417,7 +2417,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
|
||||
}
|
||||
else
|
||||
{
|
||||
- wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_B, start_idx, count, constants);
|
||||
+ wined3d_cs_emit_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_B, start_idx, count, constants);
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2466,7 +2466,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device,
|
||||
}
|
||||
else
|
||||
{
|
||||
- wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_I, start_idx, count, constants);
|
||||
+ wined3d_cs_emit_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_I, start_idx, count, constants);
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2511,7 +2511,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device,
|
||||
memset(&device->recording->changed.vs_consts_f[start_idx], 1,
|
||||
count * sizeof(*device->recording->changed.vs_consts_f));
|
||||
else
|
||||
- wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_F, start_idx, count, constants);
|
||||
+ wined3d_cs_emit_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_VS_F, start_idx, count, constants);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@@ -2650,7 +2650,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device,
|
||||
}
|
||||
else
|
||||
{
|
||||
- wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_B, start_idx, count, constants);
|
||||
+ wined3d_cs_emit_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_B, start_idx, count, constants);
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2699,7 +2699,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device,
|
||||
}
|
||||
else
|
||||
{
|
||||
- wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_I, start_idx, count, constants);
|
||||
+ wined3d_cs_emit_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_I, start_idx, count, constants);
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -2745,7 +2745,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device,
|
||||
memset(&device->recording->changed.ps_consts_f[start_idx], 1,
|
||||
count * sizeof(*device->recording->changed.ps_consts_f));
|
||||
else
|
||||
- wined3d_cs_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_F, start_idx, count, constants);
|
||||
+ wined3d_cs_emit_push_constants(device->cs, WINED3D_PUSH_CONSTANTS_PS_F, start_idx, count, constants);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index d225e85b909..e7437a38023 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3124,7 +3124,7 @@ struct wined3d_cs_block
|
||||
{
|
||||
struct list entry;
|
||||
UINT pos;
|
||||
- BYTE data[4000]; /* FIXME? The size is somewhat arbitrary. */
|
||||
+ BYTE data[0x4000]; /* FIXME? The size is somewhat arbitrary. */
|
||||
};
|
||||
|
||||
struct wined3d_cs_ops
|
||||
@@ -3132,8 +3132,6 @@ struct wined3d_cs_ops
|
||||
void *(*require_space)(struct wined3d_cs *cs, size_t size);
|
||||
void (*submit)(struct wined3d_cs *cs);
|
||||
void (*submit_and_wait)(struct wined3d_cs *cs);
|
||||
- void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p,
|
||||
- unsigned int start_idx, unsigned int count, const void *constants);
|
||||
};
|
||||
|
||||
struct wined3d_cs
|
||||
@@ -3173,6 +3171,8 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
|
||||
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
|
||||
+ unsigned int start_idx, unsigned int count, const void *constants) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
|
||||
@@ -3226,12 +3226,6 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
|
||||
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource,
|
||||
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
|
||||
-static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
|
||||
- unsigned int start_idx, unsigned int count, const void *constants)
|
||||
-{
|
||||
- cs->ops->push_constants(cs, p, start_idx, count, constants);
|
||||
-}
|
||||
-
|
||||
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
|
||||
* fixed function semantics as D3DCOLOR or FLOAT16 */
|
||||
enum wined3d_buffer_conversion_type
|
||||
--
|
||||
2.11.0
|
||||
|
@ -1,124 +0,0 @@
|
||||
From c563899de22cc9420394ffb433e5541110025c50 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 e55372065ad..bb3a5f8da6f 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 283e49760ee..f92aa8ff692 100644
|
||||
--- a/dlls/wined3d/state.c
|
||||
+++ b/dlls/wined3d/state.c
|
||||
@@ -4637,7 +4637,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)
|
||||
{
|
||||
@@ -4679,7 +4679,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)
|
||||
{
|
||||
@@ -4864,7 +4864,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 609f8f7365e..a0a46208343 100644
|
||||
--- a/dlls/wined3d/view.c
|
||||
+++ b/dlls/wined3d/view.c
|
||||
@@ -195,21 +195,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 690f22c9dd0..45b1ea84dd6 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2984,6 +2984,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,
|
||||
@@ -3299,9 +3301,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_gl_view
|
||||
{
|
||||
GLenum target;
|
||||
--
|
||||
2.11.0
|
||||
|
@ -1,28 +1,28 @@
|
||||
From eea4abcc9b804a74839b49364f0218402d2a6f8e Mon Sep 17 00:00:00 2001
|
||||
From c17d78b9e0ee2ea345d74cfc1bb5b76c97ea4623 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Tue, 1 Oct 2013 15:30:26 +0200
|
||||
Subject: wined3d: Give the cs its own state
|
||||
|
||||
---
|
||||
dlls/wined3d/cs.c | 91 ++++++++++++++++++++++++++++++++++--------
|
||||
dlls/wined3d/device.c | 3 ++
|
||||
dlls/wined3d/wined3d_private.h | 4 +-
|
||||
3 files changed, 81 insertions(+), 17 deletions(-)
|
||||
dlls/wined3d/cs.c | 78 ++++++++++++++++++++++++++++--------------
|
||||
dlls/wined3d/device.c | 4 +++
|
||||
dlls/wined3d/wined3d_private.h | 4 ++-
|
||||
3 files changed, 60 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 2aef776..be77b79 100644
|
||||
index b832b7e0733..e9d238d262f 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -68,6 +68,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_PRELOAD_RESOURCE,
|
||||
WINED3D_CS_OP_UNLOAD_RESOURCE,
|
||||
@@ -76,6 +76,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_UNMAP,
|
||||
WINED3D_CS_OP_GLFINISH,
|
||||
WINED3D_CS_OP_PUSH_CONSTANTS,
|
||||
+ WINED3D_CS_OP_STATEBLOCK,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -312,6 +313,12 @@ struct wined3d_cs_unload_resource
|
||||
struct wined3d_resource *resource;
|
||||
@@ -376,6 +377,12 @@ struct wined3d_cs_push_constants
|
||||
BYTE constants[1];
|
||||
};
|
||||
|
||||
+struct wined3d_cs_stateblock
|
||||
@ -31,10 +31,10 @@ index 2aef776..be77b79 100644
|
||||
+ struct wined3d_state state;
|
||||
+};
|
||||
+
|
||||
/* FIXME: The list synchronization probably isn't particularly fast. */
|
||||
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
|
||||
{
|
||||
@@ -492,7 +499,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
|
||||
|
||||
@@ -522,7 +529,7 @@ static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[op->rect_count]);
|
||||
|
||||
device = cs->device;
|
||||
@ -42,41 +42,38 @@ index 2aef776..be77b79 100644
|
||||
+ state = &cs->state;
|
||||
wined3d_get_draw_rect(state, &draw_rect);
|
||||
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
|
||||
&cs->state.fb, op->rect_count, op->rects, &draw_rect, op->flags,
|
||||
@@ -544,7 +551,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
|
||||
&device->fb, op->rect_count, op->rects, &draw_rect, op->flags,
|
||||
@@ -642,10 +649,10 @@ static UINT wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_dispatch *op = data;
|
||||
|
||||
- dispatch_compute(cs->device, &cs->device->state,
|
||||
+ dispatch_compute(cs->device, &cs->state,
|
||||
op->group_count_x, op->group_count_y, op->group_count_z);
|
||||
|
||||
- release_shader_resources(&cs->device->state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
|
||||
+ release_shader_resources(&cs->state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
|
||||
|
||||
return sizeof(*op);
|
||||
}
|
||||
@@ -668,7 +675,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
|
||||
|
||||
static UINT wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
- struct wined3d_state *state = &cs->device->state;
|
||||
+ struct wined3d_state *state = &cs->state;
|
||||
struct wined3d_shader_sampler_map_entry *entry;
|
||||
struct wined3d_shader_resource_view *view;
|
||||
const struct wined3d_cs_draw *op = data;
|
||||
@@ -1081,6 +1088,55 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
|
||||
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
|
||||
op->stage = stage;
|
||||
op->texture = texture;
|
||||
+ cs->ops->submit(cs);
|
||||
+}
|
||||
+
|
||||
struct wined3d_shader *shader;
|
||||
unsigned int i;
|
||||
@@ -1189,6 +1196,34 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
|
||||
cs->ops->submit(cs);
|
||||
}
|
||||
|
||||
+static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const void *data)
|
||||
+{
|
||||
+ const struct wined3d_cs_stateblock *op = data;
|
||||
+
|
||||
+ /* Don't memcpy the entire struct, we'll remove single items as we add dedicated
|
||||
+ * ops for setting states */
|
||||
+
|
||||
+ cs->state.base_vertex_index = op->state.base_vertex_index;
|
||||
+ cs->state.gl_primitive_type = op->state.gl_primitive_type;
|
||||
+
|
||||
+ memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b));
|
||||
+ memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i));
|
||||
+ memcpy(cs->state.vs_consts_f, op->state.vs_consts_f, sizeof(cs->state.vs_consts_f));
|
||||
+
|
||||
+ memcpy(cs->state.ps_consts_b, op->state.ps_consts_b, sizeof(cs->state.ps_consts_b));
|
||||
+ memcpy(cs->state.ps_consts_i, op->state.ps_consts_i, sizeof(cs->state.ps_consts_i));
|
||||
+ memcpy(cs->state.ps_consts_f, op->state.ps_consts_f, sizeof(cs->state.ps_consts_f));
|
||||
+
|
||||
+ memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights));
|
||||
+
|
||||
+ return sizeof(*op);
|
||||
@ -91,63 +88,51 @@ index 2aef776..be77b79 100644
|
||||
+
|
||||
+ /* Don't memcpy the entire struct, we'll remove single items as we add dedicated
|
||||
+ * ops for setting states */
|
||||
+ op->state.base_vertex_index = state->base_vertex_index;
|
||||
+ op->state.gl_primitive_type = state->gl_primitive_type;
|
||||
+
|
||||
+ memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b));
|
||||
+ memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i));
|
||||
+ memcpy(op->state.vs_consts_f, state->vs_consts_f, sizeof(op->state.vs_consts_f));
|
||||
+
|
||||
+ memcpy(op->state.ps_consts_b, state->ps_consts_b, sizeof(op->state.ps_consts_b));
|
||||
+ memcpy(op->state.ps_consts_i, state->ps_consts_i, sizeof(op->state.ps_consts_i));
|
||||
+ memcpy(op->state.ps_consts_f, state->ps_consts_f, sizeof(op->state.ps_consts_f));
|
||||
+
|
||||
+ /* FIXME: This is not ideal. CS is still running synchronously, so this is ok.
|
||||
+ * It will go away soon anyway. */
|
||||
+ memcpy(op->state.lights, state->lights, sizeof(op->state.lights));
|
||||
|
||||
cs->ops->submit(cs);
|
||||
}
|
||||
@@ -1549,6 +1605,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
/* WINED3D_CS_OP_PRELOAD_RESOURCE */ wined3d_cs_exec_preload_resource,
|
||||
/* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource,
|
||||
+
|
||||
+ cs->ops->submit(cs);
|
||||
+}
|
||||
+
|
||||
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_set_shader_resource_view *op = data;
|
||||
@@ -1854,6 +1889,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
|
||||
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
|
||||
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
|
||||
+ /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
|
||||
};
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
@@ -1638,7 +1695,7 @@ done:
|
||||
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
- struct wined3d_cs *cs;
|
||||
+ struct wined3d_cs *cs = NULL;
|
||||
@@ -1998,6 +2034,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
|
||||
|
||||
if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs))))
|
||||
return NULL;
|
||||
@@ -1646,8 +1703,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
|
||||
if (FAILED(state_init(&cs->state, gl_info, &device->adapter->d3d_info,
|
||||
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
|
||||
{
|
||||
- HeapFree(GetProcessHeap(), 0, cs);
|
||||
- return NULL;
|
||||
+ goto err;
|
||||
}
|
||||
+ cs->tls_idx = TLS_OUT_OF_INDEXES;
|
||||
|
||||
if (!(cs->fb.render_targets = wined3d_calloc(gl_info->limits.buffers, sizeof(*cs->fb.render_targets))))
|
||||
{
|
||||
@@ -2013,21 +2050,12 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
|
||||
|
||||
cs->ops = &wined3d_cs_st_ops;
|
||||
@@ -1656,17 +1712,13 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
|
||||
cs->data_size = WINED3D_INITIAL_CS_SIZE;
|
||||
if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size)))
|
||||
{
|
||||
- {
|
||||
- state_cleanup(&cs->state);
|
||||
- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
|
||||
- HeapFree(GetProcessHeap(), 0, cs);
|
||||
- return NULL;
|
||||
- }
|
||||
+ goto err;
|
||||
}
|
||||
|
||||
if ((cs->tls_idx = TlsAlloc()) == TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
ERR("Failed to allocate cs TLS index, err %#x.\n", GetLastError());
|
||||
- state_cleanup(&cs->state);
|
||||
- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
|
||||
- HeapFree(GetProcessHeap(), 0, cs->data);
|
||||
- HeapFree(GetProcessHeap(), 0, cs);
|
||||
- return NULL;
|
||||
@ -155,12 +140,14 @@ index 2aef776..be77b79 100644
|
||||
}
|
||||
|
||||
if (wined3d_settings.cs_multithreaded)
|
||||
@@ -1679,15 +1731,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
|
||||
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
|
||||
@@ -2040,17 +2068,19 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
|
||||
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id)))
|
||||
{
|
||||
ERR("Failed to create wined3d command stream thread.\n");
|
||||
- if (!TlsFree(cs->tls_idx))
|
||||
- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError());
|
||||
- state_cleanup(&cs->state);
|
||||
- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
|
||||
- HeapFree(GetProcessHeap(), 0, cs->data);
|
||||
- HeapFree(GetProcessHeap(), 0, cs);
|
||||
- return NULL;
|
||||
@ -171,23 +158,31 @@ index 2aef776..be77b79 100644
|
||||
return cs;
|
||||
+
|
||||
+err:
|
||||
+ if (cs)
|
||||
+ {
|
||||
+ state_cleanup(&cs->state);
|
||||
+ if (cs->tls_idx != TLS_OUT_OF_INDEXES && !TlsFree(cs->tls_idx))
|
||||
+ ERR("Failed to free cs TLS index, err %#x.\n", GetLastError());
|
||||
+ HeapFree(GetProcessHeap(), 0, cs->data);
|
||||
+ }
|
||||
+ state_cleanup(&cs->state);
|
||||
+ if (cs->tls_idx != TLS_OUT_OF_INDEXES) TlsFree(cs->tls_idx);
|
||||
+ HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
|
||||
+ HeapFree(GetProcessHeap(), 0, cs->data);
|
||||
+ HeapFree(GetProcessHeap(), 0, cs);
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
void wined3d_cs_destroy(struct wined3d_cs *cs)
|
||||
@@ -2075,9 +2105,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
|
||||
#endif
|
||||
}
|
||||
|
||||
- if (!TlsFree(cs->tls_idx))
|
||||
- ERR("Failed to free cs TLS index, err %#x.\n", GetLastError());
|
||||
-
|
||||
+ TlsFree(cs->tls_idx);
|
||||
HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
|
||||
HeapFree(GetProcessHeap(), 0, cs->data);
|
||||
HeapFree(GetProcessHeap(), 0, cs);
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index ae8bfad..dda5a03 100644
|
||||
index 831f36c9870..268d1e93857 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -3554,6 +3554,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
|
||||
@@ -3648,6 +3648,7 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
|
||||
{
|
||||
TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count);
|
||||
|
||||
@ -195,7 +190,15 @@ index ae8bfad..dda5a03 100644
|
||||
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -3582,6 +3583,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
|
||||
@@ -3659,6 +3660,7 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
|
||||
TRACE("device %p, start_vertex %u, vertex_count %u, start_instance %u, instance_count %u.\n",
|
||||
device, start_vertex, vertex_count, start_instance, instance_count);
|
||||
|
||||
+ wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
|
||||
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, start_instance, instance_count, FALSE);
|
||||
}
|
||||
|
||||
@@ -3676,6 +3678,7 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@ -203,7 +206,7 @@ index ae8bfad..dda5a03 100644
|
||||
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -3593,6 +3595,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
|
||||
@@ -3687,6 +3690,7 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
|
||||
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
|
||||
device, start_idx, index_count, start_instance, instance_count);
|
||||
|
||||
@ -212,19 +215,19 @@ index ae8bfad..dda5a03 100644
|
||||
start_idx, index_count, start_instance, instance_count, TRUE);
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 3af4f8f..2a45171 100644
|
||||
index e7437a38023..0085339d6a8 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3043,7 +3043,7 @@ struct wined3d_cs_block
|
||||
@@ -3124,7 +3124,7 @@ struct wined3d_cs_block
|
||||
{
|
||||
struct list entry;
|
||||
UINT pos;
|
||||
- BYTE data[4000]; /* FIXME? The size is somewhat arbitrary. */
|
||||
- BYTE data[0x4000]; /* FIXME? The size is somewhat arbitrary. */
|
||||
+ BYTE data[sizeof(struct wined3d_state) * 2]; /* FIXME? The size is somewhat arbitrary. */
|
||||
};
|
||||
|
||||
struct wined3d_cs_ops
|
||||
@@ -3088,6 +3088,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
|
||||
@@ -3182,6 +3182,8 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
|
||||
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
|
||||
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
@ -234,5 +237,5 @@ index 3af4f8f..2a45171 100644
|
||||
struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
@ -1,102 +0,0 @@
|
||||
From 3d5e571fff02e6e1ca260c00025864230e9a058f 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 3fb3394..630d463 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 cfd2ce1..95f7453 100644
|
||||
--- a/dlls/wined3d/view.c
|
||||
+++ b/dlls/wined3d/view.c
|
||||
@@ -195,39 +195,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_view_desc *desc, struct wined3d_resource *resource,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
--
|
||||
2.9.0
|
||||
|
@ -1,29 +1,29 @@
|
||||
From e5be3dd2d9e963f7f447fb379a2739a2f5428ccb Mon Sep 17 00:00:00 2001
|
||||
From 54250a452e83961539ea9adecd5bee1f525feb94 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 7 Apr 2013 17:53:43 +0200
|
||||
Subject: wined3d: Send primitive type updates through the command stream
|
||||
|
||||
---
|
||||
dlls/wined3d/cs.c | 39 ++++++++++++++++++++++++++++++++++-----
|
||||
dlls/wined3d/device.c | 5 ++---
|
||||
dlls/wined3d/device.c | 4 ++--
|
||||
dlls/wined3d/stateblock.c | 4 ++--
|
||||
dlls/wined3d/wined3d_private.h | 2 ++
|
||||
4 files changed, 40 insertions(+), 10 deletions(-)
|
||||
4 files changed, 40 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 5424965..d467911 100644
|
||||
index e9d238d262f..c6b7aa71ecd 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -72,6 +72,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_SET_PS_CONSTS_F,
|
||||
@@ -77,6 +77,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_GLFINISH,
|
||||
WINED3D_CS_OP_SET_BASE_VERTEX_INDEX,
|
||||
WINED3D_CS_OP_PUSH_CONSTANTS,
|
||||
WINED3D_CS_OP_STATEBLOCK,
|
||||
+ WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -335,6 +336,12 @@ struct wined3d_cs_set_base_vertex_index
|
||||
UINT base_vertex_index;
|
||||
@@ -383,6 +384,12 @@ struct wined3d_cs_stateblock
|
||||
struct wined3d_state state;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_set_primitive_type
|
||||
@ -32,29 +32,29 @@ index 5424965..d467911 100644
|
||||
+ GLenum gl_primitive_type;
|
||||
+};
|
||||
+
|
||||
/* FIXME: The list synchronization probably isn't particularly fast. */
|
||||
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
|
||||
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
|
||||
|
||||
@@ -1200,7 +1207,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
|
||||
{
|
||||
@@ -1129,9 +1136,6 @@ static UINT wined3d_cs_exec_transfer_stateblock(struct wined3d_cs *cs, const voi
|
||||
const struct wined3d_cs_stateblock *op = data;
|
||||
|
||||
/* Don't memcpy the entire struct, we'll remove single items as we add dedicated
|
||||
* ops for setting states */
|
||||
-
|
||||
- cs->state.gl_primitive_type = op->state.gl_primitive_type;
|
||||
-
|
||||
memcpy(cs->state.vs_consts_b, op->state.vs_consts_b, sizeof(cs->state.vs_consts_b));
|
||||
memcpy(cs->state.vs_consts_i, op->state.vs_consts_i, sizeof(cs->state.vs_consts_i));
|
||||
memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights));
|
||||
|
||||
@@ -1152,8 +1156,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
|
||||
return sizeof(*op);
|
||||
@@ -1213,10 +1219,6 @@ void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs, const struct win
|
||||
op = cs->ops->require_space(cs, sizeof(*op));
|
||||
op->opcode = WINED3D_CS_OP_STATEBLOCK;
|
||||
|
||||
/* Don't memcpy the entire struct, we'll remove single items as we add dedicated
|
||||
* ops for setting states */
|
||||
- /* Don't memcpy the entire struct, we'll remove single items as we add dedicated
|
||||
- * ops for setting states */
|
||||
- op->state.gl_primitive_type = state->gl_primitive_type;
|
||||
-
|
||||
memcpy(op->state.vs_consts_b, state->vs_consts_b, sizeof(op->state.vs_consts_b));
|
||||
memcpy(op->state.vs_consts_i, state->vs_consts_i, sizeof(op->state.vs_consts_i));
|
||||
|
||||
@@ -1674,6 +1676,32 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
|
||||
/* FIXME: This is not ideal. CS is still running synchronously, so this is ok.
|
||||
* It will go away soon anyway. */
|
||||
memcpy(op->state.lights, state->lights, sizeof(op->state.lights));
|
||||
@@ -1848,6 +1850,32 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
|
||||
cs->ops->submit(cs);
|
||||
}
|
||||
|
||||
@ -87,27 +87,19 @@ index 5424965..d467911 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
|
||||
@@ -1712,6 +1740,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f,
|
||||
@@ -1890,6 +1918,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
|
||||
/* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index,
|
||||
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
|
||||
/* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
|
||||
+ /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
|
||||
};
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 72266fb..7bd3994 100644
|
||||
index 268d1e93857..e01ef6e3753 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -3520,7 +3520,6 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
|
||||
enum wined3d_primitive_type primitive_type)
|
||||
{
|
||||
GLenum gl_primitive_type, prev;
|
||||
-
|
||||
TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type));
|
||||
|
||||
gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
|
||||
@@ -3528,8 +3527,8 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
|
||||
@@ -3630,8 +3630,8 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
|
||||
device->update_state->gl_primitive_type = gl_primitive_type;
|
||||
if (device->recording)
|
||||
device->recording->changed.primitive_type = TRUE;
|
||||
@ -119,10 +111,10 @@ index 72266fb..7bd3994 100644
|
||||
|
||||
void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device,
|
||||
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
|
||||
index bb3c0cc..732a45b 100644
|
||||
index fd017524075..ed39a15c7be 100644
|
||||
--- a/dlls/wined3d/stateblock.c
|
||||
+++ b/dlls/wined3d/stateblock.c
|
||||
@@ -1009,8 +1009,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
|
||||
@@ -991,8 +991,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
|
||||
gl_primitive_type = stateblock->state.gl_primitive_type;
|
||||
prev = device->update_state->gl_primitive_type;
|
||||
device->update_state->gl_primitive_type = gl_primitive_type;
|
||||
@ -134,10 +126,10 @@ index bb3c0cc..732a45b 100644
|
||||
|
||||
if (stateblock->changed.indices)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 0abec70..5648bda 100644
|
||||
index 0085339d6a8..354f9fe62d0 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3093,6 +3093,8 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
|
||||
@@ -3191,6 +3191,8 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
|
||||
void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs,
|
||||
struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN;
|
||||
@ -147,5 +139,5 @@ index 0abec70..5648bda 100644
|
||||
struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs,
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
@ -1,27 +0,0 @@
|
||||
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
|
||||
|
@ -1,55 +1,46 @@
|
||||
From 866ef0e0247fe28814e59268885ce97630750023 Mon Sep 17 00:00:00 2001
|
||||
From cc805e309ac623c64037c11868ab663b6e830fa5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 10 Apr 2013 17:16:02 +0200
|
||||
Subject: wined3d: Send light updates through the command stream
|
||||
|
||||
---
|
||||
dlls/wined3d/cs.c | 200 +++++++++++++++++++++++++++++++++--------
|
||||
dlls/wined3d/device.c | 30 ++-----
|
||||
dlls/wined3d/wined3d_private.h | 8 +-
|
||||
3 files changed, 174 insertions(+), 64 deletions(-)
|
||||
dlls/wined3d/cs.c | 194 +++++++++++++++++++++++++++++++++++------
|
||||
dlls/wined3d/device.c | 31 ++-----
|
||||
dlls/wined3d/wined3d_private.h | 6 +-
|
||||
3 files changed, 174 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 22e9bb8..2f3b33d 100644
|
||||
index c6b7aa71ecd..727b7d81e9b 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -68,7 +68,6 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_PRELOAD_RESOURCE,
|
||||
WINED3D_CS_OP_UNLOAD_RESOURCE,
|
||||
- WINED3D_CS_OP_STATEBLOCK,
|
||||
WINED3D_CS_OP_SET_VS_CONSTS_F,
|
||||
WINED3D_CS_OP_SET_VS_CONSTS_B,
|
||||
WINED3D_CS_OP_SET_VS_CONSTS_I,
|
||||
@@ -78,6 +77,8 @@ enum wined3d_cs_op
|
||||
@@ -76,8 +76,9 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_UNMAP,
|
||||
WINED3D_CS_OP_GLFINISH,
|
||||
WINED3D_CS_OP_SET_BASE_VERTEX_INDEX,
|
||||
WINED3D_CS_OP_PUSH_CONSTANTS,
|
||||
- WINED3D_CS_OP_STATEBLOCK,
|
||||
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
|
||||
+ WINED3D_CS_OP_SET_LIGHT,
|
||||
+ WINED3D_CS_OP_SET_LIGHT_ENABLE,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -322,12 +323,6 @@ struct wined3d_cs_unload_resource
|
||||
struct wined3d_resource *resource;
|
||||
@@ -378,16 +379,23 @@ struct wined3d_cs_push_constants
|
||||
BYTE constants[1];
|
||||
};
|
||||
|
||||
-struct wined3d_cs_stateblock
|
||||
-{
|
||||
- enum wined3d_cs_op opcode;
|
||||
- struct wined3d_state state;
|
||||
-};
|
||||
-
|
||||
struct wined3d_cs_set_consts_f
|
||||
+struct wined3d_cs_set_primitive_type
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
@@ -369,6 +364,19 @@ struct wined3d_cs_set_primitive_type
|
||||
GLenum gl_primitive_type;
|
||||
- struct wined3d_state state;
|
||||
+ GLenum gl_primitive_type;
|
||||
};
|
||||
|
||||
-struct wined3d_cs_set_primitive_type
|
||||
+struct wined3d_cs_set_light
|
||||
+{
|
||||
+ enum wined3d_cs_op opcode;
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
- GLenum gl_primitive_type;
|
||||
+ struct wined3d_light_info light;
|
||||
+};
|
||||
+
|
||||
@ -58,12 +49,10 @@ index 22e9bb8..2f3b33d 100644
|
||||
+ enum wined3d_cs_op opcode;
|
||||
+ UINT idx;
|
||||
+ BOOL enable;
|
||||
+};
|
||||
+
|
||||
/* FIXME: The list synchronization probably isn't particularly fast. */
|
||||
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
|
||||
{
|
||||
@@ -1157,35 +1165,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
|
||||
};
|
||||
|
||||
static inline BOOL wined3d_cs_process_block(struct wined3d_cs *cs, struct wined3d_cs_block *block);
|
||||
@@ -1203,29 +1211,6 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
|
||||
cs->ops->submit(cs);
|
||||
}
|
||||
|
||||
@ -71,9 +60,6 @@ index 22e9bb8..2f3b33d 100644
|
||||
-{
|
||||
- const struct wined3d_cs_stateblock *op = data;
|
||||
-
|
||||
- /* Don't memcpy the entire struct, we'll remove single items as we add dedicated
|
||||
- * ops for setting states */
|
||||
-
|
||||
- memcpy(cs->state.lights, op->state.lights, sizeof(cs->state.lights));
|
||||
-
|
||||
- return sizeof(*op);
|
||||
@ -86,9 +72,6 @@ index 22e9bb8..2f3b33d 100644
|
||||
- op = cs->ops->require_space(cs, sizeof(*op));
|
||||
- op->opcode = WINED3D_CS_OP_STATEBLOCK;
|
||||
-
|
||||
- /* Don't memcpy the entire struct, we'll remove single items as we add dedicated
|
||||
- * ops for setting states */
|
||||
-
|
||||
- /* FIXME: This is not ideal. CS is still running synchronously, so this is ok.
|
||||
- * It will go away soon anyway. */
|
||||
- memcpy(op->state.lights, state->lights, sizeof(op->state.lights));
|
||||
@ -99,7 +82,7 @@ index 22e9bb8..2f3b33d 100644
|
||||
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_set_shader_resource_view *op = data;
|
||||
@@ -1860,6 +1839,152 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
|
||||
@@ -1876,6 +1861,156 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
|
||||
cs->ops->submit(cs);
|
||||
}
|
||||
|
||||
@ -125,7 +108,10 @@ index 22e9bb8..2f3b33d 100644
|
||||
+ TRACE("Adding new light\n");
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
+ if (!object)
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ {
|
||||
+ ERR("Out of memory!\n");
|
||||
+ return sizeof(*op);
|
||||
+ }
|
||||
+
|
||||
+ list_add_head(&cs->state.light_map[hash_idx], &object->entry);
|
||||
+ object->glIndex = -1;
|
||||
@ -208,10 +194,11 @@ index 22e9bb8..2f3b33d 100644
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ unsigned int light_count = device->adapter->d3d_info.limits.active_light_count;
|
||||
+ unsigned int i;
|
||||
+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
+
|
||||
+ /* Find a free GL light. */
|
||||
+ for (i = 0; i < gl_info->limits.lights; ++i)
|
||||
+ for (i = 0; i < light_count; ++i)
|
||||
+ {
|
||||
+ if (!cs->state.lights[i])
|
||||
+ {
|
||||
@ -252,17 +239,11 @@ index 22e9bb8..2f3b33d 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
|
||||
@@ -1894,7 +2019,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
/* WINED3D_CS_OP_PRELOAD_RESOURCE */ wined3d_cs_exec_preload_resource,
|
||||
/* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource,
|
||||
- /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
|
||||
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
|
||||
/* WINED3D_CS_OP_SET_VS_CONSTS_B */ wined3d_cs_exec_set_vs_consts_b,
|
||||
/* WINED3D_CS_OP_SET_VS_CONSTS_I */ wined3d_cs_exec_set_vs_consts_i,
|
||||
@@ -1904,6 +2028,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -1917,8 +2052,9 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
|
||||
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
|
||||
/* WINED3D_CS_OP_SET_BASE_VERTEX_INDEX */ wined3d_cs_exec_set_base_vertex_index,
|
||||
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
|
||||
- /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
|
||||
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
|
||||
+ /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light,
|
||||
+ /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
|
||||
@ -270,10 +251,10 @@ index 22e9bb8..2f3b33d 100644
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 9db2365..c7226ae 100644
|
||||
index e01ef6e3753..d20906e7cc5 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -1610,14 +1610,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
|
||||
@@ -1597,14 +1597,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
|
||||
light->direction.x, light->direction.y, light->direction.z,
|
||||
light->range, light->falloff, light->theta, light->phi);
|
||||
|
||||
@ -288,7 +269,7 @@ index 9db2365..c7226ae 100644
|
||||
/* Save away the information. */
|
||||
object->OriginalParms = *light;
|
||||
|
||||
@@ -1697,6 +1689,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
|
||||
@@ -1684,6 +1676,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
|
||||
FIXME("Unrecognized light type %#x.\n", light->type);
|
||||
}
|
||||
|
||||
@ -298,7 +279,7 @@ index 9db2365..c7226ae 100644
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
@@ -1769,12 +1764,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
|
||||
@@ -1756,12 +1751,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
|
||||
{
|
||||
if (light_info->glIndex != -1)
|
||||
{
|
||||
@ -311,7 +292,7 @@ index 9db2365..c7226ae 100644
|
||||
device->update_state->lights[light_info->glIndex] = NULL;
|
||||
light_info->glIndex = -1;
|
||||
}
|
||||
@@ -1816,16 +1805,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
|
||||
@@ -1804,16 +1793,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
|
||||
WARN("Too many concurrently active lights\n");
|
||||
return WINED3D_OK;
|
||||
}
|
||||
@ -331,7 +312,7 @@ index 9db2365..c7226ae 100644
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
@@ -3549,7 +3534,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
|
||||
@@ -3648,7 +3633,6 @@ HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT
|
||||
{
|
||||
TRACE("device %p, start_vertex %u, vertex_count %u.\n", device, start_vertex, vertex_count);
|
||||
|
||||
@ -339,7 +320,15 @@ index 9db2365..c7226ae 100644
|
||||
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, 0, 0, FALSE);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -3578,7 +3562,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
|
||||
@@ -3660,7 +3644,6 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
|
||||
TRACE("device %p, start_vertex %u, vertex_count %u, start_instance %u, instance_count %u.\n",
|
||||
device, start_vertex, vertex_count, start_instance, instance_count);
|
||||
|
||||
- wined3d_cs_emit_transfer_stateblock(device->cs, &device->state);
|
||||
wined3d_cs_emit_draw(device->cs, 0, start_vertex, vertex_count, start_instance, instance_count, FALSE);
|
||||
}
|
||||
|
||||
@@ -3678,7 +3661,6 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *devic
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@ -347,7 +336,7 @@ index 9db2365..c7226ae 100644
|
||||
wined3d_cs_emit_draw(device->cs, device->state.base_vertex_index, start_idx, index_count, 0, 0, TRUE);
|
||||
|
||||
return WINED3D_OK;
|
||||
@@ -3590,7 +3573,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
|
||||
@@ -3690,7 +3672,6 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
|
||||
TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
|
||||
device, start_idx, index_count, start_instance, instance_count);
|
||||
|
||||
@ -356,24 +345,22 @@ index 9db2365..c7226ae 100644
|
||||
start_idx, index_count, start_instance, instance_count, TRUE);
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index c29a4a1..77d4ac3 100644
|
||||
index 354f9fe62d0..0164de77eec 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3039,7 +3039,9 @@ struct wined3d_cs_block
|
||||
@@ -3124,7 +3124,7 @@ struct wined3d_cs_block
|
||||
{
|
||||
struct list entry;
|
||||
UINT pos;
|
||||
- BYTE data[sizeof(struct wined3d_state) * 2]; /* FIXME? The size is somewhat arbitrary. */
|
||||
+ /* FIXME? The size is somewhat arbitrary. It's big enough for huge
|
||||
+ * shader constant set calls though */
|
||||
+ BYTE data[sizeof(float) * 4 * 256 * 2];
|
||||
+ BYTE data[0x4000]; /* FIXME? The size is somewhat arbitrary. */
|
||||
};
|
||||
|
||||
struct wined3d_cs_ops
|
||||
@@ -3096,12 +3098,12 @@ void wined3d_cs_emit_set_consts_f(struct wined3d_cs *cs, unsigned int start_idx,
|
||||
unsigned int count, const struct wined3d_vec4 *constants, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_consts_i(struct wined3d_cs *cs, unsigned int start_idx,
|
||||
unsigned int count, const struct wined3d_ivec4 *constants, enum wined3d_shader_type type) DECLSPEC_HIDDEN;
|
||||
@@ -3182,12 +3182,12 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
|
||||
WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
|
||||
UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
-void wined3d_cs_emit_transfer_stateblock(struct wined3d_cs *cs,
|
||||
- const struct wined3d_state *state) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs,
|
||||
@ -386,5 +373,5 @@ index c29a4a1..77d4ac3 100644
|
||||
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs,
|
||||
struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
@ -1,54 +0,0 @@
|
||||
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 896c9a5cbbf43da7bafda1c00169cb6b67c1a32a Mon Sep 17 00:00:00 2001
|
||||
From 04a17416b1f76b1b0dc6929c637dca4d995dc991 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 4 Apr 2013 14:52:24 +0200
|
||||
Subject: wined3d: Pass the depth stencil to swapchain->present
|
||||
@ -12,21 +12,21 @@ DS or the implicit DS.
|
||||
3 files changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 095fa0e..cacafec 100644
|
||||
index 727b7d81e9b..d3dc29cd7c1 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -457,7 +457,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
@@ -500,7 +500,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
swapchain = op->swapchain;
|
||||
wined3d_swapchain_set_window(swapchain, op->dst_window_override);
|
||||
|
||||
- swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags);
|
||||
+ swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags,
|
||||
+ cs->state.fb.depth_stencil);
|
||||
+ cs->state.fb->depth_stencil);
|
||||
|
||||
wined3d_resource_release(&swapchain->front_buffer->resource);
|
||||
for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index 7a3cdd2..dd0f17d 100644
|
||||
index ae82ff0cf23..932d4076b93 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -485,10 +485,10 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
|
||||
@ -38,11 +38,11 @@ index 7a3cdd2..dd0f17d 100644
|
||||
+ struct wined3d_rendertarget_view *depth_stencil)
|
||||
{
|
||||
struct wined3d_texture *back_buffer = swapchain->back_buffers[0];
|
||||
- const struct wined3d_fb_state *fb = &swapchain->device->state.fb;
|
||||
- const struct wined3d_fb_state *fb = &swapchain->device->fb;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_texture *logo_texture;
|
||||
struct wined3d_context *context;
|
||||
@@ -621,15 +621,15 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
|
||||
@@ -619,14 +619,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
|
||||
wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1],
|
||||
0, WINED3D_LOCATION_DISCARDED);
|
||||
|
||||
@ -54,14 +54,13 @@ index 7a3cdd2..dd0f17d 100644
|
||||
|
||||
if (ds && (swapchain->desc.flags & WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
|
||||
|| ds->container->flags & WINED3D_TEXTURE_DISCARD))
|
||||
{
|
||||
surface_modify_ds_location(ds, WINED3D_LOCATION_DISCARDED,
|
||||
- fb->depth_stencil->width, fb->depth_stencil->height);
|
||||
+ depth_stencil->width, depth_stencil->height);
|
||||
if (ds == swapchain->device->onscreen_depth_stencil)
|
||||
{
|
||||
wined3d_texture_decref(swapchain->device->onscreen_depth_stencil->container);
|
||||
@@ -701,7 +701,8 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai
|
||||
wined3d_texture_validate_location(ds->container,
|
||||
- fb->depth_stencil->sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
+ depth_stencil->sub_resource_idx, WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
context_release(context);
|
||||
@@ -692,7 +692,8 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai
|
||||
}
|
||||
|
||||
static void swapchain_gdi_present(struct wined3d_swapchain *swapchain,
|
||||
@ -72,10 +71,10 @@ index 7a3cdd2..dd0f17d 100644
|
||||
struct wined3d_surface *front, *back;
|
||||
HBITMAP bitmap;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index f79a792..ed335d1 100644
|
||||
index 0164de77eec..a098d7e62df 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3239,7 +3239,8 @@ struct wined3d_unordered_access_view
|
||||
@@ -3364,7 +3364,8 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_
|
||||
struct wined3d_swapchain_ops
|
||||
{
|
||||
void (*swapchain_present)(struct wined3d_swapchain *swapchain,
|
||||
@ -86,5 +85,5 @@ index f79a792..ed335d1 100644
|
||||
};
|
||||
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
@ -1,34 +0,0 @@
|
||||
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
From db37e592d76e30834d83029cdfdec6f42a322086 Mon Sep 17 00:00:00 2001
|
||||
From fa711d72c0f46697e7faecfb5ad128d19254d767 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 10 Apr 2013 19:10:41 +0200
|
||||
Subject: wined3d: Prevent the command stream from running ahead too far
|
||||
@ -9,19 +9,19 @@ Subject: wined3d: Prevent the command stream from running ahead too far
|
||||
2 files changed, 18 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index d03dd1c..7311ac5 100644
|
||||
index d3dc29cd7c1..e738c6ff058 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -509,6 +509,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
@@ -503,6 +503,8 @@ static UINT wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags,
|
||||
cs->state.fb.depth_stencil);
|
||||
cs->state.fb->depth_stencil);
|
||||
|
||||
+ InterlockedDecrement(&cs->pending_presents);
|
||||
+
|
||||
wined3d_resource_release(&swapchain->front_buffer->resource);
|
||||
for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
|
||||
{
|
||||
@@ -523,6 +525,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
@@ -517,6 +519,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
{
|
||||
struct wined3d_cs_present *op;
|
||||
unsigned int i;
|
||||
@ -29,7 +29,7 @@ index d03dd1c..7311ac5 100644
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op));
|
||||
op->opcode = WINED3D_CS_OP_PRESENT;
|
||||
@@ -538,7 +541,20 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
@@ -532,7 +535,20 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
|
||||
wined3d_resource_acquire(&swapchain->back_buffers[i]->resource);
|
||||
}
|
||||
|
||||
@ -51,10 +51,10 @@ index d03dd1c..7311ac5 100644
|
||||
|
||||
static UINT wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 4c57f7b..1d84bf9 100644
|
||||
index a098d7e62df..c28dd691a14 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3061,6 +3061,8 @@ struct wined3d_cs
|
||||
@@ -3148,6 +3148,8 @@ struct wined3d_cs
|
||||
|
||||
struct wined3d_cs_list free_list;
|
||||
struct wined3d_cs_list exec_list;
|
||||
@ -62,7 +62,7 @@ index 4c57f7b..1d84bf9 100644
|
||||
+ LONG pending_presents;
|
||||
};
|
||||
|
||||
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN;
|
||||
static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource)
|
||||
--
|
||||
2.9.0
|
||||
2.11.0
|
||||
|
@ -1,92 +0,0 @@
|
||||
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b11582969b78a6699dc7776f4c49f25d787f67dc Mon Sep 17 00:00:00 2001
|
||||
From 04ea21a9ee8a73a1c463118a26f315cbe83d5fbf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 10 Apr 2013 20:09:55 +0200
|
||||
Subject: wined3d: Wait for the cs to finish before destroying the device
|
||||
@ -8,19 +8,19 @@ Subject: wined3d: Wait for the cs to finish before destroying the device
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 81cf94e..0ce1c11 100644
|
||||
index d20906e7cc5..71701a816da 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -1126,6 +1126,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
@@ -1130,6 +1130,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
if (!device->d3d_initialized)
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ device->cs->ops->finish(device->cs);
|
||||
+ device->cs->ops->submit_and_wait(device->cs);
|
||||
+
|
||||
/* I don't think that the interface guarantees that the device is destroyed from the same thread
|
||||
* it was created. Thus make sure a context is active for the glDelete* calls
|
||||
*/
|
||||
--
|
||||
2.8.0
|
||||
2.11.0
|
||||
|
@ -1,57 +0,0 @@
|
||||
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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user