Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- I was testing the next patch in the series and I noticed that +d3d_synchronous didn't work at all...
include/wine/debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/wine/debug.h b/include/wine/debug.h index e064aaefb8e..e505a0a333a 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -52,7 +52,7 @@ enum __wine_debug_class struct __wine_debug_channel { unsigned char flags; - char name[15]; + char name[31]; };
#ifndef WINE_NO_TRACE_MSGS
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/cs.c | 18 ++++++++++++++++++ dlls/wined3d/wined3d_main.c | 15 +++++++++++++++ dlls/wined3d/wined3d_private.h | 4 ++++ 3 files changed, 37 insertions(+)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 48b73a71fe4..4b71f910048 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -21,6 +21,7 @@ #include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DECLARE_DEBUG_CHANNEL(d3d_synchronous); WINE_DECLARE_DEBUG_CHANNEL(fps);
#define WINED3D_INITIAL_CS_SIZE 4096 @@ -2866,6 +2867,18 @@ static void wined3d_cs_wait_event(struct wined3d_cs *cs) WaitForSingleObject(cs->event, INFINITE); }
+static void wined3d_cs_adapter_lock(const struct wined3d_cs *cs) +{ + if (cs->serialize_adapter) + EnterCriticalSection(&wined3d_adapter_cs); +} + +static void wined3d_cs_adapter_unlock(const struct wined3d_cs *cs) +{ + if (cs->serialize_adapter) + LeaveCriticalSection(&wined3d_adapter_cs); +} + static DWORD WINAPI wined3d_cs_run(void *ctx) { struct wined3d_cs_packet *packet; @@ -2889,7 +2902,9 @@ static DWORD WINAPI wined3d_cs_run(void *ctx) { if (++poll == WINED3D_CS_QUERY_POLL_INTERVAL) { + wined3d_cs_adapter_lock(cs); poll_queries(cs); + wined3d_cs_adapter_unlock(cs); poll = 0; }
@@ -2920,7 +2935,9 @@ static DWORD WINAPI wined3d_cs_run(void *ctx) break; }
+ wined3d_cs_adapter_lock(cs); wined3d_cs_op_handlers[opcode](cs, packet->data); + wined3d_cs_adapter_unlock(cs); TRACE("%s executed.\n", debug_cs_op(opcode)); }
@@ -2945,6 +2962,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->ops = &wined3d_cs_st_ops; cs->device = device; + cs->serialize_adapter = TRACE_ON(d3d_synchronous) || wined3d_settings.serialize_adapter;
state_init(&cs->state, d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT);
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index e1ed86e80ed..43653d6dbc1 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -96,6 +96,16 @@ static CRITICAL_SECTION_DEBUG wined3d_wndproc_cs_debug = }; static CRITICAL_SECTION wined3d_wndproc_cs = {&wined3d_wndproc_cs_debug, -1, 0, 0, 0, 0};
+CRITICAL_SECTION wined3d_adapter_cs; +static CRITICAL_SECTION_DEBUG wined3d_adapter_cs_debug = +{ + 0, 0, &wined3d_adapter_cs, + {&wined3d_adapter_cs_debug.ProcessLocksList, + &wined3d_adapter_cs_debug.ProcessLocksList}, + 0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_adapter_cs")} +}; +CRITICAL_SECTION wined3d_adapter_cs = {&wined3d_adapter_cs_debug, -1, 0, 0, 0, 0}; + /* When updating default value here, make sure to update winecfg as well, * where appropriate. */ struct wined3d_settings wined3d_settings = @@ -111,6 +121,7 @@ struct wined3d_settings wined3d_settings = ~0u, /* Don't force a specific sample count by default. */ FALSE, /* Don't range check relative addressing indices in float constants. */ FALSE, /* No strict shader math by default. */ + FALSE, /* Don't synchronize adapter commands by default. */ ~0U, /* No VS shader model limit by default. */ ~0U, /* No HS shader model limit by default. */ ~0U, /* No DS shader model limit by default. */ @@ -392,6 +403,8 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) wined3d_settings.renderer = WINED3D_RENDERER_NO3D; } } + if (!get_config_key_dword(hkey, appkey, "serialize_adapter", &wined3d_settings.serialize_adapter)) + ERR_(winediag)("Setting serialize_adapter to %#x.\n", wined3d_settings.serialize_adapter); }
if (appkey) RegCloseKey( appkey ); @@ -436,6 +449,8 @@ static BOOL wined3d_dll_destroy(HINSTANCE hInstDLL) heap_free(wined3d_settings.logo); UnregisterClassA(WINED3D_OPENGL_WINDOW_CLASS_NAME, hInstDLL);
+ DeleteCriticalSection(&wined3d_adapter_cs); + DeleteCriticalSection(&wined3d_wndproc_cs); DeleteCriticalSection(&wined3d_cs); return TRUE; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ab2543e52eb..6ed8d3c2d7d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -434,6 +434,7 @@ struct wined3d_settings unsigned int sample_count; BOOL check_float_constants; unsigned int strict_shader_math; + unsigned int serialize_adapter; unsigned int max_sm_vs; unsigned int max_sm_hs; unsigned int max_sm_ds; @@ -4640,6 +4641,7 @@ struct wined3d_cs HMODULE wined3d_module; HANDLE thread; DWORD thread_id; + BOOL serialize_adapter;
struct wined3d_cs_queue queue[WINED3D_CS_QUEUE_COUNT]; size_t data_size, start, end; @@ -6323,4 +6325,6 @@ static inline void wined3d_context_gl_reference_bo(struct wined3d_context_gl *co /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */ #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
+extern CRITICAL_SECTION wined3d_adapter_cs; + #endif
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/view.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 4db3746d8de..1abbbac4fb4 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1409,7 +1409,6 @@ static void wined3d_unordered_access_view_gl_cs_init(void *object) struct wined3d_context_gl *context_gl;
context_gl = wined3d_context_gl(context_acquire(resource->device, NULL, 0)); - gl_info = context_gl->gl_info; create_buffer_view(&view_gl->gl_view, &context_gl->c, desc, buffer, view_gl->v.format); if (desc->flags & (WINED3D_VIEW_BUFFER_COUNTER | WINED3D_VIEW_BUFFER_APPEND)) {
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d9/tests/visual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 7c0a0157389..504d276d6c5 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -16799,7 +16799,7 @@ static void fp_special_test(void) 0x0000ffff, /* end */ };
- struct + static const struct { float x, y, z; float s;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- Always consider them supported whenever the format is otherwise available instead. The idea is to avoid referring to WINED3DUSAGE_LEGACY_CUBEMAP in d3d11.
dlls/d3d11/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 2a08d2b1e65..50e8cd58fe2 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3315,7 +3315,6 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * {WINED3D_RTYPE_TEXTURE_1D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE1D}, {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE2D}, {WINED3D_RTYPE_TEXTURE_3D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE3D}, - {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_LEGACY_CUBEMAP, D3D11_FORMAT_SUPPORT_TEXTURECUBE}, {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, 0, D3D11_FORMAT_SUPPORT_RENDER_TARGET}, {WINED3D_RTYPE_NONE, WINED3D_BIND_DEPTH_STENCIL, 0, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL}, {WINED3D_RTYPE_NONE, WINED3D_BIND_UNORDERED_ACCESS, 0, D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW}, @@ -3364,6 +3363,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * { *format_support |= D3D11_FORMAT_SUPPORT_SHADER_LOAD; *format_support |= D3D11_FORMAT_SUPPORT_SHADER_SAMPLE; + *format_support |= D3D11_FORMAT_SUPPORT_TEXTURECUBE;
if (feature_level >= D3D_FEATURE_LEVEL_10_1) *format_support |= D3D11_FORMAT_SUPPORT_SHADER_GATHER;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On Tue, Dec 1, 2020 at 7:11 PM Matteo Bruni mbruni@codeweavers.com wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
I was testing the next patch in the series and I noticed that +d3d_synchronous didn't work at all...
Of course, the alternative is to shorten the channel name to fit in 14 characters. Some grepping suggests that d3d_synchronous is the only one affected, so I guess that's preferable.