Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- For reference, I got this "new" result with a d3dcompiler_46.dll found in Steam's directory.
dlls/d3dcompiler_43/tests/reflection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c index 75f30e45dce..8cf6edb1c97 100644 --- a/dlls/d3dcompiler_43/tests/reflection.c +++ b/dlls/d3dcompiler_43/tests/reflection.c @@ -164,8 +164,8 @@ static void test_reflection_interfaces(void)
expected_hr = D3D_COMPILER_VERSION < 46 ? E_NOINTERFACE : D3D_COMPILER_VERSION == 46 ? E_INVALIDARG : S_OK; hr = call_reflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D12ShaderReflection, (void **)&ref12); - /* Broken with older d3dcompiler_47. */ - ok(hr == expected_hr || broken(expected_hr == S_OK && hr == E_NOINTERFACE), "Got unexpected hr %#x.\n", hr); + /* Broken with older d3dcompiler_46, d3dcompiler_47. */ + ok(hr == expected_hr || broken(expected_hr != E_NOINTERFACE && hr == E_NOINTERFACE), "Got unexpected hr %#x.\n", hr);
if (hr != S_OK) return;
Sneaked in a couple small changes: add a simpler gap test case, move a gap test in the proper place.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index e2fb870279e..c1178749345 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -15250,6 +15250,10 @@ static void test_stream_output(void) {"ATTRIB", 1, 0, 4, 0}, }, /* Gaps */ + { + {"SV_POSITION", 0, 0, 4, 0}, + {NULL, 0, 0, 8, 0}, + }, { {"SV_POSITION", 0, 0, 4, 0}, {NULL, 0, 0, 8, 0}, @@ -15261,6 +15265,13 @@ static void test_stream_output(void) {NULL, 0, 0, 4, 0}, {"ATTRIB", 1, 0, 4, 0}, }, + { + {"attrib", 1, 0, 4, 0}, + {"attrib", 2, 0, 3, 0}, + {"attrib", 3, 0, 2, 0}, + {NULL, 0, 0, 1, 0}, + {"attrib", 4, 0, 1, 0}, + }, /* ComponentCount */ { {"ATTRIB", 1, 0, 4, 0}, @@ -15316,13 +15327,6 @@ static void test_stream_output(void) {"attrib", 1, 0, 4, 0}, {"attrib", 2, 0, 3, 3}, }, - { - {"attrib", 1, 0, 4, 0}, - {"attrib", 2, 0, 3, 0}, - {"attrib", 3, 0, 2, 0}, - {NULL, 0, 0, 1, 0}, - {"attrib", 4, 0, 1, 0}, - }, /* Multiple occurrences of the same output */ { {"ATTRIB", 1, 0, 2, 0}, @@ -15460,6 +15464,8 @@ static void test_stream_output(void) for (i = 0; i < ARRAY_SIZE(valid_so_declarations); ++i) { unsigned int max_output_slot = 0; + + winetest_push_context("Test %u", i); for (count = 0; count < ARRAY_SIZE(valid_so_declarations[i]); ++count) { const D3D10_SO_DECLARATION_ENTRY *e = &valid_so_declarations[i][count]; @@ -15470,10 +15476,12 @@ static void test_stream_output(void)
check_so_desc(device, gs_code, sizeof(gs_code), valid_so_declarations[i], count, 0, !!max_output_slot); check_so_desc(device, gs_code, sizeof(gs_code), valid_so_declarations[i], count, 64, !max_output_slot); + winetest_pop_context(); }
for (i = 0; i < ARRAY_SIZE(invalid_so_declarations); ++i) { + winetest_push_context("Test %u", i); for (count = 0; count < ARRAY_SIZE(invalid_so_declarations[i]); ++count) { const D3D10_SO_DECLARATION_ENTRY *e = &invalid_so_declarations[i][count]; @@ -15483,6 +15491,7 @@ static void test_stream_output(void)
check_so_desc(device, gs_code, sizeof(gs_code), invalid_so_declarations[i], count, 0, FALSE); check_so_desc(device, gs_code, sizeof(gs_code), invalid_so_declarations[i], count, 64, FALSE); + winetest_pop_context(); }
/* Buffer stride */
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
All D3D versions seem to basically guarantee invariance for the vertex position at the very least. In practice, desktop GL implementations also do the same. That's not necessarily the case for tile based renderers, where the cost of providing invariance might be non negligible. We want this behavior though, so let's ask for it explicitly.
Based on a patch by Stefan Dösinger.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- Fixes Half Life 2 and Payday 2 on the Apple M1.
dlls/wined3d/glsl_shader.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index fb809052d83..ad316438249 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -2184,6 +2184,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c if (map & 1) shader_addline(buffer, "void subroutine%u();\n", i); }
+ if (version->type != WINED3D_SHADER_TYPE_PIXEL && version->type != WINED3D_SHADER_TYPE_COMPUTE) + shader_addline(buffer, "invariant gl_Position;\n"); + /* Declare the constants (aka uniforms) */ if (shader->limits->constant_float > 0) { @@ -7125,6 +7128,8 @@ static GLuint shader_glsl_generate_vs3_rasterizer_input_setup(struct shader_glsl
shader_glsl_add_version_declaration(buffer, gl_info);
+ shader_addline(buffer, "invariant gl_Position;\n"); + if (per_vertex_point_size) { shader_addline(buffer, "uniform struct\n{\n"); @@ -8991,6 +8996,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_glsl_add_version_declaration(buffer, gl_info);
+ shader_addline(buffer, "invariant gl_Position;\n"); + if (shader_glsl_use_explicit_attrib_location(gl_info)) shader_addline(buffer, "#extension GL_ARB_explicit_attrib_location : enable\n");
On Wed, 6 Oct 2021 at 16:10, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -8991,6 +8996,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_glsl_add_version_declaration(buffer, gl_info);
- shader_addline(buffer, "invariant gl_Position;\n");
- if (shader_glsl_use_explicit_attrib_location(gl_info)) shader_addline(buffer, "#extension GL_ARB_explicit_attrib_location : enable\n");
This introduces GLSL compilation errors in the tests:
0:3(1): error: #extension directive is not allowed in the middle of a shader
On Wed, Oct 6, 2021 at 6:00 PM Henri Verbeet hverbeet@gmail.com wrote:
On Wed, 6 Oct 2021 at 16:10, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -8991,6 +8996,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *pr
shader_glsl_add_version_declaration(buffer, gl_info);
- shader_addline(buffer, "invariant gl_Position;\n");
- if (shader_glsl_use_explicit_attrib_location(gl_info)) shader_addline(buffer, "#extension GL_ARB_explicit_attrib_location : enable\n");
This introduces GLSL compilation errors in the tests:
0:3(1): error: #extension directive is not allowed in the middle of a shader
Oops, not sure how I missed that.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- sched_yield() causes the thread to relinquish the CPU, but only to a thread at the same priority level. If there is no other runnable thread with the same priority, the caller gets rescheduled right away. A number of games (Starcraft 2 and Shadow of the Tomb Raider are two that I have explicitly mentioned in my notes) in particular call Sleep(0) or NtYieldExecution() while on the main menu, with the idea of sleeping for a while before getting rescheduled. sched_yield() doesn't do what we want. usleep() does. FWIW the man page for sched_yield() does mention that it's intended to be used with realtime scheduling policies and calling it with processes using the default SCHED_OTHER policy (like Wine) is a bad idea.
Windows doesn't give any particular guarantee about minimal sleep duration. MSDN just says that it yields the CPU for "the remainder of its time slice". Also Sleep(0) changed a bit after Windows XP, going from relinquishing the time slice to "other threads of equal priority" to "any other thread", so I think this change makes the function follow more closely current Windows behavior regardless.
configure | 1 - configure.ac | 1 - dlls/ntdll/unix/sync.c | 6 +----- include/config.h.in | 3 --- 4 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/configure b/configure index db2e07679d4..096d750c9cc 100755 --- a/configure +++ b/configure @@ -17916,7 +17916,6 @@ for ac_func in \ prctl \ proc_pidinfo \ readlink \ - sched_yield \ setproctitle \ setprogname \ sigprocmask \ diff --git a/configure.ac b/configure.ac index 6321206b9db..ec65c6abc59 100644 --- a/configure.ac +++ b/configure.ac @@ -2147,7 +2147,6 @@ AC_CHECK_FUNCS(\ prctl \ proc_pidinfo \ readlink \ - sched_yield \ setproctitle \ setprogname \ sigprocmask \ diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 5a5d49bf4bd..1a8c386d3a8 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1506,12 +1506,8 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait, */ NTSTATUS WINAPI NtYieldExecution(void) { -#ifdef HAVE_SCHED_YIELD - sched_yield(); + usleep(0); return STATUS_SUCCESS; -#else - return STATUS_NO_YIELD_PERFORMED; -#endif }
diff --git a/include/config.h.in b/include/config.h.in index e27b23f658f..1cffe6ebac9 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -537,9 +537,6 @@ /* Define to 1 if you have the `sched_setaffinity' function. */ #undef HAVE_SCHED_SETAFFINITY
-/* Define to 1 if you have the `sched_yield' function. */ -#undef HAVE_SCHED_YIELD - /* Define to 1 if `cmd' is a member of `scsireq_t'. */ #undef HAVE_SCSIREQ_T_CMD
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- We didn't update the float16 blend check for core contexts at the time because it didn't seem worthwhile, as the only known GPUs / drivers affected by the issue were NVIDIA GeForce 6 and 7 with the proprietary driver. Nowadays the message is triggered with default settings and it has become inaccurate and superfluous, so just get rid of it. The existing traces in the individual branches below should be good enough.
dlls/wined3d/utils.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 0a1e0707359..7e5a771933c 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3427,7 +3427,6 @@ static void init_format_filter_info(struct wined3d_adapter *adapter, if (wined3d_settings.offscreen_rendering_mode != ORM_FBO || !gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { - WARN("No FBO support, or no FBO ORM, guessing filter info from GL caps\n"); if (vendor == HW_VENDOR_NVIDIA && gl_info->supported[ARB_TEXTURE_FLOAT]) { TRACE("Nvidia card with texture_float support: Assuming float16 blending\n");
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On 10/6/21 08:53, Matteo Bruni wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
For reference, I got this "new" result with a d3dcompiler_46.dll found in Steam's directory.
dlls/d3dcompiler_43/tests/reflection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c index 75f30e45dce..8cf6edb1c97 100644 --- a/dlls/d3dcompiler_43/tests/reflection.c +++ b/dlls/d3dcompiler_43/tests/reflection.c @@ -164,8 +164,8 @@ static void test_reflection_interfaces(void)
expected_hr = D3D_COMPILER_VERSION < 46 ? E_NOINTERFACE : D3D_COMPILER_VERSION == 46 ? E_INVALIDARG : S_OK; hr = call_reflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D12ShaderReflection, (void **)&ref12);
- /* Broken with older d3dcompiler_47. */
- ok(hr == expected_hr || broken(expected_hr == S_OK && hr == E_NOINTERFACE), "Got unexpected hr %#x.\n", hr);
- /* Broken with older d3dcompiler_46, d3dcompiler_47. */
- ok(hr == expected_hr || broken(expected_hr != E_NOINTERFACE && hr == E_NOINTERFACE), "Got unexpected hr %#x.\n", hr);
I guess this condition could be simplified to (hr == expected_hr || broken(hr == E_NOINTERFACE)), right?
if (hr != S_OK) return;
On Wed, Oct 6, 2021 at 4:30 PM Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
On 10/6/21 08:53, Matteo Bruni wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
For reference, I got this "new" result with a d3dcompiler_46.dll found in Steam's directory.
dlls/d3dcompiler_43/tests/reflection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c index 75f30e45dce..8cf6edb1c97 100644 --- a/dlls/d3dcompiler_43/tests/reflection.c +++ b/dlls/d3dcompiler_43/tests/reflection.c @@ -164,8 +164,8 @@ static void test_reflection_interfaces(void)
expected_hr = D3D_COMPILER_VERSION < 46 ? E_NOINTERFACE : D3D_COMPILER_VERSION == 46 ? E_INVALIDARG : S_OK; hr = call_reflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D12ShaderReflection, (void **)&ref12);
- /* Broken with older d3dcompiler_47. */
- ok(hr == expected_hr || broken(expected_hr == S_OK && hr == E_NOINTERFACE), "Got unexpected hr %#x.\n", hr);
- /* Broken with older d3dcompiler_46, d3dcompiler_47. */
- ok(hr == expected_hr || broken(expected_hr != E_NOINTERFACE && hr == E_NOINTERFACE), "Got unexpected hr %#x.\n", hr);
I guess this condition could be simplified to (hr == expected_hr || broken(hr == E_NOINTERFACE)), right?
Indeed, I'll update and resend.