Rebase against 446da60e78beb321d776b48cdee6f764c81b924b.

This commit is contained in:
Alistair Leslie-Hughes 2023-03-17 16:05:30 +11:00
parent 2ac5cdbf37
commit fab4cd0932
3 changed files with 61 additions and 137 deletions

View File

@ -1,18 +1,17 @@
From e7104770d4b57539d5b64a67212504910692e920 Mon Sep 17 00:00:00 2001
From 01097ee44ab6835a4c139261c188ae6535bfb311 Mon Sep 17 00:00:00 2001
From: Jetro Jormalainen <jje-wine@jv.jetro.fi>
Date: Tue, 30 Apr 2019 09:20:54 +1000
Subject: [PATCH] dinput: Allow empty Joystick mappings.
---
dlls/dinput/device.c | 77 ++++++++++++++++++++++++++++++-------
dlls/dinput/tests/device8.c | 50 ++++++++++++++++++++++++
2 files changed, 113 insertions(+), 14 deletions(-)
dlls/dinput/device.c | 77 ++++++++++++++++++++++++++++++++++++--------
1 file changed, 63 insertions(+), 14 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 6cc190ee7fb..2fd9329aa68 100644
index c001d1ef29a..d1ff222a653 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -364,12 +364,26 @@ static DWORD semantic_to_obj_id( struct dinput_device *This, DWORD dwSemantic )
@@ -341,12 +341,26 @@ static DWORD semantic_to_obj_id( struct dinput_device *This, DWORD dwSemantic )
return type | (0x0000ff00 & (instance << 8));
}
@ -40,7 +39,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
{
static const WCHAR *subkey = L"Software\\Wine\\DirectInput\\Mappings\\%s\\%s\\%s";
HKEY hkey;
@@ -380,8 +394,11 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
@@ -357,8 +371,11 @@ static HKEY get_mapping_key(const WCHAR *device, const WCHAR *username, const WC
swprintf( keyname, len, subkey, username, device, guid );
/* The key used is HKCU\Software\Wine\DirectInput\Mappings\[username]\[device]\[mapping_guid] */
@ -54,7 +53,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
free( keyname );
@@ -401,7 +418,9 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
@@ -378,7 +395,9 @@ static HRESULT save_mapping_settings(IDirectInputDevice8W *iface, LPDIACTIONFORM
if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK)
return DI_SETTINGSNOTSAVED;
@ -65,7 +64,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
if (!hkey)
{
@@ -436,7 +455,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
@@ -413,7 +432,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
HKEY hkey;
WCHAR *guid_str;
DIDEVICEINSTANCEW didev;
@ -74,7 +73,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
didev.dwSize = sizeof(didev);
IDirectInputDevice8_GetDeviceInfo(&This->IDirectInputDevice8W_iface, &didev);
@@ -444,7 +463,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
@@ -421,7 +440,7 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
if (StringFromCLSID(&lpdiaf->guidActionMap, &guid_str) != S_OK)
return FALSE;
@ -83,7 +82,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
if (!hkey)
{
@@ -464,15 +483,20 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
@@ -441,15 +460,20 @@ static BOOL load_mapping_settings( struct dinput_device *This, LPDIACTIONFORMATW
{
lpdiaf->rgoAction[i].dwObjID = id;
lpdiaf->rgoAction[i].guidInstance = didev.guidInstance;
@ -107,7 +106,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
}
static BOOL set_app_data( struct dinput_device *dev, int offset, UINT_PTR app_data )
@@ -1935,13 +1959,18 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
@@ -1896,13 +1920,18 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
load_success = load_mapping_settings( impl, format, username_buf );
}
@ -130,7 +129,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
genre = format->rgoAction[i].dwSemantic & DIGENRE_ANY;
if (devMask == genre || (devMask == DIGENRE_ANY && genre != DIMOUSE_MASK && genre != DIKEYBOARD_MASK))
{
@@ -1973,6 +2002,14 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
@@ -1934,6 +1963,14 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
}
}
@ -145,7 +144,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
if (!has_actions) return DI_NOEFFECT;
if (flags & (DIDBAM_DEFAULT|DIDBAM_PRESERVE|DIDBAM_INITIALIZE|DIDBAM_HWDEFAULTS))
FIXME( "Unimplemented flags %#lx\n", flags );
@@ -1990,6 +2027,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
@@ -1951,6 +1988,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
DIPROPSTRING dps;
WCHAR username_buf[MAX_PATH];
DWORD username_len = MAX_PATH;
@ -153,7 +152,7 @@ index 6cc190ee7fb..2fd9329aa68 100644
int i, action = 0, num_actions = 0;
unsigned int offset = 0;
const DIDATAFORMAT *df;
@@ -2022,12 +2060,23 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
@@ -1983,12 +2021,23 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
data_format.dwFlags = DIDF_RELAXIS;
data_format.dwDataSize = format->dwDataSize;
@ -178,81 +177,6 @@ index 6cc190ee7fb..2fd9329aa68 100644
/* Construct the dataformat and actionmap */
obj_df = malloc( sizeof(DIOBJECTDATAFORMAT) * num_actions );
diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c
index 2586736cb1d..e2be36ad7d3 100644
--- a/dlls/dinput/tests/device8.c
+++ b/dlls/dinput/tests/device8.c
@@ -48,6 +48,8 @@ struct enum_data {
/* Dummy GUID */
static const GUID ACTION_MAPPING_GUID = { 0x1, 0x2, 0x3, { 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb } };
+static const GUID NULL_GUID = { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } };
+
enum {
DITEST_AXIS,
DITEST_BUTTON,
@@ -472,6 +474,17 @@ static void test_action_mapping(void)
hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, 0);
ok (hr == DI_NOEFFECT, "SetActionMap should have no effect with no actions to map hr=%#lx\n", hr);
+ /* Test that after changing actionformat SetActionMap has effect and that second
+ * SetActionMap call with same empty actionformat has no effect */
+ af.dwDataSize = 4 * 1;
+ af.dwNumActions = 1;
+
+ hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, 0);
+ ok (hr != DI_NOEFFECT, "SetActionMap should have effect as actionformat has changed hr=%08x\n", hr);
+
+ hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, 0);
+ ok (hr == DI_NOEFFECT, "SetActionMap should have no effect with no actions to map hr=%08x\n", hr);
+
af.dwDataSize = 4 * ARRAY_SIZE(actionMapping);
af.dwNumActions = ARRAY_SIZE(actionMapping);
@@ -663,6 +676,43 @@ static void test_save_settings(void)
"Mapped incorrectly expected: 0x%#lx got: 0x%#lx\n", other_results[1], af.rgoAction[1].dwObjID);
ok (IsEqualGUID(&GUID_SysKeyboard, &af.rgoAction[1].guidInstance), "Action should be mapped to keyboard\n");
+ /* Save and load empty mapping */
+ af.rgoAction[0].dwObjID = 0;
+ af.rgoAction[0].dwHow = 0;
+ memset(&af.rgoAction[0].guidInstance, 0, sizeof(GUID));
+ af.rgoAction[1].dwObjID = 0;
+ af.rgoAction[1].dwHow = 0;
+ memset(&af.rgoAction[1].guidInstance, 0, sizeof(GUID));
+
+ hr = IDirectInputDevice8_SetActionMap(pKey, &af, NULL, DIDSAM_FORCESAVE);
+ ok (SUCCEEDED(hr), "SetActionMap failed hr=%08x\n", hr);
+
+ if (hr == DI_SETTINGSNOTSAVED)
+ {
+ skip ("Can't test saving settings if SetActionMap returns DI_SETTINGSNOTSAVED\n");
+ return;
+ }
+
+ af.rgoAction[0].dwObjID = other_results[0];
+ af.rgoAction[0].dwHow = DIAH_USERCONFIG;
+ af.rgoAction[0].guidInstance = GUID_SysKeyboard;
+ af.rgoAction[1].dwObjID = other_results[1];
+ af.rgoAction[1].dwHow = DIAH_USERCONFIG;
+ af.rgoAction[1].guidInstance = GUID_SysKeyboard;
+
+ hr = IDirectInputDevice8_BuildActionMap(pKey, &af, NULL, 0);
+ ok (SUCCEEDED(hr), "BuildActionMap failed hr=%08x\n", hr);
+
+ ok (other_results[0] == af.rgoAction[0].dwObjID,
+ "Mapped incorrectly expected: 0x%08x got: 0x%08x\n", other_results[0], af.rgoAction[0].dwObjID);
+ ok (af.rgoAction[0].dwHow == DIAH_UNMAPPED, "dwHow should have been DIAH_UNMAPPED\n");
+ ok (IsEqualGUID(&NULL_GUID, &af.rgoAction[0].guidInstance), "Action should not be mapped\n");
+
+ ok (other_results[1] == af.rgoAction[1].dwObjID,
+ "Mapped incorrectly expected: 0x%08x got: 0x%08x\n", other_results[1], af.rgoAction[1].dwObjID);
+ ok (af.rgoAction[1].dwHow == DIAH_UNMAPPED, "dwHow should have been DIAH_UNMAPPED\n");
+ ok (IsEqualGUID(&NULL_GUID, &af.rgoAction[1].guidInstance), "Action should not be mapped\n");
+
IDirectInputDevice_Release(pKey);
IDirectInput_Release(pDI);
}
--
2.34.1
2.39.2

View File

@ -1,4 +1,4 @@
From a4d28ab4e362bd30c52442e8fa6bf4706194775e Mon Sep 17 00:00:00 2001
From b63e72c627b1d258d22b48897b918c768fa617be Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Mon, 25 Feb 2019 15:23:33 +0300
Subject: [PATCH] wined3d: Support SWVP mode vertex shaders.
@ -14,10 +14,10 @@ Subject: [PATCH] wined3d: Support SWVP mode vertex shaders.
7 files changed, 104 insertions(+), 49 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 21bd83fc1e0..360650f9723 100644
index 4cd2a93f7e9..ec088871a6c 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -7460,15 +7460,11 @@ float4 main(const float4 color : COLOR) : SV_TARGET
@@ -7478,15 +7478,11 @@ float4 main(const float4 color : COLOR) : SV_TARGET
vs = NULL;
hr = IDirect3DDevice9_CreateVertexShader(device, vs_1_256, &vs);
@ -35,7 +35,7 @@ index 21bd83fc1e0..360650f9723 100644
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
@@ -7485,20 +7481,16 @@ float4 main(const float4 color : COLOR) : SV_TARGET
@@ -7503,20 +7499,16 @@ float4 main(const float4 color : COLOR) : SV_TARGET
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, vs_1_256, &vs);
@ -59,10 +59,10 @@ index 21bd83fc1e0..360650f9723 100644
cleanup:
refcount = IDirect3DDevice9_Release(device);
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 290e37728f9..92cdbfe8167 100644
index 410639c51e7..88d7a188da5 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -25110,7 +25110,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -25152,7 +25152,6 @@ static void test_mvp_software_vertex_shaders(void)
hr = IDirect3DDevice9_CreateVertexShader(device, reladdr_shader_code, &reladdr_shader);
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_CreateVertexShader(device, pure_sw_shader_code, &pure_sw_shader);
@ -70,7 +70,7 @@ index 290e37728f9..92cdbfe8167 100644
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration);
ok(SUCCEEDED(hr), "Got unexpected hr %#lx.\n", hr);
@@ -25148,7 +25147,7 @@ static void test_mvp_software_vertex_shaders(void)
@@ -25190,7 +25189,7 @@ static void test_mvp_software_vertex_shaders(void)
expected_color = 0x00ff0000; /* Color from vertex data and not from the shader. */
color = getPixelColor(device, 5, 5);
@ -79,7 +79,7 @@ index 290e37728f9..92cdbfe8167 100644
expected_color, color);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
@@ -25167,7 +25166,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -25209,7 +25208,6 @@ static void test_mvp_software_vertex_shaders(void)
expected_color = 0x00ffffff;
color = getPixelColor(device, 5, 5);
@ -87,7 +87,7 @@ index 290e37728f9..92cdbfe8167 100644
ok(color == expected_color, "Expected color 0x%08x, got 0x%08x (sw shader in sw mode).\n",
expected_color, color);
@@ -25217,7 +25215,6 @@ static void test_mvp_software_vertex_shaders(void)
@@ -25259,7 +25257,6 @@ static void test_mvp_software_vertex_shaders(void)
expected_color = 0x0000ffff; /* c[256] is c_color for SW shader. */
color = getPixelColor(device, 5, 5);
@ -96,10 +96,10 @@ index 290e37728f9..92cdbfe8167 100644
expected_color, color);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f205e95c3b5..07de7a962cc 100644
index 1e96cb206de..99d29f86307 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4682,6 +4682,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
@@ -4866,6 +4866,14 @@ void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *
warned = TRUE;
}
@ -115,7 +115,7 @@ index f205e95c3b5..07de7a962cc 100644
}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 53de4803a3f..e8835d88de7 100644
index 6a133d28cbf..972b6cb96da 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -134,7 +134,9 @@ struct shader_glsl_priv
@ -138,7 +138,7 @@ index 53de4803a3f..e8835d88de7 100644
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I];
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B];
GLint pos_fixup_location;
@@ -1189,7 +1191,7 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
@@ -1187,7 +1189,7 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
{
GL_EXTCALL(glBindBuffer(GL_UNIFORM_BUFFER, priv->ubo_vs_c));
checkGLcall("glBindBuffer");
@ -147,7 +147,7 @@ index 53de4803a3f..e8835d88de7 100644
NULL, GL_STREAM_DRAW));
checkGLcall("glBufferData");
}
@@ -1197,14 +1199,16 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
@@ -1195,14 +1197,16 @@ static void bind_and_orphan_consts_ubo(const struct wined3d_gl_info *gl_info, st
/* Context activation is done by the caller. */
static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info,
const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap,
@ -165,7 +165,7 @@ index 53de4803a3f..e8835d88de7 100644
unsigned max_const_used;
if (priv->ubo_vs_c == -1)
@@ -1214,22 +1218,32 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co
@@ -1212,22 +1216,32 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co
}
bind_and_orphan_consts_ubo(gl_info, priv);
@ -204,7 +204,7 @@ index 53de4803a3f..e8835d88de7 100644
checkGLcall("glBufferSubData");
return;
}
@@ -1595,7 +1609,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1593,7 +1607,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
GL_EXTCALL(glGenBuffers(1, &priv->ubo_vs_c));
GL_EXTCALL(glBindBuffer(GL_UNIFORM_BUFFER, priv->ubo_vs_c));
checkGLcall("glBindBuffer (UBO)");
@ -213,7 +213,7 @@ index 53de4803a3f..e8835d88de7 100644
NULL, GL_STREAM_DRAW));
checkGLcall("glBufferData");
}
@@ -1607,7 +1621,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1605,7 +1619,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
if (update_mask & WINED3D_SHADER_CONST_VS_F)
shader_glsl_load_constants_f(vshader, gl_info, state->vs_consts_f,
@ -223,7 +223,7 @@ index 53de4803a3f..e8835d88de7 100644
if (update_mask & WINED3D_SHADER_CONST_VS_I)
shader_glsl_load_constants_i(vshader, gl_info, state->vs_consts_i,
@@ -1760,7 +1775,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@@ -1758,7 +1773,8 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
if (update_mask & WINED3D_SHADER_CONST_PS_F)
shader_glsl_load_constants_f(pshader, gl_info, state->ps_consts_f,
@ -233,7 +233,7 @@ index 53de4803a3f..e8835d88de7 100644
if (update_mask & WINED3D_SHADER_CONST_PS_I)
shader_glsl_load_constants_i(pshader, gl_info, state->ps_consts_i,
@@ -1905,7 +1921,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
@@ -1903,7 +1919,7 @@ static void shader_glsl_update_float_vertex_constants(struct wined3d_device *dev
if (priv->consts_ubo)
return;
@ -242,7 +242,7 @@ index 53de4803a3f..e8835d88de7 100644
{
update_heap_entry(heap, i, priv->next_constant_version);
}
@@ -2277,7 +2293,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
@@ -2275,7 +2291,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
shader_addline(buffer,"layout(std140) uniform vs_c_ubo\n"
"{ \n"
" vec4 %s_c[%u];\n"
@ -251,7 +251,7 @@ index 53de4803a3f..e8835d88de7 100644
}
else if (shader->limits->constant_float > 0)
{
@@ -10056,12 +10072,13 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
@@ -10054,12 +10070,13 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
}
else if (!priv->consts_ubo)
{
@ -267,7 +267,7 @@ index 53de4803a3f..e8835d88de7 100644
}
for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
@@ -10379,6 +10396,10 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
@@ -10377,6 +10394,10 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
vs_list = &ffp_shader->linked_programs;
}
@ -278,7 +278,7 @@ index 53de4803a3f..e8835d88de7 100644
hshader = state->shader[WINED3D_SHADER_TYPE_HULL];
if (!(context_gl->c.shader_update_mask & (1u << WINED3D_SHADER_TYPE_HULL)) && ctx_data->glsl_program)
hs_id = ctx_data->glsl_program->hs.id;
@@ -11133,7 +11154,7 @@ static void constant_heap_free(struct constant_heap *heap)
@@ -11131,7 +11152,7 @@ static void constant_heap_free(struct constant_heap *heap)
static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe,
const struct wined3d_fragment_pipe_ops *fragment_pipe)
{
@ -287,7 +287,7 @@ index 53de4803a3f..e8835d88de7 100644
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct fragment_caps fragment_caps;
void *vertex_priv, *fragment_priv;
@@ -11144,6 +11165,18 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -11142,6 +11163,18 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
priv->consts_ubo = (device->adapter->d3d_info.wined3d_creation_flags & WINED3D_LEGACY_SHADER_CONSTANTS)
&& gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT];
@ -306,7 +306,7 @@ index 53de4803a3f..e8835d88de7 100644
string_buffer_list_init(&priv->string_buffers);
if (!(vertex_priv = vertex_pipe->vp_alloc(&glsl_shader_backend, priv)))
@@ -11173,7 +11206,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
@@ -11171,7 +11204,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
goto fail;
}
@ -316,10 +316,10 @@ index 53de4803a3f..e8835d88de7 100644
ERR("Failed to initialize vertex shader constant heap\n");
goto fail;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 982e8dd3748..6c815faae0c 100644
index 2a9d76622f6..67597bb2ea9 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -590,7 +590,7 @@ static void shader_delete_constant_list(struct list *clist)
@@ -540,7 +540,7 @@ static void shader_delete_constant_list(struct list *clist)
list_init(clist);
}
@ -328,7 +328,7 @@ index 982e8dd3748..6c815faae0c 100644
{
static const struct limits_entry
{
@@ -613,6 +613,19 @@ static void shader_set_limits(struct wined3d_shader *shader)
@@ -563,6 +563,19 @@ static void shader_set_limits(struct wined3d_shader *shader)
{WINED3D_SHADER_VERSION(4, 1), WINED3D_SHADER_VERSION(5, 0), {16, 0, 0, 0, 32, 0}},
{0}
},
@ -348,7 +348,7 @@ index 982e8dd3748..6c815faae0c 100644
hs_limits[] =
{
/* min_version, max_version, sampler, constant_int, constant_float, constant_bool, packed_output, packet_input */
@@ -657,7 +670,7 @@ static void shader_set_limits(struct wined3d_shader *shader)
@@ -607,7 +620,7 @@ static void shader_set_limits(struct wined3d_shader *shader)
FIXME("Unexpected shader type %u found.\n", shader->reg_maps.shader_version.type);
/* Fall-through. */
case WINED3D_SHADER_TYPE_VERTEX:
@ -357,7 +357,7 @@ index 982e8dd3748..6c815faae0c 100644
break;
case WINED3D_SHADER_TYPE_HULL:
limits_array = hs_limits;
@@ -1025,7 +1038,7 @@ static HRESULT shader_scan_output_signature(struct wined3d_shader *shader)
@@ -975,7 +988,7 @@ static HRESULT shader_scan_output_signature(struct wined3d_shader *shader)
}
/* Note that this does not count the loop register as an address register. */
@ -366,7 +366,7 @@ index 982e8dd3748..6c815faae0c 100644
{
struct wined3d_shader_signature_element input_signature_elements[max(MAX_ATTRIBS, MAX_REG_INPUT)];
struct wined3d_shader_signature_element output_signature_elements[MAX_REG_OUTPUT];
@@ -1051,7 +1064,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co
@@ -1001,7 +1014,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co
prev_ins = current_ins = ptr;
reg_maps->shader_version = shader_version;
@ -375,7 +375,7 @@ index 982e8dd3748..6c815faae0c 100644
if (!(reg_maps->constf = heap_calloc(((min(shader->limits->constant_float, constf_size) + 31) / 32),
sizeof(*reg_maps->constf))))
@@ -3328,7 +3341,7 @@ static unsigned int shader_max_version_from_feature_level(enum wined3d_feature_l
@@ -2079,7 +2092,7 @@ static unsigned int shader_max_version_from_feature_level(enum wined3d_feature_l
}
static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d_device *device,
@ -384,16 +384,16 @@ index 982e8dd3748..6c815faae0c 100644
{
const struct wined3d_d3d_info *d3d_info = &shader->device->adapter->d3d_info;
struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
@@ -3353,7 +3366,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d
shader_trace_init(fe, shader->frontend_data);
@@ -2099,7 +2112,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, struct wined3d
return WINED3DERR_INVALIDCALL;
}
/* Second pass: figure out which registers are used, what the semantics are, etc. */
- if (FAILED(hr = shader_get_registers_used(shader, float_const_count)))
+ if (FAILED(hr = shader_get_registers_used(shader, float_const_count, swvp)))
return hr;
if (version->type != type)
@@ -3699,14 +3712,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
@@ -2510,14 +2523,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
@ -414,7 +414,7 @@ index 982e8dd3748..6c815faae0c 100644
{
shader_cleanup(shader);
return hr;
@@ -3864,7 +3882,7 @@ static HRESULT geometry_shader_init_stream_output(struct wined3d_shader *shader,
@@ -2675,7 +2693,7 @@ static HRESULT geometry_shader_init_stream_output(struct wined3d_shader *shader,
{
shader->reg_maps.shader_version = shader_version;
shader->reg_maps.shader_version.type = WINED3D_SHADER_TYPE_GEOMETRY;
@ -423,7 +423,7 @@ index 982e8dd3748..6c815faae0c 100644
if (FAILED(hr = shader_scan_output_signature(shader)))
return hr;
}
@@ -3914,7 +3932,7 @@ static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3
@@ -2725,7 +2743,7 @@ static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3
goto fail;
if (shader->function
@ -432,7 +432,7 @@ index 982e8dd3748..6c815faae0c 100644
goto fail;
return WINED3D_OK;
@@ -4246,7 +4264,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
@@ -3057,7 +3075,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
return hr;
if (FAILED(hr = shader_set_function(shader, device,
@ -441,7 +441,7 @@ index 982e8dd3748..6c815faae0c 100644
{
shader_cleanup(shader);
return hr;
@@ -4338,7 +4356,7 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
@@ -3149,7 +3167,7 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
return hr;
}
@ -450,7 +450,7 @@ index 982e8dd3748..6c815faae0c 100644
{
shader_cleanup(object);
heap_free(object);
@@ -4372,7 +4390,7 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
@@ -3183,7 +3201,7 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
return hr;
}
@ -459,7 +459,7 @@ index 982e8dd3748..6c815faae0c 100644
{
shader_cleanup(object);
heap_free(object);
@@ -4434,7 +4452,7 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
@@ -3245,7 +3263,7 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
return hr;
}
@ -482,10 +482,10 @@ index ed4af5a0409..991f96b6dd1 100644
WARN("Invalid shader version %u.%u (%#lx).\n", major, minor, *byte_code);
return NULL;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c4ac93c2d58..76e2eb63c8a 100644
index 808a9a00136..de5e8f37b7a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4073,6 +4073,13 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
@@ -4100,6 +4100,13 @@ static inline void wined3d_device_bo_map_unlock(struct wined3d_device *device)
LeaveCriticalSection(&device->bo_map_lock);
}
@ -500,5 +500,5 @@ index c4ac93c2d58..76e2eb63c8a 100644
{
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
--
2.38.1
2.39.2

View File

@ -1 +1 @@
7db5431699037d03f26c065a58c400991210c7f7
446da60e78beb321d776b48cdee6f764c81b924b